Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.7, 0.7.1, and 0.7.2

hggtk: get rid of close buttons on toolbar

Changeset 88e98adbc4b2

Parent 4301178886fd

by Germ├бn P├│o-Caama├▒o

Changes to 11 files · Browse files at 88e98adbc4b2 Showing diff from parent 4301178886fd Diff from another changeset...

Change 1 of 2 Show Entire File hggtk/​backout.py Stacked
 
34
35
36
37
38
39
40
41
 
42
43
44
 
76
77
78
79
80
81
82
83
84
 
34
35
36
 
 
 
 
 
37
38
39
40
 
72
73
74
 
 
 
75
76
77
@@ -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
Change 1 of 2 Show Entire File hggtk/​clone.py Stacked
 
68
69
70
71
72
73
74
75
76
77
78
79
80
 
185
186
187
188
189
190
191
192
193
 
68
69
70
 
 
 
 
 
 
 
71
72
73
 
178
179
180
 
 
 
181
182
183
@@ -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:
Change 1 of 2 Show Entire File hggtk/​gdialog.py Stacked
 
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
 
312
313
314
315
316
317
318
319
320
321
322
323
 
283
284
285
 
 
 
 
 
 
 
 
 
 
 
 
 
286
287
288
 
299
300
301
 
 
 
 
 
 
302
303
304
@@ -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()
Change 1 of 3 Show Entire File hggtk/​hgemail.py Stacked
 
31
32
33
34
35
36
37
38
39
40
41
42
 
44
45
46
47
48
49
 
50
51
52
 
174
175
176
177
178
179
180
181
182
 
31
32
33
 
 
 
 
 
 
34
35
36
 
38
39
40
 
 
 
41
42
43
44
 
166
167
168
 
 
 
169
170
171
@@ -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)
Change 1 of 2 Show Entire File hggtk/​hgignore.py Stacked
 
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
 
42
43
44
 
157
158
159
160
161
162
163
164
165
 
26
27
28
 
 
 
 
 
 
29
30
31
32
 
 
 
33
34
35
36
 
149
150
151
 
 
 
152
153
154
@@ -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)
Change 1 of 2 Show Entire File hggtk/​merge.py Stacked
 
59
60
61
62
63
64
65
66
67
68
69
70
71
72
 
73
74
75
 
113
114
115
116
117
118
119
120
121
 
59
60
61
 
 
 
 
 
62
63
64
 
 
 
65
66
67
68
 
106
107
108
 
 
 
109
110
111
@@ -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:
Change 1 of 2 Show Entire File hggtk/​recovery.py Stacked
 
75
76
77
78
79
80
81
82
83
84
85
86
87
 
101
102
103
104
105
106
107
108
109
 
75
76
77
 
 
 
 
 
 
 
78
79
80
 
94
95
96
 
 
 
97
98
99
@@ -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
Change 1 of 3 Show Changes Only hggtk/​serve.py Stacked
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
 
 
 
 
 
