Plugins/VcsPlugins/vcsMercurial/TransplantExtension/ProjectHelper.py

changeset 1992
f0c5ed503bbd
parent 1509
c0b5e693b0eb
child 2302
f29e9405c851
equal deleted inserted replaced
1991:54101b0b0075 1992:f0c5ed503bbd
24 def __init__(self): 24 def __init__(self):
25 """ 25 """
26 Constructor 26 Constructor
27 """ 27 """
28 super().__init__() 28 super().__init__()
29
30 def setObjects(self, vcsObject, projectObject):
31 """
32 Public method to set references to the vcs and project objects.
33
34 @param vcsObject reference to the vcs object
35 @param projectObject reference to the project object
36 """
37 super().setObjects(vcsObject, projectObject)
38
39 if self.vcs.version >= (2, 3):
40 # transplant is deprecated as of Mercurial 2.3
41 for act in self.actions:
42 act.setEnabled(False)
29 43
30 def initActions(self): 44 def initActions(self):
31 """ 45 """
32 Public method to generate the action objects. 46 Public method to generate the action objects.
33 """ 47 """
67 @param mainMenu reference to the main menu (QMenu) 81 @param mainMenu reference to the main menu (QMenu)
68 @return populated menu (QMenu) 82 @return populated menu (QMenu)
69 """ 83 """
70 menu = QMenu(self.menuTitle(), mainMenu) 84 menu = QMenu(self.menuTitle(), mainMenu)
71 menu.setIcon(UI.PixmapCache.getIcon("vcsTransplant.png")) 85 menu.setIcon(UI.PixmapCache.getIcon("vcsTransplant.png"))
72 menu.setTearOffEnabled(True) 86 if self.vcs.version >= (2, 3):
73 87 # transplant is deprecated as of Mercurial 2.3
74 menu.addAction(self.hgTransplantAct) 88 menu.addAction(self.trUtf8("Transplant is deprecated")).setEnabled(False)
75 menu.addAction(self.hgTransplantContinueAct) 89 else:
90 menu.setTearOffEnabled(True)
91
92 menu.addAction(self.hgTransplantAct)
93 menu.addAction(self.hgTransplantContinueAct)
76 94
77 return menu 95 return menu
78 96
79 def menuTitle(self): 97 def menuTitle(self):
80 """ 98 """

eric ide

mercurial