Ejemplo n.º 1
0
    def __init__(self, title, main_app, model_controller, plugin_manager):
        qt.QMainWindow.__init__(self, None, title, qt.Qt.WDestructiveClose)
        self.setWindowState(qt.Qt.WindowMaximized)
        self.setCaption(title)

        self.setIcon(
            qt.QPixmap(os.path.join(CONF.getIconsPath(), 'faraday_icon.png')))

        self._main_app = main_app
        self._model_controller = model_controller

        self._mainArea = qt.QHBox(self)
        self.setCentralWidget(self._mainArea)
        self._vb_splitter = qt.QSplitter(self._mainArea)
        self._vb_splitter.setOrientation(qt.QSplitter.Vertical)
        self._hb_splitter = qt.QSplitter(self._vb_splitter)
        self._hb_splitter.setOrientation(qt.QSplitter.Horizontal)

        self.statusBar().setSizeGripEnabled(False)

        self._shell_widgets = []
        self._notifications = []
        self._tab_manager = TabManager(self._hb_splitter)
        self._perspective_manager = PerspectiveManager(self._hb_splitter,
                                                       self._main_app)

        self._hosts_treeview = HostsBrowser(self._perspective_manager,
                                            self._model_controller, 'Hosts')
        notifier.registerWidget(self._hosts_treeview)

        self._perspective_manager.registerPerspective(self._hosts_treeview,
                                                      default=True)

        wtw = WorkspaceTreeWindow(self._perspective_manager, 'Workspaces',
                                  self._main_app.getWorkspaceManager())
        self._perspective_manager.registerPerspective(wtw)
        self._workspaces_treeview = wtw

        self._log_console = LogConsole(self._vb_splitter, 'Console')

        self._actions = dict()
        self._setupActions()

        self._menues = {}
        self._setupMenues()

        self.main_toolbar = qt.QToolBar(self, 'main toolbar')
        self._setupMainToolbar()

        self.location_toolbar = LocationToolbar(self, 'location toolbar')
        self.location_toolbar.setOffset(1500)

        self._status_bar_widgets = dict()
        self._setupStatusBar()

        self._is_shell_maximized = False

        self.shell_font = qt.QFont()
        self.shell_font.setRawName(CONF.getFont())
        self.setSizeFont()
Ejemplo n.º 2
0
    def modifyWindowUI(self):
        slicer.util.setModuleHelpSectionVisible(False)

        mainToolBar = slicer.util.findChild(slicer.util.mainWindow(),
                                            'MainToolBar')

        self.CustomToolBar = qt.QToolBar("CustomToolBar")
        self.CustomToolBar.name = "CustomToolBar"
        slicer.util.mainWindow().insertToolBar(mainToolBar, self.CustomToolBar)

        #     central = slicer.util.findChild(slicer.util.mainWindow(), name='CentralWidget')
        #     central.setStyleSheet("background-color: #464449")

        gearIcon = qt.QIcon(self.resourcePath('Icons/Gears.png'))
        self.settingsAction = self.CustomToolBar.addAction(gearIcon, "")

        self.settingsDialog = slicer.util.loadUI(
            self.resourcePath('UI/Settings.ui'))
        self.settingsUI = slicer.util.childWidgetVariables(self.settingsDialog)

        self.settingsUI.CustomUICheckBox.toggled.connect(self.toggleUI)
        self.settingsUI.CustomStyleCheckBox.toggled.connect(self.toggleStyle)

        self.settingsAction.triggered.connect(self.raiseSettings)
        self.hideSlicerUI()
