summaryrefslogtreecommitdiff
path: root/src/dialogs/SetBackground.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2018-07-09 12:10:38 +0200
committerJörg Frings-Fürst <debian@jff.email>2018-07-09 12:10:38 +0200
commit709e2d6f5652ec90c194a4ec2b530bebc6f952cb (patch)
tree496b2f3899e1d5728ee9ae76095cc5056c317447 /src/dialogs/SetBackground.vala
parentf1353e9ffd34db5f755c7da0b3f9c10638fbfd38 (diff)
parent5c8be07095cc04a6d8a95204b0504fd7ab030154 (diff)
Merge branch 'release/0.28.3-1'0.28.3-1
Diffstat (limited to 'src/dialogs/SetBackground.vala')
-rw-r--r--src/dialogs/SetBackground.vala38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/dialogs/SetBackground.vala b/src/dialogs/SetBackground.vala
new file mode 100644
index 0000000..d9a77c4
--- /dev/null
+++ b/src/dialogs/SetBackground.vala
@@ -0,0 +1,38 @@
+/* Copyright 2016 Software Freedom Conservancy Inc.
+ * Copyright 2017 Jens Georg <mail@jensge.org>
+ *
+ * This software is licensed under the GNU LGPL (version 2.1 or later).
+ * See the COPYING file in this distribution.
+ */
+
+[GtkTemplate (ui = "/org/gnome/Shotwell/ui/set_background_dialog.ui")]
+public class SetBackgroundPhotoDialog : Gtk.Dialog {
+ [GtkChild]
+ private Gtk.CheckButton desktop_background_checkbox;
+ [GtkChild]
+ private Gtk.CheckButton screensaver_checkbox;
+
+ public SetBackgroundPhotoDialog() {
+ Object(use_header_bar: Resources.use_header_bar());
+ this.set_transient_for (AppWindow.get_instance());
+ }
+
+ [GtkCallback]
+ private void on_checkbox_clicked() {
+ set_response_sensitive (Gtk.ResponseType.OK,
+ desktop_background_checkbox.active ||
+ screensaver_checkbox.active);
+ }
+
+ public bool execute(out bool desktop_background, out bool screensaver) {
+ this.show_all();
+ var result = this.run() == Gtk.ResponseType.OK;
+ this.hide ();
+
+ desktop_background = desktop_background_checkbox.active;
+ screensaver = screensaver_checkbox.active;
+
+ this.destroy();
+ return result;
+ }
+}