summaryrefslogtreecommitdiff
path: root/portato
diff options
context:
space:
mode:
Diffstat (limited to 'portato')
-rw-r--r--portato/gui/templates/PreferenceWindow.glade67
-rw-r--r--portato/gui/windows/main.py3
-rw-r--r--portato/gui/windows/preference.py6
3 files changed, 59 insertions, 17 deletions
diff --git a/portato/gui/templates/PreferenceWindow.glade b/portato/gui/templates/PreferenceWindow.glade
index 4cc7dce..fcdc4ec 100644
--- a/portato/gui/templates/PreferenceWindow.glade
+++ b/portato/gui/templates/PreferenceWindow.glade
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
-<!--Generated with glade3 3.4.1 on Tue Mar 25 16:14:57 2008 -->
+<!--Generated with glade3 3.4.4 on Sun Jun 8 00:05:22 2008 -->
<glade-interface>
<widget class="GtkWindow" id="PreferenceWindow">
<property name="border_width">5</property>
@@ -561,31 +561,66 @@
<property name="left_padding">12</property>
<property name="right_padding">5</property>
<child>
- <widget class="GtkHBox" id="hbox1">
+ <widget class="GtkVBox" id="vbox1">
<property name="visible">True</property>
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="spacing">5</property>
<child>
- <widget class="GtkLabel" id="label11">
+ <widget class="GtkHBox" id="hbox1">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Console Font</property>
+ <property name="spacing">5</property>
+ <child>
+ <widget class="GtkLabel" id="label11">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Console Font</property>
+ <property name="single_line_mode">True</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkFontButton" id="consoleFontBtn">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="response_id">0</property>
+ <property name="title" translatable="yes">Chose a console font</property>
+ <property name="use_font">True</property>
+ <property name="use_size">True</property>
+ <property name="show_style">False</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
</widget>
</child>
<child>
- <widget class="GtkFontButton" id="consoleFontBtn">
+ <widget class="GtkHBox" id="hbox">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="response_id">0</property>
- <property name="title" translatable="yes">Chose a console font</property>
- <property name="use_font">True</property>
- <property name="use_size">True</property>
- <property name="show_style">False</property>
+ <child>
+ <widget class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Maximum length of the console title</property>
+ <property name="single_line_mode">True</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkSpinButton" id="titleLengthSpinBtn">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="adjustment">0 0 300 1 10 10</property>
+ <property name="snap_to_ticks">True</property>
+ <property name="numeric">True</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
</widget>
<packing>
+ <property name="padding">4</property>
<property name="position">1</property>
</packing>
</child>
diff --git a/portato/gui/windows/main.py b/portato/gui/windows/main.py
index 412ea1c..4eac88b 100644
--- a/portato/gui/windows/main.py
+++ b/portato/gui/windows/main.py
@@ -1166,7 +1166,8 @@ class MainWindow (Window):
else:
title = ("%s (%s)") % (_("Console"), title)
- if (len(title) > 60): title = "%s..." % title[:57]
+ tlength = int(self.cfg.get("titlelength", "GUI"))
+ if (len(title) > tlength): title = "%s..." % title[:tlength-3]
self.sysNotebook.set_tab_label_text(self.termHB, title)
return False
diff --git a/portato/gui/windows/preference.py b/portato/gui/windows/preference.py
index 991e7b3..54db879 100644
--- a/portato/gui/windows/preference.py
+++ b/portato/gui/windows/preference.py
@@ -106,6 +106,10 @@ class PreferenceWindow (AbstractDialog):
self.consoleFontBtn = self.tree.get_widget("consoleFontBtn")
self.consoleFontBtn.set_font_name(self.cfg.get("consolefont", section = "GUI"))
+ # the console title length spin button
+ self.titleLengthSpinBtn = self.tree.get_widget("titleLengthSpinBtn")
+ self.titleLengthSpinBtn.set_value(int(self.cfg.get("titlelength", section = "GUI")))
+
# the comboboxes
self.systemTabCombo = self.tree.get_widget("systemTabCombo")
self.pkgTabCombo = self.tree.get_widget("packageTabCombo")
@@ -140,6 +144,8 @@ class PreferenceWindow (AbstractDialog):
self.cfg.set("consolefont", font, section = "GUI")
self.console_fn(font)
+ self.cfg.set("titlelength", self.titleLengthSpinBtn.get_value(), section = "GUI")
+
pkgPos = self.pkgTabCombo.get_active()+1
sysPos = self.systemTabCombo.get_active()+1