Make sure that the port test status image is always reset between tests. Added a "loading" image when the test is in course.

This commit is contained in:
Pedro Algarvio 2010-01-12 03:15:50 +00:00
parent f586b91a59
commit be70305365
2 changed files with 12 additions and 6 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 723 B

View File

@ -72,8 +72,8 @@ class Preferences(component.Component):
self.treeview.append_column(column) self.treeview.append_column(column)
# Add the default categories # Add the default categories
i = 0 i = 0
for category in [_("Downloads"), _("Network"), _("Bandwidth"), _("Interface"), for category in [_("Downloads"), _("Network"), _("Bandwidth"),
_("Other"), _("Daemon"), _("Queue"), _("Proxy"), _("Interface"), _("Other"), _("Daemon"), _("Queue"), _("Proxy"),
_("Cache"), _("Plugins")]: _("Cache"), _("Plugins")]:
self.liststore.append([i, category]) self.liststore.append([i, category])
i += 1 i += 1
@ -174,7 +174,8 @@ class Preferences(component.Component):
self.liststore.remove(self.iter_to_remove) self.liststore.remove(self.iter_to_remove)
def show(self, page=None): def show(self, page=None):
"""Page should be the string in the left list.. ie, 'Network' or 'Bandwidth'""" """Page should be the string in the left list.. ie, 'Network' or
'Bandwidth'"""
if page != None: if page != None:
for (index, string) in self.liststore: for (index, string) in self.liststore:
if page == string: if page == string:
@ -734,6 +735,7 @@ class Preferences(component.Component):
self.show() self.show()
def hide(self): def hide(self):
self.glade.get_widget("port_img").hide()
self.pref_dialog.hide() self.pref_dialog.hide()
def __update_cache_status(self): def __update_cache_status(self):
@ -833,6 +835,10 @@ class Preferences(component.Component):
self.glade.get_widget("port_img").set_from_stock(gtk.STOCK_DIALOG_WARNING, 4) self.glade.get_widget("port_img").set_from_stock(gtk.STOCK_DIALOG_WARNING, 4)
self.glade.get_widget("port_img").show() self.glade.get_widget("port_img").show()
client.core.test_listen_port().addCallback(on_get_test) client.core.test_listen_port().addCallback(on_get_test)
self.glade.get_widget("port_img").set_from_file(
deluge.common.get_pixmap('loading.gif')
)
self.glade.get_widget("port_img").show()
client.force_call() client.force_call()
def on_plugin_toggled(self, renderer, path): def on_plugin_toggled(self, renderer, path):