summaryrefslogtreecommitdiff
path: root/cad/src/ne1_ui/toolbars/Ui_DisplayStylesToolBar.py
blob: 3d6b49a606b2513883388f236a5824551c20bd86 (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
# Copyright 2004-2007 Nanorex, Inc.  See LICENSE file for details. 
"""
$Id$
"""

from PyQt4 import QtGui
from PyQt4.Qt import Qt
from foundation.wiki_help import QToolBar_WikiHelp

def setupUi(win, toolbarArea):
    """
    Create and populate the "Display Styles" toolbar.
    
    @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 "Display Styles" toolbar.
    win.displayStylesToolBar = QToolBar_WikiHelp(win)
    win.displayStylesToolBar.setEnabled(True)
    win.displayStylesToolBar.setObjectName("displayStylesToolBar")
    win.addToolBar(toolbarArea, win.displayStylesToolBar)    

    # Populate the "Display Styles" toolbar.
    win.displayStylesToolBar.addAction(win.dispDefaultAction)
    win.displayStylesToolBar.addAction(win.dispLinesAction)
    win.displayStylesToolBar.addAction(win.dispTubesAction)
    win.displayStylesToolBar.addAction(win.dispBallAction)
    win.displayStylesToolBar.addAction(win.dispCPKAction)
    win.displayStylesToolBar.addAction(win.dispDnaCylinderAction)
    win.displayStylesToolBar.addSeparator()
    win.displayStylesToolBar.addAction(win.dispHideAction)
    win.displayStylesToolBar.addAction(win.dispUnhideAction) 

def retranslateUi(win):
    """
    Assigns the I{window title} property of the "Display Styles" toolbar.
    
    The window title of these toolbars will be displayed in the popup menu 
    under "View > Toolbars".
    """
    win.displayStylesToolBar.setWindowTitle(
        QtGui.QApplication.translate(
            "MainWindow", "Display Styles", 
            None, QtGui.QApplication.UnicodeUTF8))
    win.displayStylesToolBar.setToolTip(
        QtGui.QApplication.translate(
            "MainWindow", "Display Styles Toolbar", 
            None, QtGui.QApplication.UnicodeUTF8))