コード例 #1
0
ファイル: python.py プロジェクト: cmotc/medit
    def init_ui(self):
        SimpleProject.init_ui(self)

        self.panes.extend([_OUTPUT_PANE_ID])

        commands = [
            ["Execute", _("Execute Program"), _STOCK_EXECUTE, "F9", _CMD_EXECUTE],
            ["ExecuteFile", _("Execute File"), _STOCK_EXECUTE, "<shift>F9", _CMD_EXECUTE_FILE],
        ]

        for c in commands:
            self.add_action("PyProject" + c[0],
                            display_name=c[1], label=c[1],
                            stock_id=c[2], default_accel=c[3],
                            callback=PyProject.DoCmd(self, c[4]))

        editor = moo.Editor.instance()
        xml = editor.get_ui_xml()
        xml.insert_markup_after(self.merge_id, "Editor/Menubar",
                                "Project", """
                                <item name="Build" _label="%s">
                                  <item action="PyProjectExecute"/>
                                  <item action="PyProjectExecuteFile"/>
                                </item>
                                """ % (N_("_Build"),))
        xml.insert_markup(self.merge_id, "Editor/Toolbar/BuildToolbar",
                          0, """
                          <item action="PyProjectExecute"/>
                          <separator/>
                          """)
コード例 #2
0
    def init_ui(self):
        SimpleProject.init_ui(self)

        self.panes.extend([_OUTPUT_PANE_ID])

        commands = [
            [
                "Execute",
                _("Execute Program"), _STOCK_EXECUTE, "F9", _CMD_EXECUTE
            ],
            [
                "ExecuteFile",
                _("Execute File"), _STOCK_EXECUTE, "<shift>F9",
                _CMD_EXECUTE_FILE
            ],
        ]

        for c in commands:
            self.add_action("PyProject" + c[0],
                            display_name=c[1],
                            label=c[1],
                            stock_id=c[2],
                            default_accel=c[3],
                            callback=PyProject.DoCmd(self, c[4]))

        editor = moo.Editor.instance()
        xml = editor.get_ui_xml()
        xml.insert_markup_after(
            self.merge_id, "Editor/Menubar", "Project", """
                                <item name="Build" _label="%s">
                                  <item action="PyProjectExecute"/>
                                  <item action="PyProjectExecuteFile"/>
                                </item>
                                """ % (N_("_Build"), ))
        xml.insert_markup(
            self.merge_id, "Editor/Toolbar/BuildToolbar", 0, """
                          <item action="PyProjectExecute"/>
                          <separator/>
                          """)
コード例 #3
0
    def init_ui(self):
        SimpleProject.init_ui(self)

        self.panes.extend([_BUILD_PANE_ID, _OUTPUT_PANE_ID])

        commands = [
            ["Build",
             _("Build Project"), _STOCK_BUILD, "F8", _CMD_BUILD],
            ["Compile",
             _("Compile File"), _STOCK_COMPILE, "F9", _CMD_COMPILE],
            ["RunConfigure",
             _("Run Configure"), None, None, _CMD_CONFIGURE],
            ["RunAutogen",
             _("Run autogen.sh"), None, None, _CMD_AUTOGEN],
            ["Clean", _("Clean Project"), None, None, _CMD_CLEAN],
            ["Distclean",
             _("Distclean"), None, None, _CMD_DISTCLEAN],
            [
                "Execute",
                _("Execute Program"), _STOCK_EXECUTE, "<shift>F9", _CMD_EXECUTE
            ],
            ["Install",
             _("Install"), None, "<shift><ctrl>I", _CMD_INSTALL],
        ]

        for c in commands:
            self.add_action("CProject" + c[0],
                            display_name=c[1],
                            label=c[1],
                            stock_id=c[2],
                            default_accel=c[3],
                            callback=CProject.DoCmd(self, c[4]))
        self.add_action("CProjectBuildConfiguration",
                        factory=_BuildConfigurationActionFactory(self))

        editor = moo.Editor.instance()
        xml = editor.get_ui_xml()
        xml.insert_markup_after(
            self.merge_id, "Editor/Menubar", "Project", """
                                <item name="Build" _label="%s">
                                  <item action="CProjectBuild"/>
                                  <item action="CProjectCompile"/>
                                  <item action="CProjectRunConfigure"/>
                                  <item action="CProjectRunAutogen"/>
                                  <separator/>
                                  <item action="CProjectInstall"/>
                                  <separator/>
                                  <item action="CProjectClean"/>
                                  <item action="CProjectDistclean"/>
                                  <separator/>
                                  <item action="CProjectExecute"/>
                                </item>
                                """ % (N_("_Build"), ))
        xml.insert_markup(
            self.merge_id, "Editor/Toolbar/BuildToolbar", 0, """
                          <item action="CProjectBuild"/>
                          <item action="CProjectExecute"/>
                          <separator/>
                          """)
        xml.insert_markup_before(
            self.merge_id, "Editor/Menubar/Project", "ProjectOptions", """
            <separator/>
            <item action="CProjectBuildConfiguration"/>
            """)
コード例 #4
0
ファイル: c.py プロジェクト: cmotc/medit
    def init_ui(self):
        SimpleProject.init_ui(self)

        self.panes.extend([_BUILD_PANE_ID, _OUTPUT_PANE_ID])

        commands = [
            ["Build", _("Build Project"), _STOCK_BUILD, "F8", _CMD_BUILD],
            ["Compile", _("Compile File"), _STOCK_COMPILE, "F9", _CMD_COMPILE],
            ["RunConfigure", _("Run Configure"), None, None, _CMD_CONFIGURE],
            ["RunAutogen", _("Run autogen.sh"), None, None, _CMD_AUTOGEN],
            ["Clean", _("Clean Project"), None, None, _CMD_CLEAN],
            ["Distclean", _("Distclean"), None, None, _CMD_DISTCLEAN],
            ["Execute", _("Execute Program"), _STOCK_EXECUTE, "<shift>F9", _CMD_EXECUTE],
            ["Install", _("Install"), None, "<shift><ctrl>I", _CMD_INSTALL],
        ]

        for c in commands:
            self.add_action(
                "CProject" + c[0],
                display_name=c[1],
                label=c[1],
                stock_id=c[2],
                default_accel=c[3],
                callback=CProject.DoCmd(self, c[4]),
            )
        self.add_action("CProjectBuildConfiguration", factory=_BuildConfigurationActionFactory(self))

        editor = moo.Editor.instance()
        xml = editor.get_ui_xml()
        xml.insert_markup_after(
            self.merge_id,
            "Editor/Menubar",
            "Project",
            """
                                <item name="Build" _label="%s">
                                  <item action="CProjectBuild"/>
                                  <item action="CProjectCompile"/>
                                  <item action="CProjectRunConfigure"/>
                                  <item action="CProjectRunAutogen"/>
                                  <separator/>
                                  <item action="CProjectInstall"/>
                                  <separator/>
                                  <item action="CProjectClean"/>
                                  <item action="CProjectDistclean"/>
                                  <separator/>
                                  <item action="CProjectExecute"/>
                                </item>
                                """
            % (N_("_Build"),),
        )
        xml.insert_markup(
            self.merge_id,
            "Editor/Toolbar/BuildToolbar",
            0,
            """
                          <item action="CProjectBuild"/>
                          <item action="CProjectExecute"/>
                          <separator/>
                          """,
        )
        xml.insert_markup_before(
            self.merge_id,
            "Editor/Menubar/Project",
            "ProjectOptions",
            """
            <separator/>
            <item action="CProjectBuildConfiguration"/>
            """,
        )