Changeset 260 for nodebox/branches/try-qt
- Timestamp:
- 12/04/07 17:21:07 (13 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
nodebox/branches/try-qt/nodebox/gui/qt/__init__.py
r259 r260 91 91 def __init__(self, parent=None): 92 92 QTextEdit.__init__(self, parent) 93 self.connect94 93 95 94 def mousePressEvent(self, event): … … 110 109 QWidget.__init__(self) 111 110 111 self.createGUI() 112 112 self.createMenu() 113 self.createGUI()114 113 115 114 self.namespace = {} … … 148 147 149 148 self.editMenu = QMenu(self.tr("&Edit"), self) 150 self.editMenu.addAction(self.tr("&Undo"), self , SLOT("doUndo()"), QKeySequence("Ctrl+Z"))151 self.editMenu.addAction(self.tr("&Redo"), self , SLOT("doRedo()"), QKeySequence("Ctrl+Shift+Z"))149 self.editMenu.addAction(self.tr("&Undo"), self.codeView, SLOT("undo()"), QKeySequence("Ctrl+Z")) 150 self.editMenu.addAction(self.tr("&Redo"), self.codeView, SLOT("redo()"), QKeySequence("Ctrl+Shift+Z")) 152 151 self.editMenu.addSeparator() 153 152 self.menuBar.addMenu(self.editMenu) … … 157 156 self.runAction = self.pythonMenu.addAction(self.tr("&Stop"), self, SLOT("doStop()"), QKeySequence("Ctrl+.")) 158 157 self.menuBar.addMenu(self.pythonMenu) 158 159 self.windowMenu = QMenu(self.tr("&Window"), self) 160 self.windowMenu.addAction(self.tr("&Minimize"), self, SLOT("showMinimized()"), QKeySequence("Ctrl+M")) 161 self.windowMenu.addAction(self.tr("&Zoom"), self, SLOT("showMaximized()")) 162 self.windowMenu.addSeparator() 163 self.windowMenu.addAction(self.tr("&Bring All to Front"), self, SLOT("showNormal()"), QKeySequence("Ctrl+Shift+Z")) # TODO: Correct behaviour 164 self.windowMenu.addSeparator() 165 # TODO: List of all windows 166 self.menuBar.addMenu(self.windowMenu) 159 167 160 168 def createGUI(self): … … 169 177 self.graphicsView = NodeBoxGraphicsView() 170 178 self.graphicsView.document = self 179 self.graphicsView.resize(1000, 1000) 171 180 self.graphicsScroll = QScrollArea() 172 181 self.graphicsScroll.setWidget(self.graphicsView) … … 198 207 self.setLayout(mainLayout) 199 208 200 self.setWindowTitle(self.tr("NodeBox")) 209 self.setWindowTitle(self.tr("Untitled")) 210 self.resize(800, 600) 201 211 202 212 @pyqtSignature("") … … 305 315 306 316 def _runScript(self, compile=True, newSeed=True): 307 print "_runScript"308 317 if not self.cleanRun(self._execScript): 309 318 pass 310 319 311 320 # Check whether we are dealing with animation 312 print "speed", self.canvas.speed313 321 if self.canvas.speed is not None: 314 322 if not self.namespace.has_key("draw"):
