From 6425b94d7a5ffa3b620b7f784dc5c4ceb63fa9e1 Mon Sep 17 00:00:00 2001 From: Marcos Pinto Date: Fri, 25 May 2007 07:31:31 +0000 Subject: [PATCH] remove passwd lock --- glade/preferences_dialog.glade | 145 +++++++++++++++++++-------------- src/dialogs.py | 5 +- src/interface.py | 135 ++++++++++-------------------- 3 files changed, 127 insertions(+), 158 deletions(-) diff --git a/glade/preferences_dialog.glade b/glade/preferences_dialog.glade index 2ec88b5b0..56840914d 100644 --- a/glade/preferences_dialog.glade +++ b/glade/preferences_dialog.glade @@ -14,33 +14,41 @@ True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 2 True True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + True True True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK GTK_POLICY_NEVER GTK_POLICY_AUTOMATIC True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + GTK_RESIZE_QUEUE GTK_SHADOW_NONE True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 GTK_SHADOW_NONE True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 12 @@ -51,7 +59,6 @@ True Ask me where to save each download - True True @@ -62,8 +69,8 @@ True Save all downloads to: - True True + radio_ask_save 1 @@ -89,6 +96,7 @@ True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK <b>Download Location</b> True @@ -104,20 +112,24 @@ True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 GTK_SHADOW_NONE True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 12 True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 1 2 True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 Maximum simultaneous active torrents: @@ -127,8 +139,8 @@ True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 1 0 0 100 1 10 10 - 1 True GTK_UPDATE_IF_VALID @@ -145,6 +157,7 @@ True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK <b>Torrents</b> True @@ -161,17 +174,18 @@ True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 GTK_SHADOW_NONE True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 12 True Use compact storage allocation - True True @@ -180,6 +194,7 @@ True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK <b>Compact Allocation</b> True @@ -196,11 +211,13 @@ True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 GTK_SHADOW_NONE True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 12 @@ -211,8 +228,8 @@ True True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Queue torrents to bottom when they begin seeding - True True @@ -223,7 +240,6 @@ True Stop seeding torrents when their share ratio reaches: - True True @@ -235,8 +251,9 @@ True True + 5 + 0.5 0 0 10 0.050000000000000003 10 9 - 1 2 True @@ -255,6 +272,7 @@ True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK <b>Seeding</b> True @@ -283,6 +301,7 @@ True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Downloads @@ -295,19 +314,23 @@ True True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK GTK_POLICY_AUTOMATIC GTK_POLICY_AUTOMATIC True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + GTK_RESIZE_QUEUE GTK_SHADOW_NONE True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK <b>Warning - Changes to these settings will only be applied the next time Deluge is restarted</b> True GTK_JUSTIFY_CENTER @@ -320,11 +343,13 @@ True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 GTK_SHADOW_NONE True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 12 @@ -338,7 +363,6 @@ True Test Port - True 3 @@ -375,8 +399,8 @@ True True + 0.5 0 0 65535 1 10 10 - 1 3 @@ -387,8 +411,8 @@ True True + 0.5 0 0 65535 1 10 10 - 1 1 @@ -418,6 +442,7 @@ True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK <b>TCP Port</b> True @@ -434,18 +459,20 @@ True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 GTK_SHADOW_NONE True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 12 True True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Enable UPnP support - True True @@ -454,6 +481,7 @@ True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK <b>UPnP</b> True @@ -470,23 +498,26 @@ True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 GTK_SHADOW_NONE True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 12 True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 2 2 True True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Enable Mainline DHT - True True @@ -496,6 +527,7 @@ True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Max number of DHT connections: @@ -508,15 +540,15 @@ True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 1 0 0 100 1 10 10 - 1 1 2 1 2 - + GTK_FILL @@ -526,6 +558,7 @@ True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK <b>DHT</b> True @@ -558,6 +591,7 @@ True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Network @@ -571,24 +605,29 @@ True True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK GTK_POLICY_AUTOMATIC GTK_POLICY_AUTOMATIC True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + GTK_RESIZE_QUEUE GTK_SHADOW_NONE True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 GTK_SHADOW_NONE True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 12 @@ -634,8 +673,9 @@ True True + 10 + 1 -1 -1 1024 1 10 10 - 1 1 @@ -660,8 +700,9 @@ True True + 10 + 1 -1 -1 100 1 10 10 - 1 1 @@ -708,8 +749,9 @@ True True + 10 + 1 -1 -1 100 1 10 10 - 1 1 @@ -723,8 +765,9 @@ True True + 10 + 1 -1 -1 2048 1 10 10 - 1 1 @@ -764,6 +807,7 @@ True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK <b>Bandwidth Usage</b> True @@ -795,6 +839,7 @@ True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Bandwidth @@ -808,70 +853,39 @@ True True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK GTK_POLICY_AUTOMATIC GTK_POLICY_AUTOMATIC True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + GTK_RESIZE_QUEUE GTK_SHADOW_NONE True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 GTK_SHADOW_NONE True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 12 True - 3 + 2 2 - - - False - True - False - 0 - - True - * - False - - - 1 - 2 - 2 - 3 - - - - - - True - True - Password protect system tray - True - True - - - 2 - 3 - GTK_FILL - - 12 - - True Minimize to tray on close - True True @@ -885,7 +899,6 @@ True Enable system tray icon - True True True @@ -900,6 +913,7 @@ True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK <b>System Tray</b> True @@ -915,20 +929,24 @@ True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 GTK_SHADOW_NONE True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 12 True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 1 3 True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 GUI update interval @@ -938,20 +956,21 @@ True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + False 0.5 0.5 5 0.5 0.5 1 - 1 1 True 1 2 - + GTK_FILL True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK seconds @@ -967,6 +986,7 @@ True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK <b>Performance</b> True @@ -996,6 +1016,7 @@ True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Other @@ -1007,24 +1028,25 @@ - 2 + 1 True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK GTK_BUTTONBOX_END True - gtk-cancel + gtk-cancel True True - gtk-ok + gtk-ok True 1 @@ -1042,3 +1064,4 @@ + diff --git a/src/dialogs.py b/src/dialogs.py index 921a7431d..fd31fdeef 100644 --- a/src/dialogs.py +++ b/src/dialogs.py @@ -40,8 +40,6 @@ class PreferencesDlg: try: self.glade.get_widget("chk_use_tray").set_active(self.preferences.get("enable_system_tray", bool, default=True)) self.glade.get_widget("chk_min_on_close").set_active(self.preferences.get("close_to_tray", bool, default=False)) - self.glade.get_widget("chk_lock_tray").set_active(self.preferences.get("lock_tray", bool, default=False)) - self.glade.get_widget("txt_tray_passwd").set_text(self.preferences.get("tray_passwd", default="")) if(self.preferences.get("use_default_dir", bool, False)): self.glade.get_widget("radio_save_all_to").set_active(True) else: @@ -74,8 +72,6 @@ class PreferencesDlg: if r == 1: self.preferences.set("enable_system_tray", self.glade.get_widget("chk_use_tray").get_active()) self.preferences.set("close_to_tray", self.glade.get_widget("chk_min_on_close").get_active()) - self.preferences.set("lock_tray", self.glade.get_widget("chk_lock_tray").get_active()) - self.preferences.set("tray_passwd", self.glade.get_widget("txt_tray_passwd").get_text()) self.preferences.set("use_default_dir", self.glade.get_widget("radio_save_all_to").get_active()) self.preferences.set("default_download_path", self.glade.get_widget("download_path_button").get_filename()) self.preferences.set("auto_end_seeding", self.glade.get_widget("chk_autoseed").get_active()) @@ -260,3 +256,4 @@ def show_directory_chooser_dialog(parent=None, title=None): result = None chooser.destroy() return result + diff --git a/src/interface.py b/src/interface.py index a7e6cd3cc..4226fbcf0 100644 --- a/src/interface.py +++ b/src/interface.py @@ -230,40 +230,6 @@ class DelugeGTK: def tray_popup(self, status_icon, button, activate_time): self.tray_menu.popup(None, None, gtk.status_icon_position_menu, button, activate_time, status_icon) - - def unlock_tray(self,comingnext): - entered_pass = gtk.Entry(25) - entered_pass.set_activates_default(True) - entered_pass.set_width_chars(25) - entered_pass.set_visibility(False) - entered_pass.show() - tray_lock = gtk.Dialog(title=_("Deluge is locked"), parent=self.window, - buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT, gtk.STOCK_OK, gtk.RESPONSE_ACCEPT)) - label = gtk.Label(_("Deluge is password protected.\nTo show the Deluge window, please enter your password")) - label.set_line_wrap(True) - label.set_justify(gtk.JUSTIFY_CENTER) - tray_lock.set_position(gtk.WIN_POS_CENTER_ALWAYS) - tray_lock.set_size_request(400, 200) - tray_lock.set_default_response(gtk.RESPONSE_ACCEPT) - tray_lock.vbox.pack_start(label) - tray_lock.vbox.pack_start(entered_pass) - tray_lock.show_all() - if tray_lock.run() == gtk.RESPONSE_ACCEPT: - if self.config.get("tray_passwd", default="") == entered_pass.get_text(): - if comingnext == "mainwinshow": - self.window.show() - elif comingnext == "prefwinshow": - self.preferences_dialog.show() - self.apply_prefs() - self.config.save_to_file() - elif comingnext == "quitus": - self.save_window_geometry() - self.window.hide() - self.shutdown() - - tray_lock.destroy() - return True - def tray_clicked(self, status_icon): if self.window.get_property("visible"): @@ -272,19 +238,13 @@ class DelugeGTK: else: self.window.present() else: - if self.config.get("lock_tray", bool, default=False) == True: - self.unlock_tray("mainwinshow") - else: - self.window.show() + self.window.show() def force_show_hide(self, arg=None): if self.window.get_property("visible"): self.window.hide() else: - if self.config.get("lock_tray", bool, default=False) == True: - self.unlock_tray("mainwinshow") - else: - self.window.show() + self.window.show() def build_torrent_table(self): ## Create the torrent listview @@ -394,13 +354,13 @@ class DelugeGTK: if file_filter is None: file_filter = [False] * len(all_files) assert(len(all_files) == len(file_filter)) - i=0 - for f in all_files: - self.file_store.append([not file_filter[i], f['path'], common.fsize(f['size']), - f['offset'], '%.2f%%'%f['progress']]) - i=i+1 - - return True + i=0 + for f in all_files: + self.file_store.append([not file_filter[i], f['path'], common.fsize(f['size']), + f['offset'], '%.2f%%'%f['progress']]) + i=i+1 + + return True def torrent_view_clicked(self, widget, event): print widget @@ -500,19 +460,10 @@ class DelugeGTK: dialogs.show_about_dialog() def show_pref_dialog(self, arg=None): - if self.window.get_property("visible"): - self.preferences_dialog.show() - self.apply_prefs() - self.config.save_to_file() - - else: - if self.config.get("lock_tray", bool, default=False) == True: - self.unlock_tray("prefwinshow") - else: - self.preferences_dialog.show() - self.apply_prefs() - self.config.save_to_file() - + self.preferences_dialog.show() + self.apply_prefs() + self.config.save_to_file() + def show_plugin_dialog(self, arg=None): self.plugin_dialog.show() @@ -556,10 +507,10 @@ class DelugeGTK: # UID, Q#, Name, Size, Progress, Message, Seeders, Peers, DL, UL, ETA, Share def get_list_from_unique_id(self, unique_id): - state = self.manager.get_torrent_state(unique_id) - - queue = int(state['queue_pos']) + 1 - name = state['name'] + state = self.manager.get_torrent_state(unique_id) + + queue = int(state['queue_pos']) + 1 + name = state['name'] size = long(state['total_size']) progress = float(state['progress'] * 100) message = self.get_message_from_state(state) @@ -636,15 +587,19 @@ class DelugeGTK: dlrate, _('Upload'), ulrate) if 'DHT_nodes' in core_state.keys(): - dht_peers = str(dht_peers) - self.statusbar_temp_msg = self.statusbar_temp_msg + ' [DHT: %s]'%(dht_peers) - - msg = _("Deluge Bittorrent Client") + "\n" + \ - _("Connections") + ": " + str(connections) + "\n" + _("Download") + ": " + \ - dlrate + "\n" + _("Upload") + ": " + ulrate - - self.tray_icon.set_tooltip(msg) + dht_peers = core_state['DHT_nodes'] + if dht_peers == -1: + dht_peers = '?' + else: + dht_peers = str(dht_peers) + self.statusbar_temp_msg = self.statusbar_temp_msg + ' [DHT: %s]'%(dht_peers) + msg = _("Deluge Bittorrent Client") + "\n" + \ + _("Connections") + ": " + str(connections) + "\n" + _("Download") + ": " + \ + dlrate + "\n" + _("Upload") + ": " + ulrate + + self.tray_icon.set_tooltip(msg) + #Update any active plugins self.plugins.update_active_plugins() @@ -832,9 +787,9 @@ class DelugeGTK: except core.InsufficientFreeSpaceError, e: nice_need = common.fsize(e.needed_space) nice_free = common.fsize(e.free_space) - dialogs.show_popup_warning(self.window, _("There is not enough free disk space to complete your download.") + "\n" + \ - _("Space Needed:") + " " + nice_need + "\n" + \ - _("Available Space:") + " " + nice_free) + dialogs.show_popup_warning(self.window, _("There is not enough free disk space to complete your download.") + "\n" + \ + _("Space Needed:") + " " + nice_need + "\n" + \ + _("Available Space:") + " " + nice_free) @@ -914,9 +869,9 @@ class DelugeGTK: def remove_toggle_warning(self, args, warning): if not args.get_active(): warning.set_text(" ") - else: - warning.set_markup("" + _("Warning - all downloaded files for this torrent will be deleted!") + "") - return False + else: + warning.set_markup("" + _("Warning - all downloaded files for this torrent will be deleted!") + "") + return False def update_tracker(self, obj=None): torrent = self.get_selected_torrent() @@ -1033,19 +988,9 @@ class DelugeGTK: self.quit() def quit(self, widget=None): - if self.window.get_property("visible"): - self.save_window_geometry() - self.window.hide() - self.shutdown() - - else: - if self.config.get("lock_tray", bool, default=False) == True: - self.unlock_tray("quitus") - else: - self.save_window_geometry() - self.window.hide() - self.shutdown() - + self.save_window_geometry() + self.window.hide() + self.shutdown() def shutdown(self): enabled_plugins = ':'.join(self.plugins.get_enabled_plugins()) @@ -1056,7 +1001,11 @@ class DelugeGTK: self.manager.quit() gtk.main_quit() + + + ## For testing purposes, create a copy of the interface if __name__ == "__main__": interface = DelugeGTK() interface.start() +