Ejemplo n.º 3
0
    def __init__(self, *args):
        qt.QMainWindow.__init__(self, *args)

        self.plot = Qwt.QwtPlot(self)
        self.plot.setTitle("A Simple Map Demonstration")
        self.plot.setCanvasBackground(qt.Qt.white)
        self.plot.setAxisTitle(Qwt.QwtPlot.xBottom, "x")
        self.plot.setAxisTitle(Qwt.QwtPlot.yLeft, "y")    
        self.plot.setAxisScale(Qwt.QwtPlot.xBottom, 0.0, 1.0)
        self.plot.setAxisScale(Qwt.QwtPlot.yLeft, 0.0, 1.0)
        self.setCentralWidget(self.plot)

        # Initialize map data
        self.count = self.i = 1000
        self.xs = zeros(self.count, Float)
        self.ys = zeros(self.count, Float)

        self.kappa = 0.2

        self.curve = Qwt.QwtPlotCurve("Map")
        self.curve.attach(self.plot)

        self.curve.setSymbol(Qwt.QwtSymbol(Qwt.QwtSymbol.Ellipse,
                                           qt.QBrush(qt.Qt.red),
                                           qt.QPen(qt.Qt.blue),
                                           qt.QSize(5, 5)))

        self.curve.setPen(qt.QPen(qt.Qt.cyan))

        toolBar = qt.QToolBar(self)

        qt.QLabel("Count:", toolBar)
        sizeCounter = Qwt.QwtCounter(toolBar)
        toolBar.addSeparator()
        sizeCounter.setRange(0, 1000000, 100)
        sizeCounter.setValue(self.count)
        sizeCounter.setNumButtons(3)
        self.connect(
            sizeCounter, qt.SIGNAL('valueChanged(double)'), self.setCount)

        qt.QLabel("Ticks (ms):", toolBar)
        tickCounter = Qwt.QwtCounter(toolBar)
        toolBar.addSeparator()
        # 1 tick = 1 ms, 10 ticks = 10 ms (Linux clock is 100 Hz)
        self.ticks = 10
        tickCounter.setRange(0, 1000, 1)
        tickCounter.setValue(self.ticks)
        tickCounter.setNumButtons(3)
        self.connect(
            tickCounter, qt.SIGNAL('valueChanged(double)'), self.setTicks)
        self.tid = self.startTimer(self.ticks)

        self.timer_tic = None
        self.user_tic = None
        self.system_tic = None
        
        self.plot.replot()
Ejemplo n.º 4
0
    def modifyWindowUI(self):
        mainToolBar = slicer.util.findChild(slicer.util.mainWindow(),
                                            'MainToolBar')

        self.CustomToolBar = qt.QToolBar("CustomToolBar")
        self.CustomToolBar.name = "CustomToolBar"
        slicer.util.mainWindow().insertToolBar(mainToolBar, self.CustomToolBar)

        moduleIcon = qt.QIcon(":/Icons/Restyle.png")
        self.StyleAction = self.CustomToolBar.addAction(moduleIcon, "")
        self.StyleAction.triggered.connect(self.toggleStyle)
