def get_test_window_apptreeview(): cache = get_test_pkg_info() db = get_test_db() icons = get_test_gtk3_icon_cache() # create a filter app_filter = appfilter.AppFilter(db, cache) app_filter.set_supported_only(False) app_filter.set_installed_only(True) # get the TREEstore store = appstore2.AppTreeStore(db, cache, icons) # populate from data cats = get_test_categories(db) for cat in cats[:3]: with ExecutionTime("query cat '%s'" % cat.name): docs = db.get_docs_from_query(cat.query) store.set_category_documents(cat, docs) # ok, this is confusing - the AppView contains the AppTreeView that # is a tree or list depending on the model app_view = appview.AppView(db, cache, icons, show_ratings=True) app_view.set_model(store) box = Gtk.VBox() box.pack_start(app_view, True, True, 0) win = get_test_window(child=box) return win
def get_test_window_recommendations(panel_type="lobby"): cache = get_test_pkg_info() db = get_test_db() icons = get_test_gtk3_icon_cache() from softwarecenter.ui.gtk3.models.appstore2 import AppPropertiesHelper properties_helper = AppPropertiesHelper(db, cache, icons) if panel_type is "lobby": view = recommendations.RecommendationsPanelLobby(db, properties_helper) elif panel_type is "category": cats = get_test_categories(db) view = recommendations.RecommendationsPanelCategory( db, properties_helper, cats[0]) else: # panel_type is "details": view = recommendations.RecommendationsPanelDetails( db, properties_helper) win = get_test_window(child=view, width=600, height=300) win.set_data("rec_panel", view) return win
def get_test_window_recommendations(panel_type="lobby"): cache = get_test_pkg_info() db = get_test_db() icons = get_test_gtk3_icon_cache() from softwarecenter.ui.gtk3.models.appstore2 import AppPropertiesHelper properties_helper = AppPropertiesHelper(db, cache, icons) if panel_type is "lobby": view = recommendations.RecommendationsPanelLobby( db, properties_helper) elif panel_type is "category": cats = get_test_categories(db) view = recommendations.RecommendationsPanelCategory( db, properties_helper, cats[0]) else: # panel_type is "details": view = recommendations.RecommendationsPanelDetails( db, properties_helper) win = get_test_window(child=view, width=600, height=300) win.set_data("rec_panel", view) return win