Skip to content

Commit

Permalink
Add an option to disable the notifications about network errors(still…
Browse files Browse the repository at this point in the history
… notifies when the login is not yet completed).
  • Loading branch information
BonsaiDen committed May 3, 2010
1 parent bfa4cc4 commit c8a0407
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 13 deletions.
25 changes: 15 additions & 10 deletions atarashii/usr/share/atarashii/settings.glade
Expand Up @@ -664,6 +664,19 @@
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="notify_network">
<property name="label" translatable="yes">Notify about network errors</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="notify_overlay">
<property name="label" translatable="yes">Overlay playing movies</property>
Expand All @@ -674,7 +687,7 @@
</object>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
<property name="position">2</property>
</packing>
</child>
<child>
Expand All @@ -687,7 +700,7 @@
</object>
<packing>
<property name="expand">False</property>
<property name="position">2</property>
<property name="position">3</property>
</packing>
</child>
<child>
Expand Down Expand Up @@ -872,14 +885,6 @@
</object>
<packing>
<property name="expand">False</property>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="fill2">
<property name="visible">True</property>
</object>
<packing>
<property name="position">4</property>
</packing>
</child>
Expand Down
14 changes: 11 additions & 3 deletions atarashii/usr/share/pyshared/atarashii/gui.py
Expand Up @@ -816,8 +816,11 @@ def show_box(self, code, rate_error, is_visible):
# overload warning
if code == HT_503_SERVICE_UNAVAILABLE:
if not self.main.status(ST_NETWORK_FAILED):
self.notifcation(MESSAGE_WARNING,
lang.tray_warning_overload)
if self.settings.is_true('notify_network', True) \
or not self.main.status(ST_LOGIN_COMPLETE):

self.notifcation(MESSAGE_WARNING,
lang.tray_warning_overload)

self.main.set_status(ST_NETWORK_FAILED)

Expand All @@ -840,7 +843,12 @@ def show_box(self, code, rate_error, is_visible):
info = lang.warning_network

if not self.main.status(ST_NETWORK_FAILED):
self.notifcation(MESSAGE_WARNING, lang.tray_warning_network)
if self.settings.is_true('notify_network', True) \
or not self.main.status(ST_LOGIN_COMPLETE):

self.notifcation(MESSAGE_WARNING,
lang.tray_warning_network)

self.main.set_status(ST_NETWORK_FAILED)

# Don't override send errors and other stuff with 'unimportant'
Expand Down
1 change: 1 addition & 0 deletions atarashii/usr/share/pyshared/atarashii/lang/lang_de.py
Expand Up @@ -235,6 +235,7 @@
'settings_color_theme': 'Farbschema:',

'settings_notifications_enable': 'Benachrichtigungen aktivieren',
'settings_notifications_network': 'Über Netzwerkfehler benachrichtigen',
'settings_notifications_overlay': 'Abspielende Filme überlagern',
'settings_notifications_sound': 'Sounds aktivieren',
'settings_file_tweets': 'Tweets:',
Expand Down
1 change: 1 addition & 0 deletions atarashii/usr/share/pyshared/atarashii/lang/lang_en.py
Expand Up @@ -229,6 +229,7 @@
'settings_color_theme': 'Color scheme:',

'settings_notifications_enable': 'Enable notifications',
'settings_notifications_network': 'Notify on network errors',
'settings_notifications_overlay': 'Overlay playing movies',
'settings_notifications_sound': 'Activate sounds',
'settings_file_tweets': 'Tweets:',
Expand Down
5 changes: 5 additions & 0 deletions atarashii/usr/share/pyshared/atarashii/settings_dialog_sub.py
Expand Up @@ -91,6 +91,7 @@ def save_notify_sounds(self, settings):

settings['notify'] = self.notify.get_active()
settings['notify_overlay'] = self.overlay.get_active()
settings['notify_network'] = self.notify_network.get_active()
settings['sound'] = self.sound.get_active()


Expand Down Expand Up @@ -420,21 +421,25 @@ def select_file(button, snd):

# Notification
self.notify = self.get('notify')
self.notify_network = self.get('notify_network')
self.overlay = self.get('notify_overlay')
self.sound = self.get('sound')
self.notify.set_label(lang.settings_notifications_enable)
self.notify_network.set_label(lang.settings_notifications_network)
self.overlay.set_label(lang.settings_notifications_overlay)
self.sound.set_label(lang.settings_notifications_sound)

self.notify.set_active(settings.is_true('notify'))
self.overlay.set_active(settings.is_true('notify_overlay', True))
self.notify_network.set_active(settings.is_true('notify_network', True))
self.sound.set_active(settings.is_true('sound'))
self.notify.set_sensitive(True)

def toggle2(*args):
self.get('soundfiles').set_sensitive(self.sound.get_active())

def toggle(*args):
self.notify_network.set_sensitive(self.notify.get_active())
self.overlay.set_sensitive(self.notify.get_active())
self.sound.set_sensitive(self.notify.get_active())
self.get('soundfiles').set_sensitive(self.notify.get_active() \
Expand Down

0 comments on commit c8a0407

Please sign in to comment.