Commits

TK Soh  committed 604dc35

hggtk/commit: disable some tool buttons if repo is merging

  • Participants
  • Parent commits 5c437ed

Comments (0)

Files changed (2)

File hggtk/commit.py

             self._commit_clicked, tip='commit'))
         return tbbuttons
 
+
     def changed_cb(self, combobox):
         model = combobox.get_model()
         index = combobox.get_active()
         cbcell = self.tree.get_column(0).get_cell_renderers()[0]
         cbcell.set_property("activatable", not merged)
         
+        self.get_toolbutton('Re_vert').set_sensitive(not merged)
+        self.get_toolbutton('_Add').set_sensitive(not merged)
+        self.get_toolbutton('_Remove').set_sensitive(not merged)
+        self.get_toolbutton('_Select').set_sensitive(not merged)
+        self.get_toolbutton('_Deselect').set_sensitive(not merged)
+        
         if merged:
             # select all changes if repo is merged
             for entry in self.model:

File hggtk/gdialog.py

         self.opts = opts
         self.main = main
         self.tmproot = None
+        self.toolbuttons = {}
         self.settings = Settings(self.__class__.__name__)
 
     ### Following methods are meant to be overridden by subclasses ###
         tbutton.set_use_underline(True)
         tbutton.set_label(label)
         tbutton.connect('clicked', handler, userdata)
+        self.toolbuttons[label] = tbutton
         return tbutton
 
 
+    def get_toolbutton(self, label):
+        return self.toolbuttons[label]
+
+
     def _setup_gtk(self):
         self.set_title(self.get_title())
         set_tortoise_icon(self, self.get_icon())