52 act.setEnabled(True) |
52 act.setEnabled(True) |
53 for act in self.vcsAddMenuActions: |
53 for act in self.vcsAddMenuActions: |
54 act.setEnabled(False) |
54 act.setEnabled(False) |
55 for act in standardItems: |
55 for act in standardItems: |
56 act.setEnabled(False) |
56 act.setEnabled(False) |
57 ## if not hasattr(self.browser.currentItem(), 'fileName'): |
57 if not hasattr(self.browser.currentItem(), 'fileName'): |
58 ## self.blameAct.setEnabled(False) |
58 self.annotateAct.setEnabled(False) |
59 else: |
59 else: |
60 for act in self.vcsMenuActions: |
60 for act in self.vcsMenuActions: |
61 act.setEnabled(False) |
61 act.setEnabled(False) |
62 for act in self.vcsAddMenuActions: |
62 for act in self.vcsAddMenuActions: |
63 act.setEnabled(True) |
63 act.setEnabled(True) |
64 ## if 1 in self.browser.specialMenuEntries: |
|
65 ## try: |
|
66 ## name = self.browser.currentItem().fileName() |
|
67 ## except AttributeError: |
|
68 ## name = self.browser.currentItem().dirName() |
|
69 ## if not os.path.isdir(name): |
|
70 ## self.vcsMenuAddTree.setEnabled(False) |
|
71 for act in standardItems: |
64 for act in standardItems: |
72 act.setEnabled(True) |
65 act.setEnabled(True) |
73 |
66 |
74 def showContextMenuMulti(self, menu, standardItems): |
67 def showContextMenuMulti(self, menu, standardItems): |
75 """ |
68 """ |
104 else: |
97 else: |
105 for act in self.vcsMultiMenuActions: |
98 for act in self.vcsMultiMenuActions: |
106 act.setEnabled(False) |
99 act.setEnabled(False) |
107 for act in self.vcsAddMultiMenuActions: |
100 for act in self.vcsAddMultiMenuActions: |
108 act.setEnabled(True) |
101 act.setEnabled(True) |
109 ## if 1 in self.browser.specialMenuEntries and \ |
|
110 ## self.__itemsHaveFiles(items): |
|
111 ## self.vcsMultiMenuAddTree.setEnabled(False) |
|
112 for act in standardItems: |
102 for act in standardItems: |
113 act.setEnabled(True) |
103 act.setEnabled(True) |
114 |
104 |
115 def showContextMenuDir(self, menu, standardItems): |
105 def showContextMenuDir(self, menu, standardItems): |
116 """ |
106 """ |
207 menu.addSeparator() |
197 menu.addSeparator() |
208 act = menu.addAction(UI.PixmapCache.getIcon("vcsAdd.png"), |
198 act = menu.addAction(UI.PixmapCache.getIcon("vcsAdd.png"), |
209 self.trUtf8('Add to repository'), |
199 self.trUtf8('Add to repository'), |
210 self._VCSAdd) |
200 self._VCSAdd) |
211 self.vcsAddMenuActions.append(act) |
201 self.vcsAddMenuActions.append(act) |
212 ## if 1 in self.browser.specialMenuEntries: |
|
213 ## self.vcsMenuAddTree = menu.addAction(UI.PixmapCache.getIcon("vcsAdd.png"), |
|
214 ## self.trUtf8('Add tree to repository'), |
|
215 ## self._VCSAddTree) |
|
216 ## self.vcsAddMenuActions.append(self.vcsMenuAddTree) |
|
217 act = menu.addAction(UI.PixmapCache.getIcon("vcsRemove.png"), |
202 act = menu.addAction(UI.PixmapCache.getIcon("vcsRemove.png"), |
218 self.trUtf8('Remove from repository (and disk)'), |
203 self.trUtf8('Remove from repository (and disk)'), |
219 self._VCSRemove) |
204 self._VCSRemove) |
220 self.vcsMenuActions.append(act) |
205 self.vcsMenuActions.append(act) |
221 menu.addSeparator() |
206 menu.addSeparator() |
296 self.vcsMultiMenuActions.append(act) |
281 self.vcsMultiMenuActions.append(act) |
297 menu.addSeparator() |
282 menu.addSeparator() |
298 act = menu.addAction(UI.PixmapCache.getIcon("vcsAdd.png"), |
283 act = menu.addAction(UI.PixmapCache.getIcon("vcsAdd.png"), |
299 self.trUtf8('Add to repository'), self._VCSAdd) |
284 self.trUtf8('Add to repository'), self._VCSAdd) |
300 self.vcsAddMultiMenuActions.append(act) |
285 self.vcsAddMultiMenuActions.append(act) |
301 ## if 1 in self.browser.specialMenuEntries: |
|
302 ## self.vcsMultiMenuAddTree = \ |
|
303 ## menu.addAction(UI.PixmapCache.getIcon("vcsAdd.png"), |
|
304 ## self.trUtf8('Add tree to repository'), self._VCSAddTree) |
|
305 ## self.vcsAddMultiMenuActions.append(self.vcsMultiMenuAddTree) |
|
306 act = menu.addAction(UI.PixmapCache.getIcon("vcsRemove.png"), |
286 act = menu.addAction(UI.PixmapCache.getIcon("vcsRemove.png"), |
307 self.trUtf8('Remove from repository (and disk)'), |
287 self.trUtf8('Remove from repository (and disk)'), |
308 self._VCSRemove) |
288 self._VCSRemove) |
309 self.vcsMultiMenuActions.append(act) |
289 self.vcsMultiMenuActions.append(act) |
310 self.vcsRemoveMultiMenuItem = act |
290 self.vcsRemoveMultiMenuItem = act |