fix up all of the profile apart from the palette

This commit is contained in:
Chris Jones 2010-01-09 00:47:49 +00:00
parent 594ee47912
commit dd45d51725
2 changed files with 182 additions and 6 deletions

View File

@ -138,6 +138,57 @@
</row> </row>
</data> </data>
</object> </object>
<object class="GtkListStore" id="ScrollbarPositionListStore">
<columns>
<!-- column-name Position -->
<column type="gchararray"/>
</columns>
<data>
<row>
<col id="0" translatable="yes">On the left side</col>
</row>
<row>
<col id="0" translatable="yes">On the right side</col>
</row>
<row>
<col id="0" translatable="yes">Disabled</col>
</row>
</data>
</object>
<object class="GtkListStore" id="BackspaceKeyListStore">
<columns>
<!-- column-name Result -->
<column type="gchararray"/>
</columns>
<data>
<row>
<col id="0" translatable="yes">Control-H</col>
</row>
<row>
<col id="0" translatable="yes">ASCII DEL</col>
</row>
<row>
<col id="0" translatable="yes">Escape sequence</col>
</row>
</data>
</object>
<object class="GtkListStore" id="DeleteKeyListStore">
<columns>
<!-- column-name Profile -->
<column type="gchararray"/>
</columns>
<data>
<row>
<col id="0" translatable="yes">Control-H</col>
</row>
<row>
<col id="0" translatable="yes">ASCII DEL</col>
</row>
<row>
<col id="0" translatable="yes">Escape sequence</col>
</row>
</data>
</object>
<object class="GtkDialog" id="prefswin"> <object class="GtkDialog" id="prefswin">
<property name="border_width">5</property> <property name="border_width">5</property>
<property name="type_hint">normal</property> <property name="type_hint">normal</property>
@ -1431,6 +1482,7 @@
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="active">True</property> <property name="active">True</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
<signal name="toggled" handler="on_background_type_toggled"/>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -1452,6 +1504,7 @@
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
<property name="group">solid-radiobutton</property> <property name="group">solid-radiobutton</property>
<signal name="toggled" handler="on_background_type_toggled"/>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -1541,6 +1594,7 @@
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
<property name="group">solid-radiobutton</property> <property name="group">solid-radiobutton</property>
<signal name="toggled" handler="on_background_type_toggled"/>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -1590,8 +1644,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="update_policy">delayed</property> <property name="update_policy">delayed</property>
<property name="digits">2</property> <property name="adjustment">background_darkness_scale</property>
<property name="draw_value">False</property>
<property name="value_pos">bottom</property> <property name="value_pos">bottom</property>
</object> </object>
<packing> <packing>
@ -1689,6 +1742,14 @@
<child> <child>
<object class="GtkComboBox" id="scrollbar-position-combobox"> <object class="GtkComboBox" id="scrollbar-position-combobox">
<property name="visible">True</property> <property name="visible">True</property>
<property name="model">ScrollbarPositionListStore</property>
<property name="active">0</property>
<child>
<object class="GtkCellRendererText" id="cellrenderertext7"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -1711,6 +1772,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x2022;</property> <property name="invisible_char">&#x2022;</property>
<property name="adjustment">ScrollbackAdjustmend</property>
<property name="climb_rate">1</property> <property name="climb_rate">1</property>
<property name="numeric">True</property> <property name="numeric">True</property>
</object> </object>
@ -1860,6 +1922,14 @@
<child> <child>
<object class="GtkComboBox" id="backspace-binding-combobox"> <object class="GtkComboBox" id="backspace-binding-combobox">
<property name="visible">True</property> <property name="visible">True</property>
<property name="model">BackspaceKeyListStore</property>
<property name="active">1</property>
<child>
<object class="GtkCellRendererText" id="cellrenderertext8"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object> </object>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
@ -1871,6 +1941,14 @@
<child> <child>
<object class="GtkComboBox" id="delete-binding-combobox"> <object class="GtkComboBox" id="delete-binding-combobox">
<property name="visible">True</property> <property name="visible">True</property>
<property name="model">DeleteKeyListStore</property>
<property name="active">2</property>
<child>
<object class="GtkCellRendererText" id="cellrenderertext9"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object> </object>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
@ -1898,6 +1976,7 @@
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">True</property> <property name="receives_default">True</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<signal name="clicked" handler="on_reset_compatibility_clicked"/>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -2017,12 +2096,13 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="layout_style">end</property> <property name="layout_style">end</property>
<child> <child>
<object class="GtkButton" id="button1"> <object class="GtkButton" id="cancelbutton">
<property name="label">gtk-cancel</property> <property name="label">gtk-cancel</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">True</property> <property name="receives_default">True</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
<signal name="clicked" handler="on_cancelbutton_clicked"/>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -2031,12 +2111,13 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkButton" id="button2"> <object class="GtkButton" id="okbutton">
<property name="label">gtk-ok</property> <property name="label">gtk-ok</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">True</property> <property name="receives_default">True</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
<signal name="clicked" handler="on_okbutton_clicked"/>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -2054,8 +2135,8 @@
</object> </object>
</child> </child>
<action-widgets> <action-widgets>
<action-widget response="0">button1</action-widget> <action-widget response="0">cancelbutton</action-widget>
<action-widget response="0">button2</action-widget> <action-widget response="0">okbutton</action-widget>
</action-widgets> </action-widgets>
</object> </object>
<object class="GtkAdjustment" id="adjustment1"> <object class="GtkAdjustment" id="adjustment1">
@ -2078,4 +2159,16 @@
<property name="page_increment">10</property> <property name="page_increment">10</property>
<property name="page_size">10</property> <property name="page_size">10</property>
</object> </object>
<object class="GtkAdjustment" id="background_darkness_scale">
<property name="upper">1</property>
<property name="step_increment">0.10000000000000001</property>
<property name="page_increment">0.10000000000000001</property>
<property name="page_size">1</property>
</object>
<object class="GtkAdjustment" id="ScrollbackAdjustmend">
<property name="upper">10000000</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
<property name="page_size">10</property>
</object>
</interface> </interface>

