[ocrfeeder] Fix getting selected scanner from scan dialog
- From: Joaquim Rocha <jrocha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ocrfeeder] Fix getting selected scanner from scan dialog
- Date: Wed, 22 Jan 2020 22:28:21 +0000 (UTC)
commit eafa8f61443bb76318efdad5b9963de227924082
Author: scx <scx mail gmail com>
Date: Mon Jan 6 19:54:35 2020 +0100
Fix getting selected scanner from scan dialog
The code that gets the selected scanner was being called after the
dialog destroyed, and that resulted in always getting "None" as the
selected scanner.
This patch fixes that by simply calling the mentioned function before
destroying the dialog.
src/ocrfeeder/studio/studioBuilder.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/ocrfeeder/studio/studioBuilder.py b/src/ocrfeeder/studio/studioBuilder.py
index cbf4490..f713c7c 100644
--- a/src/ocrfeeder/studio/studioBuilder.py
+++ b/src/ocrfeeder/studio/studioBuilder.py
@@ -200,10 +200,10 @@ class Studio:
Gdk.threads_enter()
response = scanner_chooser_dialog.run()
Gdk.threads_leave()
- scanner_chooser_dialog.destroy()
if response == Gtk.ResponseType.ACCEPT:
device = scanner_chooser_dialog.getSelectedDevice()
- else:
+ scanner_chooser_dialog.destroy()
+ if response != Gtk.ResponseType.ACCEPT:
return
elif len(devices) == 1:
device = devices[0][0]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]