[shotwell] Extract SetBackground dialog
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [shotwell] Extract SetBackground dialog
- Date: Wed, 20 Dec 2017 21:49:34 +0000 (UTC)
commit af567f9ca897202763c770e979cd1d1781cebe7b
Author: Jens Georg <mail jensge org>
Date: Wed Dec 20 16:38:27 2017 +0100
Extract SetBackground dialog
shotwell.am | 1 +
src/Dialogs.vala | 33 ---------------------------------
src/dialogs/SetBackground.vala | 40 ++++++++++++++++++++++++++++++++++++++++
src/meson.build | 1 +
4 files changed, 42 insertions(+), 33 deletions(-)
---
diff --git a/shotwell.am b/shotwell.am
index 05af1f7..e7d0655 100644
--- a/shotwell.am
+++ b/shotwell.am
@@ -62,6 +62,7 @@ shotwell_SOURCES = \
src/db/VideoTable.vala \
src/db/VersionTable.vala \
src/db/SavedSearchDBTable.vala \
+ src/dialogs/SetBackground.vala \
src/editing_tools/EditingTools.vala \
src/editing_tools/RGBHistogramManipulator.vala \
src/editing_tools/StraightenTool.vala \
diff --git a/src/Dialogs.vala b/src/Dialogs.vala
index 69d48fa..5439426 100644
--- a/src/Dialogs.vala
+++ b/src/Dialogs.vala
@@ -1080,39 +1080,6 @@ public class EntryMultiCompletion : Gtk.EntryCompletion {
}
}
-[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() {
- bool use_header;
- Gtk.Settings.get_default ().get ("gtk-dialogs-use-header", out use_header);
- Object(use_header_bar: use_header ? 1 : 0);
- 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;
- }
-}
[GtkTemplate (ui = "/org/gnome/Shotwell/ui/set_background_slideshow_dialog.ui")]
public class SetBackgroundSlideshowDialog : Gtk.Dialog {
diff --git a/src/dialogs/SetBackground.vala b/src/dialogs/SetBackground.vala
new file mode 100644
index 0000000..3017f19
--- /dev/null
+++ b/src/dialogs/SetBackground.vala
@@ -0,0 +1,40 @@
+/* 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() {
+ bool use_header;
+ Gtk.Settings.get_default ().get ("gtk-dialogs-use-header", out use_header);
+ Object(use_header_bar: use_header ? 1 : 0);
+ 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;
+ }
+}
diff --git a/src/meson.build b/src/meson.build
index d094a1f..c471e7d 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -192,6 +192,7 @@ executable('shotwell',
'MediaViewTracker.vala',
'UnityProgressBar.vala',
'Upgrades.vala',
+ 'dialogs/SetBackground.vala',
'.unitize/_UnitInternals.vala',
'.unitize/_UtilInternals.vala',
'.unitize/_ThreadsInternals.vala',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]