diff options
Diffstat (limited to 'src/simple-scan.vala')
-rw-r--r-- | src/simple-scan.vala | 21 |
1 files changed, 11 insertions, 10 deletions
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 (); |