diff --git a/data/glade/preferences_window.glade b/data/glade/preferences_window.glade index ca87fb540..8f7df6a7f 100644 --- a/data/glade/preferences_window.glade +++ b/data/glade/preferences_window.glade @@ -211,37 +211,62 @@ 6 6 - - 50 + True - Detached roster with detached chats -Detached roster with single chat -Single window for everything -Detached roster with chat grouped by account -Detached roster with chat grouped by type - + 0 + 1 + _Window behavior: + True + one_window_type_combobox + + + 1 + 2 + GTK_FILL + + + + + True + 1 2 - 1 - 2 - + + True + If not disabled, Gajim will replace ascii smilies like ':)' with equivalent animated or static graphical emoticons + + + True + 0 + 1 + _Emoticons: + True + + + + + GTK_FILL + + + + True - If checked, Gajim will highlight spelling errors in input fields of chat windows. If no language is explicitly set via right click on the input field, the default language will be used for this contact or group chat. - _Highlight misspelled words + Hide all buttons in chat windows + Ma_ke message windows compact True 0 True - + 2 - 4 - 5 + 2 + 3 GTK_FILL @@ -264,63 +289,38 @@ Detached roster with chat grouped by type - + True - Hide all buttons in chat windows - Ma_ke message windows compact + If checked, Gajim will highlight spelling errors in input fields of chat windows. If no language is explicitly set via right click on the input field, the default language will be used for this contact or group chat. + _Highlight misspelled words True 0 True - + 2 - 2 - 3 + 4 + 5 GTK_FILL - + + 50 True - If not disabled, Gajim will replace ascii smilies like ':)' with equivalent animated or static graphical emoticons - - - True - 0 - 1 - _Emoticons: - True - - - - - GTK_FILL - - - - - True - + Detached roster with detached chats +Detached roster with single chat +Single window for everything +Detached roster with chat grouped by account +Detached roster with chat grouped by type + 1 2 - - - - - True - 0 - 1 - _Window behavior: - True - one_window_type_combobox - - 1 2 - GTK_FILL @@ -614,35 +614,55 @@ Always 6 12 - + True 6 - + + True + 6 + + + True + True + Play _sounds + True + 0 + True + + + + False + + + + + True + True + True + Ma_nage... + True + 0 + + + + False + 1 + + + + + + True True - Play _sounds + Allow sound when I'm _busy True 0 True - + - False - - - - - True - True - True - Ma_nage... - True - 0 - - - - False 1 @@ -710,33 +730,18 @@ Always 6 6 - + True All chat states Composing only Disabled - + 1 2 - - - - - True - Gajim can send and receive meta-information related to a conversation you may have with a contact. Here you can specify which chatstates you want to send to the other party. - - - True - 0 - _Send chat state notifications: - True - - - - - GTK_FILL + 1 + 2 @@ -759,18 +764,33 @@ Disabled - + + True + Gajim can send and receive meta-information related to a conversation you may have with a contact. Here you can specify which chatstates you want to send to the other party. + + + True + 0 + _Send chat state notifications: + True + + + + + GTK_FILL + + + + True All chat states Composing only Disabled - + 1 2 - 1 - 2 @@ -834,37 +854,90 @@ Disabled 12 6 - + True True - The auto not available status message. If empty, Gajim will not change the current status message -$S will be replaced by previous status message -$T will be replaced by auto-not-available timeout - + If checked, Gajim will change status to Away when the computer is unused. + _Away after: + True + 0 + True + - 3 - 4 - 1 - 2 + GTK_FILL - + True True - The auto away status message. If empty, Gajim will not change the current status message -$S will be replaced by previous status message -$T will be replaced by auto-away timeout - + If checked, Gajim will change status to Not Available when the computer has not been used even longer + _Not available after: + True + 0 + True + - 3 - 4 + 1 + 2 + GTK_FILL + + + True + 0 + minutes + + + 2 + 3 + GTK_FILL + + + + + + True + 0 + minutes + + + 2 + 3 + 1 + 2 + GTK_FILL + + + + + + True + 1 + 0 + + + 50 + True + True + 12 1 720 1 10 10 + 1 + + + + + + 1 + 2 + GTK_FILL + GTK_FILL + + True @@ -891,87 +964,34 @@ $T will be replaced by auto-away timeout - - True - 1 - 0 - - - 50 - True - True - 12 1 720 1 10 10 - 1 - - - - - - 1 - 2 - GTK_FILL - GTK_FILL - - - - - True - 0 - minutes - - - 2 - 3 - 1 - 2 - GTK_FILL - - - - - - True - 0 - minutes - - - 2 - 3 - GTK_FILL - - - - - + True True - If checked, Gajim will change status to Not Available when the computer has not been used even longer - _Not available after: - True - 0 - True - + The auto away status message. If empty, Gajim will not change the current status message +$S will be replaced by previous status message +$T will be replaced by auto-away timeout + - 1 - 2 - GTK_FILL + 3 + 4 - + True True - If checked, Gajim will change status to Away when the computer is unused. - _Away after: - True - 0 - True - + The auto not available status message. If empty, Gajim will not change the current status message +$S will be replaced by previous status message +$T will be replaced by auto-not-available timeout + - GTK_FILL + 3 + 4 + 1 + 2 @@ -1131,46 +1151,6 @@ $T will be replaced by auto-away timeout - - - True - True - GTK_POLICY_NEVER - GTK_POLICY_NEVER - GTK_SHADOW_IN - - - True - True - 3 - GTK_WRAP_WORD - - - - - 1 - 2 - GTK_FILL - - - - - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - - - True - True - False - - - - - - True @@ -1209,6 +1189,46 @@ $T will be replaced by auto-away timeout GTK_FILL + + + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + + + True + True + False + + + + + + + + + True + True + GTK_POLICY_NEVER + GTK_POLICY_NEVER + GTK_SHADOW_IN + + + True + True + 3 + GTK_WRAP_WORD + + + + + 1 + 2 + GTK_FILL + + @@ -1271,14 +1291,15 @@ $T will be replaced by auto-away timeout - + True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Chat message: + True + 0 + - GTK_FILL - GTK_FILL + 1 + 2 @@ -1299,15 +1320,14 @@ $T will be replaced by auto-away timeout - + True - True - 0 - + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Chat message: - 1 - 2 + GTK_FILL + GTK_FILL @@ -1357,18 +1377,62 @@ $T will be replaced by auto-away timeout - + True - 0 - T_heme: + True + If checked, Gajim will use protocol-specific status icons. (eg. A contact from MSN will have the equivalent msn icon for status online, away, busy, etc...) + Use _transports icons True - theme_combobox + 0 + True + + 1 + 3 + 2 + 3 + + + + + True + + + + 1 + 2 + 1 + 2 GTK_FILL GTK_FILL + + + True + 0 + Status _iconset: + True + iconset_combobox + + + 1 + 2 + GTK_FILL + GTK_FILL + + + + + True + + + + 1 + 2 + + True @@ -1387,62 +1451,18 @@ $T will be replaced by auto-away timeout - - True - - - - 1 - 2 - - - - + True 0 - Status _iconset: + T_heme: True - iconset_combobox + theme_combobox - 1 - 2 GTK_FILL GTK_FILL - - - True - - - - 1 - 2 - 1 - 2 - GTK_FILL - GTK_FILL - - - - - True - True - If checked, Gajim will use protocol-specific status icons. (eg. A contact from MSN will have the equivalent msn icon for status online, away, busy, etc...) - Use _transports icons - True - 0 - True - - - - 1 - 3 - 2 - 3 - - @@ -1481,6 +1501,135 @@ $T will be replaced by auto-away timeout 4 12 6 + + + True + 0 + _Incoming message: + True + GTK_JUSTIFY_CENTER + True + incoming_msg_colorbutton + + + GTK_FILL + + + + + + True + True + True + True + True + 0 + + + + 1 + 2 + + + + + + + True + 0 + _Outgoing message: + True + GTK_JUSTIFY_CENTER + True + outgoing_msg_colorbutton + + + 2 + 3 + GTK_FILL + + + + + + True + True + 0 + + + + 3 + 4 + GTK_FILL + + + + + + True + 0 + _Status message: + True + GTK_JUSTIFY_CENTER + True + status_msg_colorbutton + + + 1 + 2 + GTK_FILL + + + + + + True + True + 0 + + + + 1 + 2 + 1 + 2 + + + + + + + True + 0 + _URL highlight: + True + url_msg_colorbutton + + + 2 + 3 + 1 + 2 + GTK_FILL + + + + + + True + True + 0 + + + + 3 + 4 + 1 + 2 + GTK_FILL + + + True @@ -1549,135 +1698,6 @@ $T will be replaced by auto-away timeout GTK_FILL - - - True - True - 0 - - - - 3 - 4 - 1 - 2 - GTK_FILL - - - - - - True - 0 - _URL highlight: - True - url_msg_colorbutton - - - 2 - 3 - 1 - 2 - GTK_FILL - - - - - - True - True - 0 - - - - 1 - 2 - 1 - 2 - - - - - - - True - 0 - _Status message: - True - GTK_JUSTIFY_CENTER - True - status_msg_colorbutton - - - 1 - 2 - GTK_FILL - - - - - - True - True - 0 - - - - 3 - 4 - GTK_FILL - - - - - - True - 0 - _Outgoing message: - True - GTK_JUSTIFY_CENTER - True - outgoing_msg_colorbutton - - - 2 - 3 - GTK_FILL - - - - - - True - True - True - True - True - 0 - - - - 1 - 2 - - - - - - - True - 0 - _Incoming message: - True - GTK_JUSTIFY_CENTER - True - incoming_msg_colorbutton - - - GTK_FILL - - - @@ -1762,56 +1782,16 @@ Custom 12 6 - - True - 0 - _Browser: - True - custom_browser_entry - - - GTK_FILL - - - - - - True - 0 - _Mail client: - True - custom_mail_client_entry - - - 1 - 2 - GTK_FILL - - - - - + True True - - - - 1 - 2 - 1 - 2 - - - - - - True - True - + 1 2 + 2 + 3 @@ -1831,16 +1811,56 @@ Custom - + True True - + 1 2 - 2 - 3 + + + + + + True + True + + + + 1 + 2 + 1 + 2 + + + + + + True + 0 + _Mail client: + True + custom_mail_client_entry + + + 1 + 2 + GTK_FILL + + + + + + True + 0 + _Browser: + True + custom_browser_entry + + + GTK_FILL @@ -1904,19 +1924,18 @@ Custom 6 6 - + True True - If checked, Gajim will keep logs for encrypted messages. Please note that when using E2E encryption the remote party has to agree on logging, else the messages will not be logged. - Log _encrypted chat session + If checked, Gajim will ignore incoming events from unauthorized contacts. Use with caution, because it blocks all messages from any contact that is not in the roster + _Ignore events from contacts not in the roster True 0 True - + - 2 - 3 + GTK_FILL @@ -1936,18 +1955,19 @@ Custom - + True True - If checked, Gajim will ignore incoming events from unauthorized contacts. Use with caution, because it blocks all messages from any contact that is not in the roster - _Ignore events from contacts not in the roster + If checked, Gajim will keep logs for encrypted messages. Please note that when using E2E encryption the remote party has to agree on logging, else the messages will not be logged. + Log _encrypted chat session True 0 True - + - GTK_FILL + 2 + 3 diff --git a/src/common/config.py b/src/common/config.py index ed05f4167..8cc52b8c8 100644 --- a/src/common/config.py +++ b/src/common/config.py @@ -79,6 +79,7 @@ class Config: 'notify_on_signout': [ opt_bool, False ], 'notify_on_new_message': [ opt_bool, True ], 'autopopupaway': [ opt_bool, False ], + 'sounddnd': [ opt_bool, False, _('Play sound when user is busy')], 'use_notif_daemon': [ opt_bool, True , _('Use D-Bus and Notification-Daemon to show notifications') ], 'showoffline': [ opt_bool, False ], 'show_only_chat_and_online': [ opt_bool, False, _('Show only online and free for chat contacts in roster.')], diff --git a/src/common/helpers.py b/src/common/helpers.py index 735855d53..7280090d3 100644 --- a/src/common/helpers.py +++ b/src/common/helpers.py @@ -1022,7 +1022,7 @@ def allow_popup_window(account, advanced_notif_num = None): return True return False -def allow_sound_notification(sound_event, advanced_notif_num = None): +def allow_sound_notification(account, sound_event, advanced_notif_num=None): if advanced_notif_num is not None: sound = gajim.config.get_per('notifications', str(advanced_notif_num), 'sound') @@ -1030,7 +1030,9 @@ def allow_sound_notification(sound_event, advanced_notif_num = None): return True if sound == 'no': return False - if gajim.config.get_per('soundevents', sound_event, 'enabled'): + if gajim.config.get('sounddnd') or gajim.connections[account].connected != \ + gajim.SHOW_LIST.index('dnd') and gajim.config.get_per('soundevents', + sound_event, 'enabled'): return True return False diff --git a/src/config.py b/src/config.py index 43e1f404d..a2a511402 100644 --- a/src/config.py +++ b/src/config.py @@ -87,6 +87,7 @@ class PreferencesWindow: 'notify_on_signout_checkbutton') self.auto_popup_away_checkbutton = self.xml.get_widget( 'auto_popup_away_checkbutton') + self.sound_dnd_checkbutton = self.xml.get_widget('sound_dnd_checkbutton') self.auto_away_checkbutton = self.xml.get_widget('auto_away_checkbutton') self.auto_away_time_spinbutton = self.xml.get_widget( 'auto_away_time_spinbutton') @@ -301,6 +302,10 @@ class PreferencesWindow: st = gajim.config.get('autopopupaway') self.auto_popup_away_checkbutton.set_active(st) + # sounddnd + st = gajim.config.get('sounddnd') + self.sound_dnd_checkbutton.set_active(st) + # Systray systray_combobox = self.xml.get_widget('systray_combobox') if gajim.config.get('trayicon') == 'never': @@ -764,6 +769,9 @@ class PreferencesWindow: def on_auto_popup_away_checkbutton_toggled(self, widget): self.on_checkbutton_toggled(widget, 'autopopupaway') + def on_sound_dnd_checkbutton_toggled(self, widget): + self.on_checkbutton_toggled(widget, 'sounddnd') + def on_systray_combobox_changed(self, widget): active = widget.get_active() if active == 0: diff --git a/src/notify.py b/src/notify.py index 97deface2..f70e55c17 100644 --- a/src/notify.py +++ b/src/notify.py @@ -184,16 +184,16 @@ def notify(event, jid, account, parameters, advanced_notif_num=None): if helpers.allow_showing_notification(account, 'notify_on_new_message', advanced_notif_num, is_first_message): do_popup = True - if is_first_message and helpers.allow_sound_notification( + if is_first_message and helpers.allow_sound_notification(account, 'first_message_received', advanced_notif_num): do_sound = True elif not is_first_message and focused and \ - helpers.allow_sound_notification('next_message_received_focused', + helpers.allow_sound_notification(account, 'next_message_received_focused', advanced_notif_num): do_sound = True elif not is_first_message and not focused and \ - helpers.allow_sound_notification('next_message_received_unfocused', - advanced_notif_num): + helpers.allow_sound_notification(account, + 'next_message_received_unfocused', advanced_notif_num): do_sound = True else: print '*Event not implemeted yet*'