diff --git a/TODO b/TODO index 1e2a4baed..f93910f83 100644 --- a/TODO +++ b/TODO @@ -15,7 +15,6 @@ * Implement 'Classic' mode * Add remove torrent dialog and ability to remove data * Tray tooltip -* Add LSD * Add torrentfiles location config option * Add autoload folder * Add wizard diff --git a/deluge/core/core.py b/deluge/core/core.py index 4c088e8ae..fa96b0bb8 100644 --- a/deluge/core/core.py +++ b/deluge/core/core.py @@ -65,6 +65,7 @@ DEFAULT_PREFS = { "upnp": False, "natpmp": False, "utpex": False, + "lsd": False, "enc_in_policy": 1, "enc_out_policy": 1, "enc_level": 2, @@ -155,6 +156,7 @@ class Core( self.config.register_set_function("upnp", self._on_set_upnp) self.config.register_set_function("natpmp", self._on_set_natpmp) self.config.register_set_function("utpex", self._on_set_utpex) + self.config.register_set_function("lsd", self._on_set_lsd) self.config.register_set_function("enc_in_policy", self._on_set_encryption) self.config.register_set_function("enc_out_policy", @@ -468,7 +470,14 @@ class Core( self.session.start_natpmp() else: self.session.stop_natpmp() - + + def _on_set_lsd(self, key, value): + log.debug("lsd value set to %s", value) + if value: + self.session.start_lsd() + else: + self.session.stop_lsd() + def _on_set_utpex(self, key, value): log.debug("utpex value set to %s", value) if value: diff --git a/deluge/ui/gtkui/glade/remove_torrent_dialog.glade b/deluge/ui/gtkui/glade/remove_torrent_dialog.glade new file mode 100644 index 000000000..6591dba4d --- /dev/null +++ b/deluge/ui/gtkui/glade/remove_torrent_dialog.glade @@ -0,0 +1,138 @@ + + + + + + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 5 + Remove Torrents + False + GTK_WIN_POS_CENTER_ON_PARENT + GDK_WINDOW_TYPE_HINT_DIALOG + False + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 2 + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 5 + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 5 + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + gtk-dialog-warning + 6 + + + False + False + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + <big><b>Remove Torrents?</b></big> + True + + + False + False + 1 + + + + + False + False + + + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Delete .torrent files + 0 + True + + + False + False + 1 + + + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Delete saved data + 0 + True + + + False + False + 2 + + + + + False + False + 5 + 1 + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + GTK_BUTTONBOX_END + + + True + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + gtk-cancel + True + 0 + + + + + + True + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + gtk-ok + True + 0 + + + + 1 + + + + + False + GTK_PACK_END + + + + + + diff --git a/deluge/ui/gtkui/preferences.py b/deluge/ui/gtkui/preferences.py index 4b1b9b3ec..42ad1093f 100644 --- a/deluge/ui/gtkui/preferences.py +++ b/deluge/ui/gtkui/preferences.py @@ -171,6 +171,7 @@ class Preferences(component.Component): "chk_upnp": ("active", self.core_config["upnp"]), "chk_natpmp": ("active", self.core_config["natpmp"]), "chk_utpex": ("active", self.core_config["utpex"]), + "chk_lsd": ("active", self.core_config["lsd"]), "combo_encin": ("active", self.core_config["enc_in_policy"]), "combo_encout": ("active", self.core_config["enc_out_policy"]), "combo_enclevel": ("active", self.core_config["enc_level"]), @@ -223,6 +224,7 @@ class Preferences(component.Component): "chk_upnp", "chk_natpmp", "chk_utpex", + "chk_lsd", "combo_encin", "combo_encout", "combo_enclevel", @@ -323,8 +325,12 @@ class Preferences(component.Component): self.glade.get_widget("chk_random_port").get_active() new_core_config["dht"] = self.glade.get_widget("chk_dht").get_active() new_core_config["upnp"] = self.glade.get_widget("chk_upnp").get_active() - new_core_config["natpmp"] = self.glade.get_widget("chk_natpmp").get_active() - new_core_config["utpex"] = self.glade.get_widget("chk_utpex").get_active() + new_core_config["natpmp"] = \ + self.glade.get_widget("chk_natpmp").get_active() + new_core_config["utpex"] = \ + self.glade.get_widget("chk_utpex").get_active() + new_core_config["lsd"] = \ + self.glade.get_widget("chk_lsd").get_active() new_core_config["enc_in_policy"] = \ self.glade.get_widget("combo_encin").get_active() new_core_config["enc_out_policy"] = \