summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/package_details.py33
-rw-r--r--portato/gui/templates/MainWindow.ui23
-rw-r--r--portato/gui/windows/main.py11
3 files changed, 24 insertions, 43 deletions
diff --git a/plugins/package_details.py b/plugins/package_details.py
index 49a88ad..cda3c94 100644
--- a/plugins/package_details.py
+++ b/plugins/package_details.py
@@ -12,7 +12,7 @@
import gtk
import os
-from portato.gui.views import HighlightView
+from portato.gui import views
class Detail (WidgetPlugin):
__author__ = "René 'Necoro' Neumann"
@@ -49,26 +49,41 @@ class ScrolledDetail (Detail):
self._widget_.add(self._view_)
Detail.widget_init(self)
- self._widget_.show_all()
class ChangelogDetail (ScrolledDetail):
- __description__ = "Shows the Changelog of a package"
- _widget_name_ = "Changelog"
+ __description__ = _("Shows the Changelog of a package")
+ _widget_name_ = _("Changelog")
def widget_init (self):
- self._view_ = HighlightView(self.view_update, ["changelog"])
+ self._view_ = views.HighlightView(self.view_update, ["changelog"])
ScrolledDetail.widget_init(self)
def view_update (self, pkg):
- return os.path.join(pkg.get_package_path(), "Changelog")
+ return os.path.join(pkg.get_package_path(), "ChangeLog")
class EbuildDetail (ScrolledDetail):
- __description__ = "Shows the ebuild of a package"
- _widget_name_ = "Ebuild"
+ __description__ = _("Shows the ebuild of a package")
+ _widget_name_ = _("Ebuild")
def widget_init(self):
- self._view_ = HighlightView(lambda p: p.get_ebuild_path(), ["gentoo", "sh"])
+ self._view_ = views.HighlightView(lambda p: p.get_ebuild_path(), ["gentoo", "sh"])
ScrolledDetail.widget_init(self)
+class FilesDetail (ScrolledDetail):
+ __description__ = _("Shows the installed files of a package")
+ _widget_name_ = _("Files")
+
+ def widget_init (self):
+ self._view_ = views.InstalledOnlyView(self.show_files)
+ ScrolledDetail.widget_init(self)
+
+ def show_files (self, pkg):
+ try:
+ for f in pkg.get_files():
+ yield " %s\n" % f
+ except IOError, e:
+ yield _("Error: %s") % e.strerror
+
register(EbuildDetail)
+register(FilesDetail)
register(ChangelogDetail)
diff --git a/portato/gui/templates/MainWindow.ui b/portato/gui/templates/MainWindow.ui
index e26a337..5577f9b 100644
--- a/portato/gui/templates/MainWindow.ui
+++ b/portato/gui/templates/MainWindow.ui
@@ -803,29 +803,6 @@
<property name="tab_fill">False</property>
</packing>
</child>
- <child>
- <object class="GtkScrolledWindow" id="filesScroll">
- <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="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <child>
- <placeholder/>
- </child>
- </object>
- </child>
- <child type="tab">
- <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="label" translatable="yes">Files</property>
- </object>
- <packing>
- <property name="position">5</property>
- <property name="tab_fill">False</property>
- </packing>
- </child>
</object>
<packing>
<property name="position">1</property>
diff --git a/portato/gui/windows/main.py b/portato/gui/windows/main.py
index 0eec034..184d29b 100644
--- a/portato/gui/windows/main.py
+++ b/portato/gui/windows/main.py
@@ -98,7 +98,6 @@ class PackageTable:
# views
self.views = map (lambda x: self.tree.get_widget(x).get_child(),
[
- "filesScroll",
"dependencyScroll", "useListScroll"
])
@@ -523,16 +522,6 @@ class MainWindow (Window):
# the different scrolls
- def show_files (p):
- try:
- for f in p.get_files():
- yield " %s\n" % f
- except IOError, e:
- yield _("Error: %s") % e.strerror
-
- filesScroll = self.tree.get_widget("filesScroll")
- filesScroll.add(InstalledOnlyView(show_files))
-
depScroll = self.tree.get_widget("dependencyScroll")
depScroll.add(self.build_dep_list())