Commits

Moises Henriquez committed ba6aa45

Fixed icon paths to use included icons, rather than depend on system icons. Changed generic icon size to 32x32

Comments (0)

Files changed (3)

 from utils import repository
 from utils import vl
 from view import widgets
+import os
 
 __author__ = 'Moises Henriquez'
 __author_email__ = 'moc.liamg@xnl.E0M'[::-1]
 def _(str):
     return str
 
+def get_repo_path():
+    basepath = os.path.dirname(os.path.abspath(__file__))
+    return os.path.join(basepath, 'data/PACKAGES.TXT')
+
 class Window(gtk.Window):
     """ Top-level window for the vectorlinux multimedia
     add-on"""
         pane.set_position(100)
         body.pack_start(pane, True, True, 0)
 
-        app_pool = repository.repository('data/PACKAGES.TXT')
+        app_pool = repository.repository(get_repo_path())
 
         # Categories
         rpane = gtk.VBox()
         cache = vl.PackageCache()
 
         lpane = widgets.CategoryPanel(
-                app_pool, 
-                cache, 
+                app_pool,
+                cache,
                 app_display)
         for cat in (_('All'),
                 _('Audio'),
                 _('Video'),
                 _('Bonus')):
             lpane.add_category(cat)
-            
+
         pane.pack1(lpane)
         pane.pack2(rpane)
         self._catpanel = lpane
         time.sleep(0.25)
         gtk.main_quit()
         return
-    
+
     def monitor(self):
         # Get the number of selected items
        i = 0
             self._do_select(None)
             return
         return
-    
+
     def _do_select(self, selection):
         model = self.display.get_model()
         if selection is None:
         out = proc.communicate()
         return out
 
+    def restore_package(self, pkgname):
+        """
+        Restore a package back to its working condition.
+        This means forcing the version or release provided with
+        the bonus disc over ANYTHING else
+        """
+
+
 
 class PackageCache(object):
     """ Cache of currently installed packages """
 import gobject
 import glib
 from .utils import repository
+import os
 
 __author__ = 'Moises Henriquez'
 __author_email__ = 'moc.liamg@xnl.E0M'[::-1]
 def _(str):
     return str
 
+def get_data_path():
+    basepath = os.path.dirname(os.path.abspath(__file__))
+    basepath = os.path.dirname(basepath)
+    return os.path.join(basepath, 'data')
+
 class CategoryPanel(gtk.TreeView):
     """
     Tree used to display software categories
         self.append_column(col)
         for app in repo:
             self.repo.append(app)
-        
+
     def click_event(self, column):
         row = column.get_selection().get_selected_rows()[1][0][0]
         sel = self.model[row][0]
         icons = gtk.icon_theme_get_default()
         icons.append_search_path(
                 '/usr/share/icons/Tango/16x16/emblems/')
+        icons.append_search_path(os.path.join(get_data_path(),
+            'emblems'))
+
         self.overlay = False
         try:
             self._installed = icons.load_icon(
         except glib.GError:
             ## Maybe the icon was not found
             self._installed = icons.load_icon(
-                    'emblem-system', self.OVERLAY_SIZE, 0)
+                    'app-installed', self.OVERLAY_SIZE, 0)
         return
 
     def do_set_property(self, pspec, value):
             app_icon_path = None,
             installed_indicator = False):
         if app_icon_path is None:
-            app_icon_path = '/usr/share/icons/Tango/32x32/categories/applications-other.png'
+            app_icon_path = os.path.join(get_data_path(),
+                    'icons/applications-other.png')
 
             pic = gtk.gdk.pixbuf_new_from_file_at_size(
-                    app_icon_path, 24, 24)
+                    app_icon_path, 32, 32)
             markup = '<b>%s</b>\n'% app_name + ' '*4 + \
                     '<small>%s</small>'% app_short_description
             self.get_model().append([