diff options
Diffstat (limited to '')
-rw-r--r-- | etc/portato.cfg | 3 | ||||
-rw-r--r-- | portato/gui/session.py | 2 | ||||
-rw-r--r-- | portato/gui/templates/MainWindow.glade | 129 | ||||
-rw-r--r-- | portato/gui/templates/PreferenceWindow.glade | 231 | ||||
-rw-r--r-- | portato/gui/windows/main.py | 101 | ||||
-rw-r--r-- | portato/gui/windows/preference.py | 3 |
6 files changed, 277 insertions, 192 deletions
diff --git a/etc/portato.cfg b/etc/portato.cfg index 0940e01..cab0414 100644 --- a/etc/portato.cfg +++ b/etc/portato.cfg @@ -72,6 +72,9 @@ browserCmd = firefox ; disable this if you own a slow machine searchontype = true +; show slots in the version list +showslots = true + ; sets the font of the console - string values consolefont = Monospace 11 diff --git a/portato/gui/session.py b/portato/gui/session.py index 1e3d759..e356fbd 100644 --- a/portato/gui/session.py +++ b/portato/gui/session.py @@ -14,7 +14,7 @@ from ..helper import _, debug # the current version for saved sessions # change this, whenever the change is incompatible with previous versions -SESSION_VERSION = 2 +SESSION_VERSION = 1 class SessionException (Exception): diff --git a/portato/gui/templates/MainWindow.glade b/portato/gui/templates/MainWindow.glade index 183a22b..5a60ed4 100644 --- a/portato/gui/templates/MainWindow.glade +++ b/portato/gui/templates/MainWindow.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 20:15:47 2008 --> +<!--Generated with glade3 3.4.1 on Tue Mar 25 20:23:08 2008 --> <glade-interface> <widget class="GtkWindow" id="MainWindow"> <property name="border_width">2</property> @@ -413,10 +413,11 @@ <property name="label_yalign">0</property> <property name="shadow_type">GTK_SHADOW_IN</property> <child> - <widget class="GtkHPaned" id="listPaned"> + <widget class="GtkHBox" id="listHB"> <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="spacing">5</property> + <property name="homogeneous">True</property> <child> <widget class="GtkScrolledWindow" id="catScroll"> <property name="visible">True</property> @@ -430,10 +431,6 @@ </widget> </child> </widget> - <packing> - <property name="resize">True</property> - <property name="shrink">True</property> - </packing> </child> <child> <widget class="GtkScrolledWindow" id="pkgScroll"> @@ -450,8 +447,26 @@ </child> </widget> <packing> - <property name="resize">True</property> - <property name="shrink">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <widget class="GtkScrolledWindow" id="versionScroll"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <child> + <widget class="GtkTreeView" id="versionList"> + <property name="visible">True</property> + <property name="headers_clickable">True</property> + <property name="search_column">1</property> + <signal name="cursor_changed" handler="cb_version_list_changed"/> + </widget> + </child> + </widget> + <packing> + <property name="position">2</property> </packing> </child> </widget> @@ -478,91 +493,89 @@ <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> <child> - <widget class="GtkTable" id="packageHeaderTable"> + <widget class="GtkHBox" id="packageHeaderHB"> <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="n_rows">2</property> - <property name="n_columns">2</property> - <property name="column_spacing">4</property> - <property name="row_spacing">4</property> + <property name="spacing">5</property> <child> <widget class="GtkLabel" id="nameLabel"> <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">label</property> </widget> - <packing> - <property name="right_attach">2</property> - <property name="x_options">GTK_FILL</property> - <property name="y_options">GTK_FILL</property> - </packing> </child> <child> - <widget class="GtkComboBox" id="versionCombo"> + <widget class="GtkButton" id="pkgEmergeBtn"> <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="tooltip" translatable="yes">Install onto system</property> + <property name="relief">GTK_RELIEF_NONE</property> + <property name="response_id">0</property> + <signal name="clicked" handler="cb_package_emerge_clicked"/> + <child> + <widget class="GtkImage" id="image1"> + <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="stock">gtk-add</property> + </widget> + </child> </widget> <packing> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">GTK_FILL</property> + <property name="expand">False</property> + <property name="position">1</property> </packing> </child> <child> - <widget class="GtkToolbar" id="packageTB"> + <widget class="GtkButton" id="pkgUnmergeBtn"> <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="toolbar_style">GTK_TOOLBAR_ICONS</property> - <property name="icon_size">GTK_ICON_SIZE_BUTTON</property> - <property name="icon_size_set">True</property> + <property name="tooltip" translatable="yes">Uninstall from system</property> + <property name="relief">GTK_RELIEF_NONE</property> + <property name="response_id">0</property> + <signal name="clicked" handler="cb_package_unmerge_clicked"/> <child> - <widget class="GtkToolButton" id="pkgEmergeBtn"> + <widget class="GtkImage" id="image4"> <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="tooltip" translatable="yes">Install onto system</property> - <property name="stock_id">gtk-add</property> - <signal name="clicked" handler="cb_package_emerge_clicked"/> + <property name="stock">gtk-remove</property> </widget> - <packing> - <property name="expand">False</property> - </packing> - </child> - <child> - <widget class="GtkToolButton" id="pkgUnmergeBtn"> - <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="tooltip" translatable="yes">Uninstall from system</property> - <property name="stock_id">gtk-remove</property> - <signal name="clicked" handler="cb_package_unmerge_clicked"/> - </widget> - <packing> - <property name="expand">False</property> - </packing> </child> + </widget> + <packing> + <property name="expand">False</property> + <property name="position">2</property> + </packing> + </child> + <child> + <widget class="GtkButton" id="pkgRevertBtn"> + <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="relief">GTK_RELIEF_NONE</property> + <property name="response_id">0</property> + <signal name="clicked" handler="cb_package_revert_clicked"/> <child> - <widget class="GtkToolButton" id="pkgRevertBtn"> + <widget class="GtkImage" id="image5"> <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="tooltip" translatable="yes">Revert changes</property> - <property name="stock_id">gtk-undo</property> - <signal name="clicked" handler="cb_package_revert_clicked"/> + <property name="stock">gtk-undo</property> </widget> - <packing> - <property name="expand">False</property> - </packing> </child> </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="expand">False</property> + <property name="position">3</property> </packing> </child> </widget> <packing> <property name="expand">False</property> - <property name="padding">5</property> + <property name="padding">4</property> </packing> </child> <child> diff --git a/portato/gui/templates/PreferenceWindow.glade b/portato/gui/templates/PreferenceWindow.glade index 9b52e66..4cc7dce 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 14:41:14 2008 --> +<!--Generated with glade3 3.4.1 on Tue Mar 25 16:14:57 2008 --> <glade-interface> <widget class="GtkWindow" id="PreferenceWindow"> <property name="border_width">5</property> @@ -214,189 +214,189 @@ <placeholder/> </child> <child> - <widget class="GtkLabel" id="maskLabel"> - <property name="visible">True</property> - <property name="xalign">0</property> - <property name="xpad">5</property> - <property name="label" translatable="yes"><u><i>Masking Keywords</i></u></property> - <property name="use_markup">True</property> - <property name="single_line_mode">True</property> - </widget> - <packing> - <property name="top_attach">7</property> - <property name="bottom_attach">8</property> - <property name="y_padding">5</property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="testLabel"> + <widget class="GtkEntry" id="useFileEdit"> <property name="visible">True</property> - <property name="xalign">0</property> - <property name="xpad">5</property> - <property name="label" translatable="yes"><u><i>Testing Keywords</i></u></property> - <property name="use_markup">True</property> - <property name="single_line_mode">True</property> </widget> <packing> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> - <property name="y_padding">5</property> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> </packing> </child> <child> - <widget class="GtkLabel" id="useLabel"> + <widget class="GtkLabel" id="useEditLabel"> <property name="visible">True</property> <property name="xalign">0</property> - <property name="xpad">5</property> - <property name="label" translatable="yes"><u><i>Use-Flags</i></u></property> - <property name="use_markup">True</property> + <property name="label" translatable="yes">File name to use, if package.use is a directory: </property> <property name="single_line_mode">True</property> </widget> <packing> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="y_padding">6</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> </packing> </child> <child> - <widget class="GtkEventBox" id="hintEB"> + <widget class="GtkCheckButton" id="usePerVersionCheck"> <property name="visible">True</property> - <child> - <widget class="GtkFrame" id="hintFrame"> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="shadow_type">GTK_SHADOW_OUT</property> - <child> - <widget class="GtkLabel" id="hintLabel"> - <property name="visible">True</property> - <property name="xalign">0</property> - <property name="label" translatable="yes"><u>You may use the following placeholders:</u> - -<i>$(cat)</i>: category -<i>$(pkg)</i>: package name -<i>$(cat-1)/$(cat-2)</i>: first/second part of the category</property> - <property name="use_markup">True</property> - </widget> - </child> - <child> - <placeholder/> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - </child> + <property name="label" translatable="yes">Add only exact version to package.use</property> + <property name="response_id">0</property> + <property name="draw_indicator">True</property> </widget> <packing> <property name="right_attach">2</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> </packing> </child> <child> - <widget class="GtkCheckButton" id="maskPerVersionCheck"> + <widget class="GtkCheckButton" id="testPerVersionCheck"> <property name="visible">True</property> - <property name="label" translatable="yes">Add only exact version to package.mask/package.unmask</property> + <property name="label" translatable="yes">Add only exact version to package.keywords</property> <property name="response_id">0</property> <property name="draw_indicator">True</property> </widget> <packing> <property name="right_attach">2</property> - <property name="top_attach">8</property> - <property name="bottom_attach">9</property> + <property name="top_attach">5</property> + <property name="bottom_attach">6</property> </packing> </child> <child> - <widget class="GtkLabel" id="maskEditLabel"> + <widget class="GtkLabel" id="testEditLabel"> <property name="visible">True</property> <property name="xalign">0</property> - <property name="label" translatable="yes">File name to use, if package.mask/package.unmask is a directory: </property> + <property name="label" translatable="yes">File name to use, if package.keywords is a directory: </property> <property name="single_line_mode">True</property> </widget> <packing> - <property name="top_attach">9</property> - <property name="bottom_attach">10</property> + <property name="top_attach">6</property> + <property name="bottom_attach">7</property> </packing> </child> <child> - <widget class="GtkEntry" id="maskFileEdit"> + <widget class="GtkEntry" id="testFileEdit"> <property name="visible">True</property> </widget> <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> - <property name="top_attach">9</property> - <property name="bottom_attach">10</property> + <property name="top_attach">6</property> + <property name="bottom_attach">7</property> </packing> </child> <child> - <widget class="GtkEntry" id="testFileEdit"> + <widget class="GtkEntry" id="maskFileEdit"> <property name="visible">True</property> </widget> <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> - <property name="top_attach">6</property> - <property name="bottom_attach">7</property> + <property name="top_attach">9</property> + <property name="bottom_attach">10</property> </packing> </child> <child> - <widget class="GtkLabel" id="testEditLabel"> + <widget class="GtkLabel" id="maskEditLabel"> <property name="visible">True</property> <property name="xalign">0</property> - <property name="label" translatable="yes">File name to use, if package.keywords is a directory: </property> + <property name="label" translatable="yes">File name to use, if package.mask/package.unmask is a directory: </property> <property name="single_line_mode">True</property> </widget> <packing> - <property name="top_attach">6</property> - <property name="bottom_attach">7</property> + <property name="top_attach">9</property> + <property name="bottom_attach">10</property> </packing> </child> <child> - <widget class="GtkCheckButton" id="testPerVersionCheck"> + <widget class="GtkCheckButton" id="maskPerVersionCheck"> <property name="visible">True</property> - <property name="label" translatable="yes">Add only exact version to package.keywords</property> + <property name="label" translatable="yes">Add only exact version to package.mask/package.unmask</property> <property name="response_id">0</property> <property name="draw_indicator">True</property> </widget> <packing> <property name="right_attach">2</property> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> + <property name="top_attach">8</property> + <property name="bottom_attach">9</property> </packing> </child> <child> - <widget class="GtkCheckButton" id="usePerVersionCheck"> + <widget class="GtkEventBox" id="hintEB"> <property name="visible">True</property> - <property name="label" translatable="yes">Add only exact version to package.use</property> - <property name="response_id">0</property> - <property name="draw_indicator">True</property> + <child> + <widget class="GtkFrame" id="hintFrame"> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="shadow_type">GTK_SHADOW_OUT</property> + <child> + <widget class="GtkLabel" id="hintLabel"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes"><u>You may use the following placeholders:</u> + +<i>$(cat)</i>: category +<i>$(pkg)</i>: package name +<i>$(cat-1)/$(cat-2)</i>: first/second part of the category</property> + <property name="use_markup">True</property> + </widget> + </child> + <child> + <placeholder/> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + </child> </widget> <packing> <property name="right_attach">2</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> </packing> </child> <child> - <widget class="GtkLabel" id="useEditLabel"> + <widget class="GtkLabel" id="useLabel"> <property name="visible">True</property> <property name="xalign">0</property> - <property name="label" translatable="yes">File name to use, if package.use is a directory: </property> + <property name="xpad">5</property> + <property name="label" translatable="yes"><u><i>Use-Flags</i></u></property> + <property name="use_markup">True</property> <property name="single_line_mode">True</property> </widget> <packing> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="y_padding">6</property> </packing> </child> <child> - <widget class="GtkEntry" id="useFileEdit"> + <widget class="GtkLabel" id="testLabel"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="xpad">5</property> + <property name="label" translatable="yes"><u><i>Testing Keywords</i></u></property> + <property name="use_markup">True</property> + <property name="single_line_mode">True</property> + </widget> + <packing> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> + <property name="y_padding">5</property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="maskLabel"> <property name="visible">True</property> + <property name="xalign">0</property> + <property name="xpad">5</property> + <property name="label" translatable="yes"><u><i>Masking Keywords</i></u></property> + <property name="use_markup">True</property> + <property name="single_line_mode">True</property> </widget> <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> + <property name="top_attach">7</property> + <property name="bottom_attach">8</property> + <property name="y_padding">5</property> </packing> </child> </widget> @@ -701,6 +701,47 @@ <property name="position">2</property> </packing> </child> + <child> + <widget class="GtkFrame" id="packageFrame"> + <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="GtkAlignment" id="alignment7"> + <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="bottom_padding">5</property> + <property name="left_padding">12</property> + <property name="right_padding">5</property> + <child> + <widget class="GtkCheckButton" id="showSlotsCheck"> + <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">Show slots in the version list</property> + <property name="response_id">0</property> + <property name="draw_indicator">True</property> + </widget> + </child> + </widget> + </child> + <child> + <widget class="GtkLabel" id="label14"> + <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>Package Options</b></property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="expand">False</property> + <property name="position">3</property> + </packing> + </child> </widget> </child> </widget> diff --git a/portato/gui/windows/main.py b/portato/gui/windows/main.py index 4405512..cde7461 100644 --- a/portato/gui/windows/main.py +++ b/portato/gui/windows/main.py @@ -68,8 +68,8 @@ class PackageTable: self.notebook = self.tree.get_widget("packageNotebook") # the version combo - self.versionCombo = self.tree.get_widget("versionCombo") - self.build_version_combo() + self.versionList = self.tree.get_widget("versionList") + self.build_version_list() # chechboxes self.installedCheck = self.tree.get_widget("installedCheck") @@ -148,17 +148,15 @@ class PackageTable: self.instPackages = system.sort_package_list(system.find_installed_packages(cp, masked = True)) # version-combo-box - self.versionCombo.handler_block(self.versionCombo.changeHandler) # block change handler, because it would be called several times - self.versionCombo.get_model().clear() - self.fill_version_combo() - self.versionCombo.handler_unblock(self.versionCombo.changeHandler) # unblock handler again + self.versionList.get_model().clear() + self.fill_version_list() if not self.queue or not self.doEmerge: self.emergeBtn.set_sensitive(False) self.unmergeBtn.set_sensitive(False) # current status - self.cb_version_combo_changed() + self.cb_version_list_changed() self.vb.show_all() def hide (self): @@ -344,37 +342,64 @@ class PackageTable: self.useList.set_search_column(2) self.useList.set_enable_tree_lines(True) - def build_version_combo (self): - store = gtk.ListStore(gtk.gdk.Pixbuf, str) + def build_version_list (self): + store = gtk.ListStore(gtk.gdk.Pixbuf, str, str) # build view - self.versionCombo.set_model(store) - col = gtk.TreeViewColumn("Versions") + self.versionList.set_model(store) + + col = gtk.TreeViewColumn(_("Versions")) + col.set_property("expand", True) + + self.slotcol = gtk.TreeViewColumn(_("Slot")) + self.slotcol.set_property("expand", True) # adding the pixbuf cell = gtk.CellRendererPixbuf() - self.versionCombo.pack_start(cell, False) - self.versionCombo.add_attribute(cell, "pixbuf", 0) + col.pack_start(cell, False) + col.add_attribute(cell, "pixbuf", 0) # adding the package name cell = gtk.CellRendererText() - self.versionCombo.pack_start(cell, True) - self.versionCombo.add_attribute(cell, "text", 1) + col.pack_start(cell, True) + col.add_attribute(cell, "text", 1) + + # adding the slot + cell = gtk.CellRendererText() + self.slotcol.pack_start(cell, True) + self.slotcol.add_attribute(cell, "text", 2) - # connect - self.versionCombo.changeHandler = self.versionCombo.connect("changed", self.cb_version_combo_changed) + self.versionList.append_column(col) + self.versionList.append_column(self.slotcol) - def fill_version_combo (self): + def fill_version_list (self): - store = self.versionCombo.get_model() + store = self.versionList.get_model() + + # this is here for performance reasons + # to not query the package with info, we do not need + if self.main.cfg.get_boolean("showSlots", "GUI"): + def get_slot(pkg): + return pkg.get_package_settings("SLOT") + + self.slotcol.set_visible(True) + + else: + def get_slot(*args): + return "" + + self.slotcol.set_visible(False) # append versions - for vers, inst in ((x.get_version(), x.is_installed()) for x in self.packages): + for vers, inst, slot in ((x.get_version(), x.is_installed(), get_slot(x)) for x in self.packages): if inst: icon = self.main.instPixbuf else: icon = None - store.append([icon, vers]) + + store.append([icon, vers, slot]) + + pos = ((0,)) # default # activate the first one try: @@ -385,18 +410,25 @@ class PackageTable: best_version = system.find_best_match(self.packages[0].get_cp(), only_installed = (self.instPackages != [])).get_version() for i in range(len(self.packages)): if self.packages[i].get_version() == best_version: - self.versionCombo.set_active(i) + pos = (i,) break except AttributeError: # no package found - self.versionCombo.set_active(0) + pass + + self.versionList.get_selection().select_path(pos) + self.versionList.scroll_to_cell(pos) def actual_package (self): """Returns the actual selected package. @returns: the actual selected package @rtype: backend.Package""" - - return self.packages[self.versionCombo.get_active()] + + model, iter = self.versionList.get_selection().get_selected() + if iter: + return self.packages[model.get_path(iter)[0]] + else: + return self.packages[0] def _update_keywords (self, emerge, update = False): if emerge: @@ -416,7 +448,7 @@ class PackageTable: error(_("Package could not be found: %s"), e[0]) #masked_dialog(e[0]) - def cb_version_combo_changed (self, *args): + def cb_version_list_changed (self, *args): pkg = self.actual_package() @@ -511,9 +543,9 @@ class PackageTable: self.actual_package().remove_new_use_flags() self.actual_package().remove_new_masked() self.actual_package().remove_new_testing() - self.versionCombo.get_model().clear() - self.fill_version_combo() - self.cb_version_combo_changed() + self.versionList.get_model().clear() + self.fill_version_list() + self.cb_version_list_changed() if self.instantChange: self._update_keywords(True, update = True) return True @@ -694,8 +726,6 @@ class MainWindow (Window): self.vpaned.set_position(int(self.window.get_size()[1]/2)) self.hpaned = self.tree.get_widget("hpaned") self.hpaned.set_position(int(self.window.get_size()[0]/1.5)) - self.listPaned = self.tree.get_widget("listPaned") - self.listPaned.set_position(int(self.window.get_size()[0]/2)) # cat and pkg list self.sortPkgListByName = True @@ -962,13 +992,10 @@ class MainWindow (Window): # PANED def load_paned (*pos): pos = map(int, pos) - if oldVersion < 2: - [x.set_position(p) for x,p in zip((self.vpaned, self.hpaned), pos)] - else: - [x.set_position(p) for x,p in zip((self.vpaned, self.hpaned, self.listPaned), pos)] + [x.set_position(p) for x,p in zip((self.vpaned, self.hpaned), pos)] def save_paned (): - return [x.get_position() for x in (self.vpaned, self.hpaned, self.listPaned)] + return [x.get_position() for x in (self.vpaned, self.hpaned)] # SELECTION def load_selection (list, col): @@ -1037,7 +1064,7 @@ class MainWindow (Window): map(self.session.add_handler,[ ([("gtksessionversion", "session")], load_session_version, lambda: SESSION_VERSION), ([("width", "window"), ("height", "window")], lambda w,h: self.window.resize(int(w), int(h)), self.window.get_size), - ([("vpanedpos", "window"), ("hpanedpos", "window"), ("listpanedpos", "window")], load_paned, save_paned), + ([("vpanedpos", "window"), ("hpanedpos", "window")], load_paned, save_paned), ([("catsel", "window")], load_selection(self.catList, 0), save_cat_selection), ([("pkgsel", "window")], load_selection(self.pkgList, 1), save_pkg_selection) #([("merge", "queue"), ("unmerge", "queue"), ("oneshot", "queue")], load_queue, save_queue), diff --git a/portato/gui/windows/preference.py b/portato/gui/windows/preference.py index a312d4b..41db921 100644 --- a/portato/gui/windows/preference.py +++ b/portato/gui/windows/preference.py @@ -24,16 +24,17 @@ class PreferenceWindow (AbstractDialog): # all checkboxes in the window # widget name -> option name checkboxes = { + "consoleUpdateCheck" : ("updateConsole", "GUI"), "debugCheck" : "debug", "deepCheck" : "deep", "newUseCheck" : "newuse", "maskPerVersionCheck" : "maskPerVersion", "minimizeCheck" : ("hideOnMinimize", "GUI"), "searchOnTypeCheck" : ("searchOnType", "GUI"), + "showSlotsCheck" : ("showSlots", "GUI"), "systrayCheck" : ("showSystray", "GUI"), "testPerVersionCheck" : "keywordPerVersion", "titleUpdateCheck" : ("updateTitle", "GUI"), - "consoleUpdateCheck" : ("updateConsole", "GUI"), "usePerVersionCheck" : "usePerVersion" } |