apply config to minimized controls too. Fixes #5515
This commit is contained in:
parent
1188713660
commit
e6b4382aaf
|
@ -382,7 +382,8 @@ class PreferencesWindow:
|
||||||
|
|
||||||
# Default Status messages
|
# Default Status messages
|
||||||
self.default_msg_tree = self.xml.get_widget('default_msg_treeview')
|
self.default_msg_tree = self.xml.get_widget('default_msg_treeview')
|
||||||
col2 = self.default_msg_tree.rc_get_style().bg[gtk.STATE_ACTIVE].to_string()
|
col2 = self.default_msg_tree.rc_get_style().bg[gtk.STATE_ACTIVE].\
|
||||||
|
to_string()
|
||||||
# (status, translated_status, message, enabled)
|
# (status, translated_status, message, enabled)
|
||||||
model = gtk.ListStore(str, str, str, bool)
|
model = gtk.ListStore(str, str, str, bool)
|
||||||
self.default_msg_tree.set_model(model)
|
self.default_msg_tree.set_model(model)
|
||||||
|
@ -576,37 +577,43 @@ class PreferencesWindow:
|
||||||
w.set_sensitive(widget.get_active())
|
w.set_sensitive(widget.get_active())
|
||||||
gajim.interface.save_config()
|
gajim.interface.save_config()
|
||||||
|
|
||||||
|
def _get_all_controls(self):
|
||||||
|
for ctrl in gajim.interface.msg_win_mgr.get_controls():
|
||||||
|
yield ctrl
|
||||||
|
for account in gajim.connections:
|
||||||
|
for ctrl in gajim.interface.minimized_controls[account].values():
|
||||||
|
yield ctrl
|
||||||
|
|
||||||
|
def _get_all_muc_controls(self):
|
||||||
|
for ctrl in gajim.interface.msg_win_mgr.get_controls(
|
||||||
|
message_control.TYPE_GC):
|
||||||
|
yield ctrl
|
||||||
|
for account in gajim.connections:
|
||||||
|
for ctrl in gajim.interface.minimized_controls[account].values():
|
||||||
|
yield ctrl
|
||||||
|
|
||||||
def on_sort_by_show_in_roster_checkbutton_toggled(self, widget):
|
def on_sort_by_show_in_roster_checkbutton_toggled(self, widget):
|
||||||
self.on_checkbutton_toggled(widget, 'sort_by_show_in_roster')
|
self.on_checkbutton_toggled(widget, 'sort_by_show_in_roster')
|
||||||
gajim.interface.roster.setup_and_draw_roster()
|
gajim.interface.roster.setup_and_draw_roster()
|
||||||
|
|
||||||
def on_sort_by_show_in_muc_checkbutton_toggled(self, widget):
|
def on_sort_by_show_in_muc_checkbutton_toggled(self, widget):
|
||||||
self.on_checkbutton_toggled(widget, 'sort_by_show_in_muc')
|
self.on_checkbutton_toggled(widget, 'sort_by_show_in_muc')
|
||||||
# Redraw connected groupchats
|
# Redraw groupchats
|
||||||
for account in gajim.connections:
|
for ctrl in self._get_all_muc_controls():
|
||||||
if gajim.connections[account].connected:
|
ctrl.draw_roster()
|
||||||
for gc_control in gajim.interface.msg_win_mgr.get_controls(
|
|
||||||
message_control.TYPE_GC) + \
|
|
||||||
gajim.interface.minimized_controls[account].values():
|
|
||||||
gc_control.draw_roster()
|
|
||||||
|
|
||||||
def on_show_avatars_in_roster_checkbutton_toggled(self, widget):
|
def on_show_avatars_in_roster_checkbutton_toggled(self, widget):
|
||||||
self.on_checkbutton_toggled(widget, 'show_avatars_in_roster')
|
self.on_checkbutton_toggled(widget, 'show_avatars_in_roster')
|
||||||
gajim.interface.roster.setup_and_draw_roster()
|
gajim.interface.roster.setup_and_draw_roster()
|
||||||
# Redraw connected groupchats (in an ugly way)
|
# Redraw groupchats (in an ugly way)
|
||||||
for account in gajim.connections:
|
for ctrl in self._get_all_muc_controls():
|
||||||
if gajim.connections[account].connected:
|
ctrl.draw_roster()
|
||||||
for gc_control in gajim.interface.msg_win_mgr.get_controls(
|
|
||||||
message_control.TYPE_GC) + \
|
|
||||||
gajim.interface.minimized_controls[account].values():
|
|
||||||
gc_control.draw_roster()
|
|
||||||
|
|
||||||
def on_show_status_msgs_in_roster_checkbutton_toggled(self, widget):
|
def on_show_status_msgs_in_roster_checkbutton_toggled(self, widget):
|
||||||
self.on_checkbutton_toggled(widget, 'show_status_msgs_in_roster')
|
self.on_checkbutton_toggled(widget, 'show_status_msgs_in_roster')
|
||||||
gajim.interface.roster.setup_and_draw_roster()
|
gajim.interface.roster.setup_and_draw_roster()
|
||||||
for ctl in gajim.interface.msg_win_mgr.controls():
|
for ctrl in self._get_all_muc_controls():
|
||||||
if ctl.type_id == message_control.TYPE_GC:
|
ctrl.update_ui()
|
||||||
ctl.update_ui()
|
|
||||||
|
|
||||||
def on_show_mood_in_roster_checkbutton_toggled(self, widget):
|
def on_show_mood_in_roster_checkbutton_toggled(self, widget):
|
||||||
self.on_checkbutton_toggled(widget, 'show_mood_in_roster')
|
self.on_checkbutton_toggled(widget, 'show_mood_in_roster')
|
||||||
|
@ -641,8 +648,8 @@ class PreferencesWindow:
|
||||||
"""
|
"""
|
||||||
Update emoticons state in Opened Chat Windows
|
Update emoticons state in Opened Chat Windows
|
||||||
"""
|
"""
|
||||||
for win in gajim.interface.msg_win_mgr.windows():
|
for ctrl in self._get_all_controls():
|
||||||
win.toggle_emoticons()
|
ctrl.toggle_emoticons()
|
||||||
|
|
||||||
def on_one_window_type_combo_changed(self, widget):
|
def on_one_window_type_combo_changed(self, widget):
|
||||||
active = widget.get_active()
|
active = widget.get_active()
|
||||||
|
@ -653,8 +660,8 @@ class PreferencesWindow:
|
||||||
|
|
||||||
def on_compact_view_checkbutton_toggled(self, widget):
|
def on_compact_view_checkbutton_toggled(self, widget):
|
||||||
active = widget.get_active()
|
active = widget.get_active()
|
||||||
for ctl in gajim.interface.msg_win_mgr.controls():
|
for ctrl in self._get_all_controls():
|
||||||
ctl.chat_buttons_set_visible(active)
|
ctrl.chat_buttons_set_visible(active)
|
||||||
gajim.config.set('compact_view', active)
|
gajim.config.set('compact_view', active)
|
||||||
gajim.interface.save_config()
|
gajim.interface.save_config()
|
||||||
|
|
||||||
|
@ -663,7 +670,7 @@ class PreferencesWindow:
|
||||||
helpers.update_optional_features()
|
helpers.update_optional_features()
|
||||||
|
|
||||||
def apply_speller(self):
|
def apply_speller(self):
|
||||||
for ctrl in gajim.interface.msg_win_mgr.controls():
|
for ctrl in self._get_all_controls():
|
||||||
if isinstance(ctrl, chat_control.ChatControlBase):
|
if isinstance(ctrl, chat_control.ChatControlBase):
|
||||||
try:
|
try:
|
||||||
spell_obj = gtkspell.get_from_text_view(ctrl.msg_textview)
|
spell_obj = gtkspell.get_from_text_view(ctrl.msg_textview)
|
||||||
|
@ -674,7 +681,7 @@ class PreferencesWindow:
|
||||||
ctrl.set_speller()
|
ctrl.set_speller()
|
||||||
|
|
||||||
def remove_speller(self):
|
def remove_speller(self):
|
||||||
for ctrl in gajim.interface.msg_win_mgr.controls():
|
for ctrl in self._get_all_controls():
|
||||||
if isinstance(ctrl, chat_control.ChatControlBase):
|
if isinstance(ctrl, chat_control.ChatControlBase):
|
||||||
try:
|
try:
|
||||||
spell_obj = gtkspell.get_from_text_view(ctrl.msg_textview)
|
spell_obj = gtkspell.get_from_text_view(ctrl.msg_textview)
|
||||||
|
@ -837,8 +844,8 @@ class PreferencesWindow:
|
||||||
"""
|
"""
|
||||||
Update color tags in opened chat windows
|
Update color tags in opened chat windows
|
||||||
"""
|
"""
|
||||||
for win in gajim.interface.msg_win_mgr.windows():
|
for ctrl in self._get_all_controls():
|
||||||
win.update_tags()
|
ctrl.update_tags()
|
||||||
|
|
||||||
def on_preference_widget_color_set(self, widget, text):
|
def on_preference_widget_color_set(self, widget, text):
|
||||||
color = widget.get_color()
|
color = widget.get_color()
|
||||||
|
@ -860,8 +867,8 @@ class PreferencesWindow:
|
||||||
"""
|
"""
|
||||||
Update text font in opened chat windows
|
Update text font in opened chat windows
|
||||||
"""
|
"""
|
||||||
for win in gajim.interface.msg_win_mgr.windows():
|
for ctrl in self._get_all_controls():
|
||||||
win.update_font()
|
ctrl.update_font()
|
||||||
|
|
||||||
def on_incoming_nick_colorbutton_color_set(self, widget):
|
def on_incoming_nick_colorbutton_color_set(self, widget):
|
||||||
self.on_preference_widget_color_set(widget, 'inmsgcolor')
|
self.on_preference_widget_color_set(widget, 'inmsgcolor')
|
||||||
|
|
|
@ -661,18 +661,6 @@ class MessageWindow(object):
|
||||||
def get_origin(self):
|
def get_origin(self):
|
||||||
return self.window.window.get_origin()
|
return self.window.window.get_origin()
|
||||||
|
|
||||||
def toggle_emoticons(self):
|
|
||||||
for ctrl in self.controls():
|
|
||||||
ctrl.toggle_emoticons()
|
|
||||||
|
|
||||||
def update_font(self):
|
|
||||||
for ctrl in self.controls():
|
|
||||||
ctrl.update_font()
|
|
||||||
|
|
||||||
def update_tags(self):
|
|
||||||
for ctrl in self.controls():
|
|
||||||
ctrl.update_tags()
|
|
||||||
|
|
||||||
def get_control(self, key, acct):
|
def get_control(self, key, acct):
|
||||||
"""
|
"""
|
||||||
Return the MessageControl for jid or n, where n is a notebook page index.
|
Return the MessageControl for jid or n, where n is a notebook page index.
|
||||||
|
|
Loading…
Reference in New Issue