From 5f9e42aa2ecac5c718496c95bc631830b92ae4ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Sun, 8 Jun 2008 00:12:17 +0200 Subject: Make the console title length changeable by the user --- portato/gui/templates/PreferenceWindow.glade | 67 +++++++++++++++++++++------- portato/gui/windows/main.py | 3 +- portato/gui/windows/preference.py | 6 +++ 3 files changed, 59 insertions(+), 17 deletions(-) (limited to 'portato') 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 @@ - + 5 @@ -561,31 +561,66 @@ 12 5 - + True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 5 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - Console Font + 5 + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + Console Font + True + + + + + True + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + Chose a console font + True + True + False + + + 1 + + - + True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - Chose a console font - True - True - False + + + True + 0 + Maximum length of the console title + True + + + + + True + True + 0 0 300 1 10 10 + True + True + + + 1 + + + 4 1 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 -- cgit v1.2.3