summaryrefslogtreecommitdiff
path: root/portato/gui
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2008-07-03 17:59:53 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2008-07-03 17:59:53 +0200
commita32293a8bbb0a90512d4f8e0fbc385257b29e72a (patch)
treed93fbf2ff5349b00a75f7521eca629b1233baffc /portato/gui
parent09e693a8061d0b96c3aac8aae6ae12d6272b2c3e (diff)
downloadportato-a32293a8bbb0a90512d4f8e0fbc385257b29e72a.tar.gz
portato-a32293a8bbb0a90512d4f8e0fbc385257b29e72a.tar.bz2
portato-a32293a8bbb0a90512d4f8e0fbc385257b29e72a.zip
Should show dependencies now
Diffstat (limited to '')
-rw-r--r--portato/gui/templates/PluginWindow.glade160
-rw-r--r--portato/gui/windows/plugin.py50
2 files changed, 128 insertions, 82 deletions
diff --git a/portato/gui/templates/PluginWindow.glade b/portato/gui/templates/PluginWindow.glade
index 01db971..8ba7aa9 100644
--- a/portato/gui/templates/PluginWindow.glade
+++ b/portato/gui/templates/PluginWindow.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.4 on Mon Jun 30 21:04:51 2008 -->
+<!--Generated with glade3 3.4.4 on Thu Jul 3 17:48:01 2008 -->
<glade-interface>
<widget class="GtkWindow" id="PluginWindow">
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
@@ -41,81 +41,55 @@
<property name="n_columns">2</property>
<property name="row_spacing">5</property>
<child>
- <widget class="GtkHButtonBox" id="hbuttonbox1">
+ <widget class="GtkButton" id="installBtn">
<property name="visible">True</property>
- <property name="spacing">5</property>
- <property name="homogeneous">True</property>
- <property name="layout_style">GTK_BUTTONBOX_EDGE</property>
- <child>
- <widget class="GtkRadioButton" id="enabledRB">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Enabled</property>
- <property name="response_id">0</property>
- <property name="active">True</property>
- <signal name="toggled" handler="cb_state_toggled"/>
- </widget>
- </child>
- <child>
- <widget class="GtkRadioButton" id="tempEnabledRB">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Temporarily enabled</property>
- <property name="response_id">0</property>
- <property name="group">enabledRB</property>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="label" translatable="yes">_Install dependencies</property>
+ <property name="use_underline">True</property>
+ <property name="response_id">0</property>
+ </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>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkExpander" id="depExpander">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
<child>
- <widget class="GtkRadioButton" id="tempDisabledRB">
+ <widget class="GtkTreeView" id="depList">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Temporarily disabled</property>
- <property name="response_id">0</property>
- <property name="group">enabledRB</property>
- <signal name="toggled" handler="cb_state_toggled"/>
+ <property name="headers_clickable">True</property>
</widget>
- <packing>
- <property name="position">2</property>
- </packing>
</child>
<child>
- <widget class="GtkRadioButton" id="disabledRB">
+ <widget class="GtkLabel" id="label4">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Disabled</property>
- <property name="response_id">0</property>
- <property name="group">enabledRB</property>
- <signal name="toggled" handler="cb_state_toggled"/>
+ <property name="label" translatable="yes">Needed dependencies</property>
+ <property name="single_line_mode">True</property>
</widget>
<packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">3</property>
+ <property name="type">label_item</property>
</packing>
</child>
</widget>
<packing>
- <property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="y_options">GTK_FILL</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="authorLabel">
+ <widget class="GtkLabel" id="descrLabel">
<property name="visible">True</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes">label</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">1</property>
- <property name="bottom_attach">2</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
@@ -133,56 +107,82 @@
</packing>
</child>
<child>
- <widget class="GtkLabel" id="descrLabel">
+ <widget class="GtkLabel" id="authorLabel">
<property name="visible">True</property>
+ <property name="xalign">0</property>
<property name="label" translatable="yes">label</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">1</property>
+ <property name="bottom_attach">2</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
- <widget class="GtkExpander" id="depExpander">
+ <widget class="GtkHButtonBox" id="hbuttonbox1">
<property name="visible">True</property>
- <property name="can_focus">True</property>
+ <property name="spacing">5</property>
+ <property name="homogeneous">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_EDGE</property>
<child>
- <widget class="GtkTreeView" id="treeview1">
+ <widget class="GtkRadioButton" id="enabledRB">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="headers_clickable">True</property>
+ <property name="label" translatable="yes">Enabled</property>
+ <property name="response_id">0</property>
+ <property name="active">True</property>
+ <signal name="toggled" handler="cb_state_toggled"/>
</widget>
</child>
<child>
- <widget class="GtkLabel" id="label4">
+ <widget class="GtkRadioButton" id="tempEnabledRB">
<property name="visible">True</property>
- <property name="label" translatable="yes">Needed dependencies</property>
- <property name="single_line_mode">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Temporarily enabled</property>
+ <property name="response_id">0</property>
+ <property name="group">enabledRB</property>
</widget>
<packing>
- <property name="type">label_item</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkRadioButton" id="tempDisabledRB">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Temporarily disabled</property>
+ <property name="response_id">0</property>
+ <property name="group">enabledRB</property>
+ <signal name="toggled" handler="cb_state_toggled"/>
+ </widget>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkRadioButton" id="disabledRB">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Disabled</property>
+ <property name="response_id">0</property>
+ <property name="group">enabledRB</property>
+ <signal name="toggled" handler="cb_state_toggled"/>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">3</property>
</packing>
</child>
</widget>
<packing>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="installBtn">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="label" translatable="yes">_Install dependencies</property>
- <property name="use_underline">True</property>
- <property name="response_id">0</property>
- </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="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="y_options">GTK_FILL</property>
</packing>
</child>
</widget>
diff --git a/portato/gui/windows/plugin.py b/portato/gui/windows/plugin.py
index 6e8fdab..17c5326 100644
--- a/portato/gui/windows/plugin.py
+++ b/portato/gui/windows/plugin.py
@@ -42,6 +42,10 @@ class PluginWindow (AbstractDialog):
self.depExpander = self.tree.get_widget("depExpander")
self.installBtn = self.tree.get_widget("installBtn")
+ self.depList = self.tree.get_widget("depList")
+ self.build_dep_list()
+
+ self.instIcon = self.window.render_icon(gtk.STOCK_YES, gtk.ICON_SIZE_MENU)
self.view = self.tree.get_widget("pluginList")
self.store = gtk.ListStore(str)
@@ -59,6 +63,32 @@ class PluginWindow (AbstractDialog):
self.window.show_all()
+ def build_dep_list (self):
+ store = gtk.TreeStore(gtk.gdk.Pixbuf, str)
+
+ self.depList.set_model(store)
+
+ col = gtk.TreeViewColumn()
+
+ cell = gtk.CellRendererPixbuf()
+ col.pack_start(cell, False)
+ col.add_attribute(cell, "pixbuf", 0)
+
+ cell = gtk.CellRendererText()
+ col.pack_start(cell, True)
+ col.add_attribute(cell, "text", 1)
+
+ self.depList.append_column(col)
+
+ def fill_dep_list (self, inst = [], ninst = []):
+ store = self.depList.get_model()
+ store.clear()
+
+ for dep in inst:
+ store.append([self.instIcon, dep])
+ for dep in ninst:
+ store.append([None, dep])
+
def cb_state_toggled (self, rb):
plugin = self.get_actual()
@@ -91,8 +121,24 @@ class PluginWindow (AbstractDialog):
status = self.changedPlugins.get(plugin, plugin.status)
self.buttons[status].set_active(True)
- self.installBtn.hide()
- self.depExpander.hide()
+ if plugin.deps:
+ inst = []
+ ninst = []
+
+ for dep in plugin.deps:
+ if system.find_packages(dep, pkgSet = "installed"):
+ inst.append(dep)
+ else:
+ ninst.append(dep)
+
+ self.fill_dep_list(inst, ninst)
+ self.depExpander.show()
+
+ self.installBtn.show()
+ self.installBtn.set_sensitive(bool(ninst))
+ else:
+ self.installBtn.hide()
+ self.depExpander.hide()
def get_actual (self):
store, it = self.view.get_selection().get_selected()