Commits

Germán Poo-Caamaño committed 88e98ad

hggtk: get rid of close buttons on toolbar

Comments (0)

Files changed (11)

         tbuttons = [
                 self._toolbutton(gtk.STOCK_GO_BACK, 'Backout',
                                  self._backout_clicked,
-                                 'Backout selected changeset'),
-                sep,
-                self._toolbutton(gtk.STOCK_CLOSE, 'Close',
-                                 self._close_clicked,
-                                 'Close Window')
+                                 'Backout selected changeset')
             ]
         for btn in tbuttons:
             self.tbar.insert(btn, -1)
                 '  effect of the change being backed out.')
         vbox.pack_start(frame, True, True, 4)
 
-    def _close_clicked(self, toolbutton, data=None):
-        self.destroy()
-
     def set_notify_func(self, func, *args):
         self.notify_func = func
         self.notify_args = args
             ]
         for btn in tbuttons:
             self.tbar.insert(btn, -1)
-        sep = gtk.SeparatorToolItem()
-        sep.set_expand(True)
-        sep.set_draw(False)
-        self.tbar.insert(sep, -1)
-        button = self._toolbutton(gtk.STOCK_CLOSE, 'Close',
-                self._close_clicked, tip='Close Application')
-        self.tbar.insert(button, -1)
         vbox = gtk.VBox()
         self.add(vbox)
         vbox.pack_start(self.tbar, False, False, 2)
         vbox.pack_end(self._remote_cmd, False, False, 1)
         vbox.pack_end(lbl, False, False, 1)
 
-    def _close_clicked(self, toolbutton, data=None):
-        gtk.main_quit()
-
     def _toolbutton(self, stock, label, handler,
                     menu=None, userdata=None, tip=None):
         if menu:
         tbuttons =  self.get_tbbuttons()
         for tbutton in tbuttons:
             toolbar.insert(tbutton, -1)
-        sep = gtk.SeparatorToolItem()
-        sep.set_expand(True)
-        sep.set_draw(False)
-        toolbar.insert(sep, -1)
-        if self.main:
-            name = 'Quit'
-            tip = 'Close Application'
-        else:
-            name = 'Close'
-            tip = 'Close Window'
-        button = self.make_toolbutton(gtk.STOCK_CLOSE, name,
-                self._quit_clicked, tip=tip)
-        toolbar.insert(button, -1)
         self.toolbar = toolbar
         vbox.pack_start(toolbar, False, False, 0)
 
         self.connect('delete_event', self.should_live)
 
 
-
-    def _quit_clicked(self, button, data=None):
-        if not self.should_live():
-            self.destroy()
-
-
     def _destroying(self, gtkobj):
         try:
             settings = self.save_settings()
         self.tbar = gtk.Toolbar()
         self.tips = gtk.Tooltips()
 
-        sep = gtk.SeparatorToolItem()
-        sep.set_expand(True)
-        sep.set_draw(False)
-        self._btn_close = self._toolbutton(gtk.STOCK_CLOSE, 'Close',
-                self._close_clicked, 'Close Window')
-
         tbuttons = [
                 self._toolbutton(gtk.STOCK_GOTO_LAST, 'Send',
                                  self._on_send_clicked,
                 gtk.SeparatorToolItem(),
                 self._toolbutton(gtk.STOCK_PREFERENCES, 'configure',
                                  self._on_conf_clicked,
-                                 'Configure email settings'),
-                sep,
-                self._btn_close
+                                 'Configure email settings')
             ]
         for btn in tbuttons:
             self.tbar.insert(btn, -1)
 
         self.connect('map_event', self._on_window_map_event)
 
-    def _close_clicked(self, toolbutton, data=None):
-        self.destroy()
-
     def _toolbutton(self, stock, label, handler, tip):
         tbutton = gtk.ToolButton(stock)
         tbutton.set_label(label)

hggtk/hgignore.py

         self.tbar = gtk.Toolbar()
         self.tips = gtk.Tooltips()
 
-        sep = gtk.SeparatorToolItem()
-        sep.set_expand(True)
-        sep.set_draw(False)
-        self._btn_close = self._toolbutton(gtk.STOCK_CLOSE, 'Close',
-                self._close_clicked, 'Close Window')
-
         tbuttons = [
                 self._toolbutton(gtk.STOCK_REFRESH,
                     'Refresh',
                     self._refresh_clicked,
-                    tip='Reload hgignore'),
-                sep,
-                self._btn_close
+                    tip='Reload hgignore')
             ]
         for btn in tbuttons:
             self.tbar.insert(btn, -1)
         except IOError:
             pass
 
-    def _close_clicked(self, toolbutton, data=None):
-        self.destroy()
-
     def _toolbutton(self, stock, label, handler, tip):
         tbutton = gtk.ToolButton(stock)
         tbutton.set_label(label)
                 self._btn_unmerge_clicked,
                 tip='Undo merging and return working directory to'
                     ' one of it parent revision')
