diff options
-rw-r--r-- | doc/Changelog | 2 | ||||
-rw-r--r-- | doc/TODO | 1 | ||||
-rw-r--r-- | etc/portato.cfg | 8 | ||||
-rw-r--r-- | portato/backend/portage/system.py | 1 | ||||
-rw-r--r-- | portato/gui/gtk/windows.py | 62 | ||||
-rw-r--r-- | portato/gui/gui_helper.py | 4 | ||||
-rw-r--r-- | portato/gui/qt/windows.py | 21 | ||||
-rw-r--r-- | portato/gui/templates/portato.glade | 941 | ||||
-rw-r--r-- | portato/gui/templates/ui/PreferenceWindow.ui | 502 |
9 files changed, 822 insertions, 720 deletions
diff --git a/doc/Changelog b/doc/Changelog index 1d59dc1..2f66c57 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -2,6 +2,8 @@ next: - added name of overlay the package comes from - filtering "--ask" from EMERGE_DEFAULT_OPTS - show reason for a package being masked as a tooltip +- added settings: gtk: console font +- show emerge progress in window title 0.7.3: - fixed bugs @@ -16,7 +16,6 @@ Backend: GUI: ==== -- show current emerge process in Window-Title (similar to the Console) - return from console after finishing emerge Main Point: user preferences: diff --git a/etc/portato.cfg b/etc/portato.cfg index 0b38488..63091b6 100644 --- a/etc/portato.cfg +++ b/etc/portato.cfg @@ -27,7 +27,7 @@ system = portage debug = True ; the command used for syncing portage - string value -synccommand = eix-sync +synccommand = emerge --sync ; control the same-named "emerge --update" options - boolean values newuse = true @@ -53,6 +53,9 @@ useperversion = True # [Gui] +; show emerge progress in window title - boolean values +updatetitle = on + ; show the systray icon?- boolean values showsystray = true @@ -67,6 +70,9 @@ hideonminimize = true ; control whether usetips are shown for a package in the Queue - boolean values showusetips = on +; sets the font of the console - string values +consolefont = Monospace 11 + # # Qt-Section for options of the Qt-Frontend # diff --git a/portato/backend/portage/system.py b/portato/backend/portage/system.py index 9e203db..27099cc 100644 --- a/portato/backend/portage/system.py +++ b/portato/backend/portage/system.py @@ -63,6 +63,7 @@ class PortageSystem (SystemInterface): def get_environment (self): default_opts = self.get_global_settings("EMERGE_DEFAULT_OPTS") opts = dict(os.environ) + opts.update(TERM = "xterm") # emulate terminal :) if default_opts: opt_list = default_opts.split() diff --git a/portato/gui/gtk/windows.py b/portato/gui/gtk/windows.py index c77787a..967a9d8 100644 --- a/portato/gui/gtk/windows.py +++ b/portato/gui/gtk/windows.py @@ -193,6 +193,7 @@ class PreferenceWindow (AbstractDialog): "minimizeCheck" : ("minimize_opt", "gui_sec"), "systrayCheck" : ("systray_opt", "gui_sec"), "testPerVersionCheck" : "testingPerVersion_opt", + "titleUpdateCheck" : ("updateTitle_opt", "gui_sec"), "usePerVersionCheck" : "usePerVersion_opt", "useTipsCheck" : ("useTips_opt", "gtk_sec") } @@ -206,31 +207,23 @@ class PreferenceWindow (AbstractDialog): "syncCommandEdit" : "syncCmd_opt" } - # mapping from the radio buttons to the system name - # widget name -> option - system_radios = { - "portageRadio" : "portage", - "pkgCoreRadio" : "pkgcore", - "paludisRadio" : "paludis" - } - - # mapping from the system name to the radio button - # option -> widget name - systems = {} - systems.update(zip(system_radios.values(), system_radios.keys())) - - def __init__ (self, parent, cfg): + def __init__ (self, parent, cfg, set_console_font): """Constructor. @param parent: parent window @type parent: gtk.Window @param cfg: configuration object - @type cfg: gui_helper.Config""" + @type cfg: gui_helper.Config + @param set_console_font: function to call to set the console font + @type set_console_font: function(string)""" AbstractDialog.__init__(self, parent) # our config self.cfg = cfg + + # the console font setter + self.set_console_font = set_console_font # set the bg-color of the hint hintEB = self.tree.get_widget("hintEB") @@ -251,8 +244,9 @@ class PreferenceWindow (AbstractDialog): self.tree.get_widget(edit).\ set_text(self.cfg.get(self.edits[edit])) - # the system radios - self.tree.get_widget(self.systems[self.cfg.get("system_opt").lower()]).set_active(True) + # the console font button + self.consoleFontBtn = self.tree.get_widget("consoleFontBtn") + self.consoleFontBtn.set_font_name(self.cfg.get("consolefont_opt", section = self.cfg.const["gtk_sec"])) self.window.show_all() @@ -269,10 +263,10 @@ class PreferenceWindow (AbstractDialog): for edit in self.edits: self.cfg.set(self.edits[edit],self.tree.get_widget(edit).get_text()) - for radio in self.system_radios: - if self.tree.get_widget(radio).get_active(): - self.cfg.set("system_opt", self.system_radios[radio]) - + font = self.consoleFontBtn.get_font_name() + self.cfg.set("consolefont_opt", font, section = self.cfg.const["gtk_sec"]) + self.set_console_font(font) + def cb_ok_clicked(self, button): """Saves, writes to config-file and closes the window.""" self._save() @@ -743,9 +737,12 @@ class MainWindow (Window): def __init__ (self): """Build up window""" + # the title + self.main_title = "Portato (%s)" % VERSION + # main window stuff Window.__init__(self) - self.window.set_title(("Portato (%s)" % VERSION)) + self.window.set_title(self.main_title) mHeight = 800 if gtk.gdk.screen_height() <= 800: mHeight = 600 self.window.set_geometry_hints (self.window, min_width = 600, min_height = mHeight, max_height = gtk.gdk.screen_height(), max_width = gtk.gdk.screen_width()) @@ -836,7 +833,7 @@ class MainWindow (Window): self.console.set_scrollback_lines(1024) self.console.set_scroll_on_output(True) - self.console.set_font_from_string("Monospace 11") + self.console.set_font_from_string(self.cfg.get("consolefont_opt", self.cfg.const["gtk_sec"])) self.console.connect("button-press-event", self.cb_right_click) termScroll = gtk.VScrollbar(self.console.get_adjustment()) self.termHB.pack_start(self.console, True, True) @@ -927,11 +924,26 @@ class MainWindow (Window): def title_update (self, title): + def window_title_update (title): + if title is None or not self.cfg.get_boolean("updateTitle_opt", self.cfg.const["gui_sec"]): + self.window.set_title(self.main_title) + else: + title = title.strip() + if title[0] == '*': + self.window.set_title(self.main_title) + else: + space_idx = title.rfind(" ") + if space_idx != -1: + title = title[:space_idx] + + self.window.set_title(("Portato >>> %s" % title)) + def __update(title): if self.tray: self.tray.set_tooltip(title) - if title == None: + window_title_update(title) + if title is None: title = "Console" else: title = ("Console (%s)" % title) @@ -1100,7 +1112,7 @@ class MainWindow (Window): SearchWindow(self.window, packages, self.jump_to) def cb_preferences_clicked (self, button): - PreferenceWindow(self.window, self.cfg) + PreferenceWindow(self.window, self.cfg, self.console.set_font_from_string) return True def cb_about_clicked (self, button): diff --git a/portato/gui/gui_helper.py b/portato/gui/gui_helper.py index 9907a1c..a4d333c 100644 --- a/portato/gui/gui_helper.py +++ b/portato/gui/gui_helper.py @@ -49,10 +49,12 @@ class Config: # XXX: This needs to be replaced - the const-dict is just messy "newuse_opt" : "newuse", "syncCmd_opt" : "synccommand", "useTips_opt" : "showusetips", + "consolefont_opt" : "consolefont", "pkgIcons_opt" : "packageIcons", "system_opt" : "system", "systray_opt" : "showsystray", - "minimize_opt" : "hideonminimize" + "minimize_opt" : "hideonminimize", + "updateTitle_opt" : "updatetitle" } def __init__ (self, cfgFile): diff --git a/portato/gui/qt/windows.py b/portato/gui/qt/windows.py index 104a1ab..3eb3d31 100644 --- a/portato/gui/qt/windows.py +++ b/portato/gui/qt/windows.py @@ -183,7 +183,8 @@ class PreferenceWindow (Window): "testingCheck" : "testingPerVersion_opt", "pkgIconsCheck" : ("pkgIcons_opt", "qt_sec"), "minimizeCheck" : ("minimize_opt", "gui_sec"), - "systrayCheck" : ("systray_opt", "gui_sec") + "systrayCheck" : ("systray_opt", "gui_sec"), + "titleUpdateCheck" : ("updateTitle_opt", "gui_sec") } # all edits in the window @@ -591,7 +592,8 @@ class MainWindow (Window): def __init__ (self): Window.__init__(self) - self.setWindowTitle(("Portato (%s)" % VERSION)) + self.main_title = "Portato (%s)" % VERSION + self.setWindowTitle(self.main_title) self.statusbar.showMessage("Portato - A Portage GUI") self.doUpdate = False @@ -658,6 +660,21 @@ class MainWindow (Window): def _title_update (self, title): + def window_update (title): + if title is None or not self.cfg.get_boolean("updateTitle_opt", self.cfg.const["gui_sec"]): + self.setWindowTitle(self.main_title) + else: + title = title.strip() + if title[0] == '*': + self.setWindowTitle(self.main_title) + else: + space_idx = title.rfind(" ") + if space_idx != -1: + title = title[:space_idx] + + self.setWindowTitle(("Portato >>> %s" % title)) + + window_update(title) if title is None: if self.systray: self.systray.setToolTip("") title = "Console" diff --git a/portato/gui/templates/portato.glade b/portato/gui/templates/portato.glade index 8433fa0..a8fa4d0 100644 --- a/portato/gui/templates/portato.glade +++ b/portato/gui/templates/portato.glade @@ -404,50 +404,74 @@ <property name="n_rows">4</property> <property name="n_columns">2</property> <child> - <widget class="GtkHBox" id="checkHB"> + <widget class="GtkScrolledWindow" id="useListScroll"> <property name="visible">True</property> - <property name="spacing">1</property> - <property name="homogeneous">True</property> - <child> - <widget class="GtkCheckButton" id="installedCheck"> - <property name="visible">True</property> - <property name="no_show_all">True</property> - <property name="label" translatable="yes">Installed</property> - <property name="draw_indicator">True</property> - <signal name="button_press_event" handler="cb_button_pressed"/> - </widget> - <packing> - <property name="fill">False</property> - </packing> - </child> + <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> <child> - <widget class="GtkCheckButton" id="maskedCheck"> + <widget class="GtkTreeView" id="useList"> <property name="visible">True</property> - <property name="no_show_all">True</property> - <property name="label" translatable="yes">Masked</property> - <property name="draw_indicator">True</property> - <signal name="toggled" handler="cb_masked_toggled"/> </widget> - <packing> - <property name="fill">False</property> - <property name="position">1</property> - </packing> </child> + </widget> + <packing> + <property name="right_attach">2</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="x_padding">5</property> + <property name="y_padding">5</property> + </packing> + </child> + <child> + <widget class="GtkVBox" id="comboVB"> + <property name="visible">True</property> <child> - <widget class="GtkCheckButton" id="testingCheck"> - <property name="visible">True</property> - <property name="no_show_all">True</property> - <property name="label" translatable="yes">Testing</property> - <property name="draw_indicator">True</property> - <signal name="toggled" handler="cb_testing_toggled"/> - </widget> - <packing> - <property name="fill">False</property> - <property name="position">2</property> - </packing> + <placeholder/> </child> </widget> <packing> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="y_options">GTK_FILL</property> + <property name="x_padding">5</property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="descLabel"> + <property name="visible">True</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">True</property> + </widget> + <packing> + <property name="right_attach">2</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> + <property name="y_padding">10</property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="missingLabel"> + <property name="visible">True</property> + <property name="no_show_all">True</property> + <property name="label" translatable="yes"><span foreground='red'><b>MISSING KEYWORD</b></span></property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="y_options">GTK_FILL</property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="notInSysLabel"> + <property name="visible">True</property> + <property name="no_show_all">True</property> + <property name="label" translatable="yes"><b>Installed, but not in portage anymore</b></property> + <property name="use_markup">True</property> + </widget> + <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> <property name="top_attach">1</property> @@ -510,79 +534,55 @@ </packing> </child> <child> - <widget class="GtkLabel" id="notInSysLabel"> - <property name="visible">True</property> - <property name="no_show_all">True</property> - <property name="label" translatable="yes"><b>Installed, but not in portage anymore</b></property> - <property name="use_markup">True</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="y_options">GTK_FILL</property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="missingLabel"> - <property name="visible">True</property> - <property name="no_show_all">True</property> - <property name="label" translatable="yes"><span foreground='red'><b>MISSING KEYWORD</b></span></property> - <property name="use_markup">True</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="y_options">GTK_FILL</property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="descLabel"> - <property name="visible">True</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">True</property> - </widget> - <packing> - <property name="right_attach">2</property> - <property name="x_options">GTK_FILL</property> - <property name="y_options"></property> - <property name="y_padding">10</property> - </packing> - </child> - <child> - <widget class="GtkVBox" id="comboVB"> + <widget class="GtkHBox" id="checkHB"> <property name="visible">True</property> + <property name="spacing">1</property> + <property name="homogeneous">True</property> <child> - <placeholder/> + <widget class="GtkCheckButton" id="installedCheck"> + <property name="visible">True</property> + <property name="no_show_all">True</property> + <property name="label" translatable="yes">Installed</property> + <property name="draw_indicator">True</property> + <signal name="button_press_event" handler="cb_button_pressed"/> + </widget> + <packing> + <property name="fill">False</property> + </packing> </child> - </widget> - <packing> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="y_options">GTK_FILL</property> - <property name="x_padding">5</property> - </packing> - </child> - <child> - <widget class="GtkScrolledWindow" id="useListScroll"> - <property name="visible">True</property> - <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> - <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> <child> - <widget class="GtkTreeView" id="useList"> + <widget class="GtkCheckButton" id="maskedCheck"> + <property name="visible">True</property> + <property name="no_show_all">True</property> + <property name="label" translatable="yes">Masked</property> + <property name="draw_indicator">True</property> + <signal name="toggled" handler="cb_masked_toggled"/> + </widget> + <packing> + <property name="fill">False</property> + <property name="position">1</property> + </packing> + </child> + <child> + <widget class="GtkCheckButton" id="testingCheck"> <property name="visible">True</property> + <property name="no_show_all">True</property> + <property name="label" translatable="yes">Testing</property> + <property name="draw_indicator">True</property> + <signal name="toggled" handler="cb_testing_toggled"/> </widget> + <packing> + <property name="fill">False</property> + <property name="position">2</property> + </packing> </child> </widget> <packing> + <property name="left_attach">1</property> <property name="right_attach">2</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_padding">5</property> - <property name="y_padding">5</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="y_options">GTK_FILL</property> </packing> </child> </widget> @@ -890,492 +890,509 @@ <property name="visible">True</property> <property name="spacing">5</property> <child> - <widget class="GtkFrame" id="generalFrame"> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <child> - <widget class="GtkAlignment" id="alignment1"> - <property name="visible">True</property> - <property name="left_padding">12</property> - <child> - <widget class="GtkVBox" id="generalVB"> - <property name="visible">True</property> - <child> - <widget class="GtkCheckButton" id="debugCheck"> - <property name="visible">True</property> - <property name="label" translatable="yes">Debug</property> - <property name="draw_indicator">True</property> - </widget> - </child> - </widget> - </child> - </widget> - </child> - <child> - <widget class="GtkLabel" id="label1"> - <property name="visible">True</property> - <property name="label" translatable="yes"><b>General Options</b></property> - <property name="use_markup">True</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - </child> - <child> - <widget class="GtkFrame" id="visualFrame"> + <widget class="GtkNotebook" id="notebook2"> <property name="visible">True</property> + <property name="can_focus">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="label_xalign">0</property> <child> - <widget class="GtkAlignment" id="alignment7"> + <widget class="GtkVBox" id="vbox2"> <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="left_padding">12</property> + <property name="border_width">5</property> <child> - <widget class="GtkVBox" id="vbox2"> + <widget class="GtkFrame" id="generalFrame"> <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="label_xalign">0</property> <child> - <widget class="GtkCheckButton" id="useTipsCheck"> + <widget class="GtkAlignment" id="alignment1"> <property name="visible">True</property> - <property name="label" translatable="yes">Turn Use-Tips on</property> - <property name="draw_indicator">True</property> - </widget> - </child> - <child> - <widget class="GtkCheckButton" id="systrayCheck"> - <property name="visible">True</property> - <property name="can_focus">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="label" translatable="yes">Enable systray</property> - <property name="draw_indicator">True</property> + <property name="left_padding">12</property> + <child> + <widget class="GtkVBox" id="generalVB"> + <property name="visible">True</property> + <child> + <widget class="GtkCheckButton" id="debugCheck"> + <property name="visible">True</property> + <property name="label" translatable="yes">Debug</property> + <property name="draw_indicator">True</property> + </widget> + </child> + </widget> + </child> </widget> - <packing> - <property name="position">1</property> - </packing> </child> <child> - <widget class="GtkCheckButton" id="minimizeCheck"> + <widget class="GtkLabel" id="label1"> <property name="visible">True</property> - <property name="can_focus">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="label" translatable="yes">Hide on minimization (only if systray is enabled)</property> - <property name="draw_indicator">True</property> + <property name="label" translatable="yes"><b>General Options</b></property> + <property name="use_markup">True</property> </widget> <packing> - <property name="position">2</property> + <property name="type">label_item</property> </packing> </child> </widget> </child> - </widget> - </child> - <child> - <widget class="GtkLabel" id="label10"> - <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="label" translatable="yes"><b>Visual Options</b></property> - <property name="use_markup">True</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="position">1</property> - </packing> - </child> - <child> - <widget class="GtkFrame" id="systemFrame"> - <property name="sensitive">False</property> - <property name="no_show_all">True</property> - <property name="label_xalign">0</property> - <child> - <widget class="GtkAlignment" id="alignment6"> - <property name="visible">True</property> - <property name="left_padding">12</property> <child> - <widget class="GtkHButtonBox" id="systemButtonBox"> + <widget class="GtkFrame" id="updateFrame"> <property name="visible">True</property> + <property name="label_xalign">0</property> <child> - <widget class="GtkRadioButton" id="portageRadio"> - <property name="visible">True</property> - <property name="label" translatable="yes">Portage</property> - <property name="active">True</property> - <property name="draw_indicator">True</property> - </widget> - </child> - <child> - <widget class="GtkRadioButton" id="pkgCoreRadio"> + <widget class="GtkAlignment" id="alignment2"> <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">pkgCore</property> - <property name="draw_indicator">True</property> - <property name="group">portageRadio</property> + <property name="left_padding">12</property> + <child> + <widget class="GtkVBox" id="updateVB"> + <property name="visible">True</property> + <child> + <widget class="GtkCheckButton" id="deepCheck"> + <property name="visible">True</property> + <property name="label" translatable="yes">--deep</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="fill">False</property> + </packing> + </child> + <child> + <widget class="GtkCheckButton" id="newUseCheck"> + <property name="visible">True</property> + <property name="label" translatable="yes">--newuse</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="fill">False</property> + <property name="position">1</property> + </packing> + </child> + </widget> + </child> </widget> - <packing> - <property name="position">1</property> - </packing> </child> <child> - <widget class="GtkRadioButton" id="paludisRadio"> + <widget class="GtkLabel" id="label4"> <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">Paludis</property> - <property name="draw_indicator">True</property> - <property name="group">portageRadio</property> + <property name="label" translatable="yes"><b>Update World Options</b></property> + <property name="use_markup">True</property> </widget> <packing> - <property name="position">2</property> + <property name="type">label_item</property> </packing> </child> </widget> + <packing> + <property name="position">1</property> + </packing> </child> - </widget> - </child> - <child> - <widget class="GtkLabel" id="label7"> - <property name="visible">True</property> - <property name="label" translatable="yes"><b>System Options</b></property> - <property name="use_markup">True</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="position">2</property> - </packing> - </child> - <child> - <widget class="GtkFrame" id="syncFrame"> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <child> - <widget class="GtkAlignment" id="alignment5"> - <property name="visible">True</property> - <property name="bottom_padding">5</property> - |