Ejemplo n.º 5
0
    def __init__(self, *args):
        Qt.QMainWindow.__init__(self, *args)

        self.plot = BodePlot(self)
        self.plot.setMargin(5)

        self.zoomers = []
        zoomer = Qwt.QwtPlotZoomer(
            Qwt.QwtPlot.xBottom,
            Qwt.QwtPlot.yLeft,
            Qwt.QwtPicker.DragSelection,
            Qwt.QwtPicker.AlwaysOff,
            self.plot.canvas())
        zoomer.setRubberBandPen(Qt.QPen(Qt.Qt.green))
        self.zoomers.append(zoomer)

        zoomer = Qwt.QwtPlotZoomer(
            Qwt.QwtPlot.xTop,
            Qwt.QwtPlot.yRight,
            Qwt.QwtPicker.PointSelection | Qwt.QwtPicker.DragSelection,
            Qwt.QwtPicker.AlwaysOff,
            self.plot.canvas())
        zoomer.setRubberBand(Qwt.QwtPicker.NoRubberBand)
        self.zoomers.append(zoomer)

        self.picker = Qwt.QwtPlotPicker(
            Qwt.QwtPlot.xBottom,
            Qwt.QwtPlot.yLeft,
            Qwt.QwtPicker.PointSelection | Qwt.QwtPicker.DragSelection,
            Qwt.QwtPlotPicker.CrossRubberBand,
            Qwt.QwtPicker.AlwaysOn,
            self.plot.canvas())
        self.picker.setRubberBandPen(Qt.QPen(Qt.Qt.green))
        self.picker.setTrackerPen(Qt.QPen(Qt.Qt.cyan))
 
        self.setCentralWidget(self.plot)

        toolBar = Qt.QToolBar(self)
        
        btnZoom = Qt.QToolButton(toolBar)
        btnZoom.setTextLabel("Zoom")
        btnZoom.setPixmap(Qt.QPixmap(zoom_xpm))
        btnZoom.setToggleButton(True)
        btnZoom.setUsesTextLabel(True)

        btnPrint = Qt.QToolButton(toolBar)
        btnPrint.setTextLabel("Print")
        btnPrint.setPixmap(Qt.QPixmap(print_xpm))
        btnPrint.setUsesTextLabel(True)

        toolBar.addSeparator()

        dampBox = Qt.QWidget(toolBar)
        dampLayout = Qt.QHBoxLayout(dampBox)
        dampLayout.setSpacing(0)
        dampLayout.addWidget(Qt.QWidget(dampBox), 10) # spacer
        dampLayout.addWidget(Qt.QLabel("Damping Factor", dampBox), 0)
        dampLayout.addSpacing(10)

        self.cntDamp = Qwt.QwtCounter(dampBox)
        self.cntDamp.setRange(0.01, 5.0, 0.01)
        self.cntDamp.setValue(0.01)
        dampLayout.addWidget(self.cntDamp, 10)

        toolBar.setStretchableWidget(dampBox)

        self.statusBar()
        
        self.zoom(False)
        self.showInfo()
        
        self.connect(
            self.cntDamp,
            Qt.SIGNAL('valueChanged(double)'),
            self.plot.setDamp)
        self.connect(
            btnPrint,
            Qt.SIGNAL('clicked()'),
            self.print_)
        self.connect(
            btnZoom,
            Qt.SIGNAL('toggled(bool)'),
            self.zoom)
        self.connect(
            self.picker,
            Qt.SIGNAL('moved(const QPoint &)'),
            self.moved)
        self.connect(
            self.picker,
            Qt.SIGNAL('selected(const QwtPolygon &)'),
            self.selected)
Ejemplo n.º 6
0
    def __initToolBar(self):
        """Initialize the toolbar
        """
        
        toolBar = qt.QToolBar(self)
 
        qt.QLabel('Bars', toolBar)
        self.counter = Qwt.QwtCounter(toolBar)
        self.counter.setRange(0, 10000, 1)
        self.counter.setNumButtons(3)
        toolBar.addSeparator()

        qt.QLabel('Mouse', toolBar)
        mouseComboBox = qt.QComboBox(toolBar)
        for name in ('3 buttons (PyQwt)',
                     '1 button',
                     '2 buttons',
                     '3 buttons (Qwt)'):
            mouseComboBox.insertItem(name)
        mouseComboBox.setCurrentItem(0)
        toolBar.addSeparator()
        self.setZoomerMousePattern(0)

        qt.QWhatsThis.whatsThisButton(toolBar)

        qt.QWhatsThis.add(
            self.plot.canvas(),
            'A QwtPlotZoomer lets you zoom infinitely deep '
            'by saving the zoom states on a stack.\n\n'
            'You can:\n'
            '- select a zoom region\n'
            '- unzoom all\n'
            '- walk down the stack\n'
            '- walk up the stack.\n\n'
            'The combo box in the toolbar lets you attach '
            'different sets of mouse events to those actions.'
            )
        
        qt.QWhatsThis.add(
            self.counter,
            'Select the number of bars'
            )
        
        qt.QWhatsThis.add(
            mouseComboBox,
            'Configure the zoomer mouse buttons.\n\n'
            '3 buttons (PyQwt style):\n'
            '- left-click & drag to zoom\n'
            '- middle-click to unzoom all\n'
            '- right-click to walk down the stack\n'
            '- shift-right-click to walk up the stack.\n'
            '1 button:\n'
            '- click & drag to zoom\n'
            '- control-click to unzoom all\n'
            '- alt-click to walk down the stack\n'
            '- shift-alt-click to walk up the stack.\n'
            '2 buttons:\n'
            '- left-click & drag to zoom\n'
            '- right-click to unzoom all\n'
            '- alt-left-click to walk down the stack\n'
            '- alt-shift-left-click to walk up the stack.\n'
            '3 buttons (Qwt style):\n'
            '- left-click & drag to zoom\n'
            '- right-click to unzoom all\n'
            '- middle-click to walk down the stack\n'
            '- shift-middle-click to walk up the stack.\n\n'
            'If some of those key combinations interfere with '
            'your Window manager, press the:\n'
            '- escape-key to unzoom all\n'
            '- minus-key to walk down the stack\n'
            '- plus-key to walk up the stack.'
            )

        self.connect(self.counter,
                     qt.SIGNAL('valueChanged(double)'),
                     self.go)
        self.connect(mouseComboBox,
                     qt.SIGNAL('activated(int)'),
                     self.setZoomerMousePattern)
