Expose cursor blinking and colour in the prefs editor

This commit is contained in:
Chris Jones 2010-02-08 22:10:59 +00:00
parent 8307951001
commit eb7fcf5189
3 changed files with 150 additions and 50 deletions

View File

@ -162,7 +162,7 @@ DEFAULTS = {
'color_scheme' : 'grey_on_black', 'color_scheme' : 'grey_on_black',
'cursor_blink' : True, 'cursor_blink' : True,
'cursor_shape' : 'block', 'cursor_shape' : 'block',
'cursor_color' : '', 'cursor_color' : '#aaaaaaaaaaaa',
'emulation' : 'xterm', 'emulation' : 'xterm',
'font' : 'Mono 10', 'font' : 'Mono 10',
'foreground_color' : '#aaaaaaaaaaaa', 'foreground_color' : '#aaaaaaaaaaaa',

View File

@ -821,7 +821,7 @@
</child> </child>
<child> <child>
<object class="GtkCheckButton" id="visual-bell-checkbutton"> <object class="GtkCheckButton" id="visual-bell-checkbutton">
<property name="label" translatable="yes">Visual terminal _bell</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>
@ -836,7 +836,7 @@
</child> </child>
<child> <child>
<object class="GtkCheckButton" id="audible-bell-checkbutton"> <object class="GtkCheckButton" id="audible-bell-checkbutton">
<property name="label" translatable="yes">Audible 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>
@ -851,7 +851,7 @@
</child> </child>
<child> <child>
<object class="GtkCheckButton" id="urgent-bell-checkbutton"> <object class="GtkCheckButton" id="urgent-bell-checkbutton">
<property name="label" translatable="yes">WM_URGENT terminal _bell</property> <property name="label" translatable="yes">Window manager 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>
@ -864,46 +864,6 @@
<property name="position">5</property> <property name="position">5</property>
</packing> </packing>
</child> </child>
<child>
<object class="GtkHBox" id="hbox140">
<property name="visible">True</property>
<property name="spacing">12</property>
<child>
<object class="GtkLabel" id="label480">
<property name="visible">True</property>
<property name="label" translatable="yes">Cursor _shape:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">cursor-shape-combobox</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="cursor-shape-combobox">
<property name="visible">True</property>
<property name="model">CursorShapeListStore</property>
<property name="active">0</property>
<child>
<object class="GtkCellRendererText" id="cellrenderertext4"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="position">6</property>
</packing>
</child>
<child> <child>
<object class="GtkHBox" id="hbox136"> <object class="GtkHBox" id="hbox136">
<property name="visible">True</property> <property name="visible">True</property>
@ -936,6 +896,134 @@
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="position">6</property>
</packing>
</child>
<child>
<object class="GtkVBox" id="vbox8">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkLabel" id="label21">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">&lt;b&gt;Cursor&lt;/b&gt;</property>
<property name="use_markup">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkAlignment" id="alignment5">
<property name="visible">True</property>
<property name="left_padding">12</property>
<child>
<object class="GtkVBox" id="vbox9">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkHBox" id="hbox140">
<property name="visible">True</property>
<property name="spacing">12</property>
<child>
<object class="GtkLabel" id="label480">
<property name="visible">True</property>
<property name="label" translatable="yes">Cursor _shape:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">cursor-shape-combobox</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="cursor-shape-combobox">
<property name="visible">True</property>
<property name="model">CursorShapeListStore</property>
<property name="active">0</property>
<child>
<object class="GtkCellRendererText" id="cellrenderertext4"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="cursor_blink">
<property name="label" translatable="yes">Cursor blink</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox4">
<property name="visible">True</property>
<property name="spacing">6</property>
<child>
<object class="GtkLabel" id="label22">
<property name="visible">True</property>
<property name="label" translatable="yes">Cursor colour:</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkColorButton" id="cursor_color">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="color">#000000000000</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">7</property> <property name="position">7</property>
</packing> </packing>
</child> </child>

View File

@ -318,6 +318,9 @@ class PrefsEditor:
# WM_URGENT terminal bell # WM_URGENT terminal bell
widget = guiget('urgent-bell-checkbutton') widget = guiget('urgent-bell-checkbutton')
widget.set_active(self.config['urgent_bell']) widget.set_active(self.config['urgent_bell'])
# Word chars
widget = guiget('word-chars-entry')
widget.set_text(self.config['word_chars'])
# Cursor shape # Cursor shape
widget = guiget('cursor-shape-combobox') widget = guiget('cursor-shape-combobox')
if self.config['cursor_shape'] == 'underline': if self.config['cursor_shape'] == 'underline':
@ -327,9 +330,12 @@ class PrefsEditor:
else: else:
active = 0 active = 0
widget.set_active(active) widget.set_active(active)
# Word chars # Cursor blink
widget = guiget('word-chars-entry') widget = guiget('cursor_blink')
widget.set_text(self.config['word_chars']) widget.set_active(self.config['cursor_blink'])
# Cursor colour
widget = guiget('cursor_color')
widget.set_color(gtk.gdk.Color(self.config['cursor_color']))
## Command tab ## Command tab
# Login shell # Login shell
@ -480,6 +486,9 @@ class PrefsEditor:
# Urgent Bell # Urgent Bell
widget = guiget('urgent-bell-checkbutton') widget = guiget('urgent-bell-checkbutton')
self.config['urgent_bell'] = widget.get_active() self.config['urgent_bell'] = widget.get_active()
# Word chars
widget = guiget('word-chars-entry')
self.config['word_chars'] = widget.get_text()
# Cursor Shape # Cursor Shape
widget = guiget('cursor-shape-combobox') widget = guiget('cursor-shape-combobox')
selected = widget.get_active() selected = widget.get_active()
@ -490,9 +499,12 @@ class PrefsEditor:
elif selected == 2: elif selected == 2:
value = 'ibeam' value = 'ibeam'
self.config['cursor_shape'] = value self.config['cursor_shape'] = value
# Word chars # Cursor Blink
widget = guiget('word-chars-entry') widget = guiget('cursor_blink')
self.config['word_chars'] = widget.get_text() self.config['cursor_blink'] = widget.get_active()
# Cursor Colour
widget = guiget('cursor_color')
self.config['cursor_color'] = widget.get_color().to_string()
## Command tab ## Command tab
# Login shell # Login shell