make blocklist plugin loading not lock up the UI when the client is just starting

This commit is contained in:
Marcos Pinto 2007-08-09 03:55:56 +00:00
parent aad2c464e4
commit edc7574a60
3 changed files with 9 additions and 11 deletions

View File

@ -63,10 +63,6 @@ class BlocklistImport:
global_defaults=False)
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'):
self.loadlist(fetch=self.config.get('load_on_start'))

View File

@ -9,7 +9,7 @@ import BlocklistImport
class GTKConfig(gtk.Dialog):
def __init__(self, plugin):
gtk.Dialog.__init__(self, title="Blocklist Config",
flags=gtk.DIALOG_DESTROY_WITH_PARENT,
parent=None,
buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT,
gtk.STOCK_OK, gtk.RESPONSE_ACCEPT))
self.set_property("skip-taskbar-hint", True)
@ -93,7 +93,7 @@ class GTKConfig(gtk.Dialog):
class GTKProgress(gtk.Dialog):
def __init__(self, plugin):
gtk.Dialog.__init__(self, title="Loading Blocklist",
flags=gtk.DIALOG_MODAL,
parent=None,
buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT))
self.plugin = plugin
@ -164,7 +164,7 @@ class GTKProgress(gtk.Dialog):
class GTKError(gtk.Dialog):
def __init__(self, message):
gtk.Dialog.__init__(self, title="Error",
flags=gtk.DIALOG_MODAL,
parent=None,
buttons=(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT))
# Setup

View File

@ -842,18 +842,20 @@ class DelugeGTK:
for torrent_file in cmd_line_torrents:
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
# focus on startup
self.update()
gobject.timeout_add(1000, self.update)
# Load plugins after we showed main window (if not started in tray)
self.load_plugins()
try:
gtk.main()
except KeyboardInterrupt:
self.manager.quit()
def load_plugins(self):
enable_plugins = self.config.get('enabled_plugins').split(':')
for plugin in enable_plugins: