diff --git a/deluge/plugins/blocklist/blocklist/core.py b/deluge/plugins/blocklist/blocklist/core.py index 432888033..9257e0ab0 100644 --- a/deluge/plugins/blocklist/blocklist/core.py +++ b/deluge/plugins/blocklist/blocklist/core.py @@ -68,6 +68,7 @@ class Core(CorePluginBase): self.is_downloading = False self.is_importing = False self.has_imported = False + self.up_to_date = False self.num_blocked = 0 self.file_progress = 0.0 @@ -126,6 +127,7 @@ class Core(CorePluginBase): else: status["state"] = "Idle" + status["up_to_date"] = self.up_to_date status["num_blocked"] = self.num_blocked status["file_progress"] = self.file_progress status["file_type"] = self.config["file_type"] @@ -248,6 +250,10 @@ class Core(CorePluginBase): def need_new_blocklist(self): """Returns True if a new blocklist file should be downloaded""" + + # Assume blocklist is not up to date + self.up_to_date = False + # Check to see if we've just downloaded a new blocklist if os.path.exists(deluge.configmanager.get_config_dir("blocklist.download")): log.debug("New blocklist waiting to be imported") @@ -296,5 +302,6 @@ class Core(CorePluginBase): # Update last modified time of blocklist os.utime(deluge.configmanager.get_config_dir("blocklist.cache"), None) + self.up_to_date = True log.debug("Blocklist is up to date") return False diff --git a/deluge/plugins/blocklist/blocklist/data/blocklist_pref.glade b/deluge/plugins/blocklist/blocklist/data/blocklist_pref.glade index 3a2748c46..c6d95c695 100644 --- a/deluge/plugins/blocklist/blocklist/data/blocklist_pref.glade +++ b/deluge/plugins/blocklist/blocklist/data/blocklist_pref.glade @@ -1,6 +1,6 @@ - + @@ -118,12 +118,14 @@ 5 5 - + True 0 - Check for new list every: + Days + 2 + 3 GTK_FILL @@ -142,14 +144,12 @@ - + True 0 - Days + Check for new list every: - 2 - 3 GTK_FILL @@ -207,88 +207,104 @@ 0 12 - + True - + True - True - True - Download the blocklist file if necessary and import the file. - 0 - - + True - 5 + True + True + Download the blocklist file if necessary and import the file. + 0 + - + True - gtk-missing-image + 5 + + + True + gtk-missing-image + + + False + False + + + + + True + Check Download and Import + + + False + False + 1 + + - - False - False - - - - - True - Check Download and Import - - - False - False - 1 - + + False + False + + + + + True + True + True + Download a new blocklist file and import it. + 0 + + + + True + 5 + + + True + gtk-missing-image + + + False + False + + + + + True + Force Download and Import + + + False + False + 1 + + + + + + + False + False + 1 + - - False - False - - - True - True - True - Download a new blocklist file and import it. - 0 - - - - True - 5 - - - True - gtk-missing-image - - - False - False - - - - - True - Force Download and Import - - - False - False - 1 - - - - + + Blocklist is up to date + 0.15000000596046448 + 2 + gtk-yes - False - False 1 @@ -338,24 +354,60 @@ 2 5 - + True 0 - File Size: - GTK_FILL + 1 + 2 + 3 + 4 - + True 0 - Date: + 1 + 2 + 2 + 3 + + + + + True + 0 + + + 1 + 2 1 2 + + + + + True + 0 + + + 1 + 2 + + + + + True + 0 + URL: + + + 3 + 4 GTK_FILL @@ -372,61 +424,25 @@ - + True 0 - URL: + Date: - 3 - 4 + 1 + 2 GTK_FILL - + True 0 + File Size: - 1 - 2 - - - - - True - 0 - - - 1 - 2 - 1 - 2 - - - - - True - 0 - - - 1 - 2 - 2 - 3 - - - - - True - 0 - - - 1 - 2 - 3 - 4 + GTK_FILL diff --git a/deluge/plugins/blocklist/blocklist/gtkui.py b/deluge/plugins/blocklist/blocklist/gtkui.py index 04fbac835..c19a42311 100644 --- a/deluge/plugins/blocklist/blocklist/gtkui.py +++ b/deluge/plugins/blocklist/blocklist/gtkui.py @@ -70,6 +70,7 @@ class GtkUI(ui.UI): self.table_info.hide() self.glade.get_widget("button_check_download").set_sensitive(False) self.glade.get_widget("button_force_download").set_sensitive(False) + self.glade.get_widget("image_up_to_date").hide() self.status_item.set_text( "Downloading %.2f%%" % (status["file_progress"] * 100)) @@ -81,6 +82,7 @@ class GtkUI(ui.UI): self.table_info.hide() self.glade.get_widget("button_check_download").set_sensitive(False) self.glade.get_widget("button_force_download").set_sensitive(False) + self.glade.get_widget("image_up_to_date").hide() self.status_item.set_text( "Importing " + str(status["num_blocked"])) @@ -92,6 +94,10 @@ class GtkUI(ui.UI): self.progress_bar.hide() self.glade.get_widget("button_check_download").set_sensitive(True) self.glade.get_widget("button_force_download").set_sensitive(True) + if status["up_to_date"]: + self.glade.get_widget("image_up_to_date").show() + else: + self.glade.get_widget("image_up_to_date").hide() self.table_info.show() self.status_item.set_text(str(status["num_blocked"]))