Beispiel #1
0
    def __initToolbar__(self):
        """
        @summary: Initialize UI of toolbar.
        """
        actionGroupExplorer = gtk.ActionGroup("ActionGroupExplorer")
        
        # Create actions
        actionGroupExplorer.add_actions([("BackExplorerAction", gtk.STOCK_GO_BACK, _("_Back"), None, _("Go back in history"), self.__goBackEvent__),
                                         ("ForwardExplorerAction", gtk.STOCK_GO_FORWARD, _("_Forward"), None, _("Go forward in history"), self.__goForwardEvent__),
                                         ("UpExplorerAction", gtk.STOCK_GO_UP, _("Up"), None, _("Go up level in explorer"), self.__goUpLevelEvent__),
                                         ("HomeExplorerAction", gtk.STOCK_HOME, _("_Home"), None, _("Go Home"), self.__goHomeEvent__)])
        
        actionGroupExplorer.set_translation_domain(pycamimg.gettextName)
        
        __log__.debug("There is a xml path. UI Menus and tools will be recovered from path %s" % __XMLUI_FOLDER__)
        self.__uiManager__ = FactoryControls.getUIManager(os.path.join(__XMLUI_FOLDER__, "Explorer.xml"), None, actionGroupExplorer)[0]

        self.__toolBar__ = self.__uiManager__.get_widget("/ToolsExplorer")
        self.__toolBar__.set_style(gtk.TOOLBAR_BOTH_HORIZ)
        self.__toolBar__.set_tooltips(True)
        
        self.__bBack__ = self.__uiManager__.get_widget("/ToolsExplorer/Back")
        self.__bBack__.set_is_important(True)
        self.__bForward__ = self.__uiManager__.get_widget("/ToolsExplorer/Forward")
        self.__bUp__ = self.__uiManager__.get_widget("/ToolsExplorer/Up")
        self.__bHome__ = self.__uiManager__.get_widget("/ToolsExplorer/Home")
Beispiel #2
0
    def __initToolbar__(self):
        """
        @summary: Initialize toolbar
        """
        actionGroupExecute = gtk.ActionGroup("ActionGroupExecute")
        
        # Create actions
        actionGroupExecute.add_actions([("ExitAction", gtk.STOCK_QUIT, _("Exit"), None, _("Close execute dialog"), self.__closeEvent__),
                                        ("ExecuteAction", gtk.STOCK_EXECUTE, _("Execute"), None, _("Execute current project"), self.__executeEvent__),
                                        ("CancelAction", gtk.STOCK_CANCEL, _("Cancel"), None, _("Cancel current execution"), self.__cancelEvent__)])

        actionGroupExecute.set_translation_domain(self.__domain__)
        
        __log__.debug("There is a xml path. UI Menus and tools will be recovered from path %s" % __XMLUI_FOLDER__)
        self.__uiManager__ = FactoryControls.getUIManager(os.path.join(__XMLUI_FOLDER__, "execute.xml"), self, actionGroupExecute)[0]

        self.__toolBar__ = self.__uiManager__.get_widget("/ToolsExecute")
        self.__toolBar__.set_style(gtk.TOOLBAR_BOTH_HORIZ)
        self.__toolBar__.set_tooltips(True)
        
        self.__vMain__.pack_start(self.__toolBar__, False, True)
Beispiel #3
0
    def __initUIMenu__(self, domain):
        """
        @summary: Initialize menu of window. 
        @param domain: Domain used to translation.
        """
        actionGroupMenu = gtk.ActionGroup("ActionGroupMenu")
        
        # Create actions
        actionGroupMenu.add_actions([("FileMenuAction", None, _("_File")),
                                     ("NewProjectAction", None, _("New Project")),
                                     ("OpenProjectAction", gtk.STOCK_OPEN, _("_Open"), "<Control>o", _("Open PyCamimg project"), self.__openProjectEvent__),
                                     ("SaveProjectAction", gtk.STOCK_SAVE, _("_Save"), "<Control>s", _("Save current project"), self.__saveProjectEvent__),
                                     ("SaveAsProjectAction", gtk.STOCK_SAVE_AS, _("Save _As"), None, _("Save current project"), self.__saveAsProjectEvent__),
                                     ("QuitAction", gtk.STOCK_QUIT, _("_Quit"), "<Control>q", _("Quit PyCamimg"), self.__queryQuitMenuItemEvent__),
                                     ("ToolsMenuAction", None, _("_Tools")),
                                     ("OperationsAction", None, _("Operations")),
                                     ("PreferencesAction", gtk.STOCK_PREFERENCES, _("_Preferences"), None, _("Preferences of PyCamimg"), self.__openOptionsEvent__),
                                     ("PluginsAction", gtk.STOCK_CONNECT, _("P_lugins"), None, _("Plugins of PyCamimg"), self.__openPlunginsEvent__),
                                     ("HelpMenuAction", None, _("_Help")),
                                     ("AboutAction", gtk.STOCK_ABOUT, _("_About PyCamimg"), None, _("Preferences of PyCamimg"), self.__openAboutEvent__),
                                     ("AddItemAction", gtk.STOCK_ADD, _("Add Images"), None, _("Add selected images"), self.__addImageEvent__),
                                     ("DelItemAction", gtk.STOCK_DELETE, _("Delete Images"), None, _("Delete selected images"), self.__deleteImageEvent__),
                                     ("DelOperationsAction", gtk.STOCK_CLEAR, _("Delete Operations"), None, _("Delete selected operations"), self.__deleteOperationsEvent__),
                                     ("RunAction", gtk.STOCK_EXECUTE, _("Run"), None, _("Run current project"), self.__runEvent__)])
        actionGroupMenu.add_toggle_actions([("ChangeViewAction", gtk.STOCK_CONVERT, _("Toggle view"), None, _("Toggle between differents views"), self.__changeViewProjectEvent__)])

        actionGroupMenu.set_translation_domain(domain)
        
        __log__.debug("There is a xml path. UI Menus and tools will be recovered from path %s" % __XMLUI_FOLDER__)
        print __XMLUI_FOLDER__
        self.__uiManager__ = FactoryControls.getUIManager(os.path.join(__XMLUI_FOLDER__, "MainMenu.xml"), self.__mainWindow__, actionGroupMenu)[0]
        
        self.__menuBar__ = self.__uiManager__.get_widget("/MenuPyCaming")
        self.__toolBar__ = self.__uiManager__.get_widget("/ToolsPyCamimg")
        self.__toolBar__.set_style(gtk.TOOLBAR_BOTH_HORIZ)
        self.__toolBar__.set_tooltips(True)