mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-20 11:35:49 +00:00
Add button to Other preferences to associate magnet links with Deluge
This commit is contained in:
parent
7a91b96183
commit
b41a025217
6 changed files with 137 additions and 17 deletions
|
@ -6,10 +6,11 @@
|
|||
* Attempt to register as the default magnet uri handler in GNOME on startup
|
||||
* Properly show 100.00% and reduce number of progress bar updates during a torrent creation
|
||||
* Fix crash in Windows when creating a torrent
|
||||
* Add button to Other preferences to associate magnet links with Deluge
|
||||
|
||||
==== Label ====
|
||||
* Fix #1085 only use ints for specific options to prevent unhandled exception
|
||||
|
||||
|
||||
=== Deluge 1.2.0_rc4 (24 November 2009) ===
|
||||
==== Core ====
|
||||
* Fix deleting old .fastresume files with fresh configs
|
||||
|
|
BIN
deluge/data/pixmaps/magnet.png
Normal file
BIN
deluge/data/pixmaps/magnet.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 906 B |
|
@ -228,3 +228,35 @@ def get_deluge_icon():
|
|||
return icon_theme.load_icon("deluge", 64, 0)
|
||||
except:
|
||||
return get_logo(64)
|
||||
|
||||
def associate_magnet_links(overwrite=False):
|
||||
"""
|
||||
Associates magnet links to Deluge.
|
||||
|
||||
:param overwrite: if this is True, the current setting will be overwritten
|
||||
:type overwrite: bool
|
||||
:returns: True if association was set
|
||||
:rtype: bool
|
||||
|
||||
"""
|
||||
if not deluge.common.windows_check():
|
||||
# gconf method is only available in a GNOME environment
|
||||
try:
|
||||
import gconf
|
||||
except ImportError:
|
||||
log.debug("gconf not available, so will not attempt to register magnet uri handler")
|
||||
return False
|
||||
else:
|
||||
key = "/desktop/gnome/url-handlers/magnet/command"
|
||||
gconf_client = gconf.client_get_default()
|
||||
if (gconf_client.get(key) and overwrite) or not gconf_client.get(key):
|
||||
# We are either going to overwrite the key, or do it if it hasn't been set yet
|
||||
if gconf_client.set_string(key, "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!")
|
||||
return True
|
||||
else:
|
||||
log.error("Unable to register Deluge as default magnet uri handler.")
|
||||
return False
|
||||
return False
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
<widget class="GtkVBox" id="dialog-vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">2</property>
|
||||
<child>
|
||||
<widget class="GtkHPaned" id="hpaned1">
|
||||
|
@ -65,6 +66,7 @@
|
|||
<widget class="GtkVBox" id="vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label21">
|
||||
<property name="visible">True</property>
|
||||
|
@ -415,6 +417,7 @@
|
|||
<child>
|
||||
<widget class="GtkVBox" id="newvbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="chk_prioritize_first_last_pieces">
|
||||
<property name="label" translatable="yes">Prioritize first and last pieces of torrent</property>
|
||||
|
@ -498,6 +501,7 @@
|
|||
<widget class="GtkVBox" id="vbox2">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label22">
|
||||
<property name="visible">True</property>
|
||||
|
@ -537,6 +541,7 @@
|
|||
<child>
|
||||
<widget class="GtkVBox" id="vbox3">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox2">
|
||||
<property name="visible">True</property>
|
||||
|
@ -734,6 +739,7 @@
|
|||
<child>
|
||||
<widget class="GtkVBox" id="vbox25">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">5</property>
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="chk_random_outgoing_ports">
|
||||
|
@ -905,6 +911,7 @@
|
|||
<child>
|
||||
<widget class="GtkVBox" id="vbox4">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox4">
|
||||
<property name="visible">True</property>
|
||||
|
@ -1104,6 +1111,7 @@
|
|||
<widget class="GtkVBox" id="vbox10">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label7">
|
||||
<property name="visible">True</property>
|
||||
|
@ -1135,6 +1143,7 @@
|
|||
<widget class="GtkVBox" id="vbox12">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<widget class="GtkComboBox" id="combo_encin">
|
||||
<property name="visible">True</property>
|
||||
|
@ -1168,6 +1177,7 @@ Either</property>
|
|||
<widget class="GtkVBox" id="vbox15">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox15">
|
||||
<property name="visible">True</property>
|
||||
|
@ -1281,6 +1291,7 @@ Disabled</property>
|
|||
<widget class="GtkVBox" id="vbox7">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label23">
|
||||
<property name="visible">True</property>
|
||||
|
@ -1320,6 +1331,7 @@ Disabled</property>
|
|||
<child>
|
||||
<widget class="GtkVBox" id="vbox21">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">5</property>
|
||||
<child>
|
||||
<widget class="GtkTable" id="table1">
|
||||
|
@ -1778,6 +1790,7 @@ Disabled</property>
|
|||
<widget class="GtkVBox" id="vbox8">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label25">
|
||||
<property name="visible">True</property>
|
||||
|
@ -1863,6 +1876,7 @@ Disabled</property>
|
|||
<widget class="GtkVBox" id="vbox27">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="chk_show_rate_in_title">
|
||||
<property name="label" translatable="yes">Show session speed in titlebar</property>
|
||||
|
@ -1913,6 +1927,7 @@ Disabled</property>
|
|||
<widget class="GtkVBox" id="vbox5">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="chk_show_dialog">
|
||||
<property name="label" translatable="yes">Always show</property>
|
||||
|
@ -1982,6 +1997,7 @@ Disabled</property>
|
|||
<child>
|
||||
<widget class="GtkVBox" id="vbox17">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="chk_use_tray">
|
||||
<property name="label" translatable="yes">Enable system tray icon</property>
|
||||
|
@ -2160,6 +2176,7 @@ Disabled</property>
|
|||
<widget class="GtkVBox" id="vbox16">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label40">
|
||||
<property name="visible">True</property>
|
||||
|
@ -2201,6 +2218,7 @@ Disabled</property>
|
|||
<widget class="GtkVBox" id="vbox18">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<widget class="GtkAlignment" id="alignment36">
|
||||
<property name="visible">True</property>
|
||||
|
@ -2262,6 +2280,7 @@ Disabled</property>
|
|||
<widget class="GtkVBox" id="vbox19">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label44">
|
||||
<property name="visible">True</property>
|
||||
|
@ -2337,6 +2356,7 @@ Disabled</property>
|
|||
<widget class="GtkVBox" id="vbox29">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<widget class="GtkAlignment" id="alignment50">
|
||||
<property name="visible">True</property>
|
||||
|
@ -2399,6 +2419,60 @@ Disabled</property>
|
|||
<property name="position">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkAlignment" id="alignment58">
|
||||
<property name="visible">True</property>
|
||||
<property name="left_padding">12</property>
|
||||
<child>
|
||||
<widget class="GtkHButtonBox" id="hbuttonbox4">
|
||||
<property name="visible">True</property>
|
||||
<property name="layout_style">start</property>
|
||||
<child>
|
||||
<widget class="GtkButton" id="button_associate_magnet">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<signal name="clicked" handler="on_button_associate_magnet_clicked"/>
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox22">
|
||||
<property name="visible">True</property>
|
||||
<property name="spacing">2</property>
|
||||
<child>
|
||||
<widget class="GtkImage" id="image_magnet">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-missing-image</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label60">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Associate Magnet links with Deluge</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
@ -2436,6 +2510,7 @@ Disabled</property>
|
|||
<widget class="GtkVBox" id="vbox13">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label34">
|
||||
<property name="visible">True</property>
|
||||
|
@ -2477,6 +2552,7 @@ Disabled</property>
|
|||
<widget class="GtkVBox" id="vbox14">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox12">
|
||||
<property name="visible">True</property>
|
||||
|
@ -2661,6 +2737,7 @@ Disabled</property>
|
|||
<widget class="GtkVBox" id="vbox9">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label46">
|
||||
<property name="visible">True</property>
|
||||
|
@ -2690,6 +2767,7 @@ Disabled</property>
|
|||
<widget class="GtkVBox" id="queue_prefs_box2">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">5</property>
|
||||
<child>
|
||||
<widget class="GtkFrame" id="frame10">
|
||||
|
@ -2707,6 +2785,7 @@ Disabled</property>
|
|||
<widget class="GtkVBox" id="vbox6">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="chk_queue_new_top">
|
||||
<property name="label" translatable="yes">Queue new torrents to top</property>
|
||||
|
@ -2757,6 +2836,7 @@ Disabled</property>
|
|||
<child>
|
||||
<widget class="GtkVBox" id="vbox20">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">5</property>
|
||||
<child>
|
||||
<widget class="GtkTable" id="table3">
|
||||
|
@ -2908,6 +2988,7 @@ Disabled</property>
|
|||
<widget class="GtkVBox" id="vbox11">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">2</property>
|
||||
<child>
|
||||
<widget class="GtkTable" id="table2">
|
||||
|
@ -3133,6 +3214,7 @@ Disabled</property>
|
|||
<widget class="GtkVBox" id="vbox22">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label83">
|
||||
<property name="visible">True</property>
|
||||
|
@ -3160,6 +3242,7 @@ Disabled</property>
|
|||
<child>
|
||||
<widget class="GtkVBox" id="vbox26">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">5</property>
|
||||
<child>
|
||||
<widget class="GtkFrame" id="frame23">
|
||||
|
@ -3936,6 +4019,7 @@ HTTP W/ Auth</property>
|
|||
<child>
|
||||
<widget class="GtkVBox" id="vbox23">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label66">
|
||||
<property name="visible">True</property>
|
||||
|
@ -3967,6 +4051,7 @@ HTTP W/ Auth</property>
|
|||
<child>
|
||||
<widget class="GtkVBox" id="vbox24">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<widget class="GtkFrame" id="frame24">
|
||||
|
@ -4320,6 +4405,7 @@ HTTP W/ Auth</property>
|
|||
<child>
|
||||
<widget class="GtkVBox" id="vbox30">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label111">
|
||||
<property name="visible">True</property>
|
||||
|
@ -4351,6 +4437,7 @@ HTTP W/ Auth</property>
|
|||
<child>
|
||||
<widget class="GtkVBox" id="vbox31">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<widget class="GtkFrame" id="frame32">
|
||||
<property name="visible">True</property>
|
||||
|
@ -4460,6 +4547,7 @@ HTTP W/ Auth</property>
|
|||
<child>
|
||||
<widget class="GtkVBox" id="vbox32">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<widget class="GtkFrame" id="frame34">
|
||||
<property name="visible">True</property>
|
||||
|
@ -4868,6 +4956,7 @@ HTTP W/ Auth</property>
|
|||
<widget class="GtkVBox" id="vbox28">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label51">
|
||||
<property name="visible">True</property>
|
||||
|
@ -4898,6 +4987,7 @@ HTTP W/ Auth</property>
|
|||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<widget class="GtkScrolledWindow" id="scrolledwindow12">
|
||||
<property name="visible">True</property>
|
||||
|
|
|
@ -81,6 +81,7 @@ from deluge.ui.tracker_icons import TrackerIcons
|
|||
from queuedtorrents import QueuedTorrents
|
||||
from addtorrentdialog import AddTorrentDialog
|
||||
import dialogs
|
||||
import common
|
||||
|
||||
import deluge.configmanager
|
||||
import deluge.common
|
||||
|
@ -180,21 +181,9 @@ 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, "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.")
|
||||
# Attempt to register a magnet URI handler with gconf, but do not overwrite
|
||||
# if already set by another program.
|
||||
common.associate_magnet_links(False)
|
||||
|
||||
# Make sure gtkui.conf has at least the defaults set
|
||||
self.config = deluge.configmanager.ConfigManager("gtkui.conf", DEFAULT_PREFS)
|
||||
|
|
|
@ -60,6 +60,10 @@ class Preferences(component.Component):
|
|||
self.treeview = self.glade.get_widget("treeview")
|
||||
self.notebook = self.glade.get_widget("notebook")
|
||||
self.gtkui_config = ConfigManager("gtkui.conf")
|
||||
|
||||
self.glade.get_widget("image_magnet").set_from_file(
|
||||
deluge.common.get_pixmap("magnet.png"))
|
||||
|
||||
# Setup the liststore for the categories (tab pages)
|
||||
self.liststore = gtk.ListStore(int, str)
|
||||
self.treeview.set_model(self.liststore)
|
||||
|
@ -105,7 +109,8 @@ class Preferences(component.Component):
|
|||
"on_button_rescan_plugins_clicked": self._on_button_rescan_plugins_clicked,
|
||||
"on_button_find_plugins_clicked": self._on_button_find_plugins_clicked,
|
||||
"on_button_cache_refresh_clicked": self._on_button_cache_refresh_clicked,
|
||||
"on_combo_proxy_type_changed": self._on_combo_proxy_type_changed
|
||||
"on_combo_proxy_type_changed": self._on_combo_proxy_type_changed,
|
||||
"on_button_associate_magnet_clicked": self._on_button_associate_magnet_clicked
|
||||
})
|
||||
|
||||
# These get updated by requests done to the core
|
||||
|
@ -982,3 +987,6 @@ class Preferences(component.Component):
|
|||
w = self.glade.get_widget(p + s + "_" + name)
|
||||
if w:
|
||||
w.show()
|
||||
|
||||
def _on_button_associate_magnet_clicked(self, widget):
|
||||
common.associate_magnet_links(True)
|
||||
|
|
Loading…
Add table
Reference in a new issue