Fixes one typo that was causing an error in handle_events and adds attribute self.update_interface to DelugeGTK class so that plugins can determine whether or not to update information for the interface - micah

This commit is contained in:
Marcos Pinto 2007-07-20 18:36:16 +00:00
parent 938c1fed43
commit a6e8db9bb0
3 changed files with 84 additions and 76 deletions

View File

@ -51,6 +51,7 @@ class plugin_NetGraph:
break
def update(self):
if self.parent.update_interface:
import gtk
session_info = self.core.get_state()
self.savedUpSpeeds.insert(0, session_info['upload_rate'])
@ -120,8 +121,10 @@ class plugin_NetGraph:
self.pangoLayout)
self.networkPixmap.draw_line(self.image.get_style().black_gc,
0, int(self.height - (self.height*shownSpeed/maxSpeed)),
self.width, int(self.height - (self.height*shownSpeed/maxSpeed)))
0,
int(self.height - (self.height*shownSpeed/maxSpeed)),
self.width,
int(self.height - (self.height*shownSpeed/maxSpeed)))
self.networkPixmap.draw_rectangle(self.image.get_style().black_gc,False, 0, 0, self.width-1, self.height-1)

View File

@ -612,7 +612,7 @@ class Manager:
tracker_status)
elif event['event_type'] is self.constants['EVENT_TRACKER_WARNING']:
# Probably will need proper formatting later, not tested yet
tracker_status = '%s: %s' % (N_("Warning", event["message"]))
tracker_status = '%s: %s' % (N_("Warning"), event["message"])
self.set_supp_torrent_state_val(event['unique_ID'],
"tracker_status",

View File

@ -122,6 +122,9 @@ class DelugeGTK:
# should be updated and is set by the window_state_event method
self.is_minimized = False
# Boolean set to true if window is not minimized and is "visible"
self.update_interface = True
def connect_signals(self):
self.wtree.signal_autoconnect({
## File Menu
@ -815,6 +818,8 @@ class DelugeGTK:
# We need to apply the queue changes
self.manager.apply_queue()
self.update_interface = self.window.get_property("visible") and not self.is_minimized
# Handle the events
try:
self.manager.handle_events()
@ -835,7 +840,7 @@ class DelugeGTK:
self.plugins.update_active_plugins()
# only update gui if it's needed
if self.window.get_property("visible") and not self.is_minimized:
if self.update_interface:
# Put the generated message into the statusbar
# This gives plugins a chance to write to the