=== modified file 'data/Makefile.am'
--- data/Makefile.am 2013-09-03 00:57:48 +0000
+++ data/Makefile.am 2013-10-27 20:11:51 +0000
@@ -16,6 +16,7 @@
EXTRA_DIST = simple-scan.desktop.in \
org.gnome.SimpleScan.gschema.xml.in \
simple-scan.ui \
+ simple-scan-menu.ui \
simple-scan.gresource.xml
DISTCLEANFILES = \
=== modified file 'data/simple-scan.gresource.xml'
--- data/simple-scan.gresource.xml 2013-04-18 08:49:12 +0000
+++ data/simple-scan.gresource.xml 2013-10-27 20:05:53 +0000
@@ -2,5 +2,6 @@
simple-scan.ui
+ simple-scan-menu.ui
=== modified file 'data/simple-scan.ui'
--- data/simple-scan.ui 2013-06-06 22:50:37 +0000
+++ data/simple-scan.ui 2013-10-28 14:44:33 +0000
@@ -1,406 +1,476 @@
-
+
+
-
-
-
=== modified file 'po/POTFILES.in'
--- po/POTFILES.in 2011-07-10 10:50:15 +0000
+++ po/POTFILES.in 2013-10-27 23:32:36 +0000
@@ -2,6 +2,7 @@
# Please keep this file sorted alphabetically.
[encoding: UTF-8]
[type: gettext/glade]data/simple-scan.ui
+[type: gettext/glade]data/simple-scan-menu.ui
data/simple-scan.desktop.in
data/org.gnome.SimpleScan.gschema.xml.in
src/book.vala
=== removed file 'po/simple-scan.pot'
--- po/simple-scan.pot 2013-09-03 00:48:13 +0000
+++ po/simple-scan.pot 1970-01-01 00:00:00 +0000
@@ -1,704 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# FIRST AUTHOR , YEAR.
-#
-#, fuzzy
-msgid ""
-msgstr ""
-"Project-Id-Version: PACKAGE VERSION\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-09-03 12:47+1200\n"
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: LANGUAGE \n"
-"Language: \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=CHARSET\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#. Title of scan window
-#: ../data/simple-scan.ui.h:2 ../data/simple-scan.desktop.in.h:1
-msgid "Simple Scan"
-msgstr ""
-
-#. Label on document menu (contains actions for this document, e.g. save, print)
-#: ../data/simple-scan.ui.h:4
-msgid "_Document"
-msgstr ""
-
-#. Scan menu item
-#: ../data/simple-scan.ui.h:6
-msgid "Sc_an"
-msgstr ""
-
-#. Toolbar scan menu item to scan a single page from the scanner
-#: ../data/simple-scan.ui.h:8
-msgid "Single _Page"
-msgstr ""
-
-#. Toolbar scan menu item to scan all pages from a document feeder
-#: ../data/simple-scan.ui.h:10
-msgid "All Pages From _Feeder"
-msgstr ""
-
-#. Menu entry to stop current scan
-#: ../data/simple-scan.ui.h:12
-msgid "_Stop Scan"
-msgstr ""
-
-#. Combo box label for text scan mode
-#: ../data/simple-scan.ui.h:14
-msgid "Text"
-msgstr ""
-
-#. Combo box label for photo scan mode
-#: ../data/simple-scan.ui.h:16
-msgid "Photo"
-msgstr ""
-
-#. Label on email menu item
-#: ../data/simple-scan.ui.h:18
-msgid "_Email"
-msgstr ""
-
-#. Page menu (contains action for each page, e.g. delete, crop)
-#: ../data/simple-scan.ui.h:20
-msgid "_Page"
-msgstr ""
-
-#. Menu item to rotate page to left (anti-clockwise)
-#: ../data/simple-scan.ui.h:22
-msgid "Rotate _Left"
-msgstr ""
-
-#. Menu item to rotate page to right (clockwise)
-#: ../data/simple-scan.ui.h:24
-msgid "Rotate _Right"
-msgstr ""
-
-#. Label for page crop submenu
-#: ../data/simple-scan.ui.h:26
-msgid "_Crop"
-msgstr ""
-
-#. Radio button for no crop
-#: ../data/simple-scan.ui.h:28
-msgid "_None"
-msgstr ""
-
-#. Radio button for cropping page to A4 size
-#: ../data/simple-scan.ui.h:30
-msgid "A_4"
-msgstr ""
-
-#. Radio button for cropping page to A5 size
-#: ../data/simple-scan.ui.h:32
-msgid "A_5"
-msgstr ""
-
-#. Radio button for cropping page to A6 size
-#: ../data/simple-scan.ui.h:34
-msgid "A_6"
-msgstr ""
-
-#. Radio button for cropping page to US letter size
-#: ../data/simple-scan.ui.h:36
-msgid "_Letter"
-msgstr ""
-
-#. Radio button for cropping to page to US legal size
-#: ../data/simple-scan.ui.h:38
-msgid "Le_gal"
-msgstr ""
-
-#. Radio button for cropping page to 4x6 inch
-#: ../data/simple-scan.ui.h:40
-msgid "4×6"
-msgstr ""
-
-#. Radio button for cropping to custom page size
-#: ../data/simple-scan.ui.h:42
-msgid "_Custom"
-msgstr ""
-
-#. Menu item to rotate the crop area
-#: ../data/simple-scan.ui.h:44
-msgid "_Rotate Crop"
-msgstr ""
-
-#. Menu item to move the selected page to the left
-#: ../data/simple-scan.ui.h:46
-msgid "Move Left"
-msgstr ""
-
-#. Menu item to move the selected page to the right
-#: ../data/simple-scan.ui.h:48
-msgid "Move Right"
-msgstr ""
-
-#. Label on help menu
-#: ../data/simple-scan.ui.h:50
-msgid "_Help"
-msgstr ""
-
-#. Help|Contents menu
-#: ../data/simple-scan.ui.h:52
-msgid "_Contents"
-msgstr ""
-
-#. Tooltip for new document button
-#: ../data/simple-scan.ui.h:54
-msgid "Start a new document"
-msgstr ""
-
-#: ../data/simple-scan.ui.h:55
-msgid "New"
-msgstr ""
-
-#. Tooltip for scan toolbar button
-#: ../data/simple-scan.ui.h:57
-msgid "Scan a single page from the scanner"
-msgstr ""
-
-#. Label on scan toolbar item
-#: ../data/simple-scan.ui.h:59
-msgid "Scan"
-msgstr ""
-
-#. Tooltip for save toolbar button
-#: ../data/simple-scan.ui.h:61
-msgid "Save document to a file"
-msgstr ""
-
-#: ../data/simple-scan.ui.h:62
-msgid "Save"
-msgstr ""
-
-#. Tooltip for stop button
-#: ../data/simple-scan.ui.h:64
-msgid "Stop the current scan"
-msgstr ""
-
-#: ../data/simple-scan.ui.h:65
-msgid "Stop"
-msgstr ""
-
-#. Tooltip for rotate left (counter-clockwise) button
-#: ../data/simple-scan.ui.h:67
-msgid "Rotate the page to the left (counter-clockwise)"
-msgstr ""
-
-#. Label on rotate page left (anti-clockwise) item
-#: ../data/simple-scan.ui.h:69
-msgid "Rotate Left"
-msgstr ""
-
-#. Tooltip for rotate right (clockwise) button
-#: ../data/simple-scan.ui.h:71
-msgid "Rotate the page to the right (clockwise)"
-msgstr ""
-
-#. Label on rotate page right (clockwise) item
-#: ../data/simple-scan.ui.h:73
-msgid "Rotate Right"
-msgstr ""
-
-#: ../data/simple-scan.ui.h:74
-msgid "Crop the selected page"
-msgstr ""
-
-#: ../data/simple-scan.ui.h:75
-msgid "Crop"
-msgstr ""
-
-#. Label beside username entry
-#: ../data/simple-scan.ui.h:77
-msgid "_Username for resource:"
-msgstr ""
-
-#. Label beside password entry
-#: ../data/simple-scan.ui.h:79
-msgid "_Password:"
-msgstr ""
-
-#. Button to submit authorization dialog
-#: ../data/simple-scan.ui.h:81
-msgid "_Authorize"
-msgstr ""
-
-#. Title of preferences dialog
-#: ../data/simple-scan.ui.h:83
-msgid "Preferences"
-msgstr ""
-
-#. Label beside scan source combo box
-#: ../data/simple-scan.ui.h:85
-msgid "Scan S_ource:"
-msgstr ""
-
-#. Label beside scan source combo box
-#: ../data/simple-scan.ui.h:87
-msgid "_Text Resolution:"
-msgstr ""
-
-#. Label beside scan source combo box
-#: ../data/simple-scan.ui.h:89
-msgid "_Photo Resolution:"
-msgstr ""
-
-#. Label beside scan side combo box
-#: ../data/simple-scan.ui.h:91
-msgid "Scan Side:"
-msgstr ""
-
-#. Label beside page size combo box
-#: ../data/simple-scan.ui.h:93
-msgid "Page Size:"
-msgstr ""
-
-#. Label beside brightness scale
-#: ../data/simple-scan.ui.h:95
-msgid "Brightness:"
-msgstr ""
-
-#. Label beside contrast scale
-#: ../data/simple-scan.ui.h:97
-msgid "Contrast:"
-msgstr ""
-
-#. Label beside quality scale
-#: ../data/simple-scan.ui.h:99
-msgid "Quality:"
-msgstr ""
-
-#. Combo box label for scanning both sides of a page
-#: ../data/simple-scan.ui.h:101
-msgid "Front and Back"
-msgstr ""
-
-#. Combo box label for scanning the front side of a page
-#: ../data/simple-scan.ui.h:103
-msgid "Front"
-msgstr ""
-
-#. Combo box label for scanning the back side of a page
-#: ../data/simple-scan.ui.h:105
-msgid "Back"
-msgstr ""
-
-#: ../data/simple-scan.desktop.in.h:2
-msgid "Scan Documents"
-msgstr ""
-
-#: ../data/org.gnome.SimpleScan.gschema.xml.in.h:1
-msgid "Window width in pixels"
-msgstr ""
-
-#: ../data/org.gnome.SimpleScan.gschema.xml.in.h:2
-msgid "Window height in pixels"
-msgstr ""
-
-#: ../data/org.gnome.SimpleScan.gschema.xml.in.h:3
-msgid "TRUE if the application window is maximized"
-msgstr ""
-
-#: ../data/org.gnome.SimpleScan.gschema.xml.in.h:4
-msgid "Device to scan from"
-msgstr ""
-
-#: ../data/org.gnome.SimpleScan.gschema.xml.in.h:5
-msgid "SANE device to acquire images from."
-msgstr ""
-
-#: ../data/org.gnome.SimpleScan.gschema.xml.in.h:6
-msgid "Type of document being scanned"
-msgstr ""
-
-#: ../data/org.gnome.SimpleScan.gschema.xml.in.h:7
-msgid ""
-"Type of document being scanned. This setting decides on the scan resolution, "
-"colors and post-processing."
-msgstr ""
-
-#: ../data/org.gnome.SimpleScan.gschema.xml.in.h:8
-msgid "Direction of scan"
-msgstr ""
-
-#: ../data/org.gnome.SimpleScan.gschema.xml.in.h:9
-msgid "The direction of the scanner across the scanned page."
-msgstr ""
-
-#: ../data/org.gnome.SimpleScan.gschema.xml.in.h:10
-msgid "Width of scanned image in pixels"
-msgstr ""
-
-#: ../data/org.gnome.SimpleScan.gschema.xml.in.h:11
-msgid ""
-"The width of scanned image in pixels. This value is updated to what the last "
-"scanned page was."
-msgstr ""
-
-#: ../data/org.gnome.SimpleScan.gschema.xml.in.h:12
-msgid "Height of scanned image in pixels"
-msgstr ""
-
-#: ../data/org.gnome.SimpleScan.gschema.xml.in.h:13
-msgid ""
-"The height of scanned image in pixels. This value is updated to what the "
-"last scanned page was."
-msgstr ""
-
-#: ../data/org.gnome.SimpleScan.gschema.xml.in.h:14
-msgid "Width of paper in tenths of a mm"
-msgstr ""
-
-#: ../data/org.gnome.SimpleScan.gschema.xml.in.h:15
-msgid ""
-"The width of the paper in tenths of a mm (or 0 for automatic paper "
-"detection)."
-msgstr ""
-
-#: ../data/org.gnome.SimpleScan.gschema.xml.in.h:16
-msgid "Height of paper in tenths of a mm"
-msgstr ""
-
-#: ../data/org.gnome.SimpleScan.gschema.xml.in.h:17
-msgid ""
-"The height of the paper in tenths of a mm (or 0 for automatic paper "
-"detection)."
-msgstr ""
-
-#: ../data/org.gnome.SimpleScan.gschema.xml.in.h:18
-msgid "Brightness of scan"
-msgstr ""
-
-#: ../data/org.gnome.SimpleScan.gschema.xml.in.h:19
-msgid "The brightness adjustment from -100 to 100 (0 being none)."
-msgstr ""
-
-#: ../data/org.gnome.SimpleScan.gschema.xml.in.h:20
-msgid "Contrast of scan"
-msgstr ""
-
-#: ../data/org.gnome.SimpleScan.gschema.xml.in.h:21
-msgid "The contrast adjustment from -100 to 100 (0 being none)."
-msgstr ""
-
-#: ../data/org.gnome.SimpleScan.gschema.xml.in.h:22
-msgid "Resolution of last scanned image"
-msgstr ""
-
-#: ../data/org.gnome.SimpleScan.gschema.xml.in.h:23
-msgid "The resolution in dots-per-inch of the previously scanned image."
-msgstr ""
-
-#: ../data/org.gnome.SimpleScan.gschema.xml.in.h:24
-msgid "Resolution for text scans"
-msgstr ""
-
-#: ../data/org.gnome.SimpleScan.gschema.xml.in.h:25
-msgid "The resolution in dots-per-inch to use when scanning text."
-msgstr ""
-
-#: ../data/org.gnome.SimpleScan.gschema.xml.in.h:26
-msgid "Resolution for photo scans"
-msgstr ""
-
-#: ../data/org.gnome.SimpleScan.gschema.xml.in.h:27
-msgid "The resolution in dots-per-inch to use when scanning photos."
-msgstr ""
-
-#: ../data/org.gnome.SimpleScan.gschema.xml.in.h:28
-msgid "Page side to scan"
-msgstr ""
-
-#: ../data/org.gnome.SimpleScan.gschema.xml.in.h:29
-msgid "The page side to scan."
-msgstr ""
-
-#: ../data/org.gnome.SimpleScan.gschema.xml.in.h:30
-msgid "Directory to save files to"
-msgstr ""
-
-#: ../data/org.gnome.SimpleScan.gschema.xml.in.h:31
-msgid ""
-"The directory to save files to. Defaults to the documents directory if unset."
-msgstr ""
-
-#: ../data/org.gnome.SimpleScan.gschema.xml.in.h:32
-msgid "Quality value to use for JPEG compression"
-msgstr ""
-
-#: ../data/org.gnome.SimpleScan.gschema.xml.in.h:33
-msgid "Quality value to use for JPEG compression."
-msgstr ""
-
-#. Error displayed when no scanners to scan with
-#: ../src/scanner.vala:814
-msgid "No scanners available. Please connect a scanner."
-msgstr ""
-
-#. Error displayed when cannot connect to scanner
-#: ../src/scanner.vala:844
-msgid "Unable to connect to scanner"
-msgstr ""
-
-#. Error display when unable to start scan
-#: ../src/scanner.vala:1207
-msgid "Unable to start scan"
-msgstr ""
-
-#. Error displayed when communication with scanner broken
-#: ../src/scanner.vala:1220 ../src/scanner.vala:1317
-msgid "Error communicating with scanner"
-msgstr ""
-
-#. Help string for command line --version flag
-#: ../src/simple-scan.vala:21
-msgid "Show release version"
-msgstr ""
-
-#. Help string for command line --debug flag
-#: ../src/simple-scan.vala:24
-msgid "Print debugging messages"
-msgstr ""
-
-#: ../src/simple-scan.vala:26
-msgid "Fix PDF files generated with older versions of Simple Scan"
-msgstr ""
-
-#. Title of error dialog when scan failed
-#: ../src/simple-scan.vala:297
-msgid "Failed to scan"
-msgstr ""
-
-#. Default filename to use when saving document (and extension will be added, e.g. .jpg)
-#: ../src/simple-scan.vala:316
-msgid "Scanned Document"
-msgstr ""
-
-#. Arguments and description for --help text
-#: ../src/simple-scan.vala:529
-msgid "[DEVICE...] - Scanning utility"
-msgstr ""
-
-#. Text printed out when an unknown command-line argument provided
-#: ../src/simple-scan.vala:540
-#, c-format
-msgid "Run '%s --help' to see a full list of available command line options."
-msgstr ""
-
-#: ../src/ui.vala:91
-msgid "Scanned Document.pdf"
-msgstr ""
-
-#. Label in authorization dialog. '%s' is replaced with the name of the resource requesting authorization
-#: ../src/ui.vala:159
-#, c-format
-msgid "Username and password required to access '%s'"
-msgstr ""
-
-#. Warning displayed when no scanners are detected
-#: ../src/ui.vala:202
-msgid "No scanners detected"
-msgstr ""
-
-#. Hint to user on why there are no scanners detected
-#: ../src/ui.vala:204
-msgid "Please check your scanner is connected and powered on"
-msgstr ""
-
-#. Save dialog: Dialog title
-#: ../src/ui.vala:363
-msgid "Save As..."
-msgstr ""
-
-#. Save dialog: Filter name to show only image files
-#: ../src/ui.vala:377
-msgid "Image Files"
-msgstr ""
-
-#. Save dialog: Filter name to show all files
-#: ../src/ui.vala:383
-msgid "All Files"
-msgstr ""
-
-#.
-#: ../src/ui.vala:388
-msgid "Select File _Type"
-msgstr ""
-
-#. Save dialog: Label for saving in PDF format
-#: ../src/ui.vala:402
-msgid "PDF (multi-page document)"
-msgstr ""
-
-#. Save dialog: Label for saving in JPEG format
-#: ../src/ui.vala:408
-msgid "JPEG (compressed)"
-msgstr ""
-
-#. Save dialog: Label for saving in PNG format
-#: ../src/ui.vala:414
-msgid "PNG (lossless)"
-msgstr ""
-
-#. Title of error dialog when save failed
-#: ../src/ui.vala:503
-msgid "Failed to save file"
-msgstr ""
-
-#. Text in dialog warning when a document is about to be lost
-#: ../src/ui.vala:526
-msgid "If you don't save, changes will be permanently lost."
-msgstr ""
-
-#. Text in dialog warning when a document is about to be lost
-#: ../src/ui.vala:563
-msgid "Save current document?"
-msgstr ""
-
-#. Button in dialog to create new document and discard unsaved document
-#: ../src/ui.vala:565
-msgid "Discard Changes"
-msgstr ""
-
-#. Error message display when unable to save image for preview
-#: ../src/ui.vala:860
-msgid "Unable to save image for preview"
-msgstr ""
-
-#. Error message display when unable to preview image
-#: ../src/ui.vala:872
-msgid "Unable to open image preview application"
-msgstr ""
-
-#. Error message displayed when unable to launch help browser
-#: ../src/ui.vala:1119
-msgid "Unable to open help file"
-msgstr ""
-
-#. The license this software is under (GPL3+)
-#: ../src/ui.vala:1130
-msgid ""
-"This program is free software: you can redistribute it and/or modify\n"
-"it under the terms of the GNU General Public License as published by\n"
-"the Free Software Foundation, either version 3 of the License, or\n"
-"(at your option) any later version.\n"
-"\n"
-"This program is distributed in the hope that it will be useful,\n"
-"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
-"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
-"GNU General Public License for more details.\n"
-"\n"
-"You should have received a copy of the GNU General Public License\n"
-"along with this program. If not, see ."
-msgstr ""
-
-#. Title of about dialog
-#: ../src/ui.vala:1133
-msgid "About Simple Scan"
-msgstr ""
-
-#. Description of program
-#: ../src/ui.vala:1136
-msgid "Simple document scanning tool"
-msgstr ""
-
-#: ../src/ui.vala:1145
-msgid "translator-credits"
-msgstr ""
-
-#. Text in dialog warning when a document is about to be lost
-#: ../src/ui.vala:1156
-msgid "Save document before quitting?"
-msgstr ""
-
-#. Button in dialog to quit and discard unsaved document
-#: ../src/ui.vala:1158
-msgid "Quit without Saving"
-msgstr ""
-
-#. Preferences dialog: Label for default resolution in resolution list
-#: ../src/ui.vala:1289
-#, c-format
-msgid "%d dpi (default)"
-msgstr ""
-
-#. Preferences dialog: Label for minimum resolution in resolution list
-#: ../src/ui.vala:1292
-#, c-format
-msgid "%d dpi (draft)"
-msgstr ""
-
-#. Preferences dialog: Label for maximum resolution in resolution list
-#: ../src/ui.vala:1295
-#, c-format
-msgid "%d dpi (high resolution)"
-msgstr ""
-
-#. Preferences dialog: Label for resolution value in resolution list (dpi = dots per inch)
-#: ../src/ui.vala:1298
-#, c-format
-msgid "%d dpi"
-msgstr ""
-
-#. Title of dialog when cannot load required files
-#: ../src/ui.vala:1333
-msgid "Files missing"
-msgstr ""
-
-#. Description in dialog when cannot load required files
-#: ../src/ui.vala:1335
-msgid "Please check your installation"
-msgstr ""
-
-#. Button in error infobar to open preferences dialog and change scanner
-#: ../src/ui.vala:1403
-msgid "Change _Scanner"
-msgstr ""
-
-#. Combo box value for automatic paper size
-#: ../src/ui.vala:1409
-msgid "Automatic"
-msgstr ""
-
-#: ../src/ui.vala:1449
-#, c-format
-msgid "Darker"
-msgstr ""
-
-#: ../src/ui.vala:1451
-#, c-format
-msgid "Lighter"
-msgstr ""
-
-#: ../src/ui.vala:1458
-#, c-format
-msgid "Less"
-msgstr ""
-
-#: ../src/ui.vala:1460
-#, c-format
-msgid "More"
-msgstr ""
-
-#: ../src/ui.vala:1467
-#, c-format
-msgid "Minimum"
-msgstr ""
-
-#: ../src/ui.vala:1469
-#, c-format
-msgid "Maximum"
-msgstr ""
-
-#: ../src/ui.vala:1527
-msgid "Saving document..."
-msgstr ""
-
-#: ../src/ui.vala:1545
-#, c-format
-msgid "Saving page %d out of %d"
-msgstr ""
=== modified file 'src/simple-scan.vala'
--- src/simple-scan.vala 2013-09-09 00:20:02 +0000
+++ src/simple-scan.vala 2013-10-27 23:29:51 +0000
@@ -45,6 +45,15 @@
{
base.startup ();
+ var builder = new Gtk.Builder ();
+ try {
+ builder.add_from_resource ("/org/gnome/SimpleScan/simple-scan-menu.ui");
+ } catch (Error e) {
+ error ("loading menu builder file: %s", e.message);
+ }
+ var app_menu = builder.get_object ("appmenu") as MenuModel;
+ set_app_menu (app_menu);
+
ui = new UserInterface ();
book = ui.get_book ();
ui.start_scan.connect (scan_cb);
=== modified file 'src/ui.vala'
--- src/ui.vala 2013-06-06 22:50:37 +0000
+++ src/ui.vala 2013-10-28 14:48:46 +0000
@@ -14,12 +14,25 @@
private const int DEFAULT_TEXT_DPI = 150;
private const int DEFAULT_PHOTO_DPI = 300;
+ private const GLib.ActionEntry[] action_entries =
+ {
+ { "new_document", on_new_document_activate },
+ { "save", on_save_activate },
+ { "save_as", on_save_as_activate },
+ { "email", on_email_activate },
+ { "print", on_print_activate },
+ { "preferences", on_preferences_activate },
+ { "help", on_help_activate },
+ { "about", on_about_activate },
+ { "quit", on_quit_activate }
+ };
+
private Settings settings;
private Gtk.Builder builder;
- private Gtk.Window window;
- private Gtk.VBox main_vbox;
+ private Gtk.ApplicationWindow window;
+ private Gtk.Box main_vbox;
private Gtk.InfoBar info_bar;
private Gtk.Image info_bar_image;
private Gtk.Label info_bar_label;
@@ -29,8 +42,6 @@
private Gtk.MenuItem page_move_right_menuitem;
private Gtk.MenuItem page_delete_menuitem;
private Gtk.MenuItem crop_rotate_menuitem;
- private Gtk.MenuItem save_menuitem;
- private Gtk.MenuItem save_as_menuitem;
private Gtk.MenuItem copy_to_clipboard_menuitem;
private Gtk.ToolButton save_toolbutton;
private Gtk.MenuItem stop_menuitem;
@@ -552,12 +563,11 @@
add_default_page ();
book_uri = null;
book.set_needs_saving (false);
- save_as_menuitem.set_sensitive (false);
+// save_as_menuitem.set_sensitive (false);
copy_to_clipboard_menuitem.set_sensitive (false);
}
- [CCode (cname = "G_MODULE_EXPORT new_button_clicked_cb", instance_pos = -1)]
- public void new_button_clicked_cb (Gtk.Widget widget)
+ public void on_new_document_activate ()
{
if (!prompt_to_save (/* Text in dialog warning when a document is about to be lost */
_("Save current document?"),
@@ -766,8 +776,7 @@
}
}
- [CCode (cname = "G_MODULE_EXPORT preferences_button_clicked_cb", instance_pos = -1)]
- public void preferences_button_clicked_cb (Gtk.Widget widget)
+ public void on_preferences_activate ()
{
preferences_dialog.present ();
}
@@ -1036,8 +1045,7 @@
book_view.get_book ().delete_page (book_view.get_selected ());
}
- [CCode (cname = "G_MODULE_EXPORT save_file_button_clicked_cb", instance_pos = -1)]
- public void save_file_button_clicked_cb (Gtk.Widget widget)
+ public void on_save_activate ()
{
save_document (false);
}
@@ -1050,8 +1058,7 @@
page.copy_to_clipboard (window);
}
- [CCode (cname = "G_MODULE_EXPORT save_as_file_button_clicked_cb", instance_pos = -1)]
- public void save_as_file_button_clicked_cb (Gtk.Widget widget)
+ public void on_save_as_activate ()
{
save_document (true);
}
@@ -1081,14 +1088,12 @@
context.paint ();
}
- [CCode (cname = "G_MODULE_EXPORT email_button_clicked_cb", instance_pos = -1)]
- public void email_button_clicked_cb (Gtk.Widget widget)
+ public void on_email_activate ()
{
email (document_hint, get_quality ());
}
- [CCode (cname = "G_MODULE_EXPORT print_button_clicked_cb", instance_pos = -1)]
- public void print_button_clicked_cb (Gtk.Widget widget)
+ public void on_print_activate ()
{
var print = new Gtk.PrintOperation ();
print.set_n_pages ((int) book.get_n_pages ());
@@ -1106,8 +1111,7 @@
print.draw_page.disconnect (draw_page);
}
- [CCode (cname = "G_MODULE_EXPORT help_contents_menuitem_activate_cb", instance_pos = -1)]
- public void help_contents_menuitem_activate_cb (Gtk.Widget widget)
+ public void on_help_activate ()
{
try
{
@@ -1121,8 +1125,7 @@
}
}
- [CCode (cname = "G_MODULE_EXPORT about_menuitem_activate_cb", instance_pos = -1)]
- public void about_menuitem_activate_cb (Gtk.Widget widget)
+ public void on_about_activate ()
{
string[] authors = { "Robert Ancell " };
@@ -1189,8 +1192,7 @@
return true;
}
- [CCode (cname = "G_MODULE_EXPORT quit_menuitem_activate_cb", instance_pos = -1)]
- public void quit_menuitem_activate_cb (Gtk.Widget widget)
+ public void on_quit_activate ()
{
on_quit ();
}
@@ -1308,10 +1310,10 @@
private void needs_saving_cb (Book book)
{
- save_menuitem.set_sensitive (book.get_needs_saving ());
+// save_menuitem.set_sensitive (book.get_needs_saving ());
save_toolbutton.set_sensitive (book.get_needs_saving ());
if (book.get_needs_saving ())
- save_as_menuitem.set_sensitive (true);
+// save_as_menuitem.set_sensitive (true);
copy_to_clipboard_menuitem.set_sensitive (true);
}
@@ -1337,16 +1339,15 @@
}
builder.connect_signals (this);
- window = (Gtk.Window) builder.get_object ("simple_scan_window");
+ window = (Gtk.ApplicationWindow) builder.get_object ("simple_scan_window");
var app = Application.get_default () as Gtk.Application;
+ app.add_action_entries (action_entries, this);
app.add_window (window);
- main_vbox = (Gtk.VBox) builder.get_object ("main_vbox");
+ main_vbox = (Gtk.Box) builder.get_object ("main_vbox");
page_move_left_menuitem = (Gtk.MenuItem) builder.get_object ("page_move_left_menuitem");
page_move_right_menuitem = (Gtk.MenuItem) builder.get_object ("page_move_right_menuitem");
page_delete_menuitem = (Gtk.MenuItem) builder.get_object ("page_delete_menuitem");
crop_rotate_menuitem = (Gtk.MenuItem) builder.get_object ("crop_rotate_menuitem");
- save_menuitem = (Gtk.MenuItem) builder.get_object ("save_menuitem");
- save_as_menuitem = (Gtk.MenuItem) builder.get_object ("save_as_menuitem");
copy_to_clipboard_menuitem = (Gtk.MenuItem) builder.get_object ("copy_to_clipboard_menuitem");
save_toolbutton = (Gtk.ToolButton) builder.get_object ("save_toolbutton");
stop_menuitem = (Gtk.MenuItem) builder.get_object ("stop_scan_menuitem");
@@ -1600,7 +1601,7 @@
{
Gtk.ProgressBar bar;
- public ProgressBarDialog (Gtk.Window parent, string title)
+ public ProgressBarDialog (Gtk.ApplicationWindow parent, string title)
{
bar = new Gtk.ProgressBar ();
var hbox = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 5);