fix up the General profile tab in the prefs editor and hook all of its elements up to code
This commit is contained in:
parent
c14e955310
commit
1924c2f81a
|
@ -492,8 +492,8 @@
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkCheckButton" id="show-menubar-checkbutton">
|
<object class="GtkCheckButton" id="visual-bell-checkbutton">
|
||||||
<property name="label" translatable="yes">Show _menubar by default in new terminals</property>
|
<property name="label" translatable="yes">Visual terminal _bell</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="receives_default">False</property>
|
<property name="receives_default">False</property>
|
||||||
|
@ -507,8 +507,8 @@
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkCheckButton" id="bell-checkbutton">
|
<object class="GtkCheckButton" id="audible-bell-checkbutton">
|
||||||
<property name="label" translatable="yes">Terminal _bell</property>
|
<property name="label" translatable="yes">Audible terminal _bell</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="receives_default">False</property>
|
<property name="receives_default">False</property>
|
||||||
|
@ -521,6 +521,21 @@
|
||||||
<property name="position">4</property>
|
<property name="position">4</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkCheckButton" id="urgent-bell-checkbutton">
|
||||||
|
<property name="label" translatable="yes">WM_URGENT terminal _bell</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="receives_default">False</property>
|
||||||
|
<property name="use_underline">True</property>
|
||||||
|
<property name="draw_indicator">True</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">False</property>
|
||||||
|
<property name="position">5</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkHBox" id="hbox140">
|
<object class="GtkHBox" id="hbox140">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
|
@ -558,7 +573,7 @@
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
<property name="position">5</property>
|
<property name="position">6</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
|
@ -593,7 +608,7 @@
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
<property name="position">6</property>
|
<property name="position">7</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
|
|
@ -143,20 +143,50 @@ class PrefsEditor:
|
||||||
selection.select_iter(self.profileiters['default'])
|
selection.select_iter(self.profileiters['default'])
|
||||||
print "VALUES ALL SET"
|
print "VALUES ALL SET"
|
||||||
|
|
||||||
def on_profile_selection_changed(self, selection):
|
def set_profile_values(self, profile):
|
||||||
"""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):
|
|
||||||
"""Update the profile values for a given profile"""
|
"""Update the profile values for a given profile"""
|
||||||
self.config.set_profile(profile)
|
self.config.set_profile(profile)
|
||||||
guiget = self.builder.get_object
|
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 = guiget('allow-bold-checkbutton')
|
||||||
widget.set_active(self.config['allow_bold'])
|
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):
|
def on_profile_name_edited(self, cell, path, newtext):
|
||||||
"""Update a profile name"""
|
"""Update a profile name"""
|
||||||
|
|
Loading…
Reference in New Issue