Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9, 1.9.1, and 1.9.2

repowidget: refactor for different menus for 1,2,many selections

Changeset e16f4f525d84

Parent 757c9d0c17fc

by George Marrows

Changes to one file · Browse files at e16f4f525d84 Showing diff from parent 757c9d0c17fc Diff from another changeset...

 
702
703
704
705
706
707
708
709
710
711
712
 
 
 
713
714
715
 
717
718
719
720
 
 
 
 
 
 
 
 
 
721
722
723
 
767
768
769
 
 
 
 
 
 
770
771
772
 
702
703
704
 
 
705
706
707
708
709
 
710
711
712
713
714
715
 
717
718
719
 
720
721
722
723
724
725
726
727
728
729
730
731
 
775
776
777
778
779
780
781
782
783
784
785
786
@@ -702,14 +702,14 @@
    def viewMenuRequest(self, point, selection):   'User requested a context menu in repo view widget' - if len(selection) == 0: - return     # selection is a list of the currently selected revisions.   # Integers for changelog revisions, None for the working copy,   # or strings for unapplied patches.   - if self.bundle: + if len(selection) == 0: + return + elif self.bundle:   # Special menu for applied bundle   menu = QMenu(self) # TODO: save in repowidget   act = QAction(_('Pull to here'), self) @@ -717,7 +717,15 @@
  menu.addAction(act)   menu.exec_(point)   return - + elif len(selection) == 1: + self.singleSelectionMenu(point, selection) + elif len(selection) == 2: + self.doubleSelectionMenu(point, selection) + else: + self.multipleSelectionMenu(point, selection) + + def singleSelectionMenu(self, point, selection): +   if not self.contextmenu:   menu = QMenu(self)   allactions = [[None, ['update', 'manifest', 'merge', 'tag', @@ -767,6 +775,12 @@
    self.contextmenu.exec_(point)   + def doubleSelectionMenu(self, point, selection): + pass + + def multipleSelectionMenu(self, point, selection): + pass +   def updateToRevision(self):   dlg = update.UpdateDialog(self.repo, self.rev, self)   dlg.output.connect(self.output)