Plugins/VcsPlugins/vcsMercurial/RebaseExtension/ProjectHelper.py

changeset 3190
a9a94491c4fd
parent 3160
209a07d7e401
child 3345
071afe8be2a1
equal deleted inserted replaced
3189:9a21c547de5f 3190:a9a94491c4fd
30 def initActions(self): 30 def initActions(self):
31 """ 31 """
32 Public method to generate the action objects. 32 Public method to generate the action objects.
33 """ 33 """
34 self.hgRebaseAct = E5Action( 34 self.hgRebaseAct = E5Action(
35 self.trUtf8('Rebase Changesets'), 35 self.tr('Rebase Changesets'),
36 UI.PixmapCache.getIcon("vcsRebase.png"), 36 UI.PixmapCache.getIcon("vcsRebase.png"),
37 self.trUtf8('Rebase Changesets'), 37 self.tr('Rebase Changesets'),
38 0, 0, self, 'mercurial_rebase') 38 0, 0, self, 'mercurial_rebase')
39 self.hgRebaseAct.setStatusTip(self.trUtf8( 39 self.hgRebaseAct.setStatusTip(self.tr(
40 'Rebase changesets to another branch' 40 'Rebase changesets to another branch'
41 )) 41 ))
42 self.hgRebaseAct.setWhatsThis(self.trUtf8( 42 self.hgRebaseAct.setWhatsThis(self.tr(
43 """<b>Rebase Changesets</b>""" 43 """<b>Rebase Changesets</b>"""
44 """<p>This rebases changesets to another branch.</p>""" 44 """<p>This rebases changesets to another branch.</p>"""
45 )) 45 ))
46 self.hgRebaseAct.triggered[()].connect(self.__hgRebase) 46 self.hgRebaseAct.triggered[()].connect(self.__hgRebase)
47 self.actions.append(self.hgRebaseAct) 47 self.actions.append(self.hgRebaseAct)
48 48
49 self.hgRebaseContinueAct = E5Action( 49 self.hgRebaseContinueAct = E5Action(
50 self.trUtf8('Continue Rebase Session'), 50 self.tr('Continue Rebase Session'),
51 self.trUtf8('Continue Rebase Session'), 51 self.tr('Continue Rebase Session'),
52 0, 0, self, 'mercurial_rebase_continue') 52 0, 0, self, 'mercurial_rebase_continue')
53 self.hgRebaseContinueAct.setStatusTip(self.trUtf8( 53 self.hgRebaseContinueAct.setStatusTip(self.tr(
54 'Continue the last rebase session after repair' 54 'Continue the last rebase session after repair'
55 )) 55 ))
56 self.hgRebaseContinueAct.setWhatsThis(self.trUtf8( 56 self.hgRebaseContinueAct.setWhatsThis(self.tr(
57 """<b>Continue Rebase Session</b>""" 57 """<b>Continue Rebase Session</b>"""
58 """<p>This continues the last rebase session after repair.</p>""" 58 """<p>This continues the last rebase session after repair.</p>"""
59 )) 59 ))
60 self.hgRebaseContinueAct.triggered[()].connect(self.__hgRebaseContinue) 60 self.hgRebaseContinueAct.triggered[()].connect(self.__hgRebaseContinue)
61 self.actions.append(self.hgRebaseContinueAct) 61 self.actions.append(self.hgRebaseContinueAct)
62 62
63 self.hgRebaseAbortAct = E5Action( 63 self.hgRebaseAbortAct = E5Action(
64 self.trUtf8('Abort Rebase Session'), 64 self.tr('Abort Rebase Session'),
65 self.trUtf8('Abort Rebase Session'), 65 self.tr('Abort Rebase Session'),
66 0, 0, self, 'mercurial_rebase_abort') 66 0, 0, self, 'mercurial_rebase_abort')
67 self.hgRebaseAbortAct.setStatusTip(self.trUtf8( 67 self.hgRebaseAbortAct.setStatusTip(self.tr(
68 'Abort the last rebase session' 68 'Abort the last rebase session'
69 )) 69 ))
70 self.hgRebaseAbortAct.setWhatsThis(self.trUtf8( 70 self.hgRebaseAbortAct.setWhatsThis(self.tr(
71 """<b>Abort Rebase Session</b>""" 71 """<b>Abort Rebase Session</b>"""
72 """<p>This aborts the last rebase session.</p>""" 72 """<p>This aborts the last rebase session.</p>"""
73 )) 73 ))
74 self.hgRebaseAbortAct.triggered[()].connect(self.__hgRebaseAbort) 74 self.hgRebaseAbortAct.triggered[()].connect(self.__hgRebaseAbort)
75 self.actions.append(self.hgRebaseAbortAct) 75 self.actions.append(self.hgRebaseAbortAct)
95 """ 95 """
96 Public method to get the menu title. 96 Public method to get the menu title.
97 97
98 @return title of the menu (string) 98 @return title of the menu (string)
99 """ 99 """
100 return self.trUtf8("Rebase") 100 return self.tr("Rebase")
101 101
102 def __hgRebase(self): 102 def __hgRebase(self):
103 """ 103 """
104 Private slot used to rebase changesets to another branch. 104 Private slot used to rebase changesets to another branch.
105 """ 105 """
106 shouldReopen = self.vcs.getExtensionObject("rebase")\ 106 shouldReopen = self.vcs.getExtensionObject("rebase")\
107 .hgRebase(self.project.getProjectPath()) 107 .hgRebase(self.project.getProjectPath())
108 if shouldReopen: 108 if shouldReopen:
109 res = E5MessageBox.yesNo( 109 res = E5MessageBox.yesNo(
110 None, 110 None,
111 self.trUtf8("Rebase Changesets"), 111 self.tr("Rebase Changesets"),
112 self.trUtf8("""The project should be reread. Do this now?"""), 112 self.tr("""The project should be reread. Do this now?"""),
113 yesDefault=True) 113 yesDefault=True)
114 if res: 114 if res:
115 self.project.reopenProject() 115 self.project.reopenProject()
116 116
117 def __hgRebaseContinue(self): 117 def __hgRebaseContinue(self):
121 shouldReopen = self.vcs.getExtensionObject("rebase")\ 121 shouldReopen = self.vcs.getExtensionObject("rebase")\
122 .hgRebaseContinue(self.project.getProjectPath()) 122 .hgRebaseContinue(self.project.getProjectPath())
123 if shouldReopen: 123 if shouldReopen:
124 res = E5MessageBox.yesNo( 124 res = E5MessageBox.yesNo(
125 None, 125 None,
126 self.trUtf8("Rebase Changesets (Continue)"), 126 self.tr("Rebase Changesets (Continue)"),
127 self.trUtf8("""The project should be reread. Do this now?"""), 127 self.tr("""The project should be reread. Do this now?"""),
128 yesDefault=True) 128 yesDefault=True)
129 if res: 129 if res:
130 self.project.reopenProject() 130 self.project.reopenProject()
131 131
132 def __hgRebaseAbort(self): 132 def __hgRebaseAbort(self):
136 shouldReopen = self.vcs.getExtensionObject("rebase")\ 136 shouldReopen = self.vcs.getExtensionObject("rebase")\
137 .hgRebaseAbort(self.project.getProjectPath()) 137 .hgRebaseAbort(self.project.getProjectPath())
138 if shouldReopen: 138 if shouldReopen:
139 res = E5MessageBox.yesNo( 139 res = E5MessageBox.yesNo(
140 None, 140 None,
141 self.trUtf8("Rebase Changesets (Abort)"), 141 self.tr("Rebase Changesets (Abort)"),
142 self.trUtf8("""The project should be reread. Do this now?"""), 142 self.tr("""The project should be reread. Do this now?"""),
143 yesDefault=True) 143 yesDefault=True)
144 if res: 144 if res:
145 self.project.reopenProject() 145 self.project.reopenProject()

eric ide

mercurial