mirror of
https://github.com/gryf/wicd.git
synced 2026-02-17 23:45:45 +01:00
Reworded notifications and added new entries to translations.py
This commit is contained in:
@@ -226,4 +226,6 @@ language['raw_screen_arg'] = _('use urwid\'s raw screen controller')
|
|||||||
language['ok'] = _('OK')
|
language['ok'] = _('OK')
|
||||||
language['cancel'] = _('Cancel')
|
language['cancel'] = _('Cancel')
|
||||||
|
|
||||||
|
language['disconnected'] = _('Disconnected')
|
||||||
|
language['connection_established'] = _('Connection established')
|
||||||
|
language['establishing_connection'] = _('Establishing connection...')
|
||||||
|
|||||||
@@ -166,13 +166,13 @@ class TrayIcon(object):
|
|||||||
handle_no_dbus()
|
handle_no_dbus()
|
||||||
self.set_not_connected_state()
|
self.set_not_connected_state()
|
||||||
|
|
||||||
def _show_notification(self, status_string):
|
def _show_notification(self, title, details):
|
||||||
if self.should_notify:
|
if self.should_notify:
|
||||||
if not self._last_bubble:
|
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()
|
self._last_bubble.show()
|
||||||
else:
|
else:
|
||||||
self._last_bubble.update("Network status", status_string)
|
self._last_bubble.update(title, details)
|
||||||
self._last_bubble.show()
|
self._last_bubble.show()
|
||||||
|
|
||||||
self.should_notify = False
|
self.should_notify = False
|
||||||
@@ -190,7 +190,8 @@ class TrayIcon(object):
|
|||||||
status_string = language['connected_to_wired'].replace('$A',
|
status_string = language['connected_to_wired'].replace('$A',
|
||||||
wired_ip)
|
wired_ip)
|
||||||
self.tr.set_tooltip(status_string)
|
self.tr.set_tooltip(status_string)
|
||||||
self._show_notification(status_string)
|
self._show_notification(language['wired_network'],
|
||||||
|
language['connection_established'])
|
||||||
|
|
||||||
@catchdbus
|
@catchdbus
|
||||||
def set_wireless_state(self, info):
|
def set_wireless_state(self, info):
|
||||||
@@ -210,7 +211,8 @@ class TrayIcon(object):
|
|||||||
.replace('$C', str(wireless_ip)))
|
.replace('$C', str(wireless_ip)))
|
||||||
self.tr.set_tooltip(status_string)
|
self.tr.set_tooltip(status_string)
|
||||||
self.set_signal_image(int(strength), lock)
|
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):
|
def set_connecting_state(self, info):
|
||||||
@@ -223,7 +225,8 @@ class TrayIcon(object):
|
|||||||
cur_network + "..."
|
cur_network + "..."
|
||||||
self.tr.set_tooltip(status_string)
|
self.tr.set_tooltip(status_string)
|
||||||
self.tr.set_from_file(os.path.join(wpath.images, "no-signal.png"))
|
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
|
@catchdbus
|
||||||
def set_not_connected_state(self, info=None):
|
def set_not_connected_state(self, info=None):
|
||||||
@@ -237,7 +240,7 @@ class TrayIcon(object):
|
|||||||
else:
|
else:
|
||||||
status = language['not_connected']
|
status = language['not_connected']
|
||||||
self.tr.set_tooltip(status)
|
self.tr.set_tooltip(status)
|
||||||
self._show_notification(status)
|
self._show_notification(language['disconnected'], None)
|
||||||
|
|
||||||
@catchdbus
|
@catchdbus
|
||||||
def update_tray_icon(self, state=None, info=None):
|
def update_tray_icon(self, state=None, info=None):
|
||||||
|
|||||||
Reference in New Issue
Block a user