View File

@ -237,6 +237,89 @@ class PrefsEditor:
widget.set_sensitive(True) widget.set_sensitive(True)
else: else:
widget.set_sensitive(False) widget.set_sensitive(False)
# FIXME: Do the Palette schemes and pickers
## Background tab
# Radio values
self.update_background_tab()
# Background image file
if self.config['background_image'] != '':
widget = guiget('background-image-filechooser')
widget.set_filename(self.config['background_image'])
# Background image scrolls
widget = guiget('scroll-background-checkbutton')
widget.set_active(self.config['scroll_background'])
# Background shading
widget = guiget('background_darkness_scale')
widget.set_value(self.config['background_darkness'])
if self.config['background_type'] == 'solid':
guiget('solid-radiobutton').set_active(True)
elif self.config['background_type'] == 'image':
guiget('image-radiobutton').set_active(True)
elif self.config['background_type'] == 'transparent':
guiget('trans-radiobutton').set_active(True)
## Scrolling tab
# Scrollbar position
widget = guiget('scrollbar-position-combobox')
value = self.config['scrollbar_position']
if value == 'left':
widget.set_active(0)
elif value == 'disabled':
widget.set_active(2)
else:
widget.set_active(1)
# Scrollback lines
widget = guiget('scrollback-lines-spinbutton')
widget.set_value(self.config['scrollback_lines'])
# Scroll on outut
widget = guiget('scroll-on-output-checkbutton')
widget.set_active(self.config['scroll_on_output'])
# Scroll on keystroke
widget = guiget('scroll-on-keystroke-checkbutton')
widget.set_active(self.config['scroll_on_keystroke'])
## Compatibility tab
# Backspace key
widget = guiget('backspace-binding-combobox')
value = self.config['backspace_binding']
if value == 'control-h':
widget.set_active(0)
elif value == 'escape-sequence':
widget.set_active(2)
else:
widget.set_active(1)
def on_background_type_toggled(self, widget):
"""The background type was toggled"""
self.update_background_tab()
def update_background_tab(self):
"""Update the background tab"""
guiget = self.builder.get_object
# Background type
backtype = None
solidwidget = guiget('solid-radiobutton')
imagewidget = guiget('image-radiobutton')
transwidget = guiget('transparent-radiobutton')
if transwidget.get_active() == True:
backtype = 'trans'
elif imagewidget.get_active() == True:
backtype = 'image'
else:
backtype = 'solid'
if backtype == 'image':
guiget('background-image-filechooser').set_sensitive(True)
guiget('scroll-background-checkbutton').set_sensitive(True)
else:
guiget('background-image-filechooser').set_sensitive(False)
guiget('scroll-background-checkbutton').set_sensitive(False)
if backtype == 'trans':
guiget('darken-background-scale').set_sensitive(True)
else:
guiget('darken-background-scale').set_sensitive(False)
def on_profile_selection_changed(self, selection): def on_profile_selection_changed(self, selection):
"""A different profile was selected""" """A different profile was selected"""