Remove unnecessary translation from connection manager

This commit is contained in:
Calum Lind 2012-03-24 00:24:10 +00:00
parent 7625812c8c
commit e2608a0ac9
1 changed files with 19 additions and 19 deletions

View File

@ -70,9 +70,9 @@ HOSTLIST_PIXBUFS = [
] ]
HOSTLIST_STATUS = [ HOSTLIST_STATUS = [
_("Offline"), "Offline",
_("Online"), "Online",
_("Connected") "Connected"
] ]
def cell_render_host(column, cell, model, row, data): def cell_render_host(column, cell, model, row, data):
@ -253,7 +253,7 @@ class ConnectionManager(component.Component):
self.liststore[row][HOSTLIST_COL_PORT] = port self.liststore[row][HOSTLIST_COL_PORT] = port
self.liststore[row][HOSTLIST_COL_USER] = username self.liststore[row][HOSTLIST_COL_USER] = username
self.liststore[row][HOSTLIST_COL_PASS] = password 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 # Save the host list to file
self.__save_hostlist() self.__save_hostlist()
@ -288,7 +288,7 @@ class ConnectionManager(component.Component):
self.liststore[new_row][HOSTLIST_COL_PORT] = host[2] self.liststore[new_row][HOSTLIST_COL_PORT] = host[2]
self.liststore[new_row][HOSTLIST_COL_USER] = host[3] self.liststore[new_row][HOSTLIST_COL_USER] = host[3]
self.liststore[new_row][HOSTLIST_COL_PASS] = host[4] 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"
self.liststore[new_row][HOSTLIST_COL_VERSION] = "" self.liststore[new_row][HOSTLIST_COL_VERSION] = ""
def __get_host_row(self, host_id): def __get_host_row(self, host_id):
@ -317,7 +317,7 @@ class ConnectionManager(component.Component):
if not self.running: if not self.running:
return return
if row: if row:
row[HOSTLIST_COL_STATUS] = _("Online") row[HOSTLIST_COL_STATUS] = "Online"
row[HOSTLIST_COL_VERSION] = info row[HOSTLIST_COL_VERSION] = info
self.__update_buttons() self.__update_buttons()
c.disconnect() c.disconnect()
@ -326,7 +326,7 @@ class ConnectionManager(component.Component):
if not self.running: if not self.running:
return return
if row: if row:
row[HOSTLIST_COL_STATUS] = _("Offline") row[HOSTLIST_COL_STATUS] = "Offline"
self.__update_buttons() self.__update_buttons()
c.disconnect() c.disconnect()
@ -339,7 +339,7 @@ class ConnectionManager(component.Component):
return return
row = self.__get_host_row(host_id) row = self.__get_host_row(host_id)
if row: if row:
row[HOSTLIST_COL_STATUS] = _("Offline") row[HOSTLIST_COL_STATUS] = "Offline"
row[HOSTLIST_COL_VERSION] = "" row[HOSTLIST_COL_VERSION] = ""
self.__update_buttons() self.__update_buttons()
@ -358,7 +358,7 @@ class ConnectionManager(component.Component):
row[HOSTLIST_COL_VERSION] = info row[HOSTLIST_COL_VERSION] = info
self.__update_buttons() self.__update_buttons()
row[HOSTLIST_COL_STATUS] = _("Connected") row[HOSTLIST_COL_STATUS] = "Connected"
log.debug("Query daemon's info") log.debug("Query daemon's info")
client.daemon.info().addCallback(on_info) client.daemon.info().addCallback(on_info)
continue continue
@ -430,24 +430,24 @@ class ConnectionManager(component.Component):
self.builder.get_object("button_removehost").set_sensitive(True) self.builder.get_object("button_removehost").set_sensitive(True)
# See if this is the currently connected host # 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 # Display a disconnect button if we're connected to this host
self.builder.get_object("button_connect").set_label("gtk-disconnect") self.builder.get_object("button_connect").set_label("gtk-disconnect")
self.builder.get_object("button_removehost").set_sensitive(False) self.builder.get_object("button_removehost").set_sensitive(False)
else: else:
self.builder.get_object("button_connect").set_label("gtk-connect") self.builder.get_object("button_connect").set_label("gtk-connect")
if status == _("Offline") and not localhost: if status == "Offline" and not localhost:
self.builder.get_object("button_connect").set_sensitive(False) self.builder.get_object("button_connect").set_sensitive(False)
# Check to see if the host is online # Check to see if the host is online
if status == _("Connected") or status == _("Online"): if status == "Connected" or status == "Online":
self.builder.get_object("image_startdaemon").set_from_stock( self.builder.get_object("image_startdaemon").set_from_stock(
gtk.STOCK_STOP, gtk.ICON_SIZE_MENU) gtk.STOCK_STOP, gtk.ICON_SIZE_MENU)
self.builder.get_object("label_startdaemon").set_text( self.builder.get_object("label_startdaemon").set_text(
_("_Stop Daemon")) _("_Stop Daemon"))
# Update the start daemon button if the selected host is localhost # 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 # The localhost is not online
self.builder.get_object("image_startdaemon").set_from_stock( self.builder.get_object("image_startdaemon").set_from_stock(
gtk.STOCK_EXECUTE, gtk.ICON_SIZE_MENU) gtk.STOCK_EXECUTE, gtk.ICON_SIZE_MENU)
@ -562,7 +562,7 @@ class ConnectionManager(component.Component):
if not row: if not row:
return return
status = model[row][HOSTLIST_COL_STATUS] status = model[row][HOSTLIST_COL_STATUS]
if status == _("Connected"): if status == "Connected":
def on_disconnect(reason): def on_disconnect(reason):
self.__update_list() self.__update_list()
client.disconnect().addCallback(on_disconnect) client.disconnect().addCallback(on_disconnect)
@ -574,7 +574,7 @@ class ConnectionManager(component.Component):
user = model[row][HOSTLIST_COL_USER] user = model[row][HOSTLIST_COL_USER]
password = model[row][HOSTLIST_COL_PASS] password = model[row][HOSTLIST_COL_PASS]
if status == _("Offline") and \ if status == "Offline" and \
self.builder.get_object("chk_autostart").get_active() and \ self.builder.get_object("chk_autostart").get_active() and \
host in ("127.0.0.1", "localhost"): host in ("127.0.0.1", "localhost"):
if not self.start_daemon(port, deluge.configmanager.get_config_dir()): if not self.start_daemon(port, deluge.configmanager.get_config_dir()):
@ -625,7 +625,7 @@ class ConnectionManager(component.Component):
log.debug("on_button_edithost_clicked") log.debug("on_button_edithost_clicked")
model, row = self.hostlist.get_selection().get_selected() model, row = self.hostlist.get_selection().get_selected()
status = model[row][HOSTLIST_COL_STATUS] status = model[row][HOSTLIST_COL_STATUS]
if status == _("Connected"): if status == "Connected":
def on_disconnect(reason): def on_disconnect(reason):
self.__update_list() self.__update_list()
client.disconnect().addCallback(on_disconnect) client.disconnect().addCallback(on_disconnect)
@ -655,7 +655,7 @@ class ConnectionManager(component.Component):
self.liststore[row][HOSTLIST_COL_PORT] = port_spinbutton.get_value_as_int() self.liststore[row][HOSTLIST_COL_PORT] = port_spinbutton.get_value_as_int()
self.liststore[row][HOSTLIST_COL_USER] = username_entry.get_text() self.liststore[row][HOSTLIST_COL_USER] = username_entry.get_text()
self.liststore[row][HOSTLIST_COL_PASS] = password_entry.get_text() self.liststore[row][HOSTLIST_COL_PASS] = password_entry.get_text()
self.liststore[row][HOSTLIST_COL_STATUS] = _("Offline") self.liststore[row][HOSTLIST_COL_STATUS] = "Offline"
# Save the host list to file # Save the host list to file
self.__save_hostlist() self.__save_hostlist()
@ -706,7 +706,7 @@ class ConnectionManager(component.Component):
if host not in ("127.0.0.1", "localhost"): if host not in ("127.0.0.1", "localhost"):
return return
if status in (_("Online"), _("Connected")): if status in ("Online", "Connected"):
# We need to stop this daemon # We need to stop this daemon
# Call the shutdown method on the daemon # Call the shutdown method on the daemon
def on_daemon_shutdown(d): def on_daemon_shutdown(d):
@ -724,7 +724,7 @@ class ConnectionManager(component.Component):
c.connect(host, port, user, password).addCallback(on_connect, c) c.connect(host, port, user, password).addCallback(on_connect, c)
elif status == _("Offline"): elif status == "Offline":
self.start_daemon(port, deluge.configmanager.get_config_dir()) self.start_daemon(port, deluge.configmanager.get_config_dir())
reactor.callLater(2.0, self.__update_list) reactor.callLater(2.0, self.__update_list)