##// END OF EJS Templates
move some action in main windows as asked by @epatters....
Matthias BUSSONNIER -
Show More
@@ -274,56 +274,6 b' class ConsoleWidget(LoggingConfigurable, QtGui.QWidget):'
274 triggered=self.reset_font)
274 triggered=self.reset_font)
275 self.addAction(self.reset_font_size)
275 self.addAction(self.reset_font_size)
276
276
277 self.undo_action = QtGui.QAction("Undo",
278 self,
279 shortcut="Ctrl+Z",
280 statusTip="Undo last action if possible",
281 triggered=self._control.undo)
282 self.undo_action.setDisabled(True)
283 self.addAction(self.undo_action)
284
285 self.redo_action = QtGui.QAction("Redo",
286 self,
287 shortcut="Ctrl+Shift+Z",
288 statusTip="Redo last action if possible",
289 triggered=self._control.redo)
290 self.redo_action.setDisabled(True)
291 self.addAction(self.redo_action)
292
293 self.reset_action = QtGui.QAction("Reset",
294 self,
295 statusTip="Clear all varible from workspace",
296 triggered=self.reset_magic)
297 self.reset_action.setDisabled(True)
298 self.addAction(self.reset_action)
299
300 self.clear_action = QtGui.QAction("Clear",
301 self,
302 statusTip="Clear the console",
303 triggered=self.clear_magic)
304 self.clear_action.setDisabled(True)
305 self.addAction(self.clear_action)
306
307 self.who_action = QtGui.QAction("Who",
308 self,
309 statusTip="List interactive variable",
310 triggered=self.who_magic)
311 self.who_action.setDisabled(True)
312 self.addAction(self.who_action)
313
314 self.whos_action = QtGui.QAction("Whos",
315 self,
316 statusTip="List interactive variable with detail",
317 triggered=self.whos_magic)
318 self.whos_action.setDisabled(True)
319 self.addAction(self.whos_action)
320
321 self.who_ls_action = QtGui.QAction("Who ls",
322 self,
323 statusTip="Return a list of interactive variable",
324 triggered=self.who_ls_magic)
325 self.who_ls_action.setDisabled(True)
326 self.addAction(self.who_ls_action)
327
277
328
278
329 def eventFilter(self, obj, event):
279 def eventFilter(self, obj, event):
@@ -139,14 +139,23 b' class MainWindow(QtGui.QMainWindow):'
139 print "trying to add unexisting action, skipping"
139 print "trying to add unexisting action, skipping"
140
140
141 try:
141 try:
142 self.editMenu.addAction(self._frontend.undo_action)
142 self.undo_action = QtGui.QAction("Undo",
143 self._frontend.undo_action.setEnabled(True)
143 self,
144 shortcut="Ctrl+Z",
145 statusTip="Undo last action if possible",
146 triggered=self._frontend.undo)
147
148 self.editMenu.addAction(self.undo_action)
144 except AttributeError:
149 except AttributeError:
145 print "trying to add unexisting action, skipping"
150 print "trying to add unexisting action, skipping"
146
151
147 try:
152 try:
148 self.editMenu.addAction(self._frontend.redo_action)
153 self.redo_action = QtGui.QAction("Redo",
149 self._frontend.redo_action.setEnabled(True)
154 self,
155 shortcut="Ctrl+Shift+Z",
156 statusTip="Redo last action if possible",
157 triggered=self._frontend.redo)
158 self.editMenu.addAction(self.redo_action)
150 except AttributeError:
159 except AttributeError:
151 print "trying to add unexisting action, skipping"
160 print "trying to add unexisting action, skipping"
152
161
@@ -166,46 +175,62 b' class MainWindow(QtGui.QMainWindow):'
166 print "trying to add unexisting action, skipping"
175 print "trying to add unexisting action, skipping"
167
176
168 try:
177 try:
169 self.magicMenu.addAction(self._frontend.reset_action)
178 self.reset_action = QtGui.QAction("Reset",
170 self._frontend.reset_action.setEnabled(True)
179 self,
180 statusTip="Clear all varible from workspace",
181 triggered=self._frontend.reset_magic)
182 self.magicMenu.addAction(self.reset_action)
171 except AttributeError:
183 except AttributeError:
172 print "trying to add unexisting action, skipping"
184 print "trying to add unexisting action (reset), skipping"
173
185
174 try:
186 try:
175 self.magicMenu.addAction(self._frontend.history_action)
187 self.magicMenu.addAction(self._frontend.history_action)
176 self._frontend.history_action.setEnabled(True)
188 self._frontend.history_action.setEnabled(True)
177 except AttributeError:
189 except AttributeError:
178 print "trying to add unexisting action, skipping"
190 print "trying to add unexisting action (history), skipping"
179
191
180 try:
192 try:
181 self.magicMenu.addAction(self._frontend.save_action)
193 self.magicMenu.addAction(self._frontend.save_action)
182 self._frontend.save_action.setEnabled(True)
194 self._frontend.save_action.setEnabled(True)
183 except AttributeError:
195 except AttributeError:
184 print "trying to add unexisting action, skipping"
196 print "trying to add unexisting action (save), skipping"
197 self._frontend.reset_action.setEnabled(True)
185
198
186 try:
199 try:
187 self.magicMenu.addAction(self._frontend.clear_action)
200 self.clear_action = QtGui.QAction("Clear",
188 self._frontend.clear_action.setEnabled(True)
201 self,
202 statusTip="Clear the console",
203 triggered=self._frontend.clear_magic)
204 self.magicMenu.addAction(self.clear_action)
189 except AttributeError:
205 except AttributeError:
190 print "trying to add unexisting action, skipping"
206 print "trying to add unexisting action, skipping"
191
207
192 try:
208 try:
193 self.magicMenu.addAction(self._frontend.who_action)
209 self.who_action = QtGui.QAction("Who",
194 self._frontend.who_action.setEnabled(True)
210 self,
211 statusTip="List interactive variable",
212 triggered=self._frontend.who_magic)
213 self.magicMenu.addAction(self.who_action)
195 except AttributeError:
214 except AttributeError:
196 print "trying to add unexisting action, skipping"
215 print "trying to add unexisting action (who), skipping"
197
216
198 try:
217 try:
199 self.magicMenu.addAction(self._frontend.who_ls_action)
218 self.who_ls_action = QtGui.QAction("Who ls",
200 self._frontend.who_ls_action.setEnabled(True)
219 self,
220 statusTip="Return a list of interactive variable",
221 triggered=self._frontend.who_ls_magic)
222 self.magicMenu.addAction(self.who_ls_action)
201 except AttributeError:
223 except AttributeError:
202 print "trying to add unexisting action, skipping"
224 print "trying to add unexisting action (who_ls), skipping"
203
225
204 try:
226 try:
205 self.magicMenu.addAction(self._frontend.whos_action)
227 self.whos_action = QtGui.QAction("Whos",
206 self._frontend.whos_action.setEnabled(True)
228 self,
229 statusTip="List interactive variable with detail",
230 triggered=self._frontend.whos_magic)
231 self.magicMenu.addAction(self.whos_action)
207 except AttributeError:
232 except AttributeError:
208 print "trying to add unexisting action, skipping"
233 print "trying to add unexisting action (whos), skipping"
209
234
210
235
211 #---------------------------------------------------------------------------
236 #---------------------------------------------------------------------------
General Comments 0
You need to be logged in to leave comments. Login now