summaryrefslogtreecommitdiff
path: root/src/simple-scan.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2024-06-30 20:45:42 +0200
committerJörg Frings-Fürst <debian@jff.email>2024-06-30 20:45:42 +0200
commit26d8dd51f3ecc4bd6861ed5155acb3090a1983d4 (patch)
tree08d9369065e32f20a80f9cf916a5b1a468b39527 /src/simple-scan.vala
parent1676db749dc23da9fcd9c767de2f1e9a0c61b2b2 (diff)
New upstream version 46.0upstream/46.0upstream
Diffstat (limited to 'src/simple-scan.vala')
-rw-r--r--src/simple-scan.vala21
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 ();