Ticket #1652: 0001-Connection-Info-Fix.patch

File 0001-Connection-Info-Fix.patch, 2.1 KB (added by Dcastelo, 14 years ago)
  • extensions/deviceicon/network.py

    From 30b37223ffbe72663bc8c0ca7300d616fd44553d Mon Sep 17 00:00:00 2001
    From: latu <latu@localhost.localdomain>
    Date: Thu, 11 Feb 2010 11:29:05 -0200
    Subject: [PATCH] Connection Info Fix
    
    ---
     extensions/deviceicon/network.py |   14 +++++++-------
     1 files changed, 7 insertions(+), 7 deletions(-)
    
    diff --git a/extensions/deviceicon/network.py b/extensions/deviceicon/network.py
    index 2e3671b..2f27097 100644
    a b class GsmDeviceView(TrayIcon): 
    816816                connection.set_connected()
    817817                self._connection_timestamp =  time.time() - \
    818818                        connection.get_settings().connection.timestamp
    819                 self._connection_time_handler = gobject.timeout_add( \
    820                         1000, self.__connection_timecount_cb)
     819                self._connection_time_handler = gobject.timeout_add_seconds( \
     820                        1, self.__connection_timecount_cb)
    821821                self._update_stats(0, 0)
    822822                self._update_connection_time()               
    823823                self._palette.info_box.show()
    824824
    825         if state is network.DEVICE_STATE_DISCONNECTED:
     825        elif state is network.DEVICE_STATE_DISCONNECTED:
    826826            gsm_state = _GSM_STATE_DISCONNECTED
    827827            self._connection_timestamp = 0
    828828            if self._connection_time_handler is not None:
    class GsmDeviceView(TrayIcon): 
    852852        self._update_stats(in_bytes, out_bytes)
    853853
    854854    def _update_stats(self, in_bytes, out_bytes):
    855         in_kbytes = in_bytes / 1024
    856         out_kbytes = out_bytes / 1024
    857         text = _("Data sent %d kb / received %d kb") % (out_kbytes, in_kbytes)
     855        in_KBytes = in_bytes / 1024
     856        out_KBytes = out_bytes / 1024
     857        text = _("Data sent %d KB / received %d KB") % (out_KBytes, in_KBytes)
    858858        self._palette.data_label.set_text(text)
    859859
    860860    def __connection_timecount_cb(self):
    861861        self._connection_timestamp = self._connection_timestamp + 1
    862         self._update_connectiontime()
     862        self._update_connection_time()
    863863        return True
    864864
    865865    def _update_connection_time(self):