Ejemplo n.º 7
0
    def __init__(self, ctrl, argv=None):
        QtInterface.__init__(self, ctrl, argv)

        self._changeset = None

        self._window = qt.QMainWindow()
        self._window.setCaption("Smart Package Manager %s" % VERSION)
        centerWindow(self._window)
        self._window.setMinimumSize(640, 480)
        app.connect(app, qt.SIGNAL('lastWindowClosed()'), app, qt.SLOT('quit()'))

        self._undo = []
        self._redo = []

        globals = {"self": self, "qt": qt}
        group = qt.QActionGroup(self._window, "Actions")
        self._actions = compileActions(group, ACTIONS, globals)

        class ToggleAction(qt.QAction):
        
            def __init__(self, group, name, label):
                qt.QAction.__init__(self, group, name)
                self.setToggleAction(True)
                self.setMenuText(label.replace("&","&&"))
                self._name = name
            
            def connect(self, signal, callback, userdata):
                self._callback = callback
                self._userdata = userdata
                qt.QObject.connect(self, qt.SIGNAL(signal), self.slot)
            
            def slot(self):
                self._callback(self._userdata)
         
        self._filters = {}
        for name, label in [("hide-non-upgrades", _("Hide Non-upgrades")),
                            ("hide-installed", _("Hide Installed")),
                            ("hide-uninstalled", _("Hide Uninstalled")),
                            ("hide-unmarked", _("Hide Unmarked")),
                            ("hide-unlocked", _("Hide Unlocked")),
                            ("hide-requested", _("Hide Requested")),
                            ("hide-old", _("Hide Old"))]:
            act = ToggleAction(None, name, label)
            act.connect("activated()", self.toggleFilter, name)
            self._actions[name] = act

        treestyle = sysconf.get("package-tree")
        for name, label in [("groups", _("Groups")),
                            ("channels", _("Channels")),
                            ("channels-groups", _("Channels & Groups")),
                            ("none", _("None"))]:
            act = ToggleAction(group, "tree-style-"+name, label)
            if name == treestyle:
                act.setOn(True)
            act.connect("activated()", self.setTreeStyle, name)
            self._actions["tree-style-"+name] = act

        self._menubar = self._window.menuBar()
        for MENU in MENUBAR:
             def insertmenu(menubar, menu):
                item = menu[0]
                action = self._actions[item]
                m = qt.QPopupMenu(menubar)
                text = action.menuText()
                menubar.insertItem(text, m)
                for item in menu[1]:
                    if isinstance(item, tuple):
                        insertmenu(m, item)
                    elif item:
                        action = self._actions[item]
                        #i = qt.QPopupMenu(m)
                        #text = action.menuText()
                        #m.insertItem(text, i)
                        action.addTo(m)
                    else:
                        m.insertSeparator()
             insertmenu(self._menubar, MENU)

        self._toolbar = qt.QToolBar(self._window)
        for TOOL in TOOLBAR:
            def inserttool(toolbar, tool):
                if tool:
                    action = self._actions[tool]
                    #b = qt.QToolButton(toolbar, TOOL)
                    #b.setTextLabel(action.toolTip())
                    pixmap = getPixmap(TOOLBARICONS[tool])
                    #b.setIconSet(qt.QIconSet(pixmap))
                    action.setIconSet(qt.QIconSet(pixmap))
                    action.addTo(toolbar)
                else:
                    toolbar.addSeparator()
            inserttool(self._toolbar, TOOL)

        #self._window.add_accel_group(self._ui.get_accel_group())

        self._actions["exec-changes"].setAccel(qt.QKeySequence("Ctrl+C"))
        self._actions["find"].setAccel(qt.QKeySequence("Ctrl+F"))
        self._actions["expand-all"].setAccel(qt.QKeySequence("Ctrl+O"))
        self._actions["collapse-all"].setAccel(qt.QKeySequence("Ctrl+W"))
        self._actions["summary-window"].setAccel(qt.QKeySequence("Ctrl+S"))

        self._actions["exec-changes"].setEnabled(False)
        self._actions["clear-changes"].setEnabled(False)
        self._actions["undo"].setEnabled(False)
        self._actions["redo"].setEnabled(False)

        # Search bar

        self._searchbar = qt.QToolBar(self._window)
        self._searchbar.hide()
       
        label = qt.QLabel(_("Search:"), self._searchbar)
        label.show()

        self._searchentry = qt.QLineEdit(self._searchbar)
        qt.QObject.connect(self._searchentry, qt.SIGNAL("returnPressed()"), self.refreshPackages)
        self._searchentry.show()

        button = qt.QPushButton(self._searchbar)
        qt.QObject.connect(button, qt.SIGNAL("clicked()"), self.refreshPackages)
        pixmap = getPixmap("crystal-search")
        button.setIconSet(qt.QIconSet(pixmap))
        button.show()

        buttongroup = qt.QButtonGroup(self._searchbar)
        buttongroup.hide()
        
        self._searchname = qt.QRadioButton(_("Automatic"), self._searchbar)
        self._searchname.setChecked(True)
        qt.QObject.connect(self._searchname, qt.SIGNAL("clicked()"), self.refreshPackages)
        buttongroup.insert(self._searchname)
        self._searchname.show()
        self._searchdesc = qt.QRadioButton(_("Description"), self._searchbar)
        self._searchdesc.setChecked(False)
        qt.QObject.connect(self._searchdesc, qt.SIGNAL("clicked()"), self.refreshPackages)
        self._searchdesc.show()
        buttongroup.insert(self._searchdesc)

        # Packages and information

        self._splitter = qt.QSplitter(qt.Qt.Vertical, self._window)
        self._window.setCentralWidget(self._splitter)
        
        self._pv = QtPackageView(self._splitter)
        self._pv.show()

        self._pi = QtPackageInfo(self._splitter)
        self._pi.show()
        qt.QObject.connect(self._pv, qt.PYSIGNAL("packageSelected"), self._pi.setPackage)
        qt.QObject.connect(self._pv, qt.PYSIGNAL("packageActivated"), self.actOnPackages)
        qt.QObject.connect(self._pv, qt.PYSIGNAL("packagePopup"), self.packagePopup)

        self._status = self._window.statusBar()
        self._status.show()
        
        self._legend = QtLegend(self._window)
