Author: andar

Revision: 5864

Log:
        Fix #799 translate connection status

Diff:
Modified: branches/1.2_RC/ChangeLog
===================================================================
--- branches/1.2_RC/ChangeLog   2009-10-23 23:23:38 UTC (rev 5863)
+++ branches/1.2_RC/ChangeLog   2009-10-24 02:04:19 UTC (rev 5864)
@@ -5,6 +5,7 @@
        * Do not try to call doIteration() on the reactor if it has already 
stopped
        * Fix 'autostart localhost if needed' option
        * Fix starting plugins when the pluginmanager is started
+       * Fix #799 translate connection status
 
 ==== Core ====
        * Fix saving torrent state on fresh configs

Modified: branches/1.2_RC/deluge/ui/gtkui/connectionmanager.py
===================================================================
--- branches/1.2_RC/deluge/ui/gtkui/connectionmanager.py        2009-10-23 
23:23:38 UTC (rev 5863)
+++ branches/1.2_RC/deluge/ui/gtkui/connectionmanager.py        2009-10-24 
02:04:19 UTC (rev 5864)
@@ -71,9 +71,9 @@
 ]
 
 HOSTLIST_STATUS = [
-    "Offline",
-    "Online",
-    "Connected"
+    _("Offline"),
+    _("Online"),
+    _("Connected")
 ]
 
 def cell_render_host(column, cell, model, row, data):
@@ -206,7 +206,7 @@
         self.liststore[row][HOSTLIST_COL_PORT] = port
         self.liststore[row][HOSTLIST_COL_USER] = username
         self.liststore[row][HOSTLIST_COL_PASS] = password
-        self.liststore[row][HOSTLIST_COL_STATUS] = "Offline"
+        self.liststore[row][HOSTLIST_COL_STATUS] = _("Offline")
 
         # Save the host list to file
         self.__save_hostlist()
@@ -237,7 +237,7 @@
             self.liststore[new_row][HOSTLIST_COL_PORT] = host[2]
             self.liststore[new_row][HOSTLIST_COL_USER] = host[3]
             self.liststore[new_row][HOSTLIST_COL_PASS] = host[4]
-            self.liststore[new_row][HOSTLIST_COL_STATUS] = "Offline"
+            self.liststore[new_row][HOSTLIST_COL_STATUS] = _("Offline")
 
     def __get_host_row(self, host_id):
         """
@@ -261,7 +261,7 @@
                 if not self.running:
                     return
                 if row:
-                    row[HOSTLIST_COL_STATUS] = "Online"
+                    row[HOSTLIST_COL_STATUS] = _("Online")
                     row[HOSTLIST_COL_VERSION] = info
                     self.__update_buttons()
                 c.disconnect()
@@ -270,7 +270,7 @@
                 if not self.running:
                     return
                 if row:
-                    row[HOSTLIST_COL_STATUS] = "Offline"
+                    row[HOSTLIST_COL_STATUS] = _("Offline")
                     self.__update_buttons()
 
             d = c.daemon.info()
@@ -282,7 +282,7 @@
                 return
             row = self.__get_host_row(host_id)
             if row:
-                row[HOSTLIST_COL_STATUS] = "Offline"
+                row[HOSTLIST_COL_STATUS] = _("Offline")
                 self.__update_buttons()
 
         for row in self.liststore:
@@ -299,7 +299,7 @@
                         return
                     row[HOSTLIST_COL_VERSION] = info
                     self.__update_buttons()
-                row[HOSTLIST_COL_STATUS] = "Connected"
+                row[HOSTLIST_COL_STATUS] = _("Connected")
                 client.daemon.info().addCallback(on_info)
                 continue
 
@@ -358,24 +358,24 @@
         self.glade.get_widget("button_removehost").set_sensitive(True)
 
         # See if this is the currently connected host
-        if status == "Connected":
+        if status == _("Connected"):
             # Display a disconnect button if we're connected to this host
             self.glade.get_widget("button_connect").set_label("gtk-disconnect")
             self.glade.get_widget("button_removehost").set_sensitive(False)
         else:
             self.glade.get_widget("button_connect").set_label("gtk-connect")
-            if status == "Offline" and not localhost:
+            if status == _("Offline") and not localhost:
                 self.glade.get_widget("button_connect").set_sensitive(False)
 
         # Check to see if the host is online
-        if status == "Connected" or status == "Online":
+        if status == _("Connected") or status == _("Online"):
             self.glade.get_widget("image_startdaemon").set_from_stock(
                 gtk.STOCK_STOP, gtk.ICON_SIZE_MENU)
             self.glade.get_widget("label_startdaemon").set_text(
                 "_Stop Daemon")
 
         # Update the start daemon button if the selected host is localhost
-        if localhost and status == "Offline":
+        if localhost and status == _("Offline"):
             # The localhost is not online
             self.glade.get_widget("image_startdaemon").set_from_stock(
                 gtk.STOCK_EXECUTE, gtk.ICON_SIZE_MENU)
@@ -402,7 +402,7 @@
         if not row:
             return
         status = model[row][HOSTLIST_COL_STATUS]
-        if status == "Connected":
+        if status == _("Connected"):
             def on_disconnect(reason):
                 self.__update_list()
             client.disconnect().addCallback(on_disconnect)
@@ -481,7 +481,7 @@
         if host not in ("127.0.0.1", "localhost"):
             return
 
-        if status in ("Online", "Connected"):
+        if status in (_("Online"), _("Connected")):
             # We need to stop this daemon
             # Call the shutdown method on the daemon
             def on_daemon_shutdown(d):
@@ -498,7 +498,7 @@
 
                 c.connect(host, port, user, password).addCallback(on_connect, 
c)
 
-        elif status == "Offline":
+        elif status == _("Offline"):
             client.start_daemon(port, deluge.configmanager.get_config_dir())
             reactor.callLater(2.0, self.__update_list)
 

Modified: trunk/deluge/ui/gtkui/connectionmanager.py
===================================================================
--- trunk/deluge/ui/gtkui/connectionmanager.py  2009-10-23 23:23:38 UTC (rev 
5863)
+++ trunk/deluge/ui/gtkui/connectionmanager.py  2009-10-24 02:04:19 UTC (rev 
5864)
@@ -71,9 +71,9 @@
 ]
 
 HOSTLIST_STATUS = [
-    "Offline",
-    "Online",
-    "Connected"
+    _("Offline"),
+    _("Online"),
+    _("Connected")
 ]
 
 def cell_render_host(column, cell, model, row, data):
@@ -206,7 +206,7 @@
         self.liststore[row][HOSTLIST_COL_PORT] = port
         self.liststore[row][HOSTLIST_COL_USER] = username
         self.liststore[row][HOSTLIST_COL_PASS] = password
-        self.liststore[row][HOSTLIST_COL_STATUS] = "Offline"
+        self.liststore[row][HOSTLIST_COL_STATUS] = _("Offline")
 
         # Save the host list to file
         self.__save_hostlist()
@@ -237,7 +237,7 @@
             self.liststore[new_row][HOSTLIST_COL_PORT] = host[2]
             self.liststore[new_row][HOSTLIST_COL_USER] = host[3]
             self.liststore[new_row][HOSTLIST_COL_PASS] = host[4]
-            self.liststore[new_row][HOSTLIST_COL_STATUS] = "Offline"
+            self.liststore[new_row][HOSTLIST_COL_STATUS] = _("Offline")
 
     def __get_host_row(self, host_id):
         """