78
79
80
81
82
83
84
85
 
 
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
 
 
 
 
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
 #  # TortoiseHg dialog to start web server  #  # Copyright (C) 2007 Steve Borho <steve@borho.org>  # Copyright (C) 2007 TK Soh <teekaysoh@gmail.com>  #    try:   import pygtk   pygtk.require("2.0")  except:   pass    import gtk  import gobject  import httplib  import os  import pango  import Queue  import socket  import sys  import threading  import time  import hglib  from dialog import question_dialog, error_dialog  from mercurial import hg, ui, commands, cmdutil, util  from mercurial.repo import RepoError  from mercurial.hgweb import server  from mercurial.i18n import _  from shlib import set_tortoise_icon    gservice = None  class ServeDialog(gtk.Window):   """ Dialog to run web server"""   def __init__(self, cwd='', root='', webdir_conf=''):   """ Initialize the Dialog """   gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)     set_tortoise_icon(self, 'proxy.ico')   self.connect('delete-event', self._delete)     # Pipe stderr, stdout to self.write   self._queue = Queue.Queue()   sys.stdout = self   sys.stderr = self     # Override mercurial.commands.serve() with our own version   # that supports being stopped   commands.table.update(thg_serve_cmd)     self._url = None   self._root = root   self._webdirconf = webdir_conf   if cwd:   os.chdir(cwd)     self._get_config()   self.set_default_size(500, 300)     # toolbar   self.tbar = gtk.Toolbar()   self._button_start = self._toolbutton(gtk.STOCK_MEDIA_PLAY,   'Start',   self._on_start_clicked,   None)   self._button_stop = self._toolbutton(gtk.STOCK_MEDIA_STOP,   'Stop',   self._on_stop_clicked,   None)   self._button_browse = self._toolbutton(gtk.STOCK_HOME,   'Browse',   self._on_browse_clicked,   None)   self._button_conf = self._toolbutton(gtk.STOCK_PREFERENCES,   '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_stop,   gtk.SeparatorToolItem(),   self._button_browse,   gtk.SeparatorToolItem(),   self._button_conf, - sep, - self._button_close,   ]   for btn in tbuttons:   self.tbar.insert(btn, -1)     vbox = gtk.VBox()   self.add(vbox)   vbox.pack_start(self.tbar, False, False, 2)     # revision input   revbox = gtk.HBox()   lbl = gtk.Label("HTTP Port:")   lbl.set_property("width-chars", 16)   lbl.set_alignment(0, 0.5)   self._port_input = gtk.Entry()   self._port_input.set_text(self.defport)   revbox.pack_start(lbl, False, False)   revbox.pack_start(self._port_input, False, False)   vbox.pack_start(revbox, False, False, 2)     scrolledwindow = gtk.ScrolledWindow()   scrolledwindow.set_shadow_type(gtk.SHADOW_ETCHED_IN)   scrolledwindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)   self.textview = gtk.TextView(buffer=None)   self.textview.set_editable(False)   self.textview.modify_font(pango.FontDescription("Monospace"))   scrolledwindow.add(self.textview)   self.textview.set_editable(False)   self.textbuffer = self.textview.get_buffer()   vbox.pack_start(scrolledwindow, True, True)   self._set_button_states()     def _get_config(self):   try:   repo = hg.repository(ui.ui(), path=self._root)   except RepoError:   print 'no repository found'   gtk.main_quit()   self.defport = repo.ui.config('web', 'port') or '8000'   self.webname = repo.ui.config('web', 'name') or \   os.path.basename(self._root)   if self._webdirconf:   self.set_title("hg serve %s - %s" % (self._webdirconf, self.webname))   else:   self.set_title("hg serve - " + self.webname)     def _toolbutton(self, stock, label, handler, menu=None, userdata=None):   if menu:   tbutton = gtk.MenuToolButton(stock)   tbutton.set_menu(menu)   else:   tbutton = gtk.ToolButton(stock)     tbutton.set_label(label)   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()   else:   return True     def _server_stopped(self):   '''   check if server is running, or to terminate if running   '''   if gservice and not gservice.stopped:   if question_dialog(self, "Really Exit?",   "Server process is still running\n" +   "Exiting will stop the server.") != gtk.RESPONSE_YES:   return False   else:   self._stop_server()   return True   else:   return True     def _set_button_states(self):   if gservice and not gservice.stopped:   self._button_start.set_sensitive(False)   self._button_stop.set_sensitive(True)   self._button_browse.set_sensitive(True)   self._button_conf.set_sensitive(False)   else:   self._button_start.set_sensitive(True)   self._button_stop.set_sensitive(False)   self._button_browse.set_sensitive(False)   self._button_conf.set_sensitive(True)     def _on_start_clicked(self, *args):   self._start_server()   self._set_button_states()     def _on_stop_clicked(self, *args):   self._stop_server()     def _on_browse_clicked(self, *args):   ''' launch default browser to view repo '''   if self._url:   def start_browser():   if os.name == 'nt':   try:   import win32api, win32con   win32api.ShellExecute(0, "open", self._url, None, "",   win32con.SW_SHOW)   except:   # Firefox likes to create exceptions at launch,   # the user doesn't need to be bothered by them   pass   else:   import gconf   client = gconf.client_get_default()   browser = client.get_string(   '/desktop/gnome/url-handlers/http/command') + '&'   os.system(browser % self._url)   threading.Thread(target=start_browser).start()     def _on_conf_clicked(self, *args):   from thgconfig import ConfigDialog   dlg = ConfigDialog(self._root, True)   dlg.show_all()   dlg.focus_field('web.name')   dlg.run()   dlg.hide()   self._get_config()     def _start_server(self):   # gather input data   try:   port = int(self._port_input.get_text())   except:   try: port = int(self.defport)   except: port = 8000   error_dialog(self, "Invalid port 2048..65535", "Defaulting to " +   self.defport)     global gservice   gservice = None     args = [self._root, self._queue, 'serve', '--port', str(port)]   if self._webdirconf:   args.append('--webdir-conf=' + self._webdirconf)   else:   args.append('--name')   args.append(self.webname)   thread = threading.Thread(target=hglib.hgcmd_toq, args=args)   thread.start()     while not gservice or not hasattr(gservice, 'httpd'):   time.sleep(0.1)   self._url = 'http://%s:%d/' % (gservice.httpd.fqaddr, port)   gobject.timeout_add(10, self.process_queue)     def _stop_server(self):   if gservice and not gservice.stopped:   gservice.stop()     def flush(self, *args):   pass     def write(self, msg):   self._queue.put(msg)     def _write(self, msg, append=True):   msg = hglib.toutf(msg)   if append:   enditer = self.textbuffer.get_end_iter()   self.textbuffer.insert(enditer, msg)   else:   self.textbuffer.set_text(msg)     def process_queue(self):   """   Handle all the messages currently in the queue (if any).   """   while self._queue.qsize():   try:   msg = self._queue.get(0)   self._write(msg)   except Queue.Empty:   pass     if gservice and gservice.stopped:   self._set_button_states()   return False # Stop polling this function   else:   return True    def thg_serve(ui, repo, **opts):   class service:   def init(self):   self.stopped = True   util.set_signal_handler()   try:   parentui = ui.parentui or ui   optlist = ("name templates style address port prefix ipv6"   " accesslog errorlog webdir_conf certificate")   for o in optlist.split():   if opts[o]:   parentui.setconfig("web", o, str(opts[o]))   if (repo is not None) and (repo.ui != parentui):   repo.ui.setconfig("web", o, str(opts[o]))   self.httpd = server.create_server(ui, repo)   except socket.error, inst:   raise util.Abort(_('cannot start server: ') + inst.args[1])     if self.httpd.prefix:   prefix = self.httpd.prefix.strip('/') + '/'   else:   prefix = ''     port = ':%d' % self.httpd.port   if port == ':80':   port = ''     ui.status(_('listening at http://%s%s/%s (%s:%d)\n') %   (self.httpd.fqaddr, port, prefix, self.httpd.addr, self.httpd.port))     def stop(self):   self.stopped = True   # issue request to trigger handle_request() and quit   addr = '%s:%d' % (self.httpd.fqaddr, self.httpd.port)   conn = httplib.HTTPConnection(addr)   conn.request("GET", "/")   res = conn.getresponse()   res.read()   conn.close()     def run(self):   self.stopped = False   while not self.stopped:   self.httpd.handle_request()   self.httpd.server_close() # release port     global gservice   gservice = service()   cmdutil.service(opts, initfn=gservice.init, runfn=gservice.run)    thg_serve_cmd = {"^serve":   (thg_serve,   [('A', 'accesslog', '', _('name of access log file to write to')),   ('d', 'daemon', None, _('run server in background')),   ('', 'daemon-pipefds', '', _('used internally by daemon mode')),   ('E', 'errorlog', '', _('name of error log file to write to')),   ('p', 'port', 0, _('port to use (default: 8000)')),   ('a', 'address', '', _('address to use')),   ('', 'prefix', '', _('prefix path to serve from (default: server root)')),   ('n', 'name', '',   _('name to show in web pages (default: working dir)')),   ('', 'webdir-conf', '', _('name of the webdir config file'   ' (serve more than one repo)')),   ('', 'pid-file', '', _('name of file to write process ID to')),   ('', 'stdio', None, _('for remote clients')),   ('t', 'templates', '', _('web templates to use')),   ('', 'style', '', _('template style to use')),   ('6', 'ipv6', None, _('use IPv6 in addition to IPv4')),   ('', 'certificate', '', _('SSL certificate file'))],   _('hg serve [OPTION]...'))}      def run(cwd='', root='', webdir_conf='', **opts):   dialog = ServeDialog(cwd, root, webdir_conf)   dialog.show_all()   gtk.gdk.threads_init()   gtk.gdk.threads_enter()   gtk.main()   gtk.gdk.threads_leave()    if __name__ == "__main__":   import sys   opts = {}   opts['cwd'] = os.getcwd()   if len(sys.argv) == 2 and sys.argv[1].endswith('.conf'):   opts['webdir_conf'] = sys.argv[1]   else:   opts['root'] = len(sys.argv) > 1 and sys.argv[1] or ''   run(**opts)
Change 1 of 1 Show Entire File hggtk/​synch.py Stacked
 
97
98
99
100
101
102
103
104
105
106
107
108
109
 
97
98
99
 
 
 
 
 
 
 
100
101
102
@@ -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)
Change 1 of 3 Show Entire File hggtk/​tagadd.py Stacked
 
48
49
50
51
52
53
54
55
56
57
58
59
 
66
67
68
69
70
71
 
72
73
74
 
149
150
151
152
153
154
155
156
157
 
48
49
50
 
 
 
 
 
 
51
52
53
 
60
61
62
 
 
 
63
64
65
66
 
141
142
143
 
 
 
144
145
146
@@ -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
Change 1 of 2 Show Entire File hggtk/​update.py Stacked
 
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
 
113
114
115
116
117
118
119
120
121
 
56
57
58
 
 
 
 
 
59
60
 
 
61
62
63
 
106
107
108
 
 
 
109
110
111
@@ -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: