From 26d8dd51f3ecc4bd6861ed5155acb3090a1983d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sun, 30 Jun 2024 20:45:42 +0200 Subject: New upstream version 46.0 --- src/simple-scan.vala | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src/simple-scan.vala') diff --git a/src/simple-scan.vala b/src/simple-scan.vala index 5deedcf..c2e2da2 100644 --- a/src/simple-scan.vala +++ b/src/simple-scan.vala @@ -9,7 +9,7 @@ * license. */ -public class SimpleScan : Gtk.Application +public class SimpleScan : Adw.Application { static bool show_version; static bool debug_enabled; @@ -40,7 +40,7 @@ public class SimpleScan : Gtk.Application public SimpleScan (ScanDevice? device = null) { /* The inhibit () method use this */ - Object (application_id: "org.gnome.SimpleScan"); + Object (application_id: "simple-scan"); register_session = true; default_device = device; @@ -50,9 +50,6 @@ public class SimpleScan : Gtk.Application { base.startup (); - Hdy.init (); - Hdy.StyleManager.get_default ().color_scheme = PREFER_LIGHT; - app = new AppWindow (); book = app.book; app.start_scan.connect (scan_cb); @@ -1580,9 +1577,14 @@ public class SimpleScan : Gtk.Application private void authorize_cb (Scanner scanner, string resource) { - string username, password; - app.authorize (resource, out username, out password); - scanner.authorize (username, password); + app.authorize.begin (resource, (obj, res) => + { + var data = app.authorize.end(res); + if (data.success) + { + scanner.authorize (data.username, data.password); + } + }); } private Page append_page (int width = 100, int height = 100, int dpi = 100) @@ -1956,7 +1958,6 @@ public class SimpleScan : Gtk.Application var c = new OptionContext (/* Arguments and description for --help text */ _("[DEVICE…] — Scanning utility")); c.add_main_entries (options, GETTEXT_PACKAGE); - c.add_group (Gtk.get_option_group (true)); try { c.parse (ref args); @@ -2014,7 +2015,7 @@ public class SimpleScan : Gtk.Application debug ("Starting %s %s, PID=%i", args[0], VERSION, Posix.getpid ()); - Gtk.init (ref args); + Gtk.init (); var app = new SimpleScan (device); return app.run (); -- cgit v1.2.3