Beispiel #1
0
    def run(self):
        """ Run the UI workbench application.

        This method will load the core and ui plugins and start the
        main application event loop. This is a blocking call which
        will return when the application event loop exits.

        """
        InkcutWorkbench._instance = self

        with enaml.imports():
            from enaml.workbench.core.core_manifest import CoreManifest
            from enaml.workbench.ui.ui_manifest import UIManifest
            from inkcut.core.manifest import InkcutManifest
            #from inkcut.settings.manifest import SettingsManifest

        self.register(CoreManifest())
        self.register(UIManifest())
        self.register(InkcutManifest())
        #self.register(SettingsManifest())
        #: Init the ui
        ui = self.get_plugin('enaml.workbench.ui')
        ui.show_window()

        # Make sure ^C keeps working
        signal.signal(signal.SIGINT, signal.SIG_DFL)

        #: Start the core plugin
        plugin = self.get_plugin('inkcut.core')

        locale = QtCore.QLocale.system().name()
        qtTranslator = QtCore.QTranslator()
        if qtTranslator.load("inkcut/res/translations/" + locale):
            self.application._qapp.installTranslator(qtTranslator)

        ui.start_application()