make blocklist plugin loading not lock up the UI when the client is just starting
This commit is contained in:
parent
aad2c464e4
commit
edc7574a60
|
@ -63,10 +63,6 @@ class BlocklistImport:
|
||||||
global_defaults=False)
|
global_defaults=False)
|
||||||
self.config.load()
|
self.config.load()
|
||||||
|
|
||||||
# if not self.config.has_key('url'):
|
|
||||||
# self.configure()
|
|
||||||
# else:
|
|
||||||
# self.loadlist(fetch=self.config.get('load_on_start'))
|
|
||||||
if self.config.has_key('url'):
|
if self.config.has_key('url'):
|
||||||
self.loadlist(fetch=self.config.get('load_on_start'))
|
self.loadlist(fetch=self.config.get('load_on_start'))
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ import BlocklistImport
|
||||||
class GTKConfig(gtk.Dialog):
|
class GTKConfig(gtk.Dialog):
|
||||||
def __init__(self, plugin):
|
def __init__(self, plugin):
|
||||||
gtk.Dialog.__init__(self, title="Blocklist Config",
|
gtk.Dialog.__init__(self, title="Blocklist Config",
|
||||||
flags=gtk.DIALOG_DESTROY_WITH_PARENT,
|
parent=None,
|
||||||
buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT,
|
buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT,
|
||||||
gtk.STOCK_OK, gtk.RESPONSE_ACCEPT))
|
gtk.STOCK_OK, gtk.RESPONSE_ACCEPT))
|
||||||
self.set_property("skip-taskbar-hint", True)
|
self.set_property("skip-taskbar-hint", True)
|
||||||
|
@ -93,7 +93,7 @@ class GTKConfig(gtk.Dialog):
|
||||||
class GTKProgress(gtk.Dialog):
|
class GTKProgress(gtk.Dialog):
|
||||||
def __init__(self, plugin):
|
def __init__(self, plugin):
|
||||||
gtk.Dialog.__init__(self, title="Loading Blocklist",
|
gtk.Dialog.__init__(self, title="Loading Blocklist",
|
||||||
flags=gtk.DIALOG_MODAL,
|
parent=None,
|
||||||
buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT))
|
buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT))
|
||||||
self.plugin = plugin
|
self.plugin = plugin
|
||||||
|
|
||||||
|
@ -164,7 +164,7 @@ class GTKProgress(gtk.Dialog):
|
||||||
class GTKError(gtk.Dialog):
|
class GTKError(gtk.Dialog):
|
||||||
def __init__(self, message):
|
def __init__(self, message):
|
||||||
gtk.Dialog.__init__(self, title="Error",
|
gtk.Dialog.__init__(self, title="Error",
|
||||||
flags=gtk.DIALOG_MODAL,
|
parent=None,
|
||||||
buttons=(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT))
|
buttons=(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT))
|
||||||
|
|
||||||
# Setup
|
# Setup
|
||||||
|
|
|
@ -842,18 +842,20 @@ class DelugeGTK:
|
||||||
for torrent_file in cmd_line_torrents:
|
for torrent_file in cmd_line_torrents:
|
||||||
self.interactive_add_torrent(torrent_file)
|
self.interactive_add_torrent(torrent_file)
|
||||||
|
|
||||||
# Load plugins after we showed main window (if not started in tray)
|
|
||||||
self.load_plugins()
|
|
||||||
|
|
||||||
# Call update now so everything is up-to-date when the window gains
|
# Call update now so everything is up-to-date when the window gains
|
||||||
# focus on startup
|
# focus on startup
|
||||||
self.update()
|
self.update()
|
||||||
gobject.timeout_add(1000, self.update)
|
gobject.timeout_add(1000, self.update)
|
||||||
|
|
||||||
|
# Load plugins after we showed main window (if not started in tray)
|
||||||
|
self.load_plugins()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
gtk.main()
|
gtk.main()
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
self.manager.quit()
|
self.manager.quit()
|
||||||
|
|
||||||
|
|
||||||
def load_plugins(self):
|
def load_plugins(self):
|
||||||
enable_plugins = self.config.get('enabled_plugins').split(':')
|
enable_plugins = self.config.get('enabled_plugins').split(':')
|
||||||
for plugin in enable_plugins:
|
for plugin in enable_plugins:
|
||||||
|
|
Loading…
Reference in New Issue