Add AppImageHub in-app catalog browser with search, categories, and install
This commit is contained in:
@@ -17,6 +17,7 @@ use crate::core::security;
|
||||
use crate::core::updater;
|
||||
use crate::core::watcher;
|
||||
use crate::i18n::{i18n, ni18n_f};
|
||||
use crate::ui::catalog_view;
|
||||
use crate::ui::cleanup_wizard;
|
||||
use crate::ui::dashboard;
|
||||
use crate::ui::detail_view;
|
||||
@@ -150,6 +151,7 @@ impl DriftwoodWindow {
|
||||
section2.append(Some(&i18n("Find Duplicates")), Some("win.find-duplicates"));
|
||||
section2.append(Some(&i18n("Security Report")), Some("win.security-report"));
|
||||
section2.append(Some(&i18n("Disk Cleanup")), Some("win.cleanup"));
|
||||
section2.append(Some(&i18n("Browse Catalog")), Some("win.catalog"));
|
||||
menu.append_section(None, §ion2);
|
||||
|
||||
let section3 = gio::Menu::new();
|
||||
@@ -566,6 +568,16 @@ impl DriftwoodWindow {
|
||||
})
|
||||
.build();
|
||||
|
||||
// Catalog browser action
|
||||
let catalog_action = gio::ActionEntry::builder("catalog")
|
||||
.activate(|window: &Self, _, _| {
|
||||
let db = window.database().clone();
|
||||
let catalog_page = catalog_view::build_catalog_page(&db);
|
||||
let nav = window.imp().navigation_view.get().unwrap();
|
||||
nav.push(&catalog_page);
|
||||
})
|
||||
.build();
|
||||
|
||||
// Show keyboard shortcuts dialog
|
||||
let shortcuts_action = gio::ActionEntry::builder("show-shortcuts")
|
||||
.activate(|window: &Self, _, _| {
|
||||
@@ -595,6 +607,7 @@ impl DriftwoodWindow {
|
||||
find_duplicates_action,
|
||||
security_report_action,
|
||||
cleanup_action,
|
||||
catalog_action,
|
||||
shortcuts_action,
|
||||
show_drop_hint_action,
|
||||
]);
|
||||
@@ -929,6 +942,9 @@ impl DriftwoodWindow {
|
||||
let db = self.database();
|
||||
let library_view = self.imp().library_view.get().unwrap();
|
||||
|
||||
// Ensure default catalog sources exist
|
||||
crate::core::catalog::ensure_default_sources(db);
|
||||
|
||||
match db.get_all_appimages() {
|
||||
Ok(records) if !records.is_empty() => {
|
||||
library_view.populate(records);
|
||||
|
||||
Reference in New Issue
Block a user