1
0
mirror of https://github.com/gryf/wicd.git synced 2025-12-23 22:52:33 +01:00

Reworded notifications and added new entries to translations.py

This commit is contained in:
Adam Blackburn
2009-05-02 12:43:43 +08:00
parent 7aa0027c39
commit 176be0b9d3
2 changed files with 13 additions and 8 deletions

View File

@@ -226,4 +226,6 @@ language['raw_screen_arg'] = _('use urwid\'s raw screen controller')
language['ok'] = _('OK')
language['cancel'] = _('Cancel')
language['disconnected'] = _('Disconnected')
language['connection_established'] = _('Connection established')
language['establishing_connection'] = _('Establishing connection...')

View File

@@ -166,13 +166,13 @@ class TrayIcon(object):
handle_no_dbus()
self.set_not_connected_state()
def _show_notification(self, status_string):
def _show_notification(self, title, details):
if self.should_notify:
if not self._last_bubble:
self._last_bubble = pynotify.Notification("Network status", status_string)
self._last_bubble = pynotify.Notification(title, details)
self._last_bubble.show()
else:
self._last_bubble.update("Network status", status_string)
self._last_bubble.update(title, details)
self._last_bubble.show()
self.should_notify = False
@@ -190,7 +190,8 @@ class TrayIcon(object):
status_string = language['connected_to_wired'].replace('$A',
wired_ip)
self.tr.set_tooltip(status_string)
self._show_notification(status_string)
self._show_notification(language['wired_network'],
language['connection_established'])
@catchdbus
def set_wireless_state(self, info):
@@ -210,7 +211,8 @@ class TrayIcon(object):
.replace('$C', str(wireless_ip)))
self.tr.set_tooltip(status_string)
self.set_signal_image(int(strength), lock)
self._show_notification(status_string)
self._show_notification(self.network,
language['connection_established'])
def set_connecting_state(self, info):
@@ -223,7 +225,8 @@ class TrayIcon(object):
cur_network + "..."
self.tr.set_tooltip(status_string)
self.tr.set_from_file(os.path.join(wpath.images, "no-signal.png"))
self._show_notification(status_string)
self._show_notification(cur_network,
language['establishing_connection'])
@catchdbus
def set_not_connected_state(self, info=None):
@@ -237,7 +240,7 @@ class TrayIcon(object):
else:
status = language['not_connected']
self.tr.set_tooltip(status)
self._show_notification(status)
self._show_notification(language['disconnected'], None)
@catchdbus
def update_tray_icon(self, state=None, info=None):