149 self.toolbarComboBox.setCurrentIndex(self.toolbarComboBox.findText(name)) |
149 self.toolbarComboBox.setCurrentIndex(self.toolbarComboBox.findText(name)) |
150 |
150 |
151 @pyqtSlot() |
151 @pyqtSlot() |
152 def on_removeButton_clicked(self): |
152 def on_removeButton_clicked(self): |
153 """ |
153 """ |
154 Private slot to remove a custom toolbar |
154 Private slot to remove a custom toolbar. |
155 """ |
155 """ |
156 name = self.toolbarComboBox.currentText() |
156 name = self.toolbarComboBox.currentText() |
157 res = E5MessageBox.yesNo(self, |
157 res = E5MessageBox.yesNo(self, |
158 self.trUtf8("Remove Toolbar"), |
158 self.trUtf8("Remove Toolbar"), |
159 self.trUtf8("""Should the toolbar <b>{0}</b> really be removed?""")\ |
159 self.trUtf8("""Should the toolbar <b>{0}</b> really be removed?""")\ |
251 |
251 |
252 @pyqtSlot(QTreeWidgetItem, QTreeWidgetItem) |
252 @pyqtSlot(QTreeWidgetItem, QTreeWidgetItem) |
253 def on_actionsTree_currentItemChanged(self, current, previous): |
253 def on_actionsTree_currentItemChanged(self, current, previous): |
254 """ |
254 """ |
255 Private slot called, when the currently selected action changes. |
255 Private slot called, when the currently selected action changes. |
|
256 |
|
257 @param current reference to the current item (QTreeWidgetItem) |
|
258 @param previous reference to the previous current item |
|
259 (QTreeWidgetItem) |
256 """ |
260 """ |
257 self.__setupButtons() |
261 self.__setupButtons() |
258 |
262 |
259 @pyqtSlot(QListWidgetItem, QListWidgetItem) |
263 @pyqtSlot(QListWidgetItem, QListWidgetItem) |
260 def on_toolbarActionsList_currentItemChanged(self, current, previous): |
264 def on_toolbarActionsList_currentItemChanged(self, current, previous): |
261 """ |
265 """ |
262 Slot documentation goes here. |
266 Private slot to handle a change of the current item. |
|
267 |
|
268 @param current reference to the current item (QListWidgetItem) |
|
269 @param previous reference to the previous current item |
|
270 (QListWidgetItem) |
263 """ |
271 """ |
264 self.__setupButtons() |
272 self.__setupButtons() |
265 |
273 |
266 @pyqtSlot() |
274 @pyqtSlot() |
267 def on_upButton_clicked(self): |
275 def on_upButton_clicked(self): |
356 |
364 |
357 @pyqtSlot(QAbstractButton) |
365 @pyqtSlot(QAbstractButton) |
358 def on_buttonBox_clicked(self, button): |
366 def on_buttonBox_clicked(self, button): |
359 """ |
367 """ |
360 Private slot called, when a button of the button box was clicked. |
368 Private slot called, when a button of the button box was clicked. |
|
369 |
|
370 @param button reference to the button clicked (QAbstractButton) |
361 """ |
371 """ |
362 if button == self.buttonBox.button(QDialogButtonBox.Cancel): |
372 if button == self.buttonBox.button(QDialogButtonBox.Cancel): |
363 self.reject() |
373 self.reject() |
364 elif button == self.buttonBox.button(QDialogButtonBox.Apply): |
374 elif button == self.buttonBox.button(QDialogButtonBox.Apply): |
365 self.__saveToolBars() |
375 self.__saveToolBars() |
375 self.__setupButtons() |
385 self.__setupButtons() |
376 |
386 |
377 def __saveToolBars(self): |
387 def __saveToolBars(self): |
378 """ |
388 """ |
379 Private method to save the configured toolbars. |
389 Private method to save the configured toolbars. |
|
390 |
|
391 @exception RuntimeError raised to indicate an invalid action |
380 """ |
392 """ |
381 # step 1: remove toolbars marked for deletion |
393 # step 1: remove toolbars marked for deletion |
382 for tbID in self.__removedToolBarIDs: |
394 for tbID in self.__removedToolBarIDs: |
383 tb = self.__manager.toolBarById(tbID) |
395 tb = self.__manager.toolBarById(tbID) |
384 self.__manager.deleteToolBar(tb) |
396 self.__manager.deleteToolBar(tb) |