Ejemplo n.º 8
0
    def __init__(self, *args):
        """Constructor.

        Usage: plot = Plot(*args)
        
        Plot takes any number of optional arguments. The interpretation
        of each optional argument depend on its data type:
        (1) Axis -- enables the axis.
        (2) Curve -- plots a curve.
        (3) string or QString -- sets the title.
        (4) tuples of 2 integer -- sets the size.
        """
        qt.QMainWindow.__init__(self)
        self.__plot = Plot(self, *args)
        self.setCentralWidget(self.__plot)

        self.toolBar = qt.QToolBar(self)

        printButton = qt.QToolButton(self.toolBar)
        printButton.setTextLabel("Print")
        printButton.setPixmap(qt.QPixmap(print_xpm))
        self.toolBar.addSeparator()

        graceButton = qt.QToolButton(self.toolBar)
        graceButton.setTextLabel("Grace")
        graceButton.setPixmap(qt.QPixmap(grace_xpm))
        self.toolBar.addSeparator()

        mouseComboBox = qt.QComboBox(self.toolBar)
        for name in ('3 buttons (PyQwt)', '1 button', '2 buttons',
                     '3 buttons (Qwt)'):
            mouseComboBox.insertItem(name)
        mouseComboBox.setCurrentItem(self.getZoomerMouseEventSet())
        self.toolBar.addSeparator()

        qt.QWhatsThis.whatsThisButton(self.toolBar)

        self.connect(printButton, qt.SIGNAL('clicked()'), self.print_)
        self.connect(graceButton, qt.SIGNAL('clicked()'), self.gracePlot)
        self.connect(mouseComboBox, qt.SIGNAL('activated(int)'),
                     self.setZoomerMouseEventSet)

        self.statusBar().message("Move the mouse within the plot canvas"
                                 " to show the cursor position.")
        self.__plot.canvas().setMouseTracking(1)
        self.connect(self.__plot,
                     qt.SIGNAL('plotMouseMoved(const QMouseEvent&)'),
                     self.onMouseMoved)

        qt.QWhatsThis.add(printButton, 'Print to a printer or an (E)PS file.')

        qt.QWhatsThis.add(
            graceButton, 'Clone the plot into Grace.\n\n'
            'The hardcopy output of Grace is better for\n'
            'scientific journals and LaTeX documents.')

        qt.QWhatsThis.add(
            mouseComboBox,
            'Configure the mouse events for the QwtPlotZoomer.\n\n'
            '3 buttons (PyQwt style):\n'
            '- left-click & drag to zoom\n'
            '- middle-click to unzoom all\n'
            '- right-click to walk down the stack\n'
            '- shift-right-click to walk up the stack.\n'
            '1 button:\n'
            '- click & drag to zoom\n'
            '- control-click to unzoom all\n'
            '- alt-click to walk down the stack\n'
            '- shift-alt-click to walk up the stack.\n'
            '2 buttons:\n'
            '- left-click & drag to zoom\n'
            '- right-click to unzoom all\n'
            '- alt-left-click to walk down the stack\n'
            '- alt-shift-left-click to walk up the stack.\n'
            '3 buttons (Qwt style):\n'
            '- left-click & drag to zoom\n'
            '- right-click to unzoom all\n'
            '- middle-click to walk down the stack\n'
            '- shift-middle-click to walk up the stack.\n\n'
            'If some of those key combinations interfere with\n'
            'your Window manager, press the:\n'
            '- escape-key to unzoom all\n'
            '- minus-key to walk down the stack\n'
            '- plus-key to walk up the stack.')

        qt.QWhatsThis.add(
            self.__plot.legend(), 'Clicking on a legend button toggles\n'
            'a curve between hidden and shown.')

        qt.QWhatsThis.add(
            self.__plot.canvas(),
            'Clicking on a legend button toggles a curve\n'
            'between hidden and shown.\n\n'
            'A QwtPlotZoomer lets you zoom infinitely deep\n'
            'by saving the zoom states on a stack. You can:\n'
            '- select a zoom region\n'
            '- unzoom all\n'
            '- walk down the stack\n'
            '- walk up the stack.\n\n'
            'The combo box in the toolbar lets you attach\n'
            'different sets of mouse events to those actions.')

        self.resize(700, 500)
        self.show()
