Пример #1
0
class Controller(object):
    """
    Этот класс отвечает за основную работу плагина
    """
    def __init__(self, ownerPlugin):
        self._owner = ownerPlugin
        self._page = None
        self._menuToolsController = MenuToolsController(
            ownerPlugin.application)
        self._commandController = CommandController(ownerPlugin.application)

    def initialize(self):
        global _
        _ = get_()

        self._menuToolsController.initialize()
        self._commandController.initialize()
        self._owner.application.onPreferencesDialogCreate += self.__onPreferencesDialogCreate

    def destroy(self):
        self._menuToolsController.destroy()
        self._commandController.destroy()
        self._owner.application.onPreferencesDialogCreate -= self.__onPreferencesDialogCreate

    def __onPreferencesDialogCreate(self, dialog):
        from .preferencespanel import PreferencesPanel
        prefPanel = PreferencesPanel(dialog.treeBook,
                                     self._owner.application.config)

        panelName = _(u"External Tools [Plugin]")
        panelsList = [PreferencePanelInfo(prefPanel, panelName)]
        dialog.appendPreferenceGroup(panelName, panelsList)
Пример #2
0
class Controller (object):
    """
    Этот класс отвечает за основную работу плагина
    """
    def __init__ (self, ownerPlugin):
        self._owner = ownerPlugin
        self._page = None
        self._menuToolsController = MenuToolsController (ownerPlugin.application)
        self._commandController = CommandController (ownerPlugin.application)


    def initialize (self):
        global _
        _ = get_()

        self._menuToolsController.initialize()
        self._commandController.initialize()
        self._owner.application.onPreferencesDialogCreate += self.__onPreferencesDialogCreate


    def destroy (self):
        self._menuToolsController.destroy()
        self._commandController.destroy()
        self._owner.application.onPreferencesDialogCreate -= self.__onPreferencesDialogCreate


    def __onPreferencesDialogCreate (self, dialog):
        from .preferencespanel import PreferencesPanel
        prefPanel = PreferencesPanel (dialog.treeBook, self._owner.application.config)

        panelName = _(u"External Tools [Plugin]")
        panelsList = [PreferencePanelInfo (prefPanel, panelName)]
        dialog.appendPreferenceGroup (panelName, panelsList)
Пример #3
0
 def __init__(self, ownerPlugin):
     self._owner = ownerPlugin
     self._page = None
     self._menuToolsController = MenuToolsController(
         ownerPlugin.application)
     self._commandController = CommandController(ownerPlugin.application)
Пример #4
0
 def __init__ (self, ownerPlugin):
     self._owner = ownerPlugin
     self._page = None
     self._menuToolsController = MenuToolsController (ownerPlugin.application)
     self._commandController = CommandController (ownerPlugin.application)