コード例 #1
0
ファイル: ui.py プロジェクト: sportsbite/calibre
 def __init__(self, opts, parent=None, gui_debug=None):
     global _gui
     MainWindow.__init__(self,
                         opts,
                         parent=parent,
                         disable_automatic_gc=True)
     self.setWindowIcon(QApplication.instance().windowIcon())
     self.jobs_pointer = Pointer(self)
     self.proceed_requested.connect(self.do_proceed,
                                    type=Qt.QueuedConnection)
     self.proceed_question = ProceedQuestion(self)
     self.job_error_dialog = JobError(self)
     self.keyboard = Manager(self)
     _gui = self
     self.opts = opts
     self.device_connected = None
     self.gui_debug = gui_debug
     self.iactions = OrderedDict()
     # Actions
     for action in interface_actions():
         if opts.ignore_plugins and action.plugin_path is not None:
             continue
         try:
             ac = self.init_iaction(action)
         except:
             # Ignore errors in loading user supplied plugins
             import traceback
             traceback.print_exc()
             if action.plugin_path is None:
                 raise
             continue
         ac.plugin_path = action.plugin_path
         ac.interface_action_base_plugin = action
         self.add_iaction(ac)
     self.load_store_plugins()
コード例 #2
0
ファイル: ui.py プロジェクト: KyoYang/calibre
 def __init__(self, opts, parent=None, gui_debug=None):
     global _gui
     MainWindow.__init__(self, opts, parent=parent, disable_automatic_gc=True)
     self.jobs_pointer = Pointer(self)
     self.proceed_requested.connect(self.do_proceed,
             type=Qt.QueuedConnection)
     self.proceed_question = ProceedQuestion(self)
     self.job_error_dialog = JobError(self)
     self.keyboard = Manager(self)
     _gui = self
     self.opts = opts
     self.device_connected = None
     self.gui_debug = gui_debug
     self.iactions = OrderedDict()
     # Actions
     for action in interface_actions():
         if opts.ignore_plugins and action.plugin_path is not None:
             continue
         try:
             ac = self.init_iaction(action)
         except:
             # Ignore errors in loading user supplied plugins
             import traceback
             traceback.print_exc()
             if action.plugin_path is None:
                 raise
             continue
         ac.plugin_path = action.plugin_path
         ac.interface_action_base_plugin = action
         self.add_iaction(ac)
     self.load_store_plugins()
コード例 #3
0
ファイル: icon_theme.py プロジェクト: zwpaper/calibre
def icon_for_action(name):
    for plugin in interface_actions():
        if plugin.name == name:
            module, class_name = plugin.actual_plugin.partition(':')[::2]
            mod = importlib.import_module(module)
            cls = getattr(mod, class_name)
            icon = cls.action_spec[1]
            if icon:
                return icon
コード例 #4
0
ファイル: icon_theme.py プロジェクト: davidfor/calibre
def icon_for_action(name):
    for plugin in interface_actions():
        if plugin.name == name:
            module, class_name = plugin.actual_plugin.partition(':')[::2]
            mod = importlib.import_module(module)
            cls = getattr(mod, class_name)
            icon = cls.action_spec[1]
            if icon:
                return icon