summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2009-02-20 00:29:36 +0100
committerRené 'Necoro' Neumann <necoro@necoro.net>2009-02-20 00:29:36 +0100
commitd3f2196d3c638222a8e96c3d61626a9ff8efb2e1 (patch)
tree74a5dc61fdc49be449497e0cedf9759a15a50ed5
parent796f983e0eb5889ee18169bfedfdef99e5b9e2ef (diff)
downloadportato-d3f2196d3c638222a8e96c3d61626a9ff8efb2e1.tar.gz
portato-d3f2196d3c638222a8e96c3d61626a9ff8efb2e1.tar.bz2
portato-d3f2196d3c638222a8e96c3d61626a9ff8efb2e1.zip
Add color btns to the preferences, so they are configurable here too
Diffstat (limited to '')
-rw-r--r--doc/Changelog1
-rw-r--r--etc/portato.cfg1
-rw-r--r--portato/gui/templates/PreferenceWindow.ui269
-rw-r--r--portato/gui/windows/main.py16
-rw-r--r--portato/gui/windows/preference.py34
5 files changed, 222 insertions, 99 deletions
diff --git a/doc/Changelog b/doc/Changelog
index 5c7f8a7..448c8ee 100644
--- a/doc/Changelog
+++ b/doc/Changelog
@@ -8,6 +8,7 @@ next:
- check prerequisites before starting
- reorganize preferences
- change from libglade to GtkBuilder
+- add color buttns to the preferences, so the colors can be changed
- bugs fixed: #44, #41, #15, #47
0.11.1:
diff --git a/etc/portato.cfg b/etc/portato.cfg
index 5533064..950d78d 100644
--- a/etc/portato.cfg
+++ b/etc/portato.cfg
@@ -106,7 +106,6 @@ scrollbacklines = 1000
#
# Color section
-# Values in this section are normally not editable through the GUI.
#
[COLORS]
diff --git a/portato/gui/templates/PreferenceWindow.ui b/portato/gui/templates/PreferenceWindow.ui
index e5618fd..3b0edb8 100644
--- a/portato/gui/templates/PreferenceWindow.ui
+++ b/portato/gui/templates/PreferenceWindow.ui
@@ -57,6 +57,20 @@
</packing>
</child>
<child>
+ <object class="GtkCheckButton" id="searchOnTypeCheck">
+ <property name="label" translatable="yes">Search while typing</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="yalign">0.47999998927116394</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
<object class="GtkHBox" id="hbox3">
<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>
@@ -81,7 +95,7 @@
</child>
</object>
<packing>
- <property name="position">1</property>
+ <property name="position">2</property>
</packing>
</child>
</object>
@@ -657,23 +671,6 @@
<property name="position">3</property>
</packing>
</child>
- <child>
- <object class="GtkCheckButton" id="searchOnTypeCheck">
- <property name="label" translatable="yes">Search while typing</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="has_tooltip">True</property>
- <property name="tooltip_markup">Update the package list with the current search results while you are typing.
-&lt;b&gt;Note&lt;/b&gt;: Will slow down the typing process.</property>
- <property name="yalign">0.47999998927116394</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="position">4</property>
- </packing>
- </child>
</object>
</child>
</object>
@@ -693,12 +690,12 @@
</packing>
</child>
<child>
- <object class="GtkFrame" id="consoleFrame">
+ <object class="GtkFrame" id="tabFrame">
<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>
- <object class="GtkAlignment" id="alignment9">
+ <object class="GtkAlignment" id="alignment10">
<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="top_padding">5</property>
@@ -706,35 +703,30 @@
<property name="left_padding">12</property>
<property name="right_padding">5</property>
<child>
- <object class="GtkVBox" id="vbox1">
+ <object class="GtkVBox" id="vbox7">
<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>
- <object class="GtkHBox" id="hbox1">
+ <object class="GtkHBox" id="hbox2">
<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>
+ <property name="homogeneous">True</property>
<child>
- <object class="GtkLabel" id="label11">
+ <object class="GtkLabel" id="label15">
<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>
+ <property name="label" translatable="yes">Package Tabs</property>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkFontButton" id="consoleFontBtn">
+ <object class="GtkComboBox" id="packageTabCombo">
<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="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>
</object>
<packing>
<property name="position">1</property>
@@ -746,26 +738,25 @@
</packing>
</child>
<child>
- <object class="GtkHBox" id="hbox">
+ <object class="GtkHBox" id="hbox4">
<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="homogeneous">True</property>
<child>
- <object class="GtkLabel" id="label2">
+ <object class="GtkLabel" id="label21">
<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">Maximum length of the console title</property>
- <property name="single_line_mode">True</property>
+ <property name="label" translatable="yes">System Tabs</property>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkSpinButton" id="titleLengthSpinBtn">
+ <object class="GtkComboBox" id="systemTabCombo">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="adjustment">adjustment1</property>
- <property name="snap_to_ticks">True</property>
- <property name="numeric">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
</object>
<packing>
<property name="position">1</property>
@@ -773,7 +764,6 @@
</child>
</object>
<packing>
- <property name="padding">4</property>
<property name="position">1</property>
</packing>
</child>
@@ -782,10 +772,10 @@
</object>
</child>
<child type="label">
- <object class="GtkLabel" id="label8">
+ <object class="GtkLabel" id="label9">
<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">&lt;b&gt;Console Options&lt;/b&gt;</property>
+ <property name="label" translatable="yes">&lt;b&gt;Tab Options&lt;/b&gt;</property>
<property name="use_markup">True</property>
</object>
</child>
@@ -796,12 +786,12 @@
</packing>
</child>
<child>
- <object class="GtkFrame" id="tabFrame">
+ <object 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>
- <object class="GtkAlignment" id="alignment10">
+ <object 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="top_padding">5</property>
@@ -809,30 +799,97 @@
<property name="left_padding">12</property>
<property name="right_padding">5</property>
<child>
- <object class="GtkVBox" id="vbox7">
+ <object class="GtkVBox" id="vbox3">
<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>
- <object class="GtkHBox" id="hbox2">
+ <object class="GtkCheckButton" id="showSlotsCheck">
+ <property name="label" translatable="yes">Show slots in the version list</property>
<property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="homogeneous">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="collapseCatCheck">
+ <property name="label" translatable="yes">Collapse categories with same prefix</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="has_tooltip">True</property>
+ <property name="tooltip_markup">Organize the categories in a tree. Thereby collapse categories with the same prefix:
+As an example: &lt;i&gt;app-admin&lt;/i&gt;, &lt;i&gt;app-emacs&lt;/i&gt;, and &lt;i&gt;app-vim&lt;/i&gt; would be collapsed into &lt;i&gt;&lt;b&gt;app&lt;/b&gt;&lt;/i&gt; as root and &lt;i&gt;admin&lt;/i&gt;, &lt;i&gt;emacs&lt;/i&gt;, and &lt;i&gt;vim&lt;/i&gt; as children.</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object 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">&lt;b&gt;Package Options&lt;/b&gt;</property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFrame" id="consoleFrame">
+ <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>
+ <object class="GtkAlignment" id="alignment9">
+ <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="top_padding">5</property>
+ <property name="bottom_padding">5</property>
+ <property name="left_padding">12</property>
+ <property name="right_padding">5</property>
+ <child>
+ <object class="GtkVBox" id="vbox1">
+ <property name="visible">True</property>
+ <child>
+ <object 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="spacing">5</property>
<child>
- <object class="GtkLabel" id="label15">
+ <object 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">Package Tabs</property>
+ <property name="label" translatable="yes">Console Font</property>
+ <property name="single_line_mode">True</property>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkComboBox" id="packageTabCombo">
+ <object 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="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>
</object>
<packing>
<property name="position">1</property>
@@ -844,25 +901,26 @@
</packing>
</child>
<child>
- <object class="GtkHBox" id="hbox4">
+ <object class="GtkHBox" id="hbox">
<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="homogeneous">True</property>
<child>
- <object class="GtkLabel" id="label21">
+ <object class="GtkLabel" id="label2">
<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">System Tabs</property>
+ <property name="label" translatable="yes">Maximum length of the console title</property>
+ <property name="single_line_mode">True</property>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkComboBox" id="systemTabCombo">
+ <object class="GtkSpinButton" id="titleLengthSpinBtn">
<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="can_focus">True</property>
+ <property name="adjustment">adjustment1</property>
+ <property name="snap_to_ticks">True</property>
+ <property name="numeric">True</property>
</object>
<packing>
<property name="position">1</property>
@@ -870,6 +928,7 @@
</child>
</object>
<packing>
+ <property name="padding">4</property>
<property name="position">1</property>
</packing>
</child>
@@ -878,26 +937,26 @@
</object>
</child>
<child type="label">
- <object class="GtkLabel" id="label9">
+ <object class="GtkLabel" id="label8">
<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">&lt;b&gt;Tab Options&lt;/b&gt;</property>
+ <property name="label" translatable="yes">&lt;b&gt;Console Options&lt;/b&gt;</property>
<property name="use_markup">True</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
- <property name="position">2</property>
+ <property name="position">3</property>
</packing>
</child>
<child>
- <object class="GtkFrame" id="packageFrame">
+ <object class="GtkFrame" id="colorFrame">
<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>
- <object class="GtkAlignment" id="alignment7">
+ <object class="GtkAlignment" id="alignment12">
<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="top_padding">5</property>
@@ -905,31 +964,71 @@
<property name="left_padding">12</property>
<property name="right_padding">5</property>
<child>
- <object class="GtkVBox" id="vbox3">
+ <object class="GtkVBox" id="vbox8">
<property name="visible">True</property>
<child>
- <object class="GtkCheckButton" id="showSlotsCheck">
- <property name="label" translatable="yes">Show slots in the version list</property>
+ <object class="GtkHBox" id="hbox7">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="draw_indicator">True</property>
+ <property name="spacing">5</property>
+ <property name="homogeneous">True</property>
+ <child>
+ <object class="GtkLabel" id="label20">
+ <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">Package Detail Background</property>
+ <property name="single_line_mode">True</property>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkColorButton" id="pkgTableColorBtn">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="color">#000000000000</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkCheckButton" id="collapseCatCheck">
- <property name="label" translatable="yes">Collapse categories with same prefix</property>
+ <object class="GtkHBox" id="hbox6">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="has_tooltip">True</property>
- <property name="tooltip_markup">Organize the categories in a tree. Thereby collapse categories with the same prefix:
-As an example: &lt;i&gt;app-admin&lt;/i&gt;, &lt;i&gt;app-emacs&lt;/i&gt;, and &lt;i&gt;app-vim&lt;/i&gt; would be collapsed into &lt;i&gt;&lt;b&gt;app&lt;/b&gt;&lt;/i&gt; as root and &lt;i&gt;admin&lt;/i&gt;, &lt;i&gt;emacs&lt;/i&gt;, and &lt;i&gt;vim&lt;/i&gt; as children.</property>
- <property name="draw_indicator">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>
+ <object class="GtkLabel" id="label19">
+ <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">Flag Placeholder Description Background</property>
+ <property name="single_line_mode">True</property>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkColorButton" id="prefColorBtn">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="color">#000000000000</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="position">1</property>
@@ -940,17 +1039,17 @@ As an example: &lt;i&gt;app-admin&lt;/i&gt;, &lt;i&gt;app-emacs&lt;/i&gt;, and &
</object>
</child>
<child type="label">
- <object class="GtkLabel" id="label14">
+ <object class="GtkLabel" id="label18">
<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">&lt;b&gt;Package Options&lt;/b&gt;</property>
+ <property name="label" translatable="yes">&lt;b&gt;Color Options&lt;/b&gt;</property>
<property name="use_markup">True</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
- <property name="position">3</property>
+ <property name="position">4</property>
</packing>
</child>
</object>
diff --git a/portato/gui/windows/main.py b/portato/gui/windows/main.py
index 761f6f3..ee51703 100644
--- a/portato/gui/windows/main.py
+++ b/portato/gui/windows/main.py
@@ -76,8 +76,7 @@ class PackageTable:
self.maskedLabel = self.tree.get_widget("maskedLabel")
# labels
- generalVB = self.tree.get_widget("generalVB")
- generalVB.modify_bg(gtk.STATE_NORMAL, get_color(self.main.cfg, "packagetable"))
+ self.main.set_color(get_color(self.main.cfg, "packagetable"))
self.nameLabel = self.tree.get_widget("nameLabel")
self.descLabel = self.tree.get_widget("descLabel")
@@ -1259,6 +1258,17 @@ class MainWindow (Window):
self.catList.get_selection().select_path(pos)
self.catList.scroll_to_cell(pos)
+ def set_color (self, color):
+ """
+ Sets the color of the general VB (i.e. the thing that displays the package details)
+
+ @param color: color to set it to
+ @type color: gtk.gdk.Color
+ """
+
+ generalVB = self.tree.get_widget("generalVB")
+ generalVB.modify_bg(gtk.STATE_NORMAL, color)
+
def set_uri_hook (self, browser):
"""
Sets the browser command which is called when a URL is going to be opened.
@@ -1678,7 +1688,7 @@ class MainWindow (Window):
"""
User wants to open preferences.
"""
- PreferenceWindow(self.window, self.cfg, self.console.set_font_from_string, self.set_uri_hook, self.set_notebook_tabpos, self.fill_cat_store)
+ PreferenceWindow(self.window, self.cfg, self.console.set_font_from_string, self.set_uri_hook, self.set_notebook_tabpos, self.fill_cat_store, self.set_color)
return True
def cb_about_clicked (self, *args):
diff --git a/portato/gui/windows/preference.py b/portato/gui/windows/preference.py
index a7661c5..4d3493f 100644
--- a/portato/gui/windows/preference.py
+++ b/portato/gui/windows/preference.py
@@ -61,7 +61,7 @@ class PreferenceWindow (AbstractDialog):
4 : gtk.POS_RIGHT
}
- def __init__ (self, parent, cfg, console_fn, linkbtn_fn, tabpos_fn, catmodel_fn):
+ def __init__ (self, parent, cfg, console_fn, linkbtn_fn, tabpos_fn, catmodel_fn, labelcolor_fn):
"""Constructor.
@param parent: parent window
@@ -75,7 +75,9 @@ class PreferenceWindow (AbstractDialog):
@param tabpos_fn: function to call to set the tabposition of the notebooks
@type tabpos_fn: function(gtk.ComboBox,int)
@param catmodel_fn: function to call to set the model of the cat list (collapsed/not collapsed)
- @type catmodel_fn: function()"""
+ @type catmodel_fn: function()
+ @param labelcolor_fn: function to call to set the color of the label
+ @type labelcolor_fn: function(gtk.gdk.Color)"""
AbstractDialog.__init__(self, parent)
@@ -102,6 +104,7 @@ class PreferenceWindow (AbstractDialog):
self.linkbtn_fn = linkbtn_fn
self.tabpos_fn = tabpos_fn
self.catmodel_fn = catmodel_fn
+ self.labelcolor_fn = labelcolor_fn
# set the bg-color of the hint
hintEB = self.tree.get_widget("hintEB")
@@ -110,20 +113,16 @@ class PreferenceWindow (AbstractDialog):
# the checkboxes
for box, val in self.checkboxes.iteritems():
if isinstance(val, tuple):
- self.tree.get_widget(box).\
- set_active(self.cfg.get_boolean(val[0], section = val[1]))
+ self.tree.get_widget(box).set_active(self.cfg.get_boolean(val[0], section = val[1]))
else:
- self.tree.get_widget(box).\
- set_active(self.cfg.get_boolean(val))
+ self.tree.get_widget(box).set_active(self.cfg.get_boolean(val))
# the edits
for edit, val in self.edits.iteritems():
if isinstance(val,tuple):
- self.tree.get_widget(edit).\
- set_text(self.cfg.get(val[0], section = val[1]))
+ self.tree.get_widget(edit).set_text(self.cfg.get(val[0], section = val[1]))
else:
- self.tree.get_widget(edit).\
- set_text(self.cfg.get(val))
+ self.tree.get_widget(edit).set_text(self.cfg.get(val))
# the set list
self.setList = self.tree.get_widget("setList")
@@ -139,6 +138,13 @@ class PreferenceWindow (AbstractDialog):
self.titleLengthSpinBtn = self.tree.get_widget("titleLengthSpinBtn")
self.titleLengthSpinBtn.set_value(int(self.cfg.get("titlelength", section = "GUI")))
+ # the color buttons
+ self.pkgTableColorBtn = self.tree.get_widget("pkgTableColorBtn")
+ self.pkgTableColorBtn.set_color(get_color(self.cfg, "packagetable"))
+
+ self.prefColorBtn = self.tree.get_widget("prefColorBtn")
+ self.prefColorBtn.set_color(get_color(self.cfg, "prefhint"))
+
# the comboboxes
self.systemTabCombo = self.tree.get_widget("systemTabCombo")
self.pkgTabCombo = self.tree.get_widget("packageTabCombo")
@@ -209,6 +215,14 @@ class PreferenceWindow (AbstractDialog):
self.catmodel_fn()
+ # colors
+ c = self.pkgTableColorBtn.get_color()
+ self.cfg.set("packagetable", str(c)[1:], section = "COLORS")
+ self.labelcolor_fn(c)
+
+ c = self.prefColorBtn.get_color()
+ self.cfg.set("prefhint", str(c)[1:], section = "COLORS")
+
def fill_setlist (self):
store = gtk.ListStore(bool, str, str, str)