Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.0.2, 1.0.3, and 1.0.4

stable hgtk: avoid GTK deprecation warnings for tooltip API

Note: this doesn't use any of the fancy new features. GTK will allow you to
create ad-hoc tooltip widgets now (imagine a csinfo tooltip for annotate). But
it avoids warnings.

I also cleaned up the fact that hgemail was creating a redundant Tooltips
instances.

Changeset 288e39c4ecb2

Parent f71be5565076

by Steve Borho

Changes to 13 files · Browse files at 288e39c4ecb2 Showing diff from parent f71be5565076 Diff from another changeset...

 
71
72
73
74
 
75
76
77
 
71
72
73
 
74
75
76
77
@@ -71,7 +71,7 @@
  msgvbox.pack_start(scrolledwindow)     ## tooltips - self.tips = gtk.Tooltips() + self.tips = gtklib.Tooltips()   self.tips.set_tip(frame,   _('Commit message text for new changeset that reverses the'   ' effect of the change being backed out.'))
 
655
656
657
658
 
659
660
661
 
655
656
657
 
658
659
660
661
@@ -655,7 +655,7 @@
    btn = self.get_toolbutton('commit')   btn.set_label(label) - btn.set_tooltip(self.tooltips, tooltip) + self.tooltips.set_tip(btn, tooltip)     def get_head_info(self):   def ishead(ctx):
 
260
261
262
263
 
264
265
266
 
326
327
328
329
 
330
331
332
 
461
462
463
464
 
465
466
467
 
260
261
262
 
263
264
265
266
 
326
327
328
 
329
330
331
332
 
461
462
463
 
464
465
466
467
@@ -260,7 +260,7 @@
  self.show_all()   else:   self._parse_opts() - self.tooltips = gtk.Tooltips() + self.tooltips = gtklib.Tooltips()       def test_opt(self, opt): @@ -326,7 +326,7 @@
  tbutton = gtk.ToolButton(stock)     if tip: - tbutton.set_tooltip(self.tooltips, tip) + self.tooltips.set_tip(tbutton, tip)   if icon:   image = gtklib.get_icon_image(icon)   tbutton.set_icon_widget(image) @@ -461,7 +461,7 @@
  if x >= 0 and x < w and y >= 0 and y < h:   self.move(x, y)   - self.tooltips = gtk.Tooltips() + self.tooltips = gtklib.Tooltips()   toolbar = gtk.Toolbar()   tbuttons = self.get_tbbuttons()   for tbutton in tbuttons:
 
32
33
34
35
 
36
37
38
 
32
33
34
 
35
36
37
38
@@ -32,7 +32,7 @@
    self.gotofunc = gotofunc   - self.tips = gtk.Tooltips() + self.tips = gtklib.Tooltips()     hbox = gtk.HBox()   self.revEntry = gtk.Entry()
 
44
45
46
 
 
 
 
 
 
 
 
 
 
 
47
48
49
 
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
@@ -44,6 +44,17 @@
 PYELLOW = '#ffffaa'  PORANGE = '#ffddaa'   +if gtk.pygtk_version < (2, 12, 0): + # old nasty + Tooltips = gtk.Tooltips +else: + # new shiny + class Tooltips(object): + def __init__(self): + pass + def set_tip(self, widget, tip): + widget.set_tooltip_text(tip) +  def set_tortoise_icon(window, thgicon):   ico = paths.get_tortoise_icon(thgicon)   if ico: window.set_icon_from_file(ico)
 
257
258
259
260
 
261
262
263
 
257
258
259
 
260
261
262
263
@@ -257,7 +257,7 @@
    # tooltips   if tooltips is None: - tooltips = gtk.Tooltips() + tooltips = gtklib.Tooltips()     # log viewer   if self.is_normal:
 
30
31
32
33
 
34
35
36
 
95
96
97
98
99
100
101
 
102
103
104
 
106
107
108
109
 
110
111
112
 
114
115
116
117
 
118
119
120
 
123
124
125
126
 
127
128
129
130
131
132
 
133
134
135
136
137
 
138
139
140
 
141
142
143
 
144
145
146
 
191
192
193
194
 
