src/eric7/Plugins/VcsPlugins/vcsSubversion/ProjectBrowserHelper.py

branch
eric7
changeset 10438
4cd7e5a8b3cf
parent 10069
435cc5875135
child 10439
21c28b0f9e41
equal deleted inserted replaced
10437:2f70ca07f0af 10438:4cd7e5a8b3cf
33 ): 33 ):
34 """ 34 """
35 Constructor 35 Constructor
36 36
37 @param vcsObject reference to the vcs object 37 @param vcsObject reference to the vcs object
38 @type Subversion
38 @param browserObject reference to the project browser object 39 @param browserObject reference to the project browser object
40 @type ProjectBaseBrowser
39 @param projectObject reference to the project object 41 @param projectObject reference to the project object
42 @type Project
40 @param isTranslationsBrowser flag indicating, the helper is requested 43 @param isTranslationsBrowser flag indicating, the helper is requested
41 for the translations browser (this needs some special treatment) 44 for the translations browser (this needs some special treatment)
42 @param parent parent widget (QWidget) 45 @type bool
43 @param name name of this object (string) 46 @param parent parent widget
47 @type QWidget
48 @param name name of this object
49 @type str
44 """ 50 """
45 VcsProjectBrowserHelper.__init__( 51 VcsProjectBrowserHelper.__init__(
46 self, 52 self,
47 vcsObject, 53 vcsObject,
48 browserObject, 54 browserObject,
58 64
59 It enables/disables the VCS menu entries depending on the overall 65 It enables/disables the VCS menu entries depending on the overall
60 VCS status and the file status. 66 VCS status and the file status.
61 67
62 @param menu reference to the menu to be shown 68 @param menu reference to the menu to be shown
69 @type QMenu
63 @param standardItems array of standard items that need 70 @param standardItems array of standard items that need
64 activation/deactivation depending on the overall VCS status 71 activation/deactivation depending on the overall VCS status
72 @type list of QAction
65 """ 73 """
66 if self.browser.currentItem().data(1) == self.vcs.vcsName(): 74 if self.browser.currentItem().data(1) == self.vcs.vcsName():
67 for act in self.vcsMenuActions: 75 for act in self.vcsMenuActions:
68 act.setEnabled(True) 76 act.setEnabled(True)
69 for act in self.vcsAddMenuActions: 77 for act in self.vcsAddMenuActions:
94 102
95 It enables/disables the VCS menu entries depending on the overall 103 It enables/disables the VCS menu entries depending on the overall
96 VCS status and the files status. 104 VCS status and the files status.
97 105
98 @param menu reference to the menu to be shown 106 @param menu reference to the menu to be shown
107 @type QMenu
99 @param standardItems array of standard items that need 108 @param standardItems array of standard items that need
100 activation/deactivation depending on the overall VCS status 109 activation/deactivation depending on the overall VCS status
110 @type list of QAction
101 """ 111 """
102 vcsName = self.vcs.vcsName() 112 vcsName = self.vcs.vcsName()
103 items = self.browser.getSelectedItems() 113 items = self.browser.getSelectedItems()
104 vcsItems = 0 114 vcsItems = 0
105 # determine number of selected items under VCS control 115 # determine number of selected items under VCS control
134 144
135 It enables/disables the VCS menu entries depending on the overall 145 It enables/disables the VCS menu entries depending on the overall
136 VCS status and the directory status. 146 VCS status and the directory status.
137 147
138 @param menu reference to the menu to be shown 148 @param menu reference to the menu to be shown
149 @type QMenu
139 @param standardItems array of standard items that need 150 @param standardItems array of standard items that need
140 activation/deactivation depending on the overall VCS status 151 activation/deactivation depending on the overall VCS status
152 @type list of QAction
141 """ 153 """
142 if self.browser.currentItem().data(1) == self.vcs.vcsName(): 154 if self.browser.currentItem().data(1) == self.vcs.vcsName():
143 for act in self.vcsDirMenuActions: 155 for act in self.vcsDirMenuActions:
144 act.setEnabled(True) 156 act.setEnabled(True)
145 for act in self.vcsAddDirMenuActions: 157 for act in self.vcsAddDirMenuActions:
160 172
161 It enables/disables the VCS menu entries depending on the overall 173 It enables/disables the VCS menu entries depending on the overall
162 VCS status and the directory status. 174 VCS status and the directory status.
163 175
164 @param menu reference to the menu to be shown 176 @param menu reference to the menu to be shown
177 @type QMenu
165 @param standardItems array of standard items that need 178 @param standardItems array of standard items that need
166 activation/deactivation depending on the overall VCS status 179 activation/deactivation depending on the overall VCS status
180 @type list of QAction
167 """ 181 """
168 vcsName = self.vcs.vcsName() 182 vcsName = self.vcs.vcsName()
169 items = self.browser.getSelectedItems() 183 items = self.browser.getSelectedItems()
170 vcsItems = 0 184 vcsItems = 0
171 # determine number of selected items under VCS control 185 # determine number of selected items under VCS control
199 def _addVCSMenu(self, mainMenu): 213 def _addVCSMenu(self, mainMenu):
200 """ 214 """
201 Protected method used to add the VCS menu to all project browsers. 215 Protected method used to add the VCS menu to all project browsers.
202 216
203 @param mainMenu reference to the menu to be amended 217 @param mainMenu reference to the menu to be amended
218 @type QMenu
204 """ 219 """
205 self.vcsMenuActions = [] 220 self.vcsMenuActions = []
206 self.vcsAddMenuActions = [] 221 self.vcsAddMenuActions = []
207 222
208 menu = QMenu(self.tr("Version Control")) 223 menu = QMenu(self.tr("Version Control"))
385 """ 400 """
386 Protected method used to add the VCS menu for multi selection to all 401 Protected method used to add the VCS menu for multi selection to all
387 project browsers. 402 project browsers.
388 403
389 @param mainMenu reference to the menu to be amended 404 @param mainMenu reference to the menu to be amended
405 @type QMenu
390 """ 406 """
391 self.vcsMultiMenuActions = [] 407 self.vcsMultiMenuActions = []
392 self.vcsAddMultiMenuActions = [] 408 self.vcsAddMultiMenuActions = []
393 409
394 menu = QMenu(self.tr("Version Control")) 410 menu = QMenu(self.tr("Version Control"))
538 def _addVCSMenuBack(self, mainMenu): 554 def _addVCSMenuBack(self, mainMenu):
539 """ 555 """
540 Protected method used to add the VCS menu to all project browsers. 556 Protected method used to add the VCS menu to all project browsers.
541 557
542 @param mainMenu reference to the menu to be amended 558 @param mainMenu reference to the menu to be amended
559 @type QMenu
543 """ 560 """
544 if mainMenu is None: 561 if mainMenu is None:
545 return 562 return
546 563
547 menu = QMenu(self.tr("Version Control")) 564 menu = QMenu(self.tr("Version Control"))
582 def _addVCSMenuDir(self, mainMenu): 599 def _addVCSMenuDir(self, mainMenu):
583 """ 600 """
584 Protected method used to add the VCS menu to all project browsers. 601 Protected method used to add the VCS menu to all project browsers.
585 602
586 @param mainMenu reference to the menu to be amended 603 @param mainMenu reference to the menu to be amended
604 @type QMenu
587 """ 605 """
588 if mainMenu is None: 606 if mainMenu is None:
589 return 607 return
590 608
591 self.vcsDirMenuActions = [] 609 self.vcsDirMenuActions = []
725 def _addVCSMenuDirMulti(self, mainMenu): 743 def _addVCSMenuDirMulti(self, mainMenu):
726 """ 744 """
727 Protected method used to add the VCS menu to all project browsers. 745 Protected method used to add the VCS menu to all project browsers.
728 746
729 @param mainMenu reference to the menu to be amended 747 @param mainMenu reference to the menu to be amended
748 @type QMenu
730 """ 749 """
731 if mainMenu is None: 750 if mainMenu is None:
732 return 751 return
733 752
734 self.vcsDirMultiMenuActions = [] 753 self.vcsDirMultiMenuActions = []
1086 1105
1087 def __itemsHaveFiles(self, items): 1106 def __itemsHaveFiles(self, items):
1088 """ 1107 """
1089 Private method to check, if items contain file type items. 1108 Private method to check, if items contain file type items.
1090 1109
1091 @param items items to check (list of QTreeWidgetItems) 1110 @param items items to check
1092 @return flag indicating items contain file type items (boolean) 1111 @type list of QTreeWidgetItems
1112 @return flag indicating items contain file type items
1113 @rtype bool
1093 """ 1114 """
1094 return any(isinstance(itm, ProjectBrowserFileItem) for itm in items) 1115 return any(isinstance(itm, ProjectBrowserFileItem) for itm in items)

eric ide

mercurial