diff --git a/data/glade/preferences_window.glade b/data/glade/preferences_window.glade index 73bb13a6b..82eb6b817 100644 --- a/data/glade/preferences_window.glade +++ b/data/glade/preferences_window.glade @@ -1,13 +1,13 @@ - - - + + + 6 Preferences preferences - + True @@ -27,7 +27,7 @@ True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 - GTK_SHADOW_NONE + none True @@ -41,28 +41,29 @@ 6 + Display a_vatars of contacts in roster True True + False If checked, Gajim will display avatars of contacts in roster window and in group chats - Display a_vatars of contacts in roster True - 0 True False False + 0 + Display status _messages of contacts in roster True True + False If checked, Gajim will display status messages of contacts under the contact name in roster window and in group chats - Display status _messages of contacts in roster True - 0 True @@ -74,12 +75,12 @@ + Display m_ood of contacts in roster True True + False If checked, Gajim will display the mood of contacts in the roster window - Display m_ood of contacts in roster True - 0 True @@ -91,12 +92,12 @@ + Display _activity of contacts in roster True True + False If checked, Gajim will display the activity of contacts in the roster window - Display _activity of contacts in roster True - 0 True @@ -108,12 +109,12 @@ + Display _tunes of contacts in roster True True + False If checked, Gajim will display the tunes of contacts in the roster window - Display _tunes of contacts in roster True - 0 True @@ -134,15 +135,16 @@ False + 0 + in _roster True True - in _roster + False True - 0 True @@ -153,11 +155,11 @@ + in _group chats True True - in _group chats + False True - 0 True @@ -188,6 +190,7 @@ False + 0 @@ -195,7 +198,7 @@ True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 - GTK_SHADOW_NONE + none True @@ -255,11 +258,11 @@ - True - Hide all buttons in chat windows Ma_ke message windows compact + True + False + Hide all buttons in chat windows True - 0 True @@ -272,12 +275,12 @@ + _Ignore rich content in incoming messages True True + False Some messages may include rich content (formatting, colors etc). If checked, Gajim will just display the raw message text. - _Ignore rich content in incoming messages True - 0 True @@ -290,11 +293,11 @@ - 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 + True + False + 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. True - 0 True @@ -352,8 +355,8 @@ Detached roster with chat grouped by type General - tab False + tab @@ -365,7 +368,7 @@ Detached roster with chat grouped by type True 0 - GTK_SHADOW_NONE + none True @@ -389,6 +392,7 @@ Detached roster with chat grouped by type False + 0 @@ -405,15 +409,18 @@ Show only in roster + + 0 + + Notify me about contacts that sign _in True True + False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Notify me about contacts that sign _in True - 0 True @@ -423,12 +430,12 @@ Show only in roster + Notify me about contacts that sign _out True True + False Gajim will notify you via a popup window in the bottom right of the screen about contacts that just signed out - Notify me about contacts that sign _out True - 0 True @@ -440,11 +447,11 @@ Show only in roster + Allow popup/notifications when I'm _away/na/busy/invisible True True - Allow popup/notifications when I'm _away/na/busy/invisible + False True - 0 True @@ -460,7 +467,7 @@ Show only in roster False True 0 - GTK_SHADOW_NONE + none True @@ -471,28 +478,29 @@ Show only in roster 6 + Notify on new _GMail email True True + False If checked, Gajim will show a notification when a new e-mail is received via GMail - Notify on new _GMail email True - 0 True False False + 0 + Display _extra email details True True + False If checked, Gajim will also include information about the sender of the new emails - Display _extra email details True - 0 True @@ -534,6 +542,7 @@ Show only in roster False + 0 @@ -561,17 +570,17 @@ Always True + Advanced... True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Advanced... - 0 False False + 0 @@ -599,6 +608,7 @@ Always False + 0 @@ -606,7 +616,7 @@ Always True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 - GTK_SHADOW_NONE + none True @@ -623,26 +633,26 @@ Always 6 + Play _sounds True True - Play _sounds + False True - 0 True False + 0 + Ma_nage... True True True - Ma_nage... True - 0 @@ -651,14 +661,17 @@ Always + + 0 + + Allow sound when I'm _busy True True - Allow sound when I'm _busy + False True - 0 True @@ -699,9 +712,9 @@ Always Notifications - tab 1 False + tab @@ -714,7 +727,7 @@ Always True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 - GTK_SHADOW_NONE + none True @@ -811,6 +824,7 @@ Disabled False + 0 @@ -825,9 +839,9 @@ Disabled Personal Events - tab 2 False + tab @@ -840,7 +854,7 @@ Disabled True True 0 - GTK_SHADOW_NONE + none True @@ -855,12 +869,12 @@ Disabled 6 + _Away after: True True + False If checked, Gajim will change status to Away when the computer is unused. - _Away after: True - 0 True @@ -871,12 +885,12 @@ Disabled + _Not available after: True True + False If checked, Gajim will change status to Not Available when the computer has not been used even longer - _Not available after: True - 0 True @@ -1013,13 +1027,14 @@ $T will be replaced by auto-not-available timeout False False + 0 True 0 - GTK_SHADOW_NONE + none True @@ -1042,34 +1057,36 @@ $T will be replaced by auto-not-available timeout False False + 0 - + True 14 + Sign _in True True - Sign _in + False True - 0 True False False + 0 + Sign _out True True - Sign _out + False True - 0 True @@ -1090,6 +1107,7 @@ $T will be replaced by auto-not-available timeout False False + 0 @@ -1097,9 +1115,9 @@ $T will be replaced by auto-not-available timeout True True If enabled, Gajim will not ask for a status message. The specified default message will be used instead. - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN + automatic + automatic + in True @@ -1134,7 +1152,7 @@ $T will be replaced by auto-not-available timeout True 0 - GTK_SHADOW_NONE + none True @@ -1148,36 +1166,40 @@ $T will be replaced by auto-not-available timeout 2 6 6 - - - True 5 - GTK_BUTTONBOX_START + start + gtk-new True True True - gtk-new + False True - 0 + + False + False + 0 + + gtk-delete True True True - gtk-delete + False True - 0 + False + False 1 @@ -1193,9 +1215,9 @@ $T will be replaced by auto-not-available timeout True True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN + automatic + automatic + in True @@ -1211,15 +1233,15 @@ $T will be replaced by auto-not-available timeout True True - GTK_POLICY_NEVER - GTK_POLICY_NEVER - GTK_SHADOW_IN + never + never + in True True 3 - GTK_WRAP_WORD + word @@ -1229,6 +1251,9 @@ $T will be replaced by auto-not-available timeout GTK_FILL + + + @@ -1259,9 +1284,9 @@ $T will be replaced by auto-not-available timeout Status - tab 3 False + tab @@ -1273,7 +1298,7 @@ $T will be replaced by auto-not-available timeout True 0 - GTK_SHADOW_NONE + none True @@ -1287,14 +1312,11 @@ $T will be replaced by auto-not-available timeout 2 6 6 - - - True True - 0 + False @@ -1304,11 +1326,11 @@ $T will be replaced by auto-not-available timeout + Use system _default True True - Use system _default + False True - 0 True @@ -1330,6 +1352,9 @@ $T will be replaced by auto-not-available timeout GTK_FILL + + + @@ -1348,6 +1373,7 @@ $T will be replaced by auto-not-available timeout False False + 0 @@ -1355,7 +1381,7 @@ $T will be replaced by auto-not-available timeout True GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 - GTK_SHADOW_NONE + none True @@ -1370,20 +1396,14 @@ $T will be replaced by auto-not-available timeout 3 6 6 - - - - - - + Use _transports icons True True + False 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 @@ -1435,12 +1455,12 @@ $T will be replaced by auto-not-available timeout + Ma_nage... True True + False Configure color and font of the interface - Ma_nage... True - 0 @@ -1463,6 +1483,12 @@ $T will be replaced by auto-not-available timeout GTK_FILL + + + + + + @@ -1488,7 +1514,7 @@ $T will be replaced by auto-not-available timeout True 0 - GTK_SHADOW_NONE + none True @@ -1497,7 +1523,7 @@ $T will be replaced by auto-not-available timeout True - 3 + 4 4 12 6 @@ -1505,40 +1531,22 @@ $T will be replaced by auto-not-available timeout True 0 - _Incoming message: + Contact's nickname: True - GTK_JUSTIFY_CENTER - True - incoming_msg_colorbutton + center GTK_FILL - - - True - True - 0 - - - - 1 - 2 - - - - True 0 - _Outgoing message: + Your nickname: True - GTK_JUSTIFY_CENTER - True - outgoing_msg_colorbutton + center 2 @@ -1547,82 +1555,33 @@ $T will be replaced by auto-not-available timeout - - - True - True - 0 - - - - 3 - 4 - GTK_FILL - - - True 0 _Status message: True - GTK_JUSTIFY_CENTER - True - status_msg_colorbutton + center - 1 - 2 + 2 + 3 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 + 2 + 3 GTK_FILL @@ -1636,14 +1595,15 @@ $T will be replaced by auto-not-available timeout False + 0 True True + False False - 0 @@ -1662,6 +1622,7 @@ $T will be replaced by auto-not-available timeout False False + 0 @@ -1690,9 +1651,225 @@ $T will be replaced by auto-not-available timeout 4 + 3 + 4 + GTK_FILL + + + + + True + 0 + Contact's message: + + + 1 + 2 + GTK_FILL + + + + + + True + 0 + Your message: + + + 2 + 3 + 1 + 2 + GTK_FILL + + + + + + True + + + True + True + False + True + + + + 0 + + + + + True + True + True + 0 + #000000000000 + + + + 1 + + + + + 1 + 2 + 1 + 2 + + + + + + + True + + + True + True + False + True + + + + 0 + + + + + True + True + True + 0 + #000000000000 + + + + 1 + + + + + 3 + 4 + 1 + 2 + + + + + + + True + + + True + True + True + 0 + #000000000000 + + + + 0 + + + + + + + + 1 + 2 + + + + + + + True + + + True + True + True + 0 + #000000000000 + + + + 0 + + + + + + + + 1 + 2 2 3 - GTK_FILL + + + + + + + True + + + True + True + True + 0 + #000000000000 + + + + 0 + + + + + + + + 3 + 4 + + + + + + + True + + + True + True + True + 0 + #000000000000 + + + + 0 + + + + + + + + 3 + 4 + 2 + 3 + + @@ -1727,9 +1904,9 @@ $T will be replaced by auto-not-available timeout Style - tab 4 False + tab @@ -1741,7 +1918,7 @@ $T will be replaced by auto-not-available timeout True 0 - GTK_SHADOW_NONE + none True @@ -1761,11 +1938,14 @@ Always use Xfce default applications Custom + + 0 + 0 - GTK_SHADOW_NONE + none True @@ -1898,6 +2078,7 @@ Custom False False + 0 @@ -1905,7 +2086,7 @@ Custom True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 - GTK_SHADOW_NONE + none True @@ -1921,12 +2102,12 @@ Custom 6 + _Ignore events from contacts not in the roster True True + False 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 @@ -1936,12 +2117,12 @@ Custom + Allow _OS information to be sent True True + False If checked, Gajim will allow others to detect the operation system you are using - Allow _OS information to be sent True - 0 True @@ -1952,12 +2133,12 @@ Custom + Log _encrypted chat session True True + False 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 @@ -1991,7 +2172,7 @@ Custom True 0 - GTK_SHADOW_NONE + none True @@ -2003,26 +2184,27 @@ Custom 6 + _Log status changes of contacts True True - _Log status changes of contacts + False True - 0 True False False + 0 + Check on startup if Gajim is the _default Jabber client True True - Check on startup if Gajim is the _default Jabber client + False True - 0 True @@ -2057,7 +2239,7 @@ Custom True 0 - GTK_SHADOW_NONE + none True @@ -2069,7 +2251,7 @@ Custom True True - 0 + False @@ -2088,6 +2270,7 @@ Custom False False + 0 @@ -2138,28 +2321,36 @@ Custom Advanced - tab 5 False + tab + + 0 + True 15 - GTK_BUTTONBOX_END + end + gtk-close True True True - gtk-close + False True - 0 + + False + False + 0 + diff --git a/src/config.py b/src/config.py index 3d999f689..a8e3b0902 100644 --- a/src/config.py +++ b/src/config.py @@ -228,25 +228,8 @@ class PreferencesWindow: st = gajim.config.get('use_transports_iconsets') self.xml.get_widget('transports_iconsets_checkbutton').set_active(st) - # Color for incoming messages - colSt = gajim.config.get('inmsgcolor') - self.xml.get_widget('incoming_msg_colorbutton').set_color( - gtk.gdk.color_parse(colSt)) - - # Color for outgoing messages - colSt = gajim.config.get('outmsgcolor') - self.xml.get_widget('outgoing_msg_colorbutton').set_color( - gtk.gdk.color_parse(colSt)) - - # Color for status messages - colSt = gajim.config.get('statusmsgcolor') - self.xml.get_widget('status_msg_colorbutton').set_color( - gtk.gdk.color_parse(colSt)) - - # Color for hyperlinks - colSt = gajim.config.get('urlmsgcolor') - self.xml.get_widget('url_msg_colorbutton').set_color( - gtk.gdk.color_parse(colSt)) + # Color widgets + self.draw_color_widgets() # Font for messages font = gajim.config.get('conversation_font') @@ -823,12 +806,18 @@ class PreferencesWindow: for win in gajim.interface.msg_win_mgr.windows(): win.update_font() - def on_incoming_msg_colorbutton_color_set(self, widget): + def on_incoming_nick_colorbutton_color_set(self, widget): self.on_preference_widget_color_set(widget, 'inmsgcolor') - def on_outgoing_msg_colorbutton_color_set(self, widget): + def on_outgoing_nick_colorbutton_color_set(self, widget): self.on_preference_widget_color_set(widget, 'outmsgcolor') + def on_incoming_msg_colorbutton_color_set(self, widget): + self.on_preference_widget_color_set(widget, 'inmsgtxtcolor') + + def on_outgoing_msg_colorbutton_color_set(self, widget): + self.on_preference_widget_color_set(widget, 'outmsgtxtcolor') + def on_url_msg_colorbutton_color_set(self, widget): self.on_preference_widget_color_set(widget, 'urlmsgcolor') @@ -846,22 +835,71 @@ class PreferencesWindow: else: font_widget.set_sensitive(True) self.on_preference_widget_font_set(font_widget, 'conversation_font') + + def draw_color_widgets(self): + col_to_widget = {'inmsgcolor': 'incoming_nick_colorbutton', + 'outmsgcolor': 'outgoing_nick_colorbutton', + 'inmsgtxtcolor': ['incoming_msg_colorbutton', + 'incoming_msg_checkbutton'], + 'outmsgtxtcolor': ['outgoing_msg_colorbutton', + 'outgoing_msg_checkbutton'], + 'statusmsgcolor': 'status_msg_colorbutton', + 'urlmsgcolor': 'url_msg_colorbutton'} + for c in col_to_widget: + col = gajim.config.get(c) + if col: + if isinstance(col_to_widget[c], list): + self.xml.get_widget(col_to_widget[c][0]).set_color( + gtk.gdk.color_parse(col)) + self.xml.get_widget(col_to_widget[c][0]).set_sensitive(True) + self.xml.get_widget(col_to_widget[c][1]).set_active(True) + else: + self.xml.get_widget(col_to_widget[c]).set_color( + gtk.gdk.color_parse(col)) + else: + if isinstance(col_to_widget[c], list): + self.xml.get_widget(col_to_widget[c][0]).set_color( + gtk.gdk.color_parse('#000000')) + self.xml.get_widget(col_to_widget[c][0]).set_sensitive(False) + self.xml.get_widget(col_to_widget[c][1]).set_active(False) + else: + self.xml.get_widget(col_to_widget[c]).set_color( + gtk.gdk.color_parse('#000000')) def on_reset_colors_button_clicked(self, widget): - for i in ('inmsgcolor', 'outmsgcolor', 'statusmsgcolor', 'urlmsgcolor'): - gajim.config.set(i, gajim.interface.default_colors[i]) + col_to_widget = {'inmsgcolor': 'incoming_nick_colorbutton', + 'outmsgcolor': 'outgoing_nick_colorbutton', + 'inmsgtxtcolor': 'incoming_msg_colorbutton', + 'outmsgtxtcolor': 'outgoing_msg_colorbutton', + 'statusmsgcolor': 'status_msg_colorbutton', + 'urlmsgcolor': 'url_msg_colorbutton'} + for c in col_to_widget: + gajim.config.set(c, gajim.interface.default_colors[c]) + self.draw_color_widgets() - self.xml.get_widget('incoming_msg_colorbutton').set_color(\ - gtk.gdk.color_parse(gajim.config.get('inmsgcolor'))) - self.xml.get_widget('outgoing_msg_colorbutton').set_color(\ - gtk.gdk.color_parse(gajim.config.get('outmsgcolor'))) - self.xml.get_widget('status_msg_colorbutton').set_color(\ - gtk.gdk.color_parse(gajim.config.get('statusmsgcolor'))) - self.xml.get_widget('url_msg_colorbutton').set_color(\ - gtk.gdk.color_parse(gajim.config.get('urlmsgcolor'))) self.update_text_tags() gajim.interface.save_config() + def _set_color(self, state, widget_name, option): + ''' set color value in prefs and update the UI ''' + if state: + color = self.xml.get_widget(widget_name).get_color() + color_string = gtkgui_helpers.make_color_string(color) + else: + color_string = '' + gajim.config.set(option, color_string) + gajim.interface.save_config() + + def on_incoming_msg_checkbutton_toggled(self, widget): + state = widget.get_active() + self.xml.get_widget('incoming_msg_colorbutton').set_sensitive(state) + self._set_color(state, 'incoming_msg_colorbutton', 'inmsgtxtcolor') + + def on_outgoing_msg_checkbutton_toggled(self, widget): + state = widget.get_active() + self.xml.get_widget('outgoing_msg_colorbutton').set_sensitive(state) + self._set_color(state, 'outgoing_msg_colorbutton', 'outmsgtxtcolor') + def on_auto_away_checkbutton_toggled(self, widget): self.on_checkbutton_toggled(widget, 'autoaway', [self.auto_away_time_spinbutton, self.auto_away_message_entry]) diff --git a/src/dialogs.py b/src/dialogs.py index a0fc9f9b7..1f8c1abaf 100644 --- a/src/dialogs.py +++ b/src/dialogs.py @@ -4346,7 +4346,7 @@ class TransformChatToMUC: gajim.automatic_rooms[self.account][room_jid]['invities'] = guest_list gajim.automatic_rooms[self.account][room_jid]['continue_tag'] = True gajim.interface.join_gc_room(self.account, room_jid, - gajim.nicks[self.account], None, is_continued=True) + gajim.nicks[self.account], None, is_continued=True) self.window.destroy() def on_cancel_button_clicked(self, widget): @@ -4354,8 +4354,8 @@ class TransformChatToMUC: def unique_room_id_error(self, server): self.unique_room_id_supported(server, - gajim.nicks[self.account].lower().replace(' ','') + str(randrange( - 9999999))) + gajim.nicks[self.account].lower().replace(' ','') + str(randrange( + 9999999))) class DataFormWindow(Dialog): def __init__(self, form, on_response_ok): diff --git a/src/gajim.py b/src/gajim.py index ba6826581..2808da3b2 100644 --- a/src/gajim.py +++ b/src/gajim.py @@ -3530,6 +3530,8 @@ class Interface: self.default_colors = { 'inmsgcolor': gajim.config.get('inmsgcolor'), 'outmsgcolor': gajim.config.get('outmsgcolor'), + 'inmsgtxtcolor': gajim.config.get('inmsgtxtcolor'), + 'outmsgtxtcolor': gajim.config.get('outmsgtxtcolor'), 'statusmsgcolor': gajim.config.get('statusmsgcolor'), 'urlmsgcolor': gajim.config.get('urlmsgcolor'), }