diff --git a/TODO b/TODO index ee89e436e..491bf63e0 100644 --- a/TODO +++ b/TODO @@ -13,7 +13,6 @@ * Add a health indication to the statusbar * Fix up preferences for when using a remote host.. the download folders, etc.. * Add decay items to statusbar.. items that will disappear after X seconds -* Do not update UI when minimized or hidden * Add command line option to change config dir.. --config * Add method for plugins to add labels * Add context menus for labels.. ie. setting options for all torrents in label diff --git a/deluge/component.py b/deluge/component.py index a06b20e22..3f87b9cfe 100644 --- a/deluge/component.py +++ b/deluge/component.py @@ -118,12 +118,15 @@ class ComponentRegistry: def stop(self): """Stops all components""" for component in self.components.keys(): - if self.components[component].get_state != \ - COMPONENT_STATE.index("Stopped"): - log.debug("Stopping component %s..", component) - self.components[component].stop() - self.components[component]._stop() - + self.stop_component(component) + + def stop_component(self, component): + if self.components[component].get_state != \ + COMPONENT_STATE.index("Stopped"): + log.debug("Stopping component %s..", component) + self.components[component].stop() + self.components[component]._stop() + def update(self): """Updates all components""" for component in self.components.keys(): @@ -153,13 +156,19 @@ def register(name, obj, depend=None): """Registers a component with the registry""" _ComponentRegistry.register(name, obj, depend) -def start(): +def start(component=None): """Starts all components""" - _ComponentRegistry.start() + if component == None: + _ComponentRegistry.start() + else: + _ComponentRegistry.start_component(component) -def stop(): - """Stops all components""" - _ComponentRegistry.stop() +def stop(component=None): + """Stops all or specified components""" + if component == None: + _ComponentRegistry.stop() + else: + _ComponentRegistry.stop_component(component) def update(): """Updates all components""" diff --git a/deluge/data/revision b/deluge/data/revision index 31eb8b45f..e69de29bb 100644 --- a/deluge/data/revision +++ b/deluge/data/revision @@ -1 +0,0 @@ -2679 \ No newline at end of file diff --git a/deluge/ui/gtkui/mainwindow.py b/deluge/ui/gtkui/mainwindow.py index 13708d44c..b4e6e2be6 100644 --- a/deluge/ui/gtkui/mainwindow.py +++ b/deluge/ui/gtkui/mainwindow.py @@ -77,11 +77,19 @@ class MainWindow(component.Component): self.show() def show(self): + try: + component.get("TorrentView").start() + component.get("StatusBar").start() + except: + pass + # Load the state prior to showing self.load_window_state() self.window.show() def hide(self): + component.stop("TorrentView") + component.stop("StatusBar") self.window.hide() def present(self): @@ -128,9 +136,16 @@ class MainWindow(component.Component): if event.changed_mask & gtk.gdk.WINDOW_STATE_ICONIFIED: if event.new_window_state & gtk.gdk.WINDOW_STATE_ICONIFIED: log.debug("MainWindow is minimized..") + component.stop("TorrentView") + component.stop("StatusBar") self.is_minimized = True else: log.debug("MainWindow is not minimized..") + try: + component.start("TorrentView") + component.start("StatusBar") + except: + pass self.is_minimized = False return False