summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Resch <andrewresch@gmail.com>2009-12-14 18:20:51 +0000
committerAndrew Resch <andrewresch@gmail.com>2009-12-14 18:20:51 +0000
commit4bd00aa33117e8ff89503d8ae2a90ad397259bbc (patch)
tree479aff03500eae603cb4972c2d3f170c07b3a652
parente27c38ca6745e85720b5f3dad5bea333fa139215 (diff)
downloaddeluge-4bd00aa33117e8ff89503d8ae2a90ad397259bbc.tar.gz
deluge-4bd00aa33117e8ff89503d8ae2a90ad397259bbc.tar.bz2
deluge-4bd00aa33117e8ff89503d8ae2a90ad397259bbc.zip
Fix #1086 deprecated gtk.Tooltips usage
-rw-r--r--ChangeLog1
-rw-r--r--deluge/ui/gtkui/statusbar.py19
2 files changed, 12 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index e5845aba3..5fbb88434 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -30,6 +30,7 @@
gtkui to shutdown the currently connected daemon.
* Fix #594 tray password dialog freeze in Windows
* Made the password dialog prettier
+ * Fix #1086 deprecated gtk.Tooltips usage
==== Console ====
* Fix using the console in Windows, but only in command-line mode
diff --git a/deluge/ui/gtkui/statusbar.py b/deluge/ui/gtkui/statusbar.py
index 3c5914fb2..e8da9daa4 100644
--- a/deluge/ui/gtkui/statusbar.py
+++ b/deluge/ui/gtkui/statusbar.py
@@ -45,7 +45,7 @@ from deluge.configmanager import ConfigManager
from deluge.log import LOG as log
class StatusBarItem:
- def __init__(self, image=None, stock=None, text=None, callback=None):
+ def __init__(self, image=None, stock=None, text=None, callback=None, tooltip=None):
self._widgets = []
self._ebox = gtk.EventBox()
self._hbox = gtk.HBox()
@@ -70,6 +70,9 @@ class StatusBarItem:
if callback != None:
self.set_callback(callback)
+ if tooltip:
+ self.set_tooltip(tooltip)
+
self.show_all()
def set_callback(self, callback):
@@ -91,8 +94,12 @@ class StatusBarItem:
if self._label.get_text() != text:
self._label.set_text(text)
+ def set_tooltip(self, tip):
+ if self._ebox.get_tooltip_text() != tip:
+ self._ebox.set_tooltip_text(tip)
+
def get_widgets(self):
- return self._widgets()
+ return self._widgets
def get_eventbox(self):
return self._ebox
@@ -105,7 +112,6 @@ class StatusBar(component.Component):
component.Component.__init__(self, "StatusBar", interval=3)
self.window = component.get("MainWindow")
self.statusbar = self.window.main_glade.get_widget("statusbar")
- self.tooltips = gtk.Tooltips()
self.config = ConfigManager("gtkui.conf")
# Status variables that are updated via callback
@@ -172,8 +178,7 @@ class StatusBar(component.Component):
tooltip=_("Protocol Traffic Download/Upload"))
self.dht_item = StatusBarItem(
- image=deluge.common.get_pixmap("dht16.png"))
- self.tooltips.set_tip(self.dht_item.get_eventbox(), "DHT Nodes")
+ image=deluge.common.get_pixmap("dht16.png"), tooltip=_("DHT Nodes"))
self.health_item = self.add_item(
stock=gtk.STOCK_DIALOG_ERROR,
@@ -223,10 +228,8 @@ class StatusBar(component.Component):
def add_item(self, image=None, stock=None, text=None, callback=None, tooltip=None):
"""Adds an item to the status bar"""
# The return tuple.. we return whatever widgets we add
- item = StatusBarItem(image, stock, text, callback)
+ item = StatusBarItem(image, stock, text, callback, tooltip)
self.hbox.pack_start(item.get_eventbox(), expand=False, fill=False)
- if tooltip:
- self.tooltips.set_tip(item.get_eventbox(), tooltip)
return item
def remove_item(self, item):