# HG changeset patch
# User Germán Póo-Caamaño <[email protected]>
# Date 1232558968 10800
# Node ID de58b77ac94e7f90e6ab09f199fd826946788f0a
# Parent  095d7aedcc4884eb8258bb1eb6dbad191ff8a2b7
hggtk: get rid of close buttons on toolbar

diff --git a/hggtk/backout.py b/hggtk/backout.py
--- a/hggtk/backout.py
+++ b/hggtk/backout.py
@@ -34,11 +34,7 @@
         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)
@@ -76,9 +72,6 @@
                 '  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
diff --git a/hggtk/clone.py b/hggtk/clone.py
--- a/hggtk/clone.py
+++ b/hggtk/clone.py
@@ -68,13 +68,6 @@
             ]
         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)
@@ -185,9 +178,6 @@
         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:
diff --git a/hggtk/gdialog.py b/hggtk/gdialog.py
--- a/hggtk/gdialog.py
+++ b/hggtk/gdialog.py
@@ -283,19 +283,6 @@
         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)
 
@@ -312,12 +299,6 @@
         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()
diff --git a/hggtk/hgemail.py b/hggtk/hgemail.py
--- a/hggtk/hgemail.py
+++ b/hggtk/hgemail.py
@@ -31,12 +31,6 @@
         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,
@@ -44,9 +38,7 @@
                 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)
@@ -174,9 +166,6 @@
 
         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)
diff --git a/hggtk/hgignore.py b/hggtk/hgignore.py
--- a/hggtk/hgignore.py
+++ b/hggtk/hgignore.py
@@ -26,19 +26,11 @@
         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)
@@ -157,9 +149,6 @@
         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)
diff --git a/hggtk/merge.py b/hggtk/merge.py
--- a/hggtk/merge.py
+++ b/hggtk/merge.py
@@ -59,17 +59,10 @@
                 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)
@@ -113,9 +106,6 @@
         # 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:
diff --git a/hggtk/recovery.py b/hggtk/recovery.py
--- a/hggtk/recovery.py
+++ b/hggtk/recovery.py
@@ -75,13 +75,6 @@
             ]
         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)
@@ -101,9 +94,6 @@
         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
diff --git a/hggtk/serve.py b/hggtk/serve.py
--- a/hggtk/serve.py
+++ b/hggtk/serve.py
@@ -75,11 +75,6 @@
                                               '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,
@@ -88,8 +83,6 @@
                 self._button_browse,
                 gtk.SeparatorToolItem(),
                 self._button_conf,
-                sep,
-                self._button_close,
             ]
         for btn in tbuttons:
             self.tbar.insert(btn, -1)
@@ -146,10 +139,6 @@
         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()
diff --git a/hggtk/synch.py b/hggtk/synch.py
--- a/hggtk/synch.py
+++ b/hggtk/synch.py
@@ -97,13 +97,6 @@
             ]
         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)
diff --git a/hggtk/tagadd.py b/hggtk/tagadd.py
--- a/hggtk/tagadd.py
+++ b/hggtk/tagadd.py
@@ -48,12 +48,6 @@
         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', 
@@ -66,9 +60,7 @@
                 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)
@@ -149,9 +141,6 @@
                 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
diff --git a/hggtk/update.py b/hggtk/update.py
--- a/hggtk/update.py
+++ b/hggtk/update.py
@@ -56,15 +56,8 @@
                 '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)
@@ -113,9 +106,6 @@
         # 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:
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Tortoisehg-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop

Reply via email to