Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.0, 2.0.1, and 2.0.2

stable repowidegt: introduce submenues for cmenu

Changeset 0e1beb661a93

Parent 3680c03bab6e

by Adrian Buehlmann

Changes to one file · Browse files at 0e1beb661a93 Showing diff from parent 3680c03bab6e Diff from another changeset...

 
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
891
892
893
894
895
896
897
898
899
 
 
 
 
 
 
900
901
902
 
 
 
 
 
 
 
 
 
903
904
 
905
906
907
908
909
910
911
 
912
913
914
 
873
874
875
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
 
 
 
 
 
 
 
 
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
 
921
922
923
924
925
926
927
 
928
929
930
931
@@ -873,42 +873,59 @@
    exs = self.repo.extensions()   menu = QMenu(self) - for ext, func, desc, icon, cb in ( - (None, isrev, _('Update...'), 'hg-update', self.updateToRevision), - (None, isctx, _('Visual diff...'), 'visualdiff', self.visualDiffRevision), - (None, isrev, _('Diff to local...'), 'ldiff', self.visualDiffToLocal), - (None, fixed, _('Merge with...'), 'hg-merge', self.mergeWithRevision), - (None, isctx, _('Browse at rev...'), 'hg-annotate', self.manifestRevision), - (None, fixed, _('Tag...'), 'hg-tag', self.tagToRevision), - (None, fixed, _('Bookmark...'), 'bookmark', self.bookmarkRevision), - (None, fixed, _('Backout...'), 'hg-revert', self.backoutToRevision), - (None, isrev, _('Export patch'), 'hg-export', self.exportRevisions), - (None, isrev, _('Email patch...'), 'mail-forward', self.emailRevision), - (None, isrev, _('Archive...'), 'hg-archive', self.archiveRevision), - (None, isctx, _('Copy patch'), 'copy-patch', self.copyPatch), - (None, isrev, _('Copy hash'), 'copy-hash', self.copyHash), - ('transplant', fixed, _('Transplant to local'), 'hg-transplant', + submenu = None + for type, ext, func, desc, icon, cb in ( + (0, None, isrev, _('Update...'), 'hg-update', self.updateToRevision), + (0, None, None, None, None, None), + (0, None, isctx, _('Visual diff...'), 'visualdiff', self.visualDiffRevision), + (0, None, isrev, _('Diff to local...'), 'ldiff', self.visualDiffToLocal), + (0, None, isctx, _('Browse at rev...'), 'hg-annotate', self.manifestRevision), + (0, None, None, None, None, None), + (0, None, fixed, _('Merge with...'), 'hg-merge', self.mergeWithRevision), + (0, None, None, None, None, None), + (0, None, fixed, _('Tag...'), 'hg-tag', self.tagToRevision), + (0, None, fixed, _('Bookmark...'), 'bookmark', self.bookmarkRevision), + (0, None, None, None, None, None), + (0, None, fixed, _('Backout...'), 'hg-revert', self.backoutToRevision), + (0, None, None, None, None, None), + (1, None, None, _("Export"), None, None), + (2, None, isrev, _('Export patch'), 'hg-export', self.exportRevisions), + (2, None, isrev, _('Email patch...'), 'mail-forward', self.emailRevision), + (2, None, isrev, _('Archive...'), 'hg-archive', self.archiveRevision), + (2, None, isctx, _('Copy patch'), 'copy-patch', self.copyPatch), + (0, None, None, None, None, None), + (0, None, isrev, _('Copy hash'), 'copy-hash', self.copyHash), + (0, None, None, None, None, None), + (0, 'rebase', fixed, _('Rebase...'), None, self.rebaseRevision), + (0, 'transplant', fixed, _('Transplant to local'), 'hg-transplant',   self.transplantRevision), - ('rebase', None, None, None, None), - ('rebase', fixed, _('Rebase...'), None, self.rebaseRevision), - ('mq', None, None, None, None), - ('mq', qgoto, _('QGoto'), 'hg-qgoto', self.qgotoRevision), - ('mq', fixed, _('Import to MQ'), 'qimport', self.qimportRevision), - ('mq', applied, _('Finish patch'), 'qfinish', self.qfinishRevision), - ('mq', fixed, _('Strip...'), 'menudelete', self.stripRevision), - ('reviewboard', fixed, _('Post to Review Board...'), + (1, 'mq', None, _('Patch Queue'), None, None), + (2, 'mq', qgoto, _('QGoto'), 'hg-qgoto', self.qgotoRevision), + (2, 'mq', fixed, _('Import to MQ'), 'qimport', self.qimportRevision), + (2, 'mq', applied, _('Finish patch'), 'qfinish', self.qfinishRevision), + (2, 'mq', fixed, _('Strip...'), 'menudelete', self.stripRevision), + (0, 'reviewboard', fixed, _('Post to Review Board...'),   'reviewboard', self.sendToReviewBoard)):   if ext and ext not in exs:   continue + if type == 1: # start submenu + if icon: + submenu = menu.addMenu(icon, desc) + else: + submenu = menu.addMenu(desc) + continue + m = menu + if type == 2: # submenu entry + m = submenu   if desc is None: - menu.addSeparator() + m.addSeparator()   else:   act = QAction(desc, self)   act.triggered.connect(cb)   if icon:   act.setIcon(geticon(icon))   act.enableFunc = func - menu.addAction(act) + m.addAction(act)   items.append(act)   self.singlecmenu = menu   self.singlecmenuitems = items