7
from SimpleGtkbuilderApp import SimpleGtkbuilderApp
9
from view.appview import AppView, AppStore
10
from view.catview import CategoriesView
11
from view.viewswitcher import ViewSwitcher
14
XAPIAN_BASE_PATH = "/var/cache/app-install"
15
APP_INSTALL_PATH = "/usr/share/app-install"
16
ICON_PATH = APP_INSTALL_PATH+"/icons/"
18
class AppCenter(SimpleGtkbuilderApp):
20
def __init__(self, datadir):
21
SimpleGtkbuilderApp.__init__(self, datadir+"/ui/MptCenter.ui")
24
xapian_base_path = XAPIAN_BASE_PATH
25
pathname = os.path.join(xapian_base_path, "xapian")
26
db = xapian.Database(pathname)
28
# additional icons come from app-install-data
29
icons = gtk.icon_theme_get_default()
30
icons.append_search_path(ICON_PATH)
33
self.view_switcher = ViewSwitcher()
34
self.scrolledwindow_viewswitcher.add(self.view_switcher)
35
self.view_switcher.show()
38
self.cat_view = CategoriesView(APP_INSTALL_PATH, db, icons)
39
self.scrolledwindow_categories.add(self.cat_view)
43
store = AppStore(db, icons)
44
self.app_view = AppView(store)
45
self.scrolledwindow_applist.add(self.app_view)
49
self.window_main.show_all()
50
SimpleGtkbuilderApp.run(self)