summaryrefslogtreecommitdiff
path: root/portato/gui/gtk
diff options
context:
space:
mode:
Diffstat (limited to 'portato/gui/gtk')
-rw-r--r--portato/gui/gtk/TreeViewTooltips.py2
-rw-r--r--portato/gui/gtk/glade/portato.glade452
-rw-r--r--portato/gui/gtk/usetips.py4
-rw-r--r--portato/gui/gtk/windows.py56
4 files changed, 298 insertions, 216 deletions
diff --git a/portato/gui/gtk/TreeViewTooltips.py b/portato/gui/gtk/TreeViewTooltips.py
index 1112d3e..120d4df 100644
--- a/portato/gui/gtk/TreeViewTooltips.py
+++ b/portato/gui/gtk/TreeViewTooltips.py
@@ -292,7 +292,7 @@ class TreeViewTooltips:
def get_tooltip(self, view, column, path):
'See the module doc string for a description of this method'
- raise NotImplemented, 'Subclass must implement get_tooltip()'
+ raise NotImplementedError, 'Subclass must implement get_tooltip()'
if __name__ == '__main__':
diff --git a/portato/gui/gtk/glade/portato.glade b/portato/gui/gtk/glade/portato.glade
index f99be90..c8695c3 100644
--- a/portato/gui/gtk/glade/portato.glade
+++ b/portato/gui/gtk/glade/portato.glade
@@ -392,72 +392,48 @@
<property name="n_rows">4</property>
<property name="n_columns">2</property>
<child>
- <widget class="GtkScrolledWindow" id="useListScroll">
+ <widget class="GtkHBox" id="checkHB">
<property name="visible">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="spacing">1</property>
+ <property name="homogeneous">True</property>
<child>
- <widget class="GtkTreeView" id="useList">
+ <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="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>
- <placeholder/>
+ <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="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">&lt;span foreground='red'&gt;&lt;b&gt;MISSING KEYWORD&lt;/b&gt;&lt;/span&gt;</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">&lt;b&gt;Installed, but not in portage anymore&lt;/b&gt;</property>
- <property name="use_markup">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
@@ -522,55 +498,79 @@
</packing>
</child>
<child>
- <widget class="GtkHBox" id="checkHB">
+ <widget class="GtkLabel" id="notInSysLabel">
+ <property name="visible">True</property>
+ <property name="no_show_all">True</property>
+ <property name="label" translatable="yes">&lt;b&gt;Installed, but not in portage anymore&lt;/b&gt;</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">&lt;span foreground='red'&gt;&lt;b&gt;MISSING KEYWORD&lt;/b&gt;&lt;/span&gt;</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">
<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>
<child>
- <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>
+ <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="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="GtkCheckButton" id="testingCheck">
+ <widget class="GtkTreeView" id="useList">
<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">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options">GTK_FILL</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>
</widget>
@@ -845,6 +845,68 @@
</widget>
</child>
<child>
+ <widget class="GtkFrame" id="systemFrame">
+ <property name="visible">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">
+ <property name="visible">True</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">
+ <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>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkRadioButton" id="paludisRadio">
+ <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>
+ </widget>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label7">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">&lt;b&gt;System Options&lt;/b&gt;</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="syncFrame">
<property name="visible">True</property>
<property name="label_xalign">0</property>
@@ -890,7 +952,7 @@
</child>
</widget>
<packing>
- <property name="position">1</property>
+ <property name="position">2</property>
</packing>
</child>
<child>
@@ -941,7 +1003,7 @@
</child>
</widget>
<packing>
- <property name="position">2</property>
+ <property name="position">3</property>
</packing>
</child>
<child>
@@ -969,186 +1031,186 @@
<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">&lt;u&gt;&lt;i&gt;Masking Keywords&lt;/i&gt;&lt;/u&gt;</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">&lt;u&gt;&lt;i&gt;Testing Keywords&lt;/i&gt;&lt;/u&gt;</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">&lt;u&gt;&lt;i&gt;Use-Flags&lt;/i&gt;&lt;/u&gt;</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">&lt;u&gt;You may use the following placeholders:&lt;/u&gt;
-
- &lt;i&gt;$(cat)&lt;/i&gt;: category
- &lt;i&gt;$(pkg)&lt;/i&gt;: package name
- &lt;i&gt;$(cat-1)/$(cat-2)&lt;/i&gt;: 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="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="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="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="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">&lt;u&gt;You may use the following placeholders:&lt;/u&gt;
+
+ &lt;i&gt;$(cat)&lt;/i&gt;: category
+ &lt;i&gt;$(pkg)&lt;/i&gt;: package name
+ &lt;i&gt;$(cat-1)/$(cat-2)&lt;/i&gt;: 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">&lt;u&gt;&lt;i&gt;Use-Flags&lt;/i&gt;&lt;/u&gt;</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">&lt;u&gt;&lt;i&gt;Testing Keywords&lt;/i&gt;&lt;/u&gt;</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">&lt;u&gt;&lt;i&gt;Masking Keywords&lt;/i&gt;&lt;/u&gt;</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>
@@ -1167,7 +1229,7 @@
</child>
</widget>
<packing>
- <property name="position">3</property>
+ <property name="position">4</property>
</packing>
</child>
<child>
@@ -1196,7 +1258,7 @@
</child>
</widget>
<packing>
- <property name="position">4</property>
+ <property name="position">5</property>
</packing>
</child>
</widget>
diff --git a/portato/gui/gtk/usetips.py b/portato/gui/gtk/usetips.py
index 6611e09..d59e397 100644
--- a/portato/gui/gtk/usetips.py
+++ b/portato/gui/gtk/usetips.py
@@ -10,7 +10,7 @@
#
# Written by René 'Necoro' Neumann <necoro@necoro.net>
-from portato.backend import Package
+from portato.backend import system
from portato.backend.flags import invert_use_flag
from TreeViewTooltips import TreeViewTooltips
@@ -48,7 +48,7 @@ class UseTips (TreeViewTooltips):
return None
def __get_flags(self, cpv):
- pkg = Package(cpv)
+ pkg = system.new_package(cpv)
enabled = []
disabled = []
diff --git a/portato/gui/gtk/windows.py b/portato/gui/gtk/windows.py
index a872f3a..7841e5e 100644
--- a/portato/gui/gtk/windows.py
+++ b/portato/gui/gtk/windows.py
@@ -23,8 +23,7 @@ if USE_GTKSOURCEVIEW:
# our backend stuff
from portato.helper import *
from portato.constants import CONFIG_LOCATION, VERSION, DATA_DIR
-from portato import backend
-from portato.backend import flags
+from portato.backend import flags, system
from portato.backend.exceptions import *
# more GUI stuff
@@ -37,7 +36,6 @@ from usetips import UseTips
import vte
# other
-from portage_util import unique_array
import types
GLADE_FILE = DATA_DIR+"portato.glade"
@@ -189,6 +187,19 @@ 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):
"""Constructor.
@@ -206,6 +217,7 @@ class PreferenceWindow (AbstractDialog):
hintEB = self.tree.get_widget("hintEB")
hintEB.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse("#f3f785"))
+ # the checkboxes
for box in self.checkboxes:
val = self.checkboxes[box]
if type(val) == types.TupleType:
@@ -215,10 +227,14 @@ class PreferenceWindow (AbstractDialog):
self.tree.get_widget(box).\
set_active(self.cfg.get_boolean(val))
+ # the edits
for edit in self.edits:
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)
+
self.window.show_all()
def _save(self):
@@ -233,6 +249,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])
def cb_ok_clicked(self, button):
"""Saves, writes to config-file and closes the window."""
@@ -355,8 +375,8 @@ class PackageTable:
self.instantChange = instantChange
# packages and installed packages
- self.packages = backend.sort_package_list(backend.find_packages(cp, masked = True))
- self.instPackages = backend.sort_package_list(backend.find_installed_packages(cp, masked = True))
+ self.packages = system.sort_package_list(system.find_packages(cp, masked = True))
+ self.instPackages = system.sort_package_list(system.find_installed_packages(cp, masked = True))
# version-combo-box
self.vCombo = self.build_vers_combo()
@@ -400,7 +420,7 @@ class PackageTable:
pkg_flags = pkg.get_all_use_flags()
pkg_flags.sort()
for use in pkg_flags:
- store.append([pkg.is_use_flag_enabled(use), use, backend.get_use_desc(use, self.cp)])
+ store.append([pkg.is_use_flag_enabled(use), use, system.get_use_desc(use, self.cp)])
return store
@@ -439,7 +459,7 @@ class PackageTable:
if self.version:
best_version = self.version
else:
- best_version = backend.find_best_match(self.packages[0].get_cp(), (self.instPackages != [])).get_version()
+ best_version = system.find_best_match(self.packages[0].get_cp(), (self.instPackages != [])).get_version()
for i in range(len(self.packages)):
if self.packages[i].get_version() == best_version:
combo.set_active(i)
@@ -465,7 +485,7 @@ class PackageTable:
try:
try:
self.queue.append(self.actual_package().get_cpv(), unmerge = False, update = update)
- except backend.PackageNotFoundException, e:
+ except PackageNotFoundException, e:
if unmask_dialog(e[0]) == gtk.RESPONSE_YES:
self.queue.append(self.actual_package().get_cpv(), unmerge = False, unmask = True, update = update)
except BlockedException, e:
@@ -473,7 +493,7 @@ class PackageTable:
else:
try:
self.queue.append(self.actual_package().get_cpv(), unmerge = True)
- except backend.PackageNotFoundException, e:
+ except PackageNotFoundException, e:
masked_dialog(e[0])
def cb_combo_changed (self, combo):
@@ -730,7 +750,7 @@ class MainWindow (Window):
store = gtk.ListStore(str)
# build categories
- for p in backend.list_categories():
+ for p in system.list_categories():
store.append([p])
# sort them alphabetically
store.set_sort_column_id(0, gtk.SORT_ASCENDING)
@@ -823,7 +843,7 @@ class MainWindow (Window):
iterator = store.get_original().get_iter(path)
if store.is_in_emerge(iterator):
package = store.get_value(iterator, 0)
- cat, name, vers, rev = backend.split_package_name(package)
+ cat, name, vers, rev = system.split_cpv(package)
if rev != "r0": vers = vers+"-"+rev
self.show_package(cat+"/"+name, queue = self.queue, version = vers, instantChange = True, doEmerge = False)
return True
@@ -844,7 +864,7 @@ class MainWindow (Window):
changed_flags_dialog("masking keywords")
flags.write_masked()
flags.write_testing()
- backend.reload_settings()
+ system.reload_settings()
if not self.doUpdate:
self.queue.emerge(force=True)
@@ -861,11 +881,11 @@ class MainWindow (Window):
@Window.watch_cursor
def cb_update_clicked (self, action):
- if not backend.am_i_root():
+ if not am_i_root():
not_root_dialog()
else:
- updating = backend.update_world(newuse = self.cfg.get_boolean("newuse_opt"), deep = self.cfg.get_boolean("deep_opt"))
+ updating = system.update_world(newuse = self.cfg.get_boolean("newuse_opt"), deep = self.cfg.get_boolean("deep_opt"))
debug("updating list:", [(x.get_cpv(), y.get_cpv()) for x,y in updating],"--> length:",len(updating))
try:
@@ -907,7 +927,7 @@ class MainWindow (Window):
return True
def cb_sync_clicked (self, action):
- if not backend.am_i_root():
+ if not am_i_root():
not_root_dialog()
else:
self.notebook.set_current_page(self.CONSOLE_PAGE)
@@ -920,7 +940,7 @@ class MainWindow (Window):
self.queue.sync()
def cb_save_flags_clicked (self, action):
- if not backend.am_i_root():
+ if not am_i_root():
not_root_dialog()
else:
flags.write_use_flags()
@@ -930,7 +950,7 @@ class MainWindow (Window):
@Window.watch_cursor
def cb_reload_clicked (self, action):
"""Reloads the portage settings and the database."""
- backend.reload_settings()
+ system.reload_settings()
del self.db
self.db = Database()
self.db.populate()
@@ -939,7 +959,7 @@ class MainWindow (Window):
def cb_search_clicked (self, entry):
"""Do a search."""
if entry.get_text() != "":
- packages = backend.find_all_packages(entry.get_text(), withVersion = False)
+ packages = system.find_all_packages(entry.get_text(), withVersion = False)
if packages == []:
nothing_found_dialog()