src/eric7/EricWidgets/EricToolBarDialog.py

branch
eric7
changeset 10423
299802979277
parent 10373
093dcebe5ecb
child 10439
21c28b0f9e41
equal deleted inserted replaced
10422:e28b89693f37 10423:299802979277
51 def __init__(self, toolBarManager, parent=None): 51 def __init__(self, toolBarManager, parent=None):
52 """ 52 """
53 Constructor 53 Constructor
54 54
55 @param toolBarManager reference to a toolbar manager object 55 @param toolBarManager reference to a toolbar manager object
56 (EricToolBarManager) 56 @type EricToolBarManager
57 @param parent reference to the parent widget (QWidget) 57 @param parent reference to the parent widget
58 @type QWidget
58 """ 59 """
59 super().__init__(parent) 60 super().__init__(parent)
60 self.setupUi(self) 61 self.setupUi(self)
61 62
62 self.__manager = toolBarManager 63 self.__manager = toolBarManager
266 @pyqtSlot(int) 267 @pyqtSlot(int)
267 def __toolbarComboBox_currentIndexChanged(self, index): 268 def __toolbarComboBox_currentIndexChanged(self, index):
268 """ 269 """
269 Private slot called upon a selection of the current toolbar. 270 Private slot called upon a selection of the current toolbar.
270 271
271 @param index index of the new current toolbar (integer) 272 @param index index of the new current toolbar
273 @type int
272 """ 274 """
273 itemID = self.toolbarComboBox.itemData(index) 275 itemID = self.toolbarComboBox.itemData(index)
274 self.__currentToolBarItem = self.__toolbarItems[itemID] 276 self.__currentToolBarItem = self.__toolbarItems[itemID]
275 self.toolbarActionsList.clear() 277 self.toolbarActionsList.clear()
276 for actionID in self.__currentToolBarItem.actionIDs: 278 for actionID in self.__currentToolBarItem.actionIDs:
298 @pyqtSlot(QTreeWidgetItem, QTreeWidgetItem) 300 @pyqtSlot(QTreeWidgetItem, QTreeWidgetItem)
299 def on_actionsTree_currentItemChanged(self, current, previous): 301 def on_actionsTree_currentItemChanged(self, current, previous):
300 """ 302 """
301 Private slot called, when the currently selected action changes. 303 Private slot called, when the currently selected action changes.
302 304
303 @param current reference to the current item (QTreeWidgetItem) 305 @param current reference to the current item
306 @type QTreeWidgetItem
304 @param previous reference to the previous current item 307 @param previous reference to the previous current item
305 (QTreeWidgetItem) 308 @type QTreeWidgetItem
306 """ 309 """
307 self.__setupButtons() 310 self.__setupButtons()
308 311
309 @pyqtSlot(QListWidgetItem, QListWidgetItem) 312 @pyqtSlot(QListWidgetItem, QListWidgetItem)
310 def on_toolbarActionsList_currentItemChanged(self, current, previous): 313 def on_toolbarActionsList_currentItemChanged(self, current, previous):
311 """ 314 """
312 Private slot to handle a change of the current item. 315 Private slot to handle a change of the current item.
313 316
314 @param current reference to the current item (QListWidgetItem) 317 @param current reference to the current item
318 @type QListWidgetItem
315 @param previous reference to the previous current item 319 @param previous reference to the previous current item
316 (QListWidgetItem) 320 @type QListWidgetItem
317 """ 321 """
318 self.__setupButtons() 322 self.__setupButtons()
319 323
320 @pyqtSlot() 324 @pyqtSlot()
321 def on_upButton_clicked(self): 325 def on_upButton_clicked(self):
419 @pyqtSlot(QAbstractButton) 423 @pyqtSlot(QAbstractButton)
420 def on_buttonBox_clicked(self, button): 424 def on_buttonBox_clicked(self, button):
421 """ 425 """
422 Private slot called, when a button of the button box was clicked. 426 Private slot called, when a button of the button box was clicked.
423 427
424 @param button reference to the button clicked (QAbstractButton) 428 @param button reference to the button clicked
429 @type QAbstractButton
425 """ 430 """
426 if button == self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel): 431 if button == self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel):
427 self.reject() 432 self.reject()
428 elif button == self.buttonBox.button(QDialogButtonBox.StandardButton.Apply): 433 elif button == self.buttonBox.button(QDialogButtonBox.StandardButton.Apply):
429 self.__saveToolBars() 434 self.__saveToolBars()
484 """ 489 """
485 Private methdo to restore the current toolbar to the given list of 490 Private methdo to restore the current toolbar to the given list of
486 actions. 491 actions.
487 492
488 @param actions list of actions to set for the current toolbar 493 @param actions list of actions to set for the current toolbar
489 (list of QAction) 494 @type list of QAction
490 """ 495 """
491 tbItemID = id(self.__currentToolBarItem) 496 tbItemID = id(self.__currentToolBarItem)
492 for widgetActionID in self.__toolBarItemToWidgetActionID[tbItemID]: 497 for widgetActionID in self.__toolBarItemToWidgetActionID[tbItemID]:
493 self.__widgetActionToToolBarItemID[widgetActionID] = None 498 self.__widgetActionToToolBarItemID[widgetActionID] = None
494 self.__toolBarItemToWidgetActionID[tbItemID] = [] 499 self.__toolBarItemToWidgetActionID[tbItemID] = []

eric ide

mercurial