summaryrefslogtreecommitdiff
path: root/src/simple-scan.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2024-07-21 19:58:31 +0200
committerJörg Frings-Fürst <debian@jff.email>2024-07-21 19:58:31 +0200
commit5a514d891db203b803a37c2110184f537fcd5608 (patch)
tree0c85f179d5cfeb471f3227bd4a94998e3aaf4ee1 /src/simple-scan.vala
parent408791709f23be34de957320384d02b228ea488f (diff)
parent35c7b263d4fc6910be51005193095cfbdeaa969a (diff)
Merge branch 'release/debian/46.0-1'HEADdebian/46.0-1master
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 ();