summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/Changelog1
-rw-r--r--etc/portato.cfg3
-rw-r--r--portato/gui/templates/PreferenceWindow.glade67
-rw-r--r--portato/gui/windows/main.py3
-rw-r--r--portato/gui/windows/preference.py6
5 files changed, 63 insertions, 17 deletions
diff --git a/doc/Changelog b/doc/Changelog
index a34d73c..ad0454f 100644
--- a/doc/Changelog
+++ b/doc/Changelog
@@ -1,4 +1,5 @@
next:
+- make max. title length of the console changeable by the user
- added shortcut for "Reload Portage"
- increased the maximum scrollback lines
- now only use external "shm" package
diff --git a/etc/portato.cfg b/etc/portato.cfg
index 07e6bdb..90cbace 100644
--- a/etc/portato.cfg
+++ b/etc/portato.cfg
@@ -78,6 +78,9 @@ showslots = true
; sets the font of the console - string values
consolefont = Monospace 11
+; controls the maximum length of the console title - integer value
+titlelength = 60
+
; sets the position of the tabs of the two notebooks
; allowed positions:
; - 1 : top
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