236 def __initActionsMenu(self): |
236 def __initActionsMenu(self): |
237 """ |
237 """ |
238 Private method to initialize the actions menu. |
238 Private method to initialize the actions menu. |
239 """ |
239 """ |
240 self.__actionsMenu = QMenu() |
240 self.__actionsMenu = QMenu() |
|
241 |
241 self.__graftAct = self.__actionsMenu.addAction( |
242 self.__graftAct = self.__actionsMenu.addAction( |
242 UI.PixmapCache.getIcon("vcsGraft.png"), |
243 UI.PixmapCache.getIcon("vcsGraft.png"), |
243 self.tr("Copy Changesets"), self.__graftActTriggered) |
244 self.tr("Copy Changesets"), self.__graftActTriggered) |
244 self.__graftAct.setToolTip(self.tr( |
245 self.__graftAct.setToolTip(self.tr( |
245 "Copy the selected changesets to the current branch")) |
246 "Copy the selected changesets to the current branch")) |
|
247 |
|
248 self.__mergeAct = self.__actionsMenu.addAction( |
|
249 UI.PixmapCache.getIcon("vcsMerge.png"), |
|
250 self.tr("Merge with Changeset"), self.__mergeActTriggered) |
|
251 self.__mergeAct.setToolTip(self.tr( |
|
252 "Merge the working directory with the selected changeset")) |
246 |
253 |
247 self.__phaseAct = self.__actionsMenu.addAction( |
254 self.__phaseAct = self.__actionsMenu.addAction( |
248 self.tr("Change Phase"), self.__phaseActTriggered) |
255 self.tr("Change Phase"), self.__phaseActTriggered) |
249 self.__phaseAct.setToolTip(self.tr( |
256 self.__phaseAct.setToolTip(self.tr( |
250 "Change the phase of the selected revisions")) |
257 "Change the phase of the selected revisions")) |
317 |
324 |
318 self.actionsButton.setIcon( |
325 self.actionsButton.setIcon( |
319 UI.PixmapCache.getIcon("actionsToolButton.png")) |
326 UI.PixmapCache.getIcon("actionsToolButton.png")) |
320 self.actionsButton.setMenu(self.__actionsMenu) |
327 self.actionsButton.setMenu(self.__actionsMenu) |
321 |
328 |
322 # TODO: add action "Merge" (1 revision selected) |
|
323 # TODO: add action "Create Changegroup" (>=2 revs, lowest rev is base) |
329 # TODO: add action "Create Changegroup" (>=2 revs, lowest rev is base) |
324 # TODO: add action "Sign Revision" (>= 1 revs) (GPG extension) |
330 # TODO: add action "Sign Revision" (>= 1 revs) (GPG extension) |
325 # TODO: add action "Verify Signature" (1 rev) (GPG extension) |
331 # TODO: add action "Verify Signature" (1 rev) (GPG extension) |
326 |
332 |
327 def __initData(self): |
333 def __initData(self): |
1415 otherBranches += 1 |
1421 otherBranches += 1 |
1416 |
1422 |
1417 # step 2: set the status of the graft action |
1423 # step 2: set the status of the graft action |
1418 self.__graftAct.setEnabled(otherBranches > 0) |
1424 self.__graftAct.setEnabled(otherBranches > 0) |
1419 |
1425 |
|
1426 self.__mergeAct.setEnabled(len(self.logTree.selectedItems()) == 1) |
1420 self.__tagAct.setEnabled(len(self.logTree.selectedItems()) == 1) |
1427 self.__tagAct.setEnabled(len(self.logTree.selectedItems()) == 1) |
1421 self.__switchAct.setEnabled(len(self.logTree.selectedItems()) == 1) |
1428 self.__switchAct.setEnabled(len(self.logTree.selectedItems()) == 1) |
1422 self.__bookmarkAct.setEnabled( |
1429 self.__bookmarkAct.setEnabled( |
1423 len(self.logTree.selectedItems()) == 1) |
1430 len(self.logTree.selectedItems()) == 1) |
1424 self.__bookmarkMoveAct.setEnabled( |
1431 self.__bookmarkMoveAct.setEnabled( |
2114 e5App().getObject("Project").reopenProject() |
2121 e5App().getObject("Project").reopenProject() |
2115 return |
2122 return |
2116 |
2123 |
2117 self.on_refreshButton_clicked() |
2124 self.on_refreshButton_clicked() |
2118 |
2125 |
|
2126 @pyqtSlot() |
|
2127 def __mergeActTriggered(self): |
|
2128 """ |
|
2129 Private slot to merge the working directory with the selected |
|
2130 changeset. |
|
2131 """ |
|
2132 itm = self.logTree.selectedItems()[0] |
|
2133 rev = "rev({0})".format( |
|
2134 itm.text(self.RevisionColumn).strip().split(":", 1)[0]) |
|
2135 self.vcs.vcsMerge(self.repodir, rev=rev) |
|
2136 |
2119 def __actionMode(self): |
2137 def __actionMode(self): |
2120 """ |
2138 """ |
2121 Private method to get the selected action mode. |
2139 Private method to get the selected action mode. |
2122 |
2140 |
2123 @return selected action mode (string, one of filter or find) |
2141 @return selected action mode (string, one of filter or find) |