Add GitHub metadata enrichment for catalog apps
This commit is contained in:
@@ -2384,7 +2384,7 @@ fn fuse_install_command(status: &FuseStatus) -> Option<&'static str> {
|
||||
|
||||
/// Show a screenshot in a fullscreen lightbox window with prev/next navigation.
|
||||
/// Uses a separate gtk::Window to avoid parent scroll position interference.
|
||||
fn show_screenshot_lightbox(
|
||||
pub fn show_screenshot_lightbox(
|
||||
parent: >k::Window,
|
||||
textures: &Rc<std::cell::RefCell<Vec<Option<gtk::gdk::Texture>>>>,
|
||||
initial_index: usize,
|
||||
@@ -2607,12 +2607,23 @@ fn fetch_favicon_async(url: &str, image: >k::Image) {
|
||||
});
|
||||
}
|
||||
|
||||
fn show_uninstall_dialog(
|
||||
pub fn show_uninstall_dialog(
|
||||
toast_overlay: &adw::ToastOverlay,
|
||||
record: &AppImageRecord,
|
||||
db: &Rc<Database>,
|
||||
is_integrated: bool,
|
||||
data_paths: &[(String, String, u64)],
|
||||
) {
|
||||
show_uninstall_dialog_with_callback(toast_overlay, record, db, is_integrated, data_paths, None);
|
||||
}
|
||||
|
||||
pub fn show_uninstall_dialog_with_callback(
|
||||
toast_overlay: &adw::ToastOverlay,
|
||||
record: &AppImageRecord,
|
||||
db: &Rc<Database>,
|
||||
is_integrated: bool,
|
||||
data_paths: &[(String, String, u64)],
|
||||
on_complete: Option<Box<dyn FnOnce() + 'static>>,
|
||||
) {
|
||||
let name = record.app_name.as_deref().unwrap_or(&record.filename);
|
||||
let dialog = adw::AlertDialog::builder()
|
||||
@@ -2667,6 +2678,7 @@ fn show_uninstall_dialog(
|
||||
let record_path = record.path.clone();
|
||||
let db_ref = db.clone();
|
||||
let toast_ref = toast_overlay.clone();
|
||||
let on_complete = std::cell::Cell::new(on_complete);
|
||||
dialog.connect_response(Some("uninstall"), move |_dlg, _response| {
|
||||
// Remove integration if checked
|
||||
if let Some(ref check) = integration_check {
|
||||
@@ -2700,6 +2712,11 @@ fn show_uninstall_dialog(
|
||||
|
||||
toast_ref.add_toast(adw::Toast::new("AppImage uninstalled"));
|
||||
|
||||
// Run the completion callback if provided
|
||||
if let Some(cb) = on_complete.take() {
|
||||
cb();
|
||||
}
|
||||
|
||||
// Navigate back (the detail view is now stale)
|
||||
if let Some(nav) = toast_ref.ancestor(adw::NavigationView::static_type()) {
|
||||
let nav: adw::NavigationView = nav.downcast().unwrap();
|
||||
|
||||
Reference in New Issue
Block a user