@@ -261,7 +261,7 @@
                 if not self.running:
                     return
                 if row:
-                    row[HOSTLIST_COL_STATUS] = "Online"
+                    row[HOSTLIST_COL_STATUS] = _("Online")
                     row[HOSTLIST_COL_VERSION] = info
                     self.__update_buttons()
                 c.disconnect()
@@ -270,7 +270,7 @@
                 if not self.running:
                     return
                 if row:
-                    row[HOSTLIST_COL_STATUS] = "Offline"
+                    row[HOSTLIST_COL_STATUS] = _("Offline")
                     self.__update_buttons()
 
             d = c.daemon.info()
@@ -282,7 +282,7 @@
                 return
             row = self.__get_host_row(host_id)
             if row:
-                row[HOSTLIST_COL_STATUS] = "Offline"
+                row[HOSTLIST_COL_STATUS] = _("Offline")
                 self.__update_buttons()
 
         for row in self.liststore:
@@ -299,7 +299,7 @@
                         return
                     row[HOSTLIST_COL_VERSION] = info
                     self.__update_buttons()
-                row[HOSTLIST_COL_STATUS] = "Connected"
+                row[HOSTLIST_COL_STATUS] = _("Connected")
                 client.daemon.info().addCallback(on_info)
                 continue
 
@@ -358,24 +358,24 @@
         self.glade.get_widget("button_removehost").set_sensitive(True)
 
         # See if this is the currently connected host
-        if status == "Connected":
+        if status == _("Connected"):
             # Display a disconnect button if we're connected to this host
             self.glade.get_widget("button_connect").set_label("gtk-disconnect")
             self.glade.get_widget("button_removehost").set_sensitive(False)
         else:
             self.glade.get_widget("button_connect").set_label("gtk-connect")
-            if status == "Offline" and not localhost:
+            if status == _("Offline") and not localhost:
                 self.glade.get_widget("button_connect").set_sensitive(False)
 
         # Check to see if the host is online
-        if status == "Connected" or status == "Online":
+        if status == _("Connected") or status == _("Online"):
             self.glade.get_widget("image_startdaemon").set_from_stock(
                 gtk.STOCK_STOP, gtk.ICON_SIZE_MENU)
             self.glade.get_widget("label_startdaemon").set_text(
                 "_Stop Daemon")
 
         # Update the start daemon button if the selected host is localhost
-        if localhost and status == "Offline":
+        if localhost and status == _("Offline"):
             # The localhost is not online
             self.glade.get_widget("image_startdaemon").set_from_stock(
                 gtk.STOCK_EXECUTE, gtk.ICON_SIZE_MENU)
@@ -402,7 +402,7 @@
         if not row:
             return
         status = model[row][HOSTLIST_COL_STATUS]
-        if status == "Connected":
+        if status == _("Connected"):
             def on_disconnect(reason):
                 self.__update_list()
             client.disconnect().addCallback(on_disconnect)
@@ -481,7 +481,7 @@
         if host not in ("127.0.0.1", "localhost"):
             return
 
-        if status in ("Online", "Connected"):
+        if status in (_("Online"), _("Connected")):
             # We need to stop this daemon
             # Call the shutdown method on the daemon
             def on_daemon_shutdown(d):
@@ -498,7 +498,7 @@
 
                 c.connect(host, port, user, password).addCallback(on_connect, 
c)
 
-        elif status == "Offline":
+        elif status == _("Offline"):
             client.start_daemon(port, deluge.configmanager.get_config_dir())
             reactor.callLater(2.0, self.__update_list)
 



--~--~---------~--~----~------------~-------~--~----~
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