mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-09 18:14:11 +00:00
Do not update UI when minimized or hidden.
This commit is contained in:
parent
2fba592e6c
commit
1653a72c7a
1
TODO
1
TODO
@ -13,7 +13,6 @@
|
|||||||
* Add a health indication to the statusbar
|
* Add a health indication to the statusbar
|
||||||
* Fix up preferences for when using a remote host.. the download folders, etc..
|
* 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
|
* 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 command line option to change config dir.. --config
|
||||||
* Add method for plugins to add labels
|
* Add method for plugins to add labels
|
||||||
* Add context menus for labels.. ie. setting options for all torrents in label
|
* Add context menus for labels.. ie. setting options for all torrents in label
|
||||||
|
@ -118,12 +118,15 @@ class ComponentRegistry:
|
|||||||
def stop(self):
|
def stop(self):
|
||||||
"""Stops all components"""
|
"""Stops all components"""
|
||||||
for component in self.components.keys():
|
for component in self.components.keys():
|
||||||
if self.components[component].get_state != \
|
self.stop_component(component)
|
||||||
COMPONENT_STATE.index("Stopped"):
|
|
||||||
log.debug("Stopping component %s..", component)
|
def stop_component(self, component):
|
||||||
self.components[component].stop()
|
if self.components[component].get_state != \
|
||||||
self.components[component]._stop()
|
COMPONENT_STATE.index("Stopped"):
|
||||||
|
log.debug("Stopping component %s..", component)
|
||||||
|
self.components[component].stop()
|
||||||
|
self.components[component]._stop()
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
"""Updates all components"""
|
"""Updates all components"""
|
||||||
for component in self.components.keys():
|
for component in self.components.keys():
|
||||||
@ -153,13 +156,19 @@ def register(name, obj, depend=None):
|
|||||||
"""Registers a component with the registry"""
|
"""Registers a component with the registry"""
|
||||||
_ComponentRegistry.register(name, obj, depend)
|
_ComponentRegistry.register(name, obj, depend)
|
||||||
|
|
||||||
def start():
|
def start(component=None):
|
||||||
"""Starts all components"""
|
"""Starts all components"""
|
||||||
_ComponentRegistry.start()
|
if component == None:
|
||||||
|
_ComponentRegistry.start()
|
||||||
|
else:
|
||||||
|
_ComponentRegistry.start_component(component)
|
||||||
|
|
||||||
def stop():
|
def stop(component=None):
|
||||||
"""Stops all components"""
|
"""Stops all or specified components"""
|
||||||
_ComponentRegistry.stop()
|
if component == None:
|
||||||
|
_ComponentRegistry.stop()
|
||||||
|
else:
|
||||||
|
_ComponentRegistry.stop_component(component)
|
||||||
|
|
||||||
def update():
|
def update():
|
||||||
"""Updates all components"""
|
"""Updates all components"""
|
||||||
|
@ -1 +0,0 @@
|
|||||||
2679
|
|
@ -77,11 +77,19 @@ class MainWindow(component.Component):
|
|||||||
self.show()
|
self.show()
|
||||||
|
|
||||||
def show(self):
|
def show(self):
|
||||||
|
try:
|
||||||
|
component.get("TorrentView").start()
|
||||||
|
component.get("StatusBar").start()
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
# Load the state prior to showing
|
# Load the state prior to showing
|
||||||
self.load_window_state()
|
self.load_window_state()
|
||||||
self.window.show()
|
self.window.show()
|
||||||
|
|
||||||
def hide(self):
|
def hide(self):
|
||||||
|
component.stop("TorrentView")
|
||||||
|
component.stop("StatusBar")
|
||||||
self.window.hide()
|
self.window.hide()
|
||||||
|
|
||||||
def present(self):
|
def present(self):
|
||||||
@ -128,9 +136,16 @@ class MainWindow(component.Component):
|
|||||||
if event.changed_mask & gtk.gdk.WINDOW_STATE_ICONIFIED:
|
if event.changed_mask & gtk.gdk.WINDOW_STATE_ICONIFIED:
|
||||||
if event.new_window_state & gtk.gdk.WINDOW_STATE_ICONIFIED:
|
if event.new_window_state & gtk.gdk.WINDOW_STATE_ICONIFIED:
|
||||||
log.debug("MainWindow is minimized..")
|
log.debug("MainWindow is minimized..")
|
||||||
|
component.stop("TorrentView")
|
||||||
|
component.stop("StatusBar")
|
||||||
self.is_minimized = True
|
self.is_minimized = True
|
||||||
else:
|
else:
|
||||||
log.debug("MainWindow is not minimized..")
|
log.debug("MainWindow is not minimized..")
|
||||||
|
try:
|
||||||
|
component.start("TorrentView")
|
||||||
|
component.start("StatusBar")
|
||||||
|
except:
|
||||||
|
pass
|
||||||
self.is_minimized = False
|
self.is_minimized = False
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user