summaryrefslogtreecommitdiff
path: root/cad/src/ne1_ui/toolbars/Ui_StandardToolBar.py
blob: 4427f0af3308a1c9e1bb551d255040f45b325029 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Copyright 2004-2007 Nanorex, Inc.  See LICENSE file for details. 
"""
$Id$
"""
from PyQt4 import QtGui
from foundation.wiki_help import QToolBar_WikiHelp

def setupUi(win, toolbarArea):
    """
    Creates and populates the "Standard" toolbar in the main window.

    @param win: NE1's main window object.
    @type  win: U{B{QMainWindow}<http://doc.trolltech.com/4/qmainwindow.html>}
    
    @param toolbarArea: The ToolBarArea of the main window where this toolbar
                        will live (i.e. top, right, left, bottom).
    @type  toolbarArea: U{B{Qt.ToolBarArea enum}<http://doc.trolltech.com/4.2/qt.html#ToolBarArea-enum>}
    """

    # Create the "Standard" toolbar.
    win.standardToolBar = QToolBar_WikiHelp(win)
    win.standardToolBar.setEnabled(True)
    win.standardToolBar.setObjectName("standardToolBar") 
    win.addToolBar(toolbarArea , win.standardToolBar)

    # Populate the "Standard" toolbar.
    win.standardToolBar.addAction(win.fileOpenAction)
    win.standardToolBar.addAction(win.fileSaveAction)
    win.standardToolBar.addSeparator()
    win.standardToolBar.addAction(win.editMakeCheckpointAction) # hidden.
    win.standardToolBar.addAction(win.editUndoAction)
    win.standardToolBar.addAction(win.editRedoAction)
    win.standardToolBar.addAction(win.editCutAction)
    win.standardToolBar.addAction(win.editCopyAction)
    win.standardToolBar.addAction(win.pasteFromClipboardAction)
    win.standardToolBar.addAction(win.editDeleteAction)
    win.standardToolBar.addSeparator()
    win.standardToolBar.addAction(win.toolsSelectMoleculesAction)
    win.standardToolBar.addAction(win.toolsMoveMoleculeAction)
    win.standardToolBar.addAction(win.rotateComponentsAction)
    win.standardToolBar.addAction(win.modifyAdjustSelAction)
    win.standardToolBar.addAction(win.modifyAdjustAllAction)
    win.standardToolBar.addAction(win.simMinimizeEnergyAction)
    win.standardToolBar.addSeparator()
    win.standardToolBar.addAction(win.dispObjectColorAction)
    win.standardToolBar.addAction(win.resetChunkColorAction)
    win.standardToolBar.addSeparator()
    win.standardToolBar.addAction(win.colorSchemeAction)
    win.standardToolBar.addAction(win.lightingSchemeAction)
    win.standardToolBar.addSeparator()
    win.standardToolBar.addAction(win.editRenameSelectionAction)
    win.standardToolBar.addAction(win.editAddSuffixAction)
    win.standardToolBar.addSeparator()
    win.standardToolBar.addAction(win.editPrefsAction)    
    
    win.standardToolBar.addSeparator()  
    win.standardToolBar.addAction(win.helpWhatsThisAction)

def retranslateUi(win):
    """
    Assigns the I{window title} property of the "Standard" toolbar.

    The window title of the "Standard" toolbar will be displayed in the popup 
    menu under "View > Toolbars".
    """
    win.standardToolBar.setWindowTitle(
        QtGui.QApplication.translate(
            "MainWindow", "Standard", 
            None, QtGui.QApplication.UnicodeUTF8))
    win.standardToolBar.setToolTip(
        QtGui.QApplication.translate(
            "MainWindow", "Standard Toolbar", 
            None, QtGui.QApplication.UnicodeUTF8))