Ejemplo n.º 9
0
    def __init__(self, *args, **kwargs):
        qt.QMainWindow.__init__(self, *args)

        self.filename = None
        
        self.setCaption("GUI Builder")

        toolbar = qt.QToolBar(self)
        self.cmdNew = ToolButton(toolbar, "new", self.newClicked, "create a new GUI")
        self.cmdOpen = ToolButton(toolbar, "open", self.openClicked, "open an existing GUI file")
        self.cmdSave = ToolButton(toolbar, "save", self.saveClicked, "save current GUI")
        HorizontalSpacer(toolbar, size=20)
        self.cmdLaunchGUI = ToolButton(toolbar, "launch", self.launchGUIClicked, "launch GUI (as a separate process)")
        HorizontalSpacer(toolbar, size=20)
        self.cmdViewPropertyEditor = ToolButton(toolbar, "Draw", self.showProperties, "show properties window")
        self.cmdViewGuiPreview = ToolButton(toolbar, "window_preview", self.showGuiPreview, "show GUI preview")
        self.cmdViewLog = ToolButton(toolbar, "Inform", self.showLog, "show log messages window")
        self.cmdViewHWR = ToolButton(toolbar, "view_tree", self.showHWR, "show Hardware Repository")
        HorizontalSpacer(toolbar)
        
        vbox = qt.QVBox(self)
        self.setCentralWidget(vbox) #vsplitter)
         
        hbox = qt.QSplitter(qt.Qt.Horizontal, vbox)
        self.statusbar = self.statusBar()
        self.guiEditorWindow = GUIEditorWindow(hbox)
        self.toolboxWindow = ToolboxWindow(hbox)
        
        self.logWindow = LogViewBrick.LogViewBrick(None)
        self.logWindow.setCaption("Log window")
        sw = qt.QApplication.desktop().screen().width()
        sh = qt.QApplication.desktop().screen().height()
        self.logWindow.resize(qt.QSize(sw*0.8, sh*0.2))
        self.propertyEditorWindow = PropertyEditorWindow(None)
        self.guiPreviewWindow = GUIPreviewWindow(None)
        self.hwrWindow = HWRWindow(None)

        self.configuration = self.guiEditorWindow.configuration
        
        #
        # build File menu
        #
        fileMenu = qt.QPopupMenu(self)
        fileMenu.insertItem('New', self.newClicked)
        fileMenu.insertSeparator()
        fileMenu.insertItem('Open', self.openClicked)
        fileMenu.insertSeparator()
        fileMenu.insertItem('Save', self.saveClicked)
        fileMenu.insertItem('Save as', self.saveAsClicked)
        fileMenu.insertSeparator()
        fileMenu.insertItem('Quit', self.quitClicked)
        viewMenu = qt.QPopupMenu(self)
        viewMenu.insertItem('Property Editor', self.showProperties)
        viewMenu.insertItem('GUI Preview', self.showGuiPreview)
        viewMenu.insertItem('Log window', self.showLog)
        
        #
        # build menu bar
        #
        mainMenu = self.menuBar()
        mainMenu.insertItem('File', fileMenu)
        mainMenu.insertItem('View', viewMenu)

        #
        # connections
        #
        qt.QObject.connect(self.toolboxWindow, qt.PYSIGNAL("addBrick"), self.guiEditorWindow.addBrick)
        qt.QObject.connect(self.guiEditorWindow, qt.PYSIGNAL("editProperties"), self.propertyEditorWindow.editProperties)
        qt.QObject.connect(self.guiEditorWindow, qt.PYSIGNAL("newItem"), self.propertyEditorWindow.addProperties)
        qt.QObject.connect(self.guiEditorWindow, qt.PYSIGNAL("updatePreview"), self.guiPreviewWindow.drawWindow)
        qt.QObject.connect(self.guiPreviewWindow, qt.PYSIGNAL("previewItemClicked"), self.guiEditorWindow.selectItem)
        qt.QObject.connect(self.guiEditorWindow, qt.PYSIGNAL("showProperties"), self.showProperties)
        qt.QObject.connect(self.guiEditorWindow, qt.PYSIGNAL("hideProperties"), self.hideProperties)
        qt.QObject.connect(self.guiEditorWindow, qt.PYSIGNAL("showPreview"), self.showGuiPreview)

        #
        # finish GUI
        #
        self.toolboxWindow.refresh()

        self.guiPreviewWindow.show()