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',
'cursor_blink' : True,
'cursor_shape' : 'block',
'cursor_color' : '',
'cursor_color' : '#aaaaaaaaaaaa',
'emulation' : 'xterm',
'font' : 'Mono 10',
'foreground_color' : '#aaaaaaaaaaaa',

View File

@ -821,7 +821,7 @@
</child>
<child>
<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="can_focus">True</property>
<property name="receives_default">False</property>
@ -836,7 +836,7 @@
</child>
<child>
<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="can_focus">True</property>
<property name="receives_default">False</property>
@ -851,7 +851,7 @@
</child>
<child>
<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="can_focus">True</property>
<property name="receives_default">False</property>
@ -864,6 +864,67 @@
<property name="position">5</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox136">
<property name="visible">True</property>
<property name="spacing">12</property>
<child>
<object class="GtkLabel" id="word-chars-entry-label">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Select-by-_word characters:</property>
<property name="use_underline">True</property>
<property name="justify">center</property>
<property name="mnemonic_widget">word-chars-entry</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="word-chars-entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">&#x2022;</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<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>
@ -901,21 +962,31 @@
</object>
<packing>
<property name="expand">False</property>
<property name="position">6</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox136">
<object class="GtkCheckButton" id="cursor_blink">
<property name="label" translatable="yes">Cursor blink</property>
<property name="visible">True</property>
<property name="spacing">12</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="GtkLabel" id="word-chars-entry-label">
<object class="GtkHBox" id="hbox4">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Select-by-_word characters:</property>
<property name="use_underline">True</property>
<property name="justify">center</property>
<property name="mnemonic_widget">word-chars-entry</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>
@ -924,18 +995,35 @@
</packing>
</child>
<child>
<object class="GtkEntry" id="word-chars-entry">
<object class="GtkColorButton" id="cursor_color">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">&#x2022;</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>
</packing>
</child>

View File

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