From 1924c2f81a24272a6aaf91413811195d437ded3a Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Fri, 8 Jan 2010 08:39:21 +0000 Subject: [PATCH] fix up the General profile tab in the prefs editor and hook all of its elements up to code --- data/preferences.glade | 27 ++++++++++++++++----- terminatorlib/prefseditor.py | 46 +++++++++++++++++++++++++++++------- 2 files changed, 59 insertions(+), 14 deletions(-) diff --git a/data/preferences.glade b/data/preferences.glade index bc03ca74..20be3ccd 100644 --- a/data/preferences.glade +++ b/data/preferences.glade @@ -492,8 +492,8 @@ - - Show _menubar by default in new terminals + + Visual terminal _bell True True False @@ -507,8 +507,8 @@ - - Terminal _bell + + Audible terminal _bell True True False @@ -521,6 +521,21 @@ 4 + + + WM_URGENT terminal _bell + True + True + False + True + True + + + False + False + 5 + + True @@ -558,7 +573,7 @@ False - 5 + 6 @@ -593,7 +608,7 @@ False - 6 + 7 diff --git a/terminatorlib/prefseditor.py b/terminatorlib/prefseditor.py index 25d43c03..b949b69e 100755 --- a/terminatorlib/prefseditor.py +++ b/terminatorlib/prefseditor.py @@ -143,20 +143,50 @@ class PrefsEditor: selection.select_iter(self.profileiters['default']) print "VALUES ALL SET" - def on_profile_selection_changed(self, selection): - """A different profile was selected""" - (listmodel, rowiter) = selection.get_selected() - profile = listmodel.get_value(rowiter, 0) - self.update_profile_values(profile) - - def update_profile_values(self, profile): + def set_profile_values(self, profile): """Update the profile values for a given profile""" self.config.set_profile(profile) guiget = self.builder.get_object - print "setting profile %s" % profile + dbg('PrefsEditor::set_profile_values: Setting profile %s' % profile) + + ## General tab + # Use system font + widget = guiget('system-font-checkbutton') + widget.set_active(self.config['use_system_font']) + # Font selector + widget = guiget('font-selector') + widget.set_font_name(self.config['font']) + # Allow bold text widget = guiget('allow-bold-checkbutton') widget.set_active(self.config['allow_bold']) + # Visual terminal bell + widget = guiget('visual-bell-checkbutton') + widget.set_active(self.config['visible_bell']) + # Audible terminal bell + widget = guiget('audible-bell-checkbutton') + widget.set_active(self.config['audible_bell']) + # WM_URGENT terminal bell + widget = guiget('urgent-bell-checkbutton') + widget.set_active(self.config['urgent_bell']) + # Cursor shape + widget = guiget('cursor-shape-combobox') + if self.config['cursor_shape'] == 'underline': + active = 1 + elif self.config['cursor_shape'] == 'ibeam': + active = 2 + else: + active = 0 + widget.set_active(active) + # Word chars + widget = guiget('word-chars-entry') + widget.set_text(self.config['word_chars']) + + def on_profile_selection_changed(self, selection): + """A different profile was selected""" + (listmodel, rowiter) = selection.get_selected() + profile = listmodel.get_value(rowiter, 0) + self.set_profile_values(profile) def on_profile_name_edited(self, cell, path, newtext): """Update a profile name"""