Author: johnnyg

Revision: 6050

Log:
        Fix blocklist status icon not opening proper preferences page.
Show blocklist's file date using the locale's date / time representation.

Diff:
Modified: branches/1.2_RC/ChangeLog
===================================================================
--- branches/1.2_RC/ChangeLog   2009-12-20 04:23:50 UTC (rev 6049)
+++ branches/1.2_RC/ChangeLog   2009-12-20 09:01:07 UTC (rev 6050)
@@ -8,6 +8,10 @@
 ==== Windows ====
        * Fix displaying folders in the add torrent dialog
 
+==== Blocklist ====
+       * Fix blocklist status icon not opening the blocklist preference
+         page in certain locales
+
 === Deluge 1.2.0_rc5 (17 December 2009) ===
 ==== Web ====
        * Swap order of buttons in Remove window (Closes #1083)

Modified: branches/1.2_RC/deluge/plugins/blocklist/blocklist/core.py
===================================================================
--- branches/1.2_RC/deluge/plugins/blocklist/blocklist/core.py  2009-12-20 
04:23:50 UTC (rev 6049)
+++ branches/1.2_RC/deluge/plugins/blocklist/blocklist/core.py  2009-12-20 
09:01:07 UTC (rev 6050)
@@ -174,7 +174,7 @@
         status["file_progress"] = self.file_progress
         status["file_url"] = self.config["url"]
         status["file_size"] = self.config["list_size"]
-        status["file_date"] = 
datetime.fromtimestamp(self.config["last_update"]).strftime("%a, %d %b %Y 
%H:%M:%S") if self.config["last_update"] else ""
+        status["file_date"] = self.config["last_update"]
         status["file_type"] = self.config["list_type"]
         if self.config["list_compression"]:
             status["file_type"] += " (%s)" % self.config["list_compression"]
@@ -330,7 +330,7 @@
             self.reader = None
             try_again = True
         elif os.path.exists(blocklist) and not self.use_cache:
-           # If we have a backup and we haven't already used it
+            # If we have a backup and we haven't already used it
             e = f.trap(Exception)
             log.warning("Error reading blocklist: %s", e)
             self.use_cache = True

Modified: branches/1.2_RC/deluge/plugins/blocklist/blocklist/gtkui.py
===================================================================
--- branches/1.2_RC/deluge/plugins/blocklist/blocklist/gtkui.py 2009-12-20 
04:23:50 UTC (rev 6049)
+++ branches/1.2_RC/deluge/plugins/blocklist/blocklist/gtkui.py 2009-12-20 
09:01:07 UTC (rev 6050)
@@ -33,6 +33,7 @@
 #
 #
 
+from datetime import datetime
 import gtk
 
 from deluge.log import LOG as log
@@ -115,7 +116,7 @@
                 self.glade.get_widget("label_filesize").set_text(
                     deluge.common.fsize(status["file_size"]))
                 self.glade.get_widget("label_modified").set_text(
-                    str(status["file_date"]))
+                    datetime.fromtimestamp(status["file_date"]).strftime("%c"))
                 
self.glade.get_widget("label_type").set_text(status["file_type"])
                 self.glade.get_widget("label_url").set_text(
                     status["file_url"])
@@ -151,7 +152,7 @@
         client.blocklist.check_import(force=True)
 
     def _on_status_item_clicked(self, widget, event):
-        component.get("Preferences").show("Blocklist")
+        component.get("Preferences").show(_("Blocklist"))
 
     def load_preferences_page(self):
         """Initializes the preferences page and adds it to the preferences 
dialog"""

Modified: trunk/deluge/plugins/blocklist/blocklist/core.py
===================================================================
--- trunk/deluge/plugins/blocklist/blocklist/core.py    2009-12-20 04:23:50 UTC 
(rev 6049)
+++ trunk/deluge/plugins/blocklist/blocklist/core.py    2009-12-20 09:01:07 UTC 
(rev 6050)
@@ -174,7 +174,7 @@
         status["file_progress"] = self.file_progress
         status["file_url"] = self.config["url"]
         status["file_size"] = self.config["list_size"]
-        status["file_date"] = 
datetime.fromtimestamp(self.config["last_update"]).strftime("%a, %d %b %Y 
%H:%M:%S") if self.config["last_update"] else ""
+        status["file_date"] = self.config["last_update"]
         status["file_type"] = self.config["list_type"]
         if self.config["list_compression"]:
             status["file_type"] += " (%s)" % self.config["list_compression"]
@@ -330,7 +330,7 @@
             self.reader = None
             try_again = True
         elif os.path.exists(blocklist) and not self.use_cache:
-           # If we have a backup and we haven't already used it
+            # If we have a backup and we haven't already used it
             e = f.trap(Exception)
             log.warning("Error reading blocklist: %s", e)
             self.use_cache = True

Modified: trunk/deluge/plugins/blocklist/blocklist/gtkui.py
===================================================================
--- trunk/deluge/plugins/blocklist/blocklist/gtkui.py   2009-12-20 04:23:50 UTC 
(rev 6049)
+++ trunk/deluge/plugins/blocklist/blocklist/gtkui.py   2009-12-20 09:01:07 UTC 
(rev 6050)
@@ -33,6 +33,7 @@
 #
 #
 
+from datetime import datetime
 import gtk
 
 from deluge.log import LOG as log
@@ -115,7 +116,7 @@
                 self.glade.get_widget("label_filesize").set_text(
                     deluge.common.fsize(status["file_size"]))
                 self.glade.get_widget("label_modified").set_text(
-                    str(status["file_date"]))
+                    datetime.fromtimestamp(status["file_date"]).strftime("%c"))
                 
self.glade.get_widget("label_type").set_text(status["file_type"])
                 self.glade.get_widget("label_url").set_text(
                     status["file_url"])
@@ -151,7 +152,7 @@
         client.blocklist.check_import(force=True)
 
     def _on_status_item_clicked(self, widget, event):
-        component.get("Preferences").show("Blocklist")
+        component.get("Preferences").show(_("Blocklist"))
 
     def load_preferences_page(self):
         """Initializes the preferences page and adds it to the preferences 
dialog"""


--

You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en.


Reply via email to