Пример #1
0
    def _retranslateUi(self):
        """
        This method centralizes all calls that set UI text for the purpose of
        making it easier for the programmer to translate the UI into other
        languages.

        @see: U{B{The Qt Linquist Manual}<http://doc.trolltech.com/4/linguist-manual.html>}
        """
        self.setWindowTitle(QtGui.QApplication.translate(
            "MainWindow", "NanoEngineer-1",
            None, QtGui.QApplication.UnicodeUTF8))

        # QActions
        Ui_MainWindowWidgets.retranslateUi(self)

        # Toolbars
        Ui_StandardToolBar.retranslateUi(self)
        Ui_ViewToolBar.retranslateUi(self)
        Ui_StandardViewsToolBar.retranslateUi(self)
        Ui_DisplayStylesToolBar.retranslateUi(self)
        Ui_BuildStructuresToolBar.retranslateUi(self)
        Ui_BuildToolsToolBar.retranslateUi(self)
        Ui_SelectToolBar.retranslateUi(self)
        Ui_SimulationToolBar.retranslateUi(self)
        Ui_RenderingToolBar.retranslateUi(self)

        # Menus and submenus
        Ui_FileMenu.retranslateUi(self)
        Ui_EditMenu.retranslateUi(self)
        Ui_ViewMenu.retranslateUi(self)
        Ui_InsertMenu.retranslateUi(self)
        Ui_ToolsMenu.retranslateUi(self)
        Ui_SimulationMenu.retranslateUi(self)
        Ui_RenderingMenu.retranslateUi(self)
        Ui_HelpMenu.retranslateUi(self)
Пример #2
0
    def _retranslateUi(self):
        """
        This method centralizes all calls that set UI text for the purpose of 
        making it easier for the programmer to translate the UI into other 
        languages.

        @see: U{B{The Qt Linquist Manual}<http://doc.trolltech.com/4/linguist-manual.html>}
        """
        self.setWindowTitle(QtGui.QApplication.translate(
            "MainWindow", "NanoEngineer-1", 
            None, QtGui.QApplication.UnicodeUTF8))

        # QActions
        Ui_MainWindowWidgets.retranslateUi(self)
        
        # Toolbars
        Ui_StandardToolBar.retranslateUi(self)
        Ui_ViewToolBar.retranslateUi(self)
        Ui_StandardViewsToolBar.retranslateUi(self)
        Ui_DisplayStylesToolBar.retranslateUi(self)
        Ui_BuildStructuresToolBar.retranslateUi(self)
        Ui_BuildToolsToolBar.retranslateUi(self)
        Ui_SelectToolBar.retranslateUi(self)
        Ui_SimulationToolBar.retranslateUi(self)
        Ui_RenderingToolBar.retranslateUi(self)

        # Menus and submenus
        Ui_FileMenu.retranslateUi(self)
        Ui_EditMenu.retranslateUi(self)
        Ui_ViewMenu.retranslateUi(self)     
        Ui_InsertMenu.retranslateUi(self)
        Ui_ToolsMenu.retranslateUi(self)
        Ui_SimulationMenu.retranslateUi(self)
        Ui_RenderingMenu.retranslateUi(self)
        Ui_HelpMenu.retranslateUi(self)
Пример #3
0
    def _setupToolbars(self):
        """
        Populates all Main Window toolbars.
        Also restores the state of toolbars from the NE1 last session.
        """

        # Add toolbars to the Top area of the main window (first row)
        toolbarArea = Qt.TopToolBarArea
        Ui_StandardToolBar.setupUi(self, toolbarArea)
        Ui_BuildToolsToolBar.setupUi(self, toolbarArea)
        self.addToolBarBreak(toolbarArea)  # Starts second row.
        Ui_ViewToolBar.setupUi(self, toolbarArea)
        Ui_StandardViewsToolBar.setupUi(self, toolbarArea)
        Ui_SimulationToolBar.setupUi(self, toolbarArea)

        # Add toolbars to the Right area of the main window.
        toolbarArea = Qt.RightToolBarArea
        Ui_SelectToolBar.setupUi(self, toolbarArea)
        Ui_DisplayStylesToolBar.setupUi(self, toolbarArea)
        Ui_RenderingToolBar.setupUi(self, toolbarArea)

        # This is hidden the first time NE1 starts (below).
        # BTW, I don't think the "Build Structures" toolbar is necessary since
        # all its options are available prominentaly on the Command Toolbar.
        # I intend to completely remove it soon. Mark 2008-02-29.
        Ui_BuildStructuresToolBar.setupUi(self, toolbarArea)

        from utilities.prefs_constants import toolbar_state_prefs_key
        # This fixes bug 2482.
        if not env.prefs[toolbar_state_prefs_key] == 'defaultToolbarState':
            # Restore the state of the toolbars from the last session.
            toolBarState = QtCore.QByteArray(
                env.prefs[toolbar_state_prefs_key])
            self.restoreState(toolBarState)
        else:
            # No previous session. Hide only these toolbars by default.
            self.buildStructuresToolBar.hide()

        return
Пример #4
0
    def _setupToolbars(self):
        """
        Populates all Main Window toolbars.
        Also restores the state of toolbars from the NE1 last session.
        """

        # Add toolbars to the Top area of the main window (first row)
        toolbarArea = Qt.TopToolBarArea
        Ui_StandardToolBar.setupUi(self, toolbarArea)
        Ui_BuildToolsToolBar.setupUi(self, toolbarArea)
        self.addToolBarBreak (toolbarArea) # Starts second row.
        Ui_ViewToolBar.setupUi(self, toolbarArea)
        Ui_StandardViewsToolBar.setupUi(self, toolbarArea)
        Ui_SimulationToolBar.setupUi(self, toolbarArea)

        # Add toolbars to the Right area of the main window.
        toolbarArea = Qt.RightToolBarArea
        Ui_SelectToolBar.setupUi(self, toolbarArea)
        Ui_DisplayStylesToolBar.setupUi(self, toolbarArea)
        Ui_RenderingToolBar.setupUi(self, toolbarArea)

        # This is hidden the first time NE1 starts (below).
        # BTW, I don't think the "Build Structures" toolbar is necessary since
        # all its options are available prominentaly on the Command Toolbar.
        # I intend to completely remove it soon. Mark 2008-02-29.
        Ui_BuildStructuresToolBar.setupUi(self, toolbarArea)

        from utilities.prefs_constants import toolbar_state_prefs_key
        # This fixes bug 2482.
        if not env.prefs[toolbar_state_prefs_key] == 'defaultToolbarState':
            # Restore the state of the toolbars from the last session.
            toolBarState = QtCore.QByteArray(env.prefs[toolbar_state_prefs_key])
            self.restoreState(toolBarState)
        else:
            # No previous session. Hide only these toolbars by default.
            self.buildStructuresToolBar.hide()

        return