195
196
197
 
227
228
229
230
 
231
232
233
 
30
31
32
 
33
34
35
36
 
95
96
97
 
98
99
 
100
101
102
103
 
105
106
107
 
108
109
110
111
 
113
114
115
 
116
117
118
119
 
122
123
124
 
125
126
127
128
129
130
 
131
132
133
134
135
 
136
137
138
 
139
140
141
 
142
143
144
145
 
190
191
192
 
193
194
195
196
 
226
227
228
 
229
230
231
232
@@ -30,7 +30,7 @@
  self.revargs = revargs     self.tbar = gtk.Toolbar() - self.tips = gtk.Tooltips() + self.tips = gtklib.Tooltips()     tbuttons = [   self._toolbutton(gtk.STOCK_GOTO_LAST, _('Send'), @@ -95,10 +95,9 @@
  table = gtklib.LayoutTable()   flagframe.add(table)   - self.tooltips = gtk.Tooltips()   self._normal = gtk.RadioButton(None, _('Send changesets as Hg patches'))   table.add_row(self._normal) - self.tooltips.set_tip(self._normal, + self.tips.set_tip(self._normal,   _('Hg patches (as generated by export command) are compatible'   ' with most patch programs. They include a header which'   ' contains the most important changeset metadata.')) @@ -106,7 +105,7 @@
  self._git = gtk.RadioButton(self._normal,   _('Use extended (git) patch format'))   table.add_row(self._git) - self.tooltips.set_tip(self._git, + self.tips.set_tip(self._git,   _('Git patches can describe binary files, copies, and'   ' permission changes, but recipients may not be able to'   ' use them if they are not using git or Mercurial.')) @@ -114,7 +113,7 @@
  self._plain = gtk.RadioButton(self._normal,   _('Plain, do not prepend Hg header'))   table.add_row(self._plain) - self.tooltips.set_tip(self._plain, + self.tips.set_tip(self._plain,   _('Stripping Mercurial header removes username and parent'   ' information. Only useful if recipient is not using'   ' Mercurial (and does not like to see the headers).')) @@ -123,24 +122,24 @@
  _('Send single binary bundle, not patches'))   table.add_row(self._bundle)   if revargs[0] in ('--outgoing', '-o'): - self.tooltips.set_tip(self._bundle, + self.tips.set_tip(self._bundle,   _('Bundles store complete changesets in binary form.'   ' Upstream users can pull from them. This is the safest'   ' way to send changes to recipient Mercurial users.'))   else:   self._bundle.set_sensitive(False) - self.tooltips.set_tip(self._bundle, + self.tips.set_tip(self._bundle,   _('This feature is only available when sending outgoing'   ' changesets. It is not applicable with revision ranges.'))     self._attach = gtk.CheckButton(_('attach')) - self.tooltips.set_tip(self._attach, + self.tips.set_tip(self._attach,   _('send patches as attachments'))   self._inline = gtk.CheckButton(_('inline')) - self.tooltips.set_tip(self._inline, + self.tips.set_tip(self._inline,   _('send patches as inline attachments'))   self._diffstat = gtk.CheckButton(_('diffstat')) - self.tooltips.set_tip(self._diffstat, + self.tips.set_tip(self._diffstat,   _('add diffstat output to messages'))   table.add_row(self._attach, self._inline, self._diffstat, padding=False)   @@ -191,7 +190,7 @@
  def _toolbutton(self, stock, label, handler, tip):   tbutton = gtk.ToolButton(stock)   tbutton.set_label(label) - tbutton.set_tooltip(self.tips, tip) + self.tips.set_tip(tbutton, tip)   tbutton.connect('clicked', handler)   return tbutton   @@ -227,7 +226,7 @@
  self._ccbox.child.set_text(hglib.fromutf(repo.ui.config('email', 'cc', '')))   self._frombox.child.set_text(hglib.fromutf(getfromaddr(repo.ui)))   self._subjbox.child.set_text(hglib.fromutf(repo.ui.config('email', 'subject', ''))) - self.tooltips.set_tip(self._eventbox, + self.tips.set_tip(self._eventbox,   _('Patch series description is sent in initial summary'   ' email with [PATCH 0 of N] subject. It should describe'   ' the effects of the entire patch series. When emailing'
 
1763
1764
1765
1766
 
1767
1768
1769
1770
1771
1772
 
1773
1774
1775
 
1763
1764
1765
 
1766
1767
1768
1769
1770
1771
 
1772
1773
1774
1775
@@ -1763,13 +1763,13 @@
    # create apply/reject toolbar buttons   apply = gtk.ToolButton(gtk.STOCK_APPLY) - apply.set_tooltip(self.tooltips, + self.tooltips.set_tip(apply,   _('Accept incoming previewed changesets'))   apply.set_label(_('Accept'))   apply.show()     reject = gtk.ToolButton(gtk.STOCK_DIALOG_ERROR) - reject.set_tooltip(self.tooltips, + self.tooltips.set_tip(reject,   _('Reject incoming previewed changesets'))   reject.set_label(_('Reject'))   reject.show()
 
41
42
43
44
 
45
46
47
 
115
116
117
118
 
119
120
121
 
41
42
43
 
44
45
46
47
 
115
116
117
 
118
119
120
121
@@ -41,7 +41,7 @@
    # toolbar   self.tbar = gtk.Toolbar() - self.tips = gtk.Tooltips() + self.tips = gtklib.Tooltips()   self._stop_button = self._toolbutton(gtk.STOCK_STOP,   _('Stop'), self._stop_clicked, tip=_('Stop the hg operation'))   self._stop_button.set_sensitive(False) @@ -115,7 +115,7 @@
    tbutton.set_label(label)   if tip: - tbutton.set_tooltip(self.tips, tip) + self.tips.set_tip(tbutton, tip)   tbutton.connect('clicked', handler, userdata)   return tbutton  
 
56
57
58
59
 
60
61
62
 
142
143
144
145
 
146
147
148
 
56
57
58
 
59
60
61
62
 
142
143
144
 
145
146
147
148
@@ -56,7 +56,7 @@
    # toolbar   self.tbar = gtk.Toolbar() - self.tooltips = gtk.Tooltips() + self.tooltips = gtklib.Tooltips()   self._button_start = self._toolbutton(gtk.STOCK_MEDIA_PLAY,   _('Start'),   self._on_start_clicked, @@ -142,7 +142,7 @@
  tbutton = gtk.ToolButton(stock)     if tip: - tbutton.set_tooltip(self.tooltips, tip) + self.tooltips.set_tip(tbutton, tip)     tbutton.set_label(label)   tbutton.connect('clicked', handler, userdata)
 
126
127
128
129
 
130
131
132
 
126
127
128
 
129
130
131
132
@@ -126,7 +126,7 @@
  hbox.pack_start(self.hgighlight_taskbaricon, False, False, 2)     # Tooltips - tips = gtk.Tooltips() + tips = gtklib.Tooltips()     tooltip = _('Enable/Disable the overlay icons globally')   tips.set_tip(self.ovenable, tooltip)
 
54
55
56
57
 
58
59
60
 
415
416
417
418
 
419
420
421
 
54
55
56
 
57
58
59
60
 
415
416
417
 
418
419
420
421
@@ -54,7 +54,7 @@
    # toolbar   self.tbar = gtk.Toolbar() - self.tips = gtk.Tooltips() + self.tips = gtklib.Tooltips()   self.stop_button = self.toolbutton(gtk.STOCK_STOP,   _('Stop'), self.stop_clicked, tip=_('Stop the hg operation'))   self.stop_button.set_sensitive(False) @@ -415,7 +415,7 @@
    tbutton.set_label(label)   if tip: - tbutton.set_tooltip(self.tips, tip) + self.tips.set_tip(tbutton, tip)   tbutton.connect('clicked', handler, userdata)   return tbutton  
 
657
658
659
660
 
661
662
663
 
657
658
659
 
660
661
662
663
@@ -657,7 +657,7 @@
    self.dirty = False   self.pages = {} - self.tooltips = gtk.Tooltips() + self.tooltips = gtklib.Tooltips()   self.history = settings.Settings('thgconfig')     # add spell ckeck entry if spell check is supported