-        sep = gtk.SeparatorToolItem()
-        sep.set_expand(True)
-        sep.set_draw(False)
-        self._btn_close = self._toolbutton(gtk.STOCK_CLOSE, 'Close',
-                self._close_clicked, tip='Close Application')
         tbuttons = [
                 self._btn_merge,
                 gtk.SeparatorToolItem(),
-                self._btn_unmerge,
-                sep,
-                self._btn_close
+                self._btn_unmerge
             ]
         for btn in tbuttons:
             self.tbar.insert(btn, -1)
         # show them all
         self._refresh()
 
-    def _close_clicked(self, toolbutton, data=None):
-        self.destroy()
-
     def _toolbutton(self, stock, label, handler,
                     menu=None, userdata=None, tip=None):
         if menu:

hggtk/recovery.py

             ]
         for btn in tbuttons:
             self.tbar.insert(btn, -1)
-        sep = gtk.SeparatorToolItem()
-        sep.set_expand(True)
-        sep.set_draw(False)
-        self.tbar.insert(sep, -1)
-        button = self._toolbutton(gtk.STOCK_CLOSE, 'Close',
-                self._close_clicked, tip='Close Application')
-        self.tbar.insert(button, -1)
         vbox = gtk.VBox()
         self.add(vbox)
         vbox.pack_start(self.tbar, False, False, 2)
         self.stbar = gtklib.StatusBar()
         vbox.pack_start(self.stbar, False, False, 2)
 
-    def _close_clicked(self, *args):
-        self._do_close()
-        
     def _delete(self, widget, event):
         self._do_close()
         return True
                                               'Configure',
                                               self._on_conf_clicked,
                                               None)
-        sep = gtk.SeparatorToolItem()
-        sep.set_expand(True)
-        sep.set_draw(False)
-        self._button_close = self._toolbutton(gtk.STOCK_CLOSE, 'Quit',
-                self._close_clicked)
 
         tbuttons = [
                 self._button_start,
                 self._button_browse,
                 gtk.SeparatorToolItem(),
                 self._button_conf,
-                sep,
-                self._button_close,
             ]
         for btn in tbuttons:
             self.tbar.insert(btn, -1)
         tbutton.connect('clicked', handler, userdata)
         return tbutton
             
-    def _close_clicked(self, *args):
-        if self._server_stopped() == True:
-            gtk.main_quit()
-        
     def _delete(self, widget, event):
         if self._server_stopped() == True:
             gtk.main_quit()
             ]
         for btn in tbuttons:
             self.tbar.insert(btn, -1)
-        sep = gtk.SeparatorToolItem()
-        sep.set_expand(True)
-        sep.set_draw(False)
-        self.tbar.insert(sep, -1)
-        button = self._toolbutton(gtk.STOCK_CLOSE, 'Quit',
-                self._close_clicked, tip='Quit Application')
-        self.tbar.insert(button, -1)
         vbox = gtk.VBox()
         self.add(vbox)
         vbox.pack_start(self.tbar, False, False, 2)
         self.tbar = gtk.Toolbar()
         self.tips = gtk.Tooltips()
         
-        sep = gtk.SeparatorToolItem()
-        sep.set_expand(True)
-        sep.set_draw(False)
-        self._btn_close = self._toolbutton(gtk.STOCK_CLOSE, 'Close',
-                self._close_clicked, tip='Close Application')
-
         self._btn_addtag = self._toolbutton(
                 gtk.STOCK_ADD,
                 'Add', 
                 tip='Remove tag from repository')
         tbuttons = [
                 self._btn_addtag,
-                self._btn_rmtag,
-                sep,
-                self._btn_close,
+                self._btn_rmtag
             ]
         for btn in tbuttons:
             self.tbar.insert(btn, -1)
                 continue
             self._tagslist.append([tagname])
             
-    def _close_clicked(self, toolbutton, data=None):
-        self.destroy()
-
     def _btn_tag_clicked(self, button):
         """ select tag from tags dialog """
         import tags
                 'Update', 
                 self._btn_update_clicked,
                 tip='Update working directory to selected revision')
-        sep = gtk.SeparatorToolItem()
-        sep.set_expand(True)
-        sep.set_draw(False)
-        self._btn_close = self._toolbutton(gtk.STOCK_CLOSE, 'Close',
-                self._close_clicked, tip='Close Application')
         tbuttons = [
                 self._btn_update,
-                sep,
-                self._btn_close,
             ]
         for btn in tbuttons:
             self.tbar.insert(btn, -1)
         # show them all
         self._refresh()
 
-    def _close_clicked(self, toolbutton, data=None):
-        self.destroy()
-
     def _toolbutton(self, stock, label, handler,
                     menu=None, userdata=None, tip=None):
         if menu:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.