51 ## Private methods |
51 ## Private methods |
52 ###################################################### |
52 ###################################################### |
53 |
53 |
54 def __toolBarByName(self, name): |
54 def __toolBarByName(self, name): |
55 """ |
55 """ |
56 Private slot to get a toolbar by it's object name. |
56 Private slot to get a toolbar by its object name. |
57 |
57 |
58 @param name object name of the toolbar (string) |
58 @param name object name of the toolbar (string) |
59 @return reference to the toolbar (QToolBar) |
59 @return reference to the toolbar (QToolBar) |
60 """ |
60 """ |
61 for toolBar in list(self.__allToolBars.values()): |
61 for toolBar in list(self.__allToolBars.values()): |
257 self.__toolBars[tbID] = newActions |
257 self.__toolBars[tbID] = newActions |
258 self.__toolBarsWithSeparators[tbID] = newActionsWithSeparators |
258 self.__toolBarsWithSeparators[tbID] = newActionsWithSeparators |
259 |
259 |
260 def resetToolBar(self, toolBar): |
260 def resetToolBar(self, toolBar): |
261 """ |
261 """ |
262 Public method to reset a toolbar to it's default state. |
262 Public method to reset a toolbar to its default state. |
263 |
263 |
264 @param toolBar reference to the toolbar to configure (QToolBar) |
264 @param toolBar reference to the toolbar to configure (QToolBar) |
265 """ |
265 """ |
266 if not self.isDefaultToolBar(): |
266 if not self.isDefaultToolBar(): |
267 return |
267 return |
632 |
632 |
633 return self.__categoryToActions[category][:] |
633 return self.__categoryToActions[category][:] |
634 |
634 |
635 def actionById(self, aID): |
635 def actionById(self, aID): |
636 """ |
636 """ |
637 Public method to get an action given it's id. |
637 Public method to get an action given its id. |
638 |
638 |
639 @param aID id of the action object (integer) |
639 @param aID id of the action object (integer) |
640 @return reference to the action (QAction) |
640 @return reference to the action (QAction) |
641 """ |
641 """ |
642 if aID not in self.__allActions: |
642 if aID not in self.__allActions: |
643 return None |
643 return None |
644 return self.__allActions[aID] |
644 return self.__allActions[aID] |
645 |
645 |
646 def toolBarById(self, tbID): |
646 def toolBarById(self, tbID): |
647 """ |
647 """ |
648 Public method to get a toolbar given it's id. |
648 Public method to get a toolbar given its id. |
649 |
649 |
650 @param tbID id of the toolbar object (integer) |
650 @param tbID id of the toolbar object (integer) |
651 @return reference to the toolbar (QToolBar) |
651 @return reference to the toolbar (QToolBar) |
652 """ |
652 """ |
653 if tbID not in self.__allToolBars: |
653 if tbID not in self.__allToolBars: |
654 return None |
654 return None |
655 return self.__allToolBars[tbID] |
655 return self.__allToolBars[tbID] |
656 |
656 |
657 def toolBarActions(self, tbID): |
657 def toolBarActions(self, tbID): |
658 """ |
658 """ |
659 Public method to get a toolbar's actions given it's id. |
659 Public method to get a toolbar's actions given its id. |
660 |
660 |
661 @param tbID id of the toolbar object (integer) |
661 @param tbID id of the toolbar object (integer) |
662 @return list of actions (list of QAction) |
662 @return list of actions (list of QAction) |
663 """ |
663 """ |
664 if tbID not in self.__toolBars: |
664 if tbID not in self.__toolBars: |
674 """ |
674 """ |
675 return self.__toolBars |
675 return self.__toolBars |
676 |
676 |
677 def defaultToolBarActions(self, tbID): |
677 def defaultToolBarActions(self, tbID): |
678 """ |
678 """ |
679 Public method to get a default toolbar's actions given it's id. |
679 Public method to get a default toolbar's actions given its id. |
680 |
680 |
681 @param tbID id of the default toolbar object (integer) |
681 @param tbID id of the default toolbar object (integer) |
682 @return list of actions (list of QAction) |
682 @return list of actions (list of QAction) |
683 """ |
683 """ |
684 if tbID not in self.__defaultToolBars: |
684 if tbID not in self.__defaultToolBars: |