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

branch
eric7
changeset 10438
4cd7e5a8b3cf
parent 10069
435cc5875135
child 10439
21c28b0f9e41
equal deleted inserted replaced
10437:2f70ca07f0af 10438:4cd7e5a8b3cf
34 ): 34 ):
35 """ 35 """
36 Constructor 36 Constructor
37 37
38 @param vcsObject reference to the vcs object 38 @param vcsObject reference to the vcs object
39 @type Git
39 @param browserObject reference to the project browser object 40 @param browserObject reference to the project browser object
41 @type ProjectBaseBrowser
40 @param projectObject reference to the project object 42 @param projectObject reference to the project object
43 @type Project
41 @param isTranslationsBrowser flag indicating, the helper is requested 44 @param isTranslationsBrowser flag indicating, the helper is requested
42 for the translations browser (this needs some special treatment) 45 for the translations browser (this needs some special treatment)
43 @param parent parent widget (QWidget) 46 @type bool
44 @param name name of this object (string) 47 @param parent parent widget
48 @type QWidget
49 @param name name of this object
50 @type str
45 """ 51 """
46 VcsProjectBrowserHelper.__init__( 52 VcsProjectBrowserHelper.__init__(
47 self, 53 self,
48 vcsObject, 54 vcsObject,
49 browserObject, 55 browserObject,
59 65
60 It enables/disables the VCS menu entries depending on the overall 66 It enables/disables the VCS menu entries depending on the overall
61 VCS status and the file status. 67 VCS status and the file status.
62 68
63 @param menu reference to the menu to be shown 69 @param menu reference to the menu to be shown
70 @type QMenu
64 @param standardItems array of standard items that need 71 @param standardItems array of standard items that need
65 activation/deactivation depending on the overall VCS status 72 activation/deactivation depending on the overall VCS status
73 @type list of QAction
66 """ 74 """
67 if self.browser.currentItem().data(1) == self.vcs.vcsName(): 75 if self.browser.currentItem().data(1) == self.vcs.vcsName():
68 for act in self.vcsMenuActions: 76 for act in self.vcsMenuActions:
69 act.setEnabled(True) 77 act.setEnabled(True)
70 for act in standardItems: 78 for act in standardItems:
84 92
85 It enables/disables the VCS menu entries depending on the overall 93 It enables/disables the VCS menu entries depending on the overall
86 VCS status and the files status. 94 VCS status and the files status.
87 95
88 @param menu reference to the menu to be shown 96 @param menu reference to the menu to be shown
97 @type QMenu
89 @param standardItems array of standard items that need 98 @param standardItems array of standard items that need
90 activation/deactivation depending on the overall VCS status 99 activation/deactivation depending on the overall VCS status
100 @type list of QAction
91 """ 101 """
92 vcsName = self.vcs.vcsName() 102 vcsName = self.vcs.vcsName()
93 items = self.browser.getSelectedItems() 103 items = self.browser.getSelectedItems()
94 vcsItems = 0 104 vcsItems = 0
95 # determine number of selected items under VCS control 105 # determine number of selected items under VCS control
118 128
119 It enables/disables the VCS menu entries depending on the overall 129 It enables/disables the VCS menu entries depending on the overall
120 VCS status and the directory status. 130 VCS status and the directory status.
121 131
122 @param menu reference to the menu to be shown 132 @param menu reference to the menu to be shown
133 @type QMenu
123 @param standardItems array of standard items that need 134 @param standardItems array of standard items that need
124 activation/deactivation depending on the overall VCS status 135 activation/deactivation depending on the overall VCS status
136 @type list of QAction
125 """ 137 """
126 if self.browser.currentItem().data(1) == self.vcs.vcsName(): 138 if self.browser.currentItem().data(1) == self.vcs.vcsName():
127 for act in self.vcsDirMenuActions: 139 for act in self.vcsDirMenuActions:
128 act.setEnabled(True) 140 act.setEnabled(True)
129 for act in standardItems: 141 for act in standardItems:
140 152
141 It enables/disables the VCS menu entries depending on the overall 153 It enables/disables the VCS menu entries depending on the overall
142 VCS status and the directory status. 154 VCS status and the directory status.
143 155
144 @param menu reference to the menu to be shown 156 @param menu reference to the menu to be shown
157 @type QMenu
145 @param standardItems array of standard items that need 158 @param standardItems array of standard items that need
146 activation/deactivation depending on the overall VCS status 159 activation/deactivation depending on the overall VCS status
160 @type list of QAction
147 """ 161 """
148 vcsName = self.vcs.vcsName() 162 vcsName = self.vcs.vcsName()
149 items = self.browser.getSelectedItems() 163 items = self.browser.getSelectedItems()
150 vcsItems = 0 164 vcsItems = 0
151 # determine number of selected items under VCS control 165 # determine number of selected items under VCS control
175 def _addVCSMenu(self, mainMenu): 189 def _addVCSMenu(self, mainMenu):
176 """ 190 """
177 Protected method used to add the VCS menu to all project browsers. 191 Protected method used to add the VCS menu to all project browsers.
178 192
179 @param mainMenu reference to the menu to be amended 193 @param mainMenu reference to the menu to be amended
194 @type QMenu
180 """ 195 """
181 self.vcsMenuActions = [] 196 self.vcsMenuActions = []
182 self.vcsAddMenuActions = [] 197 self.vcsAddMenuActions = []
183 198
184 menu = QMenu(self.tr("Version Control")) 199 menu = QMenu(self.tr("Version Control"))
316 """ 331 """
317 Protected method used to add the VCS menu for multi selection to all 332 Protected method used to add the VCS menu for multi selection to all
318 project browsers. 333 project browsers.
319 334
320 @param mainMenu reference to the menu to be amended 335 @param mainMenu reference to the menu to be amended
336 @type QMenu
321 """ 337 """
322 self.vcsMultiMenuActions = [] 338 self.vcsMultiMenuActions = []
323 339
324 menu = QMenu(self.tr("Version Control")) 340 menu = QMenu(self.tr("Version Control"))
325 341
420 def _addVCSMenuBack(self, mainMenu): 436 def _addVCSMenuBack(self, mainMenu):
421 """ 437 """
422 Protected method used to add the VCS menu to all project browsers. 438 Protected method used to add the VCS menu to all project browsers.
423 439
424 @param mainMenu reference to the menu to be amended 440 @param mainMenu reference to the menu to be amended
441 @type QMenu
425 """ 442 """
426 if mainMenu is None: 443 if mainMenu is None:
427 return 444 return
428 445
429 menu = QMenu(self.tr("Version Control")) 446 menu = QMenu(self.tr("Version Control"))
464 def _addVCSMenuDir(self, mainMenu): 481 def _addVCSMenuDir(self, mainMenu):
465 """ 482 """
466 Protected method used to add the VCS menu to all project browsers. 483 Protected method used to add the VCS menu to all project browsers.
467 484
468 @param mainMenu reference to the menu to be amended 485 @param mainMenu reference to the menu to be amended
486 @type QMenu
469 """ 487 """
470 if mainMenu is None: 488 if mainMenu is None:
471 return 489 return
472 490
473 self.vcsDirMenuActions = [] 491 self.vcsDirMenuActions = []
578 def _addVCSMenuDirMulti(self, mainMenu): 596 def _addVCSMenuDirMulti(self, mainMenu):
579 """ 597 """
580 Protected method used to add the VCS menu to all project browsers. 598 Protected method used to add the VCS menu to all project browsers.
581 599
582 @param mainMenu reference to the menu to be amended 600 @param mainMenu reference to the menu to be amended
601 @type QMenu
583 """ 602 """
584 if mainMenu is None: 603 if mainMenu is None:
585 return 604 return
586 605
587 self.vcsDirMultiMenuActions = [] 606 self.vcsDirMultiMenuActions = []

eric ide

mercurial