176 |
177 |
177 def __initActionsMenu(self): |
178 def __initActionsMenu(self): |
178 """ |
179 """ |
179 Private method to initialize the actions menu. |
180 Private method to initialize the actions menu. |
180 """ |
181 """ |
181 # TODO: add some eye candy |
|
182 self.__actionsMenu = QMenu() |
182 self.__actionsMenu = QMenu() |
183 self.__graftAct = self.__actionsMenu.addAction( |
183 self.__graftAct = self.__actionsMenu.addAction( |
|
184 UI.PixmapCache.getIcon("vcsGraft.png"), |
184 self.tr("Copy Changesets"), self.__graftActTriggered) |
185 self.tr("Copy Changesets"), self.__graftActTriggered) |
185 self.__graftAct.setToolTip(self.tr( |
186 self.__graftAct.setToolTip(self.tr( |
186 "Copy the selected changesets to the current branch")) |
187 "Copy the selected changesets to the current branch")) |
187 |
188 |
188 self.__phaseAct = self.__actionsMenu.addAction( |
189 self.__phaseAct = self.__actionsMenu.addAction( |
193 """<b>Change Phase</b>\n<p>This changes the phase of the""" |
194 """<b>Change Phase</b>\n<p>This changes the phase of the""" |
194 """ selected revisions. The selected revisions have to have""" |
195 """ selected revisions. The selected revisions have to have""" |
195 """ the same current phase.</p>""")) |
196 """ the same current phase.</p>""")) |
196 |
197 |
197 self.__tagAct = self.__actionsMenu.addAction( |
198 self.__tagAct = self.__actionsMenu.addAction( |
198 self.tr("Tag"), self.__tagActTriggered) |
199 UI.PixmapCache.getIcon("vcsTag.png"), self.tr("Tag"), |
|
200 self.__tagActTriggered) |
199 self.__tagAct.setToolTip(self.tr("Tag the selected revision")) |
201 self.__tagAct.setToolTip(self.tr("Tag the selected revision")) |
200 |
202 |
201 self.__switchAct = self.__actionsMenu.addAction( |
203 self.__switchAct = self.__actionsMenu.addAction( |
202 self.tr("Switch"), self.__switchActTriggered) |
204 UI.PixmapCache.getIcon("vcsSwitch.png"), self.tr("Switch"), |
|
205 self.__switchActTriggered) |
203 self.__switchAct.setToolTip(self.tr( |
206 self.__switchAct.setToolTip(self.tr( |
204 "Switch the working directory to the selected revision")) |
207 "Switch the working directory to the selected revision")) |
205 |
208 |
206 self.__actionsMenu.addSeparator() |
209 self.__actionsMenu.addSeparator() |
207 |
210 |
208 self.__bookmarkAct = self.__actionsMenu.addAction( |
211 self.__bookmarkAct = self.__actionsMenu.addAction( |
|
212 UI.PixmapCache.getIcon("addBookmark.png"), |
209 self.tr("Define Bookmark..."), self.__bookmarkActTriggered) |
213 self.tr("Define Bookmark..."), self.__bookmarkActTriggered) |
210 self.__bookmarkAct.setToolTip( |
214 self.__bookmarkAct.setToolTip( |
211 self.tr("Bookmark the selected revision")) |
215 self.tr("Bookmark the selected revision")) |
212 self.__bookmarkMoveAct = self.__actionsMenu.addAction( |
216 self.__bookmarkMoveAct = self.__actionsMenu.addAction( |
|
217 UI.PixmapCache.getIcon("moveBookmark.png"), |
213 self.tr("Move Bookmark..."), self.__bookmarkMoveActTriggered) |
218 self.tr("Move Bookmark..."), self.__bookmarkMoveActTriggered) |
214 self.__bookmarkMoveAct.setToolTip( |
219 self.__bookmarkMoveAct.setToolTip( |
215 self.tr("Move bookmark to the selected revision")) |
220 self.tr("Move bookmark to the selected revision")) |
216 |
221 |
217 self.__actionsMenu.addSeparator() |
222 self.__actionsMenu.addSeparator() |
218 |
223 |
219 self.__pullAct = self.__actionsMenu.addAction( |
224 self.__pullAct = self.__actionsMenu.addAction( |
220 self.tr("Pull Changes"), self.__pullActTriggered) |
225 UI.PixmapCache.getIcon("vcsUpdate.png"), self.tr("Pull Changes"), |
|
226 self.__pullActTriggered) |
221 self.__pullAct.setToolTip(self.tr( |
227 self.__pullAct.setToolTip(self.tr( |
222 "Pull changes from a remote repository")) |
228 "Pull changes from a remote repository")) |
223 self.__lfPullAct = self.__actionsMenu.addAction( |
229 self.__lfPullAct = self.__actionsMenu.addAction( |
224 self.tr("Pull Large Files"), self.__lfPullActTriggered) |
230 self.tr("Pull Large Files"), self.__lfPullActTriggered) |
225 self.__lfPullAct.setToolTip(self.tr( |
231 self.__lfPullAct.setToolTip(self.tr( |
230 "Fetch changes from a remote repository")) |
236 "Fetch changes from a remote repository")) |
231 |
237 |
232 self.__actionsMenu.addSeparator() |
238 self.__actionsMenu.addSeparator() |
233 |
239 |
234 self.__pushAct = self.__actionsMenu.addAction( |
240 self.__pushAct = self.__actionsMenu.addAction( |
|
241 UI.PixmapCache.getIcon("vcsCommit.png"), |
235 self.tr("Push Selected Changes"), self.__pushActTriggered) |
242 self.tr("Push Selected Changes"), self.__pushActTriggered) |
236 self.__pushAct.setToolTip(self.tr( |
243 self.__pushAct.setToolTip(self.tr( |
237 "Push changes of the selected changeset and its ancestors" |
244 "Push changes of the selected changeset and its ancestors" |
238 " to a remote repository")) |
245 " to a remote repository")) |
239 self.__pushAllAct = self.__actionsMenu.addAction( |
246 self.__pushAllAct = self.__actionsMenu.addAction( |
|
247 UI.PixmapCache.getIcon("vcsCommit.png"), |
240 self.tr("Push All Changes"), self.__pushAllActTriggered) |
248 self.tr("Push All Changes"), self.__pushAllActTriggered) |
241 self.__pushAllAct.setToolTip(self.tr( |
249 self.__pushAllAct.setToolTip(self.tr( |
242 "Push all changes to a remote repository")) |
250 "Push all changes to a remote repository")) |
243 |
251 |
244 self.__actionsMenu.addSeparator() |
252 self.__actionsMenu.addSeparator() |
245 |
253 |
246 self.__stripAct = self.__actionsMenu.addAction( |
254 self.__stripAct = self.__actionsMenu.addAction( |
|
255 UI.PixmapCache.getIcon("fileDelete.png"), |
247 self.tr("Strip Changesets"), self.__stripActTriggered) |
256 self.tr("Strip Changesets"), self.__stripActTriggered) |
248 self.__stripAct.setToolTip(self.tr( |
257 self.__stripAct.setToolTip(self.tr( |
249 "Strip changesets from a repository")) |
258 "Strip changesets from a repository")) |
250 |
259 |
251 self.actionsButton.setIcon( |
260 self.actionsButton.setIcon( |
1724 selected revision. |
1733 selected revision. |
1725 """ |
1734 """ |
1726 if len(self.logTree.selectedItems()) == 1: |
1735 if len(self.logTree.selectedItems()) == 1: |
1727 itm = self.logTree.selectedItems()[0] |
1736 itm = self.logTree.selectedItems()[0] |
1728 rev = itm.text(self.RevisionColumn).strip().split(":", 1)[0] |
1737 rev = itm.text(self.RevisionColumn).strip().split(":", 1)[0] |
|
1738 bookmarks = [bm.strip() for bm in |
|
1739 itm.text(self.BookmarksColumn).strip().split(",") |
|
1740 if bm.strip()] |
|
1741 if bookmarks: |
|
1742 bookmark, ok = QInputDialog.getItem( |
|
1743 self, |
|
1744 self.tr("Switch"), |
|
1745 self.tr("Select bookmark to switch to (leave empty to" |
|
1746 " use revision):"), |
|
1747 [""] + bookmarks, |
|
1748 0, False) |
|
1749 if not ok: |
|
1750 return |
|
1751 if bookmark: |
|
1752 rev = bookmark |
1729 if rev: |
1753 if rev: |
1730 shouldReopen = self.vcs.vcsUpdate(self.repodir, revision=rev) |
1754 shouldReopen = self.vcs.vcsUpdate(self.repodir, revision=rev) |
1731 if shouldReopen: |
1755 if shouldReopen: |
1732 res = E5MessageBox.yesNo( |
1756 res = E5MessageBox.yesNo( |
1733 None, |
1757 None, |