Esempio n. 1
0
    def on_initialize(self):
        widget = self.get_widget()
        widget.sig_started.connect(self.sig_started)
        widget.sig_finished.connect(self.sig_finished)

        run_action = self.create_action(
            ProfilerActions.ProfileCurrentFile,
            text=_("Run profiler"),
            tip=_("Run profiler"),
            icon=self.create_icon('profiler'),
            triggered=self.run_profiler,
            register_shortcut=True,
        )

        run_action.setEnabled(is_profiler_installed())
Esempio n. 2
0
    def register(self):
        widget = self.get_widget()
        editor = self.get_plugin(Plugins.Editor)

        widget.sig_edit_goto_requested.connect(editor.load)
        widget.sig_started.connect(self.sig_started)
        widget.sig_finished.connect(self.sig_finished)

        run_action = self.create_action(
            ProfilerActions.ProfileCurrentFile,
            text=_("Run profiler"),
            tip=_("Run profiler"),
            icon=self.create_icon('run'),
            triggered=self.run_profiler,
        )
        run_action.setEnabled(is_profiler_installed())

        run_menu = self.get_application_menu(ApplicationMenus.Run)
        self.add_item_to_application_menu(run_action, menu=run_menu)
Esempio n. 3
0
    def register(self):
        widget = self.get_widget()
        editor = self.get_plugin(Plugins.Editor)
        mainmenu = self.get_plugin(Plugins.MainMenu)
        preferences = self.get_plugin(Plugins.Preferences)

        preferences.register_plugin_preferences(self)
        widget.sig_edit_goto_requested.connect(editor.load)
        widget.sig_started.connect(self.sig_started)
        widget.sig_finished.connect(self.sig_finished)

        run_action = self.create_action(
            ProfilerActions.ProfileCurrentFile,
            text=_("Run profiler"),
            tip=_("Run profiler"),
            icon=self.create_icon('profiler'),
            triggered=self.run_profiler,
            register_shortcut=True,
        )
        run_action.setEnabled(is_profiler_installed())

        if mainmenu:
            run_menu = mainmenu.get_application_menu(ApplicationMenus.Run)
            mainmenu.add_item_to_application_menu(run_action, menu=run_menu)