diff --git a/ChangeLog b/ChangeLog index 3fadfcb4b..aa902c409 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,10 @@ -=== Deluge 1.2.0_rc5 (in development) === +=== Deluge 1.2.0_rc5 (In Development) === ==== Web ==== * Swap order of buttons in Remove window (Closes #1083) +==== GtkUI ==== + * Attempt to register as the default magnet uri handler in GNOME on startup + === Deluge 1.2.0_rc4 (24 November 2009) === ==== Core ==== * Fix deleting old .fastresume files with fresh configs diff --git a/deluge/ui/gtkui/gtkui.py b/deluge/ui/gtkui/gtkui.py index b8f435716..f06e795cf 100644 --- a/deluge/ui/gtkui/gtkui.py +++ b/deluge/ui/gtkui/gtkui.py @@ -180,6 +180,22 @@ class GtkUI(object): return 1 SetConsoleCtrlHandler(win_handler) + # Attempt to register a magnet URI handler with gconf + try: + import gconf + except ImportError: + log.debug("gconf not available, so will not attempt to register magnet uri handler") + else: + key = "/desktop/gnome/url-handlers/magnet/command" + gconf_client = gconf.client_get_default() + if not gconf_client.get(key): + if gconf_client.set_string(key, "/usr/bin/deluge '%s'"): + gconf_client.set_bool("/desktop/gnome/url-handlers/magnet/needs_terminal", False) + gconf_client.set_bool("/desktop/gnome/url-handlers/magnet/enabled", True) + log.info("Deluge registered as default magnet uri handler!") + else: + log.error("Unable to register Deluge as default magnet uri handler.") + # Make sure gtkui.conf has at least the defaults set self.config = deluge.configmanager.ConfigManager("gtkui.conf", DEFAULT_PREFS)