Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.3, 0.4rc1, and 0.4rc2

hggtk/hgemail: new window style, add tooltips

Changeset fce4f4d4fe97

Parent a70d8cf2da50

by Steve Borho

Changes to 3 files · Browse files at fce4f4d4fe97 Showing diff from parent a70d8cf2da50 Diff from another changeset...

Change 1 of 6 Show Entire File hggtk/​hgemail.py Stacked
 
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
 
55
56
57
58
 
59
60
61
 
147
148
149
150
 
151
152
153
154
155
156
157
158
159
160
 
 
 
 
 
161
162
 
 
163
164
165
 
216
217
218
219
 
220
221
222
 
224
225
226
227
 
228
229
230
 
301
302
303
304
 
305
306
307
 
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
 
67
68
69
 
70
71
72
73
 
159
160
161
 
162
163
164
165
 
 
 
 
 
 
 
166
167
168
169
170
171
 
172
173
174
175
176
 
227
228
229
 
230
231
232
233
 
235
236
237
 
238
239
240
241
 
312
313
314
 
315
316
317
318
@@ -17,29 +17,41 @@
 from thgconfig import ConfigDialog  from hgcmd import CmdDialog   -class EmailDialog(gtk.Dialog): +class EmailDialog(gtk.Window):   """ Send patches or bundles via email """   def __init__(self, root='', revargs=[]):   """ Initialize the Dialog """ - buttons = (gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE) - super(EmailDialog, self).__init__(flags=gtk.DIALOG_MODAL, - buttons=buttons) + gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL) +   shlib.set_tortoise_icon(self, 'hg.ico')   self.root = root   self.revargs = revargs     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), + self._on_send_clicked, + 'Send email(s)'),   gtk.SeparatorToolItem(),   self._toolbutton(gtk.STOCK_PREFERENCES, 'configure', - self._on_conf_clicked), - gtk.SeparatorToolItem(), + self._on_conf_clicked, + 'Configure email settings'), + sep, + self._btn_close   ]   for btn in tbuttons:   self.tbar.insert(btn, -1) - self.vbox.pack_start(self.tbar, False, False, 2) + mainvbox = gtk.VBox() + self.add(mainvbox) + mainvbox.pack_start(self.tbar, False, False, 2)     # set dialog title   if revargs[0] in ('--outgoing', '-o'): @@ -55,7 +67,7 @@
  flagframe = gtk.Frame('Options')   hbox.pack_start(envframe, True, True, 4)   hbox.pack_start(flagframe, False, False, 4) - self.vbox.pack_start(hbox, False, True, 4) + mainvbox.pack_start(hbox, False, True, 4)     vbox = gtk.VBox()   envframe.add(vbox) @@ -147,19 +159,18 @@
  ' the effects of the entire patch series. When emailing'   ' a bundle, these fields make up the message subject and body.'   ' The description field is unused when sending a single patch') - self.vbox.pack_start(frame, True, True, 4) + mainvbox.pack_start(frame, True, True, 4)     self.connect('map_event', self._on_window_map_event)   - 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) - + def _close_clicked(self, toolbutton, data=None): + self.destroy() + + def _toolbutton(self, stock, label, handler, tip): + tbutton = gtk.ToolButton(stock)   tbutton.set_label(label) - tbutton.connect('clicked', handler, userdata) + tbutton.set_tooltip(self.tips, tip) + tbutton.connect('clicked', handler)   return tbutton     def _on_window_map_event(self, event, param): @@ -216,7 +227,7 @@
  self._plain.set_active(True)   self._plain.set_sensitive(False)   - def _on_conf_clicked(self, button, userdata): + def _on_conf_clicked(self, button):   dlg = ConfigDialog(self.root, False)   dlg.show_all()   dlg.focus_field('email.from') @@ -224,7 +235,7 @@
  dlg.hide()   self._refresh(False)   - def _on_send_clicked(self, button, userdata): + def _on_send_clicked(self, button):   def record_new_value(cpath, history, newvalue):   if not newvalue: return   if cpath not in history: @@ -301,7 +312,7 @@
  # place for testing purposes.   dialog = EmailDialog(root, ['tip'])   dialog.show_all() - dialog.connect('response', gtk.main_quit) + dialog.connect('destroy', gtk.main_quit)   gtk.gdk.threads_init()   gtk.gdk.threads_enter()   gtk.main()
Change 1 of 1 Show Entire File hggtk/​history.py Stacked
 
450
451
452
 
453
454
455
 
 
456
457
458
 
450
451
452
453
454
 
 
455
456
457
458
459
@@ -450,9 +450,10 @@
  from hgemail import EmailDialog   rev = self.currow[treemodel.REVID]   dlg = EmailDialog(self.repo.root, ['--rev', str(rev)]) + dlg.set_transient_for(self)   dlg.show_all() - dlg.run() - dlg.hide() + dlg.present() + dlg.set_transient_for(None)     def _checkout(self, menuitem):   rev = self.currow[treemodel.REVID]
Change 1 of 1 Show Entire File hggtk/​synch.py Stacked
 
293
294
295
 
296
297
298
 
 
299
300
301
 
293
294
295
296
297
 
 
298
299
300
301
302
@@ -293,9 +293,10 @@
  return   from hgemail import EmailDialog   dlg = EmailDialog(self.root, ['--outgoing', path]) + dlg.set_transient_for(self)   dlg.show_all() - dlg.run() - dlg.hide() + dlg.present() + dlg.set_transient_for(None)     def _incoming_clicked(self, toolbutton, data=None):   cmd = ['incoming']