diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2016-06-05 04:23:52 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2016-06-05 04:23:52 +0200 |
commit | bec5f87053759705fb77bae1aa378f2666c7d153 (patch) | |
tree | bd955b9777aa39b207fa161edf19a6609f822909 /src | |
parent | 1c99a41a296cda6647edc32437a813f6923cb1d0 (diff) | |
parent | 4e10e30c2f99d552239871aa1b27a08a6c18f1a4 (diff) |
Merge tag 'upstream/0.23.1'
Upstream version 0.23.1
Diffstat (limited to 'src')
176 files changed, 541 insertions, 312 deletions
diff --git a/src/AppDirs.vala b/src/AppDirs.vala index 1421314..ecd375d 100644 --- a/src/AppDirs.vala +++ b/src/AppDirs.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. @@ -34,13 +34,29 @@ class AppDirs { } public static void try_migrate_data() { + // Migrate the user plugin dir from .gnome2 to .local + File user_plugin_dir = get_user_plugins_dir(); + File old_dir = + get_home_dir().get_child(".gnome2").get_child("shotwell").get_child("plugins"); + + if (old_dir.query_exists() && !user_plugin_dir.get_parent().query_exists()) { + try { + user_plugin_dir.get_parent().make_directory_with_parents(null); + } catch (Error err) { } + } + + try { + old_dir.move(user_plugin_dir, FileCopyFlags.NONE); + } catch (Error err) { } + + File new_dir = get_data_dir(); - File old_dir = get_home_dir().get_child(".shotwell"); + old_dir = get_home_dir().get_child(".shotwell"); if (new_dir.query_exists() || !old_dir.query_exists()) return; File cache_dir = get_cache_dir(); - Posix.mode_t mask = Posix.umask(0700); + Posix.mode_t mask = Posix.umask(0077); if (!cache_dir.query_exists()) { try { cache_dir.make_directory_with_parents(null); @@ -211,8 +227,23 @@ class AppDirs { return subdir; } + public static void ensure_writable(File dir) { + if (dir.query_exists(null)) { + try { + FileInfo info = dir.query_info(FileAttribute.UNIX_MODE, FileQueryInfoFlags.NONE); + uint32 mode = info.get_attribute_uint32(FileAttribute.UNIX_MODE) | 0700; + if (!dir.set_attribute_uint32(FileAttribute.UNIX_MODE, mode, FileQueryInfoFlags.NONE)) { + AppWindow.panic(_("Could not make directory %s writable").printf(dir.get_path())); + } + } catch (Error err) { + AppWindow.panic(_("Could not make directory %s writable: %s").printf(dir.get_path(), err.message)); + } + } + } + public static File get_cache_subdir(string name, string? subname = null) { File subdir = get_cache_dir().get_child(name); + ensure_writable(subdir); if (subname != null) subdir = subdir.get_child(subname); @@ -223,7 +254,7 @@ class AppDirs { AppWindow.panic(_("Unable to create data subdirectory %s: %s").printf(subdir.get_path(), err.message)); } - + ensure_writable(subdir); return subdir; } @@ -246,7 +277,7 @@ class AppDirs { } public static File get_user_plugins_dir() { - return get_home_dir().get_child(".gnome2").get_child("shotwell").get_child("plugins"); + return get_data_dir().get_child("plugins"); } public static File? get_log_file() { diff --git a/src/AppWindow.vala b/src/AppWindow.vala index d294114..dcb88fd 100644 --- a/src/AppWindow.vala +++ b/src/AppWindow.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. @@ -9,7 +9,8 @@ public class FullscreenWindow : PageWindow { public const int TOOLBAR_DISMISSAL_SEC = 2; public const int TOOLBAR_CHECK_DISMISSAL_MSEC = 500; - private Gtk.Window toolbar_window = new Gtk.Window(Gtk.WindowType.POPUP); + private Gtk.Overlay overlay = new Gtk.Overlay(); + private Gtk.Toolbar toolbar = null; private Gtk.ToolButton close_button = new Gtk.ToolButton(null, null); private Gtk.ToggleToolButton pin_button = new Gtk.ToggleToolButton(); private bool is_toolbar_shown = false; @@ -59,8 +60,12 @@ public class FullscreenWindow : PageWindow { close_button.set_tooltip_text(_("Leave fullscreen")); close_button.clicked.connect(on_close); - Gtk.Toolbar toolbar = page.get_toolbar(); + toolbar = page.get_toolbar(); toolbar.set_show_arrow(false); + toolbar.valign = Gtk.Align.END; + toolbar.halign = Gtk.Align.CENTER; + toolbar.expand = false; + toolbar.opacity = Resources.TRANSIENT_WINDOW_OPACITY; if (page is SlideshowPage) { // slideshow page doesn't own toolbar to hide it, subscribe to signal instead @@ -75,14 +80,9 @@ public class FullscreenWindow : PageWindow { toolbar.insert(close_button, -1); - // set up toolbar along bottom of screen - toolbar_window.set_screen(get_screen()); - toolbar_window.set_border_width(0); - toolbar_window.add(toolbar); - - toolbar_window.realize.connect(on_toolbar_realized); - - add(page); + add(overlay); + overlay.add(page); + overlay.add_overlay (toolbar); // call to set_default_size() saves one repaint caused by changing // size from default to full screen. In slideshow mode, this change @@ -159,7 +159,6 @@ public class FullscreenWindow : PageWindow { private void on_close() { Config.Facade.get_instance().set_pin_toolbar_state(is_toolbar_dismissal_enabled); hide_toolbar(); - toolbar_window = null; AppWindow.get_instance().end_fullscreen(); } @@ -213,7 +212,7 @@ public class FullscreenWindow : PageWindow { devmgr.get_client_pointer().get_position(null, null, out py); int wy; - toolbar_window.get_window().get_geometry(null, out wy, null, null); + toolbar.get_window().get_geometry(null, out wy, null, null); return (py >= wy); } @@ -232,26 +231,8 @@ public class FullscreenWindow : PageWindow { return false; } - private void on_toolbar_realized() { - Gtk.Requisition req; - toolbar_window.get_preferred_size(null, out req); - - // place the toolbar in the center of the monitor along the bottom edge - Gdk.Rectangle monitor = get_monitor_geometry(); - int tx = monitor.x + (monitor.width - req.width) / 2; - if (tx < 0) - tx = 0; - - int ty = monitor.y + monitor.height - req.height; - if (ty < 0) - ty = 0; - - toolbar_window.move(tx, ty); - toolbar_window.set_opacity(Resources.TRANSIENT_WINDOW_OPACITY); - } - private void invoke_toolbar() { - toolbar_window.show_all(); + toolbar.show_all(); is_toolbar_shown = true; @@ -262,9 +243,6 @@ public class FullscreenWindow : PageWindow { if (!is_toolbar_shown) return false; - if (toolbar_window == null) - return false; - // if dismissal is disabled, keep open but keep checking if ((!is_toolbar_dismissal_enabled)) return true; @@ -296,7 +274,7 @@ public class FullscreenWindow : PageWindow { } private void hide_toolbar() { - toolbar_window.hide(); + toolbar.hide(); is_toolbar_shown = false; } } @@ -449,14 +427,7 @@ public abstract class AppWindow : PageWindow { instance = this; title = Resources.APP_TITLE; - - GLib.List<Gdk.Pixbuf> pixbuf_list = new GLib.List<Gdk.Pixbuf>(); - foreach (string resource in Resources.APP_ICONS) - pixbuf_list.append(Resources.get_icon(resource, 0)); - // Use copy() because set_default_icon_list() actually accepts an owned reference - // If we didn't hold the pixbufs in memory, would need to use copy_deep() - // See https://mail.gnome.org/archives/vala-list/2014-August/msg00022.html - set_default_icon_list(pixbuf_list.copy()); + set_default_icon_name("shotwell"); // restore previous size and maximization state if (this is LibraryWindow) { @@ -699,7 +670,7 @@ public abstract class AppWindow : PageWindow { "copyright", Resources.COPYRIGHT, "website", Resources.HOME_URL, "license", Resources.LICENSE, - "website-label", _("Visit the Yorba web site"), + "website-label", _("Visit the Shotwell web site"), "authors", Resources.AUTHORS, "logo", Resources.get_icon(Resources.ICON_ABOUT_LOGO, -1), "translator-credits", _("translator-credits"), diff --git a/src/Application.vala b/src/Application.vala index fa81832..fe3e3e9 100644 --- a/src/Application.vala +++ b/src/Application.vala @@ -1,4 +1,4 @@ -/* Copyright 2010-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/BatchImport.vala b/src/BatchImport.vala index 13feabe..4a46a26 100644 --- a/src/BatchImport.vala +++ b/src/BatchImport.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. @@ -431,7 +431,7 @@ public class BatchImport : Object { private Gee.HashMap<string, File> imported_full_md5_table = new Gee.HashMap<string, File>(); #endif private uint throbber_id = 0; - private int max_outstanding_import_jobs = Workers.thread_per_cpu_minus_one(); + private uint max_outstanding_import_jobs = Workers.thread_per_cpu_minus_one(); private bool untrash_duplicates = true; private bool mark_duplicates_online = true; diff --git a/src/Box.vala b/src/Box.vala index 253f0b6..a1067bc 100644 --- a/src/Box.vala +++ b/src/Box.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/CheckerboardLayout.vala b/src/CheckerboardLayout.vala index b71870c..30f3d66 100644 --- a/src/CheckerboardLayout.vala +++ b/src/CheckerboardLayout.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/CollectionPage.vala b/src/CollectionPage.vala index 95cbf01..c5fcbee 100644 --- a/src/CollectionPage.vala +++ b/src/CollectionPage.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/ColorTransformation.vala b/src/ColorTransformation.vala index 1e3e4a8..a7b7452 100644 --- a/src/ColorTransformation.vala +++ b/src/ColorTransformation.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/CommandManager.vala b/src/CommandManager.vala index 379b259..c7e40ab 100644 --- a/src/CommandManager.vala +++ b/src/CommandManager.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/Commands.vala b/src/Commands.vala index d1a0593..a5816ea 100644 --- a/src/Commands.vala +++ b/src/Commands.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/CustomComponents.vala b/src/CustomComponents.vala index d9e4916..0a08c93 100644 --- a/src/CustomComponents.vala +++ b/src/CustomComponents.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/Debug.vala b/src/Debug.vala index c8e8de5..f159b0d 100644 --- a/src/Debug.vala +++ b/src/Debug.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/DesktopIntegration.vala b/src/DesktopIntegration.vala index 1ee3c59..89ff556 100644 --- a/src/DesktopIntegration.vala +++ b/src/DesktopIntegration.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/Dialogs.vala b/src/Dialogs.vala index d760e73..c208caf 100644 --- a/src/Dialogs.vala +++ b/src/Dialogs.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. @@ -168,7 +168,9 @@ public class ExportDialog : Gtk.Dialog { private bool in_insert = false; public ExportDialog(string title) { - Object (use_header_bar: 1); + bool use_header; + Gtk.Settings.get_default ().get ("gtk-dialogs-use-header", out use_header); + Object (use_header_bar: use_header ? 1 : 0); this.title = title; resizable = false; @@ -1191,7 +1193,9 @@ public class TextEntryDialog : Gtk.Dialog { private Gtk.ButtonBox action_area_box; public TextEntryDialog() { - Object (use_header_bar: 1); + bool use_header; + Gtk.Settings.get_default ().get ("gtk-dialogs-use-header", out use_header); + Object (use_header_bar: use_header ? 1 : 0); } public void set_builder(Gtk.Builder builder) { @@ -1264,7 +1268,9 @@ public class MultiTextEntryDialog : Gtk.Dialog { private Gtk.ButtonBox action_area_box; public MultiTextEntryDialog() { - Object (use_header_bar: 1); + bool use_header; + Gtk.Settings.get_default ().get ("gtk-dialogs-use-header", out use_header); + Object (use_header_bar: use_header ? 1 : 0); } public void set_builder(Gtk.Builder builder) { @@ -1649,7 +1655,9 @@ public class AdjustDateTimeDialog : Gtk.Dialog { bool contains_video = false, bool only_video = false) { assert(source != null); - Object(use_header_bar: 1); + bool use_header; + Gtk.Settings.get_default ().get ("gtk-dialogs-use-header", out use_header); + Object(use_header_bar: use_header ? 1 : 0); set_modal(true); set_resizable(false); @@ -2086,7 +2094,7 @@ public class WelcomeDialog : Gtk.Dialog { secondary_text.set_markup("<span weight=\"normal\">%s</span>".printf( _("To get started, import photos in any of these ways:"))); secondary_text.set_alignment(0, 0.5f); - Gtk.Image image = new Gtk.Image.from_pixbuf(Resources.get_icon(Resources.ICON_APP, 50)); + var image = new Gtk.Image.from_icon_name ("shotwell", Gtk.IconSize.DIALOG); Gtk.Box header_text = new Gtk.Box(Gtk.Orientation.VERTICAL, 0); header_text.pack_start(primary_text, false, false, 5); @@ -2278,6 +2286,12 @@ public class PreferencesDialog { builder = AppWindow.create_builder(); dialog = builder.get_object("preferences_dialog") as Gtk.Dialog; + bool use_header; + Gtk.Settings.get_default ().get ("gtk-dialogs-use-header", out use_header); + if (!use_header) { + Gtk.Widget null_titlebar = null; + dialog.set_titlebar (null_titlebar); + } dialog.set_parent_window(AppWindow.get_instance().get_parent_window()); dialog.set_transient_for(AppWindow.get_instance()); dialog.delete_event.connect(on_delete); diff --git a/src/Dimensions.vala b/src/Dimensions.vala index 42188d3..b5556da 100644 --- a/src/Dimensions.vala +++ b/src/Dimensions.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/DirectoryMonitor.vala b/src/DirectoryMonitor.vala index 468425f..50d0048 100644 --- a/src/DirectoryMonitor.vala +++ b/src/DirectoryMonitor.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/Event.vala b/src/Event.vala index cbc3485..3518cab 100644 --- a/src/Event.vala +++ b/src/Event.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/Exporter.vala b/src/Exporter.vala index 6a1b377..221ba73 100644 --- a/src/Exporter.vala +++ b/src/Exporter.vala @@ -1,4 +1,4 @@ -/* Copyright 2010-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/International.vala b/src/International.vala index a51d0a2..23bdd0b 100644 --- a/src/International.vala +++ b/src/International.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/LibraryFiles.vala b/src/LibraryFiles.vala index 918ed1e..20d43ab 100644 --- a/src/LibraryFiles.vala +++ b/src/LibraryFiles.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/LibraryMonitor.vala b/src/LibraryMonitor.vala index 4793f7d..75194c1 100644 --- a/src/LibraryMonitor.vala +++ b/src/LibraryMonitor.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/MediaDataRepresentation.vala b/src/MediaDataRepresentation.vala index 31b9cc8..f01f147 100644 --- a/src/MediaDataRepresentation.vala +++ b/src/MediaDataRepresentation.vala @@ -1,4 +1,4 @@ -/* Copyright 2010-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/MediaInterfaces.vala b/src/MediaInterfaces.vala index e5f078c..37209cf 100644 --- a/src/MediaInterfaces.vala +++ b/src/MediaInterfaces.vala @@ -1,4 +1,4 @@ -/* Copyright 2010-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/MediaMetadata.vala b/src/MediaMetadata.vala index 22ee96b..68f7251 100644 --- a/src/MediaMetadata.vala +++ b/src/MediaMetadata.vala @@ -1,4 +1,4 @@ -/* Copyright 2010-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/MediaMonitor.vala b/src/MediaMonitor.vala index 5d9c488..3859b97 100644 --- a/src/MediaMonitor.vala +++ b/src/MediaMonitor.vala @@ -1,4 +1,4 @@ -/* Copyright 2010-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/MediaPage.vala b/src/MediaPage.vala index 6496503..1da615c 100644 --- a/src/MediaPage.vala +++ b/src/MediaPage.vala @@ -1,4 +1,4 @@ -/* Copyright 2010-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/MediaViewTracker.vala b/src/MediaViewTracker.vala index 0c48f2d..27fcf4a 100644 --- a/src/MediaViewTracker.vala +++ b/src/MediaViewTracker.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/MetadataWriter.vala b/src/MetadataWriter.vala index 969506e..0c23260 100644 --- a/src/MetadataWriter.vala +++ b/src/MetadataWriter.vala @@ -1,4 +1,4 @@ -/* Copyright 2010-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. @@ -165,6 +165,7 @@ public class MetadataWriter : Object { private bool enabled = false; private HashTimedQueue<LibraryPhoto> dirty; private Gee.HashMap<LibraryPhoto, CommitJob> pending = new Gee.HashMap<LibraryPhoto, CommitJob>(); + private Gee.HashSet<CommitJob> pending_cancel = new Gee.HashSet<CommitJob>(); private Gee.HashSet<string> interested_photo_details = new Gee.HashSet<string>(); private LibraryPhoto? ignore_photo_alteration = null; private uint outstanding_total = 0; @@ -578,7 +579,10 @@ public class MetadataWriter : Object { bool cancelled = false; if (pending.has_key(photo)) { - pending.get(photo).cancel(); + CommitJob j = (CommitJob) pending.get(photo); + pending_cancel.add(j); + j.cancel(); + pending.unset(photo); cancelled = true; } @@ -610,6 +614,10 @@ public class MetadataWriter : Object { keywords.add(tag.get_name()); } + // check if there is already a job for that photo. if yes, cancel it. + if (pending.has_key(photo)) + cancel_job(photo); + CommitJob job = new CommitJob(this, photo, keywords); pending.set(photo, job); @@ -683,7 +691,7 @@ public class MetadataWriter : Object { } private void on_update_cancelled(BackgroundJob j) { - bool removed = pending.unset(((CommitJob) j).photo); + bool removed = pending_cancel.remove((CommitJob) j); assert(removed); count_cancelled_work(1, true); diff --git a/src/Orientation.vala b/src/Orientation.vala index e9f0cd0..9ff74e4 100644 --- a/src/Orientation.vala +++ b/src/Orientation.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/Page.vala b/src/Page.vala index 72613e0..2f6f2c3 100644 --- a/src/Page.vala +++ b/src/Page.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. @@ -1157,6 +1157,9 @@ public abstract class Page : Gtk.ScrolledWindow { if (event_source != null) event_source.get_window().set_cursor(new Gdk.Cursor(Gdk.CursorType.BLANK_CURSOR)); + // We remove the timeout so reset the id + last_timeout_id = 0; + return false; } } diff --git a/src/Photo.vala b/src/Photo.vala index 2f2b7a5..11dbae6 100644 --- a/src/Photo.vala +++ b/src/Photo.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. @@ -4079,7 +4079,14 @@ public abstract class Photo : PhotoSource, Dateable { private void on_editable_file_changed(File file, File? other_file, FileMonitorEvent event) { // This has some expense, but this assertion is important for a lot of sanity reasons. lock (readers) { - assert(readers.editable != null && file.equal(readers.editable.get_file())); + assert(readers.editable != null); + + if (!file.equal(readers.editable.get_file())) { + // Ignore. When the export file is created, we receive a + // DELETE event for renaming temporary file created by exiv2 when + // writing meta-data. + return; + } } debug("EDITABLE %s: %s", event.to_string(), file.get_path()); diff --git a/src/PhotoMonitor.vala b/src/PhotoMonitor.vala index 58725a4..caf0720 100644 --- a/src/PhotoMonitor.vala +++ b/src/PhotoMonitor.vala @@ -1,4 +1,4 @@ -/* Copyright 2010-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/PhotoPage.vala b/src/PhotoPage.vala index c4175a3..ce57c2f 100644 --- a/src/PhotoPage.vala +++ b/src/PhotoPage.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. @@ -1136,6 +1136,7 @@ public abstract class EditingHostPage : SinglePhotoPage { set_pixbuf(pixbuf, photo.get_dimensions()); } catch (GLib.Error err) { + set_pixbuf(new Gdk.Pixbuf(Gdk.Colorspace.RGB, false, 8, 1, 1), photo.get_dimensions()); warning("%s", err.message); } } @@ -1159,11 +1160,8 @@ public abstract class EditingHostPage : SinglePhotoPage { } } if (pixbuf == null) { - // Create empty pixbuf. - pixbuf = AppWindow.get_instance().render_icon("image-missing", - Gtk.IconSize.DIALOG, null); + pixbuf = get_placeholder_pixbuf(); get_canvas_scaling().perform_on_pixbuf(pixbuf, Gdk.InterpType.NEAREST, true); - } return pixbuf; } diff --git a/src/PixbufCache.vala b/src/PixbufCache.vala index e3723ae..5b79868 100644 --- a/src/PixbufCache.vala +++ b/src/PixbufCache.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/Printing.vala b/src/Printing.vala index b0a2cf0..a7505ef 100644 --- a/src/Printing.vala +++ b/src/Printing.vala @@ -1,4 +1,4 @@ -/* Copyright 2010-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/Properties.vala b/src/Properties.vala index 88e0e1d..9d7bdd4 100644 --- a/src/Properties.vala +++ b/src/Properties.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. @@ -630,7 +630,9 @@ private class ExtendedPropertiesWindow : Gtk.Dialog { } public ExtendedPropertiesWindow(Gtk.Window owner) { - Object(use_header_bar: 1); + bool use_header; + Gtk.Settings.get_default ().get ("gtk-dialogs-use-header", out use_header); + Object(use_header_bar: use_header ? 1 : 0); add_events(Gdk.EventMask.BUTTON_PRESS_MASK | Gdk.EventMask.KEY_PRESS_MASK); focus_on_map = true; diff --git a/src/Resources.vala b/src/Resources.vala index 54118f8..101c49d 100644 --- a/src/Resources.vala +++ b/src/Resources.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. @@ -24,7 +24,7 @@ namespace Resources { public const string? GIT_VERSION = null; #endif - public const string COPYRIGHT = _("Copyright 2009-2015 Yorba Foundation"); + public const string COPYRIGHT = _("Copyright 2016 Software Freedom Conservancy Inc."); public const string APP_GETTEXT_PACKAGE = GETTEXT_PACKAGE; public const string HOME_URL = "https://wiki.gnome.org/Apps/Shotwell"; @@ -86,11 +86,6 @@ along with Shotwell; if not, write to the Free Software Foundation, Inc., public const string GO_NEXT = "go-next"; public const string GO_PREVIOUS = "go-previous"; - public const string ICON_APP = "shotwell.svg"; - public const string ICON_APP16 = "shotwell-16.svg"; - public const string ICON_APP24 = "shotwell-24.svg"; - - public const string APP_ICONS[] = { ICON_APP, ICON_APP16, ICON_APP24 }; public const string ICON_ABOUT_LOGO = "shotwell-street.jpg"; public const string ICON_GENERIC_PLUGIN = "generic-plugin.png"; @@ -103,7 +98,7 @@ along with Shotwell; if not, write to the Free Software Foundation, Inc., public const string ICON_RATING_FIVE = "five-stars.svg"; public const string ICON_FILTER_REJECTED_OR_BETTER = "all-rejected.png"; public const int ICON_FILTER_REJECTED_OR_BETTER_FIXED_SIZE = 32; - public const string ICON_FILTER_UNRATED_OR_BETTER = "shotwell-16.svg"; + public const string ICON_FILTER_UNRATED_OR_BETTER = "shotwell-16.png"; public const int ICON_FILTER_UNRATED_OR_BETTER_FIXED_SIZE = 16; public const string ICON_FILTER_ONE_OR_BETTER = "one-star-filter-plus.svg"; public const string ICON_FILTER_TWO_OR_BETTER = "two-star-filter-plus.svg"; @@ -125,7 +120,7 @@ along with Shotwell; if not, write to the Free Software Foundation, Inc., public const string ICON_IMPORTING = "go-down"; public const string ICON_LAST_IMPORT = "document-open-recent"; public const string ICON_MISSING_FILES = "process-stop"; - public const string ICON_PHOTOS = "shotwell-16"; + public const string ICON_PHOTOS = "shotwell"; public const string ICON_SINGLE_PHOTO = "image-x-generic"; public const string ICON_FILTER_PHOTOS = "filter-photos"; public const string ICON_FILTER_PHOTOS_DISABLED = "filter-photos-disabled"; @@ -1087,7 +1082,7 @@ along with Shotwell; if not, write to the Free Software Foundation, Inc., } public const string CUSTOM_CSS = - """LibraryWindow { + """LibraryWindow * { -GtkPaned-handle-size: 1; } LibraryWindow .pane-separator { diff --git a/src/Screensaver.vala b/src/Screensaver.vala index 836df5b..c91462e 100644 --- a/src/Screensaver.vala +++ b/src/Screensaver.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/SearchFilter.vala b/src/SearchFilter.vala index 3fc5d8b..fafdc09 100644 --- a/src/SearchFilter.vala +++ b/src/SearchFilter.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/SlideshowPage.vala b/src/SlideshowPage.vala index 654576d..ebf7962 100644 --- a/src/SlideshowPage.vala +++ b/src/SlideshowPage.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/SortedList.vala b/src/SortedList.vala index ed8313f..00672ab 100644 --- a/src/SortedList.vala +++ b/src/SortedList.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/Tag.vala b/src/Tag.vala index 8218a88..cf41c0e 100644 --- a/src/Tag.vala +++ b/src/Tag.vala @@ -1,4 +1,4 @@ -/* Copyright 2010-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/Thumbnail.vala b/src/Thumbnail.vala index 4ce9e81..983ab75 100644 --- a/src/Thumbnail.vala +++ b/src/Thumbnail.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/ThumbnailCache.vala b/src/ThumbnailCache.vala index 6408a1a..f803089 100644 --- a/src/ThumbnailCache.vala +++ b/src/ThumbnailCache.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/TimedQueue.vala b/src/TimedQueue.vala index d175c8d..47faf3c 100644 --- a/src/TimedQueue.vala +++ b/src/TimedQueue.vala @@ -1,4 +1,4 @@ -/* Copyright 2010-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/Tombstone.vala b/src/Tombstone.vala index 6a95881..33649d0 100644 --- a/src/Tombstone.vala +++ b/src/Tombstone.vala @@ -1,4 +1,4 @@ -/* Copyright 2010-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/UnityProgressBar.vala b/src/UnityProgressBar.vala index d28428e..f524a7b 100644 --- a/src/UnityProgressBar.vala +++ b/src/UnityProgressBar.vala @@ -1,4 +1,4 @@ -/* Copyright 2010-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/Upgrades.vala b/src/Upgrades.vala index d7ccf6f..d60d195 100644 --- a/src/Upgrades.vala +++ b/src/Upgrades.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/VideoMetadata.vala b/src/VideoMetadata.vala index 5dfa812..49ba8ef 100644 --- a/src/VideoMetadata.vala +++ b/src/VideoMetadata.vala @@ -1,4 +1,4 @@ -/* Copyright 2010-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/VideoMonitor.vala b/src/VideoMonitor.vala index 7f2fd3b..15f1222 100644 --- a/src/VideoMonitor.vala +++ b/src/VideoMonitor.vala @@ -1,4 +1,4 @@ -/* Copyright 2010-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/VideoSupport.vala b/src/VideoSupport.vala index 4e6f3ed..6543cf5 100644 --- a/src/VideoSupport.vala +++ b/src/VideoSupport.vala @@ -1,4 +1,4 @@ -/* Copyright 2010-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. @@ -258,8 +258,9 @@ public class VideoReader { if (ret_waitpid < 0) { debug("waitpid returned error code: %d", ret_waitpid); buf = null; - } else if (0 != posix_wexitstatus(child_status)) { - debug("Thumbnailer exited with error code: %d", posix_wexitstatus(child_status)); + } else if (0 != Process.exit_status(child_status)) { + debug("Thumbnailer exited with error code: %d", + Process.exit_status(child_status)); buf = null; } diff --git a/src/camera/Branch.vala b/src/camera/Branch.vala index 83f3f56..9bc551a 100644 --- a/src/camera/Branch.vala +++ b/src/camera/Branch.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/camera/Camera.vala b/src/camera/Camera.vala index 84fff8e..891507e 100644 --- a/src/camera/Camera.vala +++ b/src/camera/Camera.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/camera/CameraTable.vala b/src/camera/CameraTable.vala index bdeac54..f59dcff 100644 --- a/src/camera/CameraTable.vala +++ b/src/camera/CameraTable.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/camera/GPhoto.vala b/src/camera/GPhoto.vala index 41af0b2..ac911dd 100644 --- a/src/camera/GPhoto.vala +++ b/src/camera/GPhoto.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/camera/ImportPage.vala b/src/camera/ImportPage.vala index ba66990..daece35 100644 --- a/src/camera/ImportPage.vala +++ b/src/camera/ImportPage.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. @@ -289,8 +289,7 @@ class ImportPreview : MediaSourceItem { bool using_placeholder = (pixbuf == null); if (pixbuf == null) { if (placeholder_preview == null) { - placeholder_preview = AppWindow.get_instance().render_icon("image-missing", - Gtk.IconSize.DIALOG, null); + placeholder_preview = get_placeholder_pixbuf(); placeholder_preview = scale_pixbuf(placeholder_preview, MAX_SCALE, Gdk.InterpType.BILINEAR, true); } diff --git a/src/config/Config.vala b/src/config/Config.vala index 588c466..c86abd1 100644 --- a/src/config/Config.vala +++ b/src/config/Config.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/config/ConfigurationInterfaces.vala b/src/config/ConfigurationInterfaces.vala index 41ae188..03e7f59 100644 --- a/src/config/ConfigurationInterfaces.vala +++ b/src/config/ConfigurationInterfaces.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/config/GSettingsEngine.vala b/src/config/GSettingsEngine.vala index 1586684..d7ad69f 100644 --- a/src/config/GSettingsEngine.vala +++ b/src/config/GSettingsEngine.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/core/Alteration.vala b/src/core/Alteration.vala index ecb8142..6dc544f 100644 --- a/src/core/Alteration.vala +++ b/src/core/Alteration.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/core/ContainerSourceCollection.vala b/src/core/ContainerSourceCollection.vala index 24e2d89..a5b0fbc 100644 --- a/src/core/ContainerSourceCollection.vala +++ b/src/core/ContainerSourceCollection.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/core/Core.vala b/src/core/Core.vala index b646f02..374a6d0 100644 --- a/src/core/Core.vala +++ b/src/core/Core.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/core/DataCollection.vala b/src/core/DataCollection.vala index 0e8041d..83a216d 100644 --- a/src/core/DataCollection.vala +++ b/src/core/DataCollection.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/core/DataObject.vala b/src/core/DataObject.vala index 85ec63f..4d4566e 100644 --- a/src/core/DataObject.vala +++ b/src/core/DataObject.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/core/DataSet.vala b/src/core/DataSet.vala index dc11422..7701ed6 100644 --- a/src/core/DataSet.vala +++ b/src/core/DataSet.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/core/DataSource.vala b/src/core/DataSource.vala index 514ef9b..352ac54 100644 --- a/src/core/DataSource.vala +++ b/src/core/DataSource.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/core/DataSourceTypes.vala b/src/core/DataSourceTypes.vala index f7ebec1..6d8479e 100644 --- a/src/core/DataSourceTypes.vala +++ b/src/core/DataSourceTypes.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/core/DataView.vala b/src/core/DataView.vala index c70b9b4..af16d88 100644 --- a/src/core/DataView.vala +++ b/src/core/DataView.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/core/DataViewTypes.vala b/src/core/DataViewTypes.vala index fe7bffd..9166fa9 100644 --- a/src/core/DataViewTypes.vala +++ b/src/core/DataViewTypes.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/core/DatabaseSourceCollection.vala b/src/core/DatabaseSourceCollection.vala index 917c50d..fec6825 100644 --- a/src/core/DatabaseSourceCollection.vala +++ b/src/core/DatabaseSourceCollection.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/core/SourceCollection.vala b/src/core/SourceCollection.vala index 9e2af57..066b813 100644 --- a/src/core/SourceCollection.vala +++ b/src/core/SourceCollection.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/core/SourceHoldingTank.vala b/src/core/SourceHoldingTank.vala index a3fb1c6..0c2083d 100644 --- a/src/core/SourceHoldingTank.vala +++ b/src/core/SourceHoldingTank.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/core/SourceInterfaces.vala b/src/core/SourceInterfaces.vala index 958e4b3..b1d1aa6 100644 --- a/src/core/SourceInterfaces.vala +++ b/src/core/SourceInterfaces.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/core/Tracker.vala b/src/core/Tracker.vala index 3f5d39a..46fc893 100644 --- a/src/core/Tracker.vala +++ b/src/core/Tracker.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/core/ViewCollection.vala b/src/core/ViewCollection.vala index 5577681..ce6fcaf 100644 --- a/src/core/ViewCollection.vala +++ b/src/core/ViewCollection.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/core/util.vala b/src/core/util.vala index 0460454..9507895 100644 --- a/src/core/util.vala +++ b/src/core/util.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/data_imports/DataImportJob.vala b/src/data_imports/DataImportJob.vala index df5aebe..4035ae6 100644 --- a/src/data_imports/DataImportJob.vala +++ b/src/data_imports/DataImportJob.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/data_imports/DataImportSource.vala b/src/data_imports/DataImportSource.vala index f60c06d..9d16761 100644 --- a/src/data_imports/DataImportSource.vala +++ b/src/data_imports/DataImportSource.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/data_imports/DataImports.vala b/src/data_imports/DataImports.vala index 1406d71..a98c91b 100644 --- a/src/data_imports/DataImports.vala +++ b/src/data_imports/DataImports.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/data_imports/DataImportsPluginHost.vala b/src/data_imports/DataImportsPluginHost.vala index f783e1f..6939ea5 100644 --- a/src/data_imports/DataImportsPluginHost.vala +++ b/src/data_imports/DataImportsPluginHost.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/data_imports/DataImportsUI.vala b/src/data_imports/DataImportsUI.vala index 7b975a7..a64f751 100644 --- a/src/data_imports/DataImportsUI.vala +++ b/src/data_imports/DataImportsUI.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. @@ -208,13 +208,17 @@ public class DataImportsDialog : Gtk.Dialog { private Spit.DataImports.ConcreteDataImportsHost host; protected DataImportsDialog() { - Object(use_header_bar: 1); - ((Gtk.HeaderBar) get_header_bar()).set_show_close_button(false); + bool use_header; + Gtk.Settings.get_default ().get ("gtk-dialogs-use-header", out use_header); + Object(use_header_bar: use_header ? 1 : 0); + if (use_header) + ((Gtk.HeaderBar) get_header_bar()).set_show_close_button(false); resizable = false; delete_event.connect(on_window_close); string title = _("Import From Application"); + string label = _("Import media _from:"); set_title(title); @@ -245,6 +249,37 @@ public class DataImportsDialog : Gtk.Dialog { service_selector_box.set_active(0); service_selector_box.changed.connect(on_service_changed); + + if (!use_header) + { + var service_selector_box_label = new Gtk.Label.with_mnemonic(label); + service_selector_box_label.set_mnemonic_widget(service_selector_box); + service_selector_box_label.set_alignment(0.0f, 0.5f); + + /* the wrapper is not an extraneous widget -- it's necessary to prevent the service + selection box from growing and shrinking whenever its parent's size changes. + When wrapped inside a Gtk.Alignment, the Alignment grows and shrinks instead of + the service selection box. */ + Gtk.Alignment service_selector_box_wrapper = new Gtk.Alignment(1.0f, 0.5f, 0.0f, 0.0f); + service_selector_box_wrapper.add(service_selector_box); + + Gtk.Box service_selector_layouter = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 8); + service_selector_layouter.set_border_width(12); + service_selector_layouter.add(service_selector_box_label); + service_selector_layouter.pack_start(service_selector_box_wrapper, true, true, 0); + + /* 'service area' is the selector assembly plus the horizontal rule dividing it from the + rest of the dialog */ + Gtk.Box service_area_layouter = new Gtk.Box(Gtk.Orientation.VERTICAL, 0); + service_area_layouter.pack_start(service_selector_layouter, true, true, 0); + Gtk.Separator service_central_separator = new Gtk.Separator(Gtk.Orientation.HORIZONTAL); + service_area_layouter.add(service_central_separator); + + Gtk.Alignment service_area_wrapper = new Gtk.Alignment(0.0f, 0.0f, 1.0f, 0.0f); + service_area_wrapper.add(service_area_layouter); + + ((Gtk.Box) get_content_area()).pack_start(service_area_wrapper, false, false, 0); + } } // Intall the central area in all cases @@ -255,8 +290,12 @@ public class DataImportsDialog : Gtk.Dialog { close_cancel_button.set_can_default(true); close_cancel_button.clicked.connect(on_close_cancel_clicked); - ((Gtk.HeaderBar) get_header_bar()).pack_start(close_cancel_button); - ((Gtk.HeaderBar) get_header_bar()).pack_end(service_selector_box); + if (use_header) { + ((Gtk.HeaderBar) get_header_bar()).pack_start(close_cancel_button); + ((Gtk.HeaderBar) get_header_bar()).pack_end(service_selector_box); + } + else + ((Gtk.Box) get_action_area()).add(close_cancel_button); set_standard_window_mode(); diff --git a/src/db/DatabaseTable.vala b/src/db/DatabaseTable.vala index 235ac06..42eac69 100644 --- a/src/db/DatabaseTable.vala +++ b/src/db/DatabaseTable.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. @@ -69,10 +69,17 @@ public abstract class DatabaseTable { db = null; string backup_path = filename + ".bak"; - string cmdline = "cp " + backup_path + " " + filename; - Posix.system(cmdline); - prepare_db(filename); + try { + File src = File.new_for_commandline_arg(backup_path); + File dest = File.new_for_commandline_arg(filename); + src.copy(dest, + FileCopyFlags.OVERWRITE | + FileCopyFlags.ALL_METADATA); + prepare_db(filename); + } catch (Error error) { + AppWindow.panic(_("Unable to restore photo database %s").printf(error.message)); + } } // disable synchronized commits for performance reasons ... this is not vital, hence we diff --git a/src/db/Db.vala b/src/db/Db.vala index c6b69d9..d536b41 100644 --- a/src/db/Db.vala +++ b/src/db/Db.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/db/EventTable.vala b/src/db/EventTable.vala index 04310b8..593d51c 100644 --- a/src/db/EventTable.vala +++ b/src/db/EventTable.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/db/PhotoTable.vala b/src/db/PhotoTable.vala index 21a8d5e..5be08e7 100644 --- a/src/db/PhotoTable.vala +++ b/src/db/PhotoTable.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/db/SavedSearchDBTable.vala b/src/db/SavedSearchDBTable.vala index 9baab4e..93c8237 100644 --- a/src/db/SavedSearchDBTable.vala +++ b/src/db/SavedSearchDBTable.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/db/TagTable.vala b/src/db/TagTable.vala index 05b2daa..d650641 100644 --- a/src/db/TagTable.vala +++ b/src/db/TagTable.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/db/TombstoneTable.vala b/src/db/TombstoneTable.vala index 861cba4..892198f 100644 --- a/src/db/TombstoneTable.vala +++ b/src/db/TombstoneTable.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/db/VersionTable.vala b/src/db/VersionTable.vala index 3711b83..101b8fb 100644 --- a/src/db/VersionTable.vala +++ b/src/db/VersionTable.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/db/VideoTable.vala b/src/db/VideoTable.vala index bd45750..7bd1bb7 100644 --- a/src/db/VideoTable.vala +++ b/src/db/VideoTable.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/direct/Direct.vala b/src/direct/Direct.vala index 59680b1..028b190 100644 --- a/src/direct/Direct.vala +++ b/src/direct/Direct.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/direct/DirectPhoto.vala b/src/direct/DirectPhoto.vala index 9cd86f9..4016ee2 100644 --- a/src/direct/DirectPhoto.vala +++ b/src/direct/DirectPhoto.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. @@ -121,8 +121,10 @@ public class DirectPhoto : Photo { } public override Gdk.Pixbuf? get_thumbnail(int scale) throws Error { - return (get_metadata().get_preview_count() == 0) ? null : - get_orientation().rotate_pixbuf(get_metadata().get_preview(0).get_pixbuf()); + var metadata = get_metadata(); + + return (metadata == null || metadata.get_preview_count() == 0) ? null : + get_orientation().rotate_pixbuf(metadata.get_preview(0).get_pixbuf()); } protected override void notify_altered(Alteration alteration) { diff --git a/src/direct/DirectPhotoPage.vala b/src/direct/DirectPhotoPage.vala index 58d82fc..3d23528 100644 --- a/src/direct/DirectPhotoPage.vala +++ b/src/direct/DirectPhotoPage.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. @@ -242,7 +242,12 @@ public class DirectPhotoPage : EditingHostPage { DirectPhoto? photo = DirectPhoto.global.get_file_source(initial_file); - display_mirror_of(view_controller, photo); + if (photo != null) { + display_mirror_of(view_controller, photo); + } else { + AppWindow.panic(_("Unable open photo %s. Sorry.").printf(initial_file.get_path())); + } + initial_file = null; } @@ -406,7 +411,12 @@ public class DirectPhotoPage : EditingHostPage { base.update_actions(selected_count, count); } - private bool check_ok_to_close_photo(Photo photo) { + private bool check_ok_to_close_photo(Photo? photo) { + // Means we failed to load the photo for some reason. Do not block + // shutdown + if (photo == null) + return true; + if (!photo.has_alterations()) return true; diff --git a/src/direct/DirectView.vala b/src/direct/DirectView.vala index 6f37850..afafff2 100644 --- a/src/direct/DirectView.vala +++ b/src/direct/DirectView.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/direct/DirectWindow.vala b/src/direct/DirectWindow.vala index 35729b7..2a33423 100644 --- a/src/direct/DirectWindow.vala +++ b/src/direct/DirectWindow.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/editing_tools/EditingTools.vala b/src/editing_tools/EditingTools.vala index 6c91011..c61a38c 100644 --- a/src/editing_tools/EditingTools.vala +++ b/src/editing_tools/EditingTools.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. @@ -989,12 +989,6 @@ public class CropTool : EditingTool { crop_tool_window.get_size(out crop_tool_window.normal_width, out crop_tool_window.normal_height); - int window_x_pos = 0; - int window_y_pos = 0; - crop_tool_window.get_position(out window_x_pos, out window_y_pos); - - crop_tool_window.hide(); - crop_tool_window.layout.remove(crop_tool_window.constraint_combo); crop_tool_window.layout.remove(crop_tool_window.pivot_reticle_button); crop_tool_window.layout.remove(crop_tool_window.response_layout); @@ -1015,7 +1009,6 @@ public class CropTool : EditingTool { } custom_aspect_ratio = ((float) custom_init_width) / ((float) custom_init_height); - crop_tool_window.move(window_x_pos, window_y_pos); crop_tool_window.show_all(); constraint_mode = ConstraintMode.CUSTOM; @@ -1025,12 +1018,6 @@ public class CropTool : EditingTool { if (constraint_mode == ConstraintMode.NORMAL) return; - int window_x_pos = 0; - int window_y_pos = 0; - crop_tool_window.get_position(out window_x_pos, out window_y_pos); - - crop_tool_window.hide(); - crop_tool_window.layout.remove(crop_tool_window.constraint_combo); crop_tool_window.layout.remove(crop_tool_window.custom_width_entry); crop_tool_window.layout.remove(crop_tool_window.custom_mulsign_label); @@ -1045,7 +1032,6 @@ public class CropTool : EditingTool { crop_tool_window.resize(crop_tool_window.normal_width, crop_tool_window.normal_height); - crop_tool_window.move(window_x_pos, window_y_pos); crop_tool_window.show_all(); constraint_mode = ConstraintMode.NORMAL; @@ -1156,11 +1142,7 @@ public class CropTool : EditingTool { base.activate(canvas); - // make sure the window has its regular size before going into - // custom mode, which will resize it and needs to save the old - // size first. crop_tool_window.show_all(); - crop_tool_window.hide(); // was 'custom' the most-recently-chosen menu item? if(!canvas.get_photo().has_crop()) { diff --git a/src/editing_tools/StraightenTool.vala b/src/editing_tools/StraightenTool.vala index e2b117e..f869739 100644 --- a/src/editing_tools/StraightenTool.vala +++ b/src/editing_tools/StraightenTool.vala @@ -1,5 +1,5 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/events/Branch.vala b/src/events/Branch.vala index 1093411..15144f2 100644 --- a/src/events/Branch.vala +++ b/src/events/Branch.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/events/EventDirectoryItem.vala b/src/events/EventDirectoryItem.vala index d3434c2..f316de7 100644 --- a/src/events/EventDirectoryItem.vala +++ b/src/events/EventDirectoryItem.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/events/EventPage.vala b/src/events/EventPage.vala index ed103a8..fdaf80b 100644 --- a/src/events/EventPage.vala +++ b/src/events/EventPage.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/events/Events.vala b/src/events/Events.vala index f93e33c..1cc3fd2 100644 --- a/src/events/Events.vala +++ b/src/events/Events.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/events/EventsDirectoryPage.vala b/src/events/EventsDirectoryPage.vala index 99601a0..75ac468 100644 --- a/src/events/EventsDirectoryPage.vala +++ b/src/events/EventsDirectoryPage.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/folders/Branch.vala b/src/folders/Branch.vala index 0904e5c..38b8c80 100644 --- a/src/folders/Branch.vala +++ b/src/folders/Branch.vala @@ -1,4 +1,4 @@ -/* Copyright 2012-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/folders/Folders.vala b/src/folders/Folders.vala index da6f817..d20e6b3 100644 --- a/src/folders/Folders.vala +++ b/src/folders/Folders.vala @@ -1,4 +1,4 @@ -/* Copyright 2012-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/folders/Page.vala b/src/folders/Page.vala index eb3a84f..6145c95 100644 --- a/src/folders/Page.vala +++ b/src/folders/Page.vala @@ -1,4 +1,4 @@ -/* Copyright 2012-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/library/Branch.vala b/src/library/Branch.vala index 0e875d2..bab17fc 100644 --- a/src/library/Branch.vala +++ b/src/library/Branch.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/library/FlaggedPage.vala b/src/library/FlaggedPage.vala index b45cc54..f713773 100644 --- a/src/library/FlaggedPage.vala +++ b/src/library/FlaggedPage.vala @@ -1,4 +1,4 @@ -/* Copyright 2010-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/library/FlaggedSidebarEntry.vala b/src/library/FlaggedSidebarEntry.vala index 240aaf3..e94e695 100644 --- a/src/library/FlaggedSidebarEntry.vala +++ b/src/library/FlaggedSidebarEntry.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/library/ImportQueuePage.vala b/src/library/ImportQueuePage.vala index 9886f5a..f19f947 100644 --- a/src/library/ImportQueuePage.vala +++ b/src/library/ImportQueuePage.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/library/ImportQueueSidebarEntry.vala b/src/library/ImportQueueSidebarEntry.vala index 5d34ce2..5a1770e 100644 --- a/src/library/ImportQueueSidebarEntry.vala +++ b/src/library/ImportQueueSidebarEntry.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/library/LastImportPage.vala b/src/library/LastImportPage.vala index ea9045c..be30989 100644 --- a/src/library/LastImportPage.vala +++ b/src/library/LastImportPage.vala @@ -1,4 +1,4 @@ -/* Copyright 2010-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/library/LastImportSidebarEntry.vala b/src/library/LastImportSidebarEntry.vala index 3414130..b974481 100644 --- a/src/library/LastImportSidebarEntry.vala +++ b/src/library/LastImportSidebarEntry.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/library/Library.vala b/src/library/Library.vala index 272f3d2..48eb721 100644 --- a/src/library/Library.vala +++ b/src/library/Library.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/library/LibraryWindow.vala b/src/library/LibraryWindow.vala index a756436..5779ef4 100644 --- a/src/library/LibraryWindow.vala +++ b/src/library/LibraryWindow.vala @@ -1,12 +1,11 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. */ public class LibraryWindow : AppWindow { - public const int SIDEBAR_MIN_WIDTH = 224; - public const int SIDEBAR_MAX_WIDTH = 320; + public const int SIDEBAR_MIN_WIDTH = 120; public static int PAGE_MIN_WIDTH { get { diff --git a/src/library/OfflinePage.vala b/src/library/OfflinePage.vala index eecd71b..f8ba7c1 100644 --- a/src/library/OfflinePage.vala +++ b/src/library/OfflinePage.vala @@ -1,4 +1,4 @@ -/* Copyright 2010-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/library/OfflineSidebarEntry.vala b/src/library/OfflineSidebarEntry.vala index 34c09a0..9e4eb7f 100644 --- a/src/library/OfflineSidebarEntry.vala +++ b/src/library/OfflineSidebarEntry.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/library/TrashPage.vala b/src/library/TrashPage.vala index ae80a7b..9bafee5 100644 --- a/src/library/TrashPage.vala +++ b/src/library/TrashPage.vala @@ -1,4 +1,4 @@ -/* Copyright 2010-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/library/TrashSidebarEntry.vala b/src/library/TrashSidebarEntry.vala index 69412b7..1269ce8 100644 --- a/src/library/TrashSidebarEntry.vala +++ b/src/library/TrashSidebarEntry.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/main.vala b/src/main.vala index 6a705a7..2df29ed 100644 --- a/src/main.vala +++ b/src/main.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. @@ -433,9 +433,17 @@ void main(string[] args) { if (is_string_empty(filename) && !was_already_running) { string orig_path = AppDirs.get_data_subdir("data").get_child("photo.db").get_path(); string backup_path = orig_path + ".bak"; - string cmdline = "cp " + orig_path + " " + backup_path; - Posix.system(cmdline); - Posix.system("sync"); + try { + File src = File.new_for_commandline_arg(orig_path); + File dest = File.new_for_commandline_arg(backup_path); + src.copy(dest, + FileCopyFlags.OVERWRITE | + FileCopyFlags.ALL_METADATA); + } catch(Error error) { + warning("Failed to create backup file of database: %s", + error.message); + } + Posix.sync(); } } diff --git a/src/photos/BmpSupport.vala b/src/photos/BmpSupport.vala index 677eac3..a59a4d9 100644 --- a/src/photos/BmpSupport.vala +++ b/src/photos/BmpSupport.vala @@ -1,4 +1,4 @@ -/* Copyright 2010-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/photos/GRaw.vala b/src/photos/GRaw.vala index 1aa7ca5..53c328c 100644 --- a/src/photos/GRaw.vala +++ b/src/photos/GRaw.vala @@ -1,4 +1,4 @@ -/* Copyright 2010-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/photos/GdkSupport.vala b/src/photos/GdkSupport.vala index 05e6854..51ae72c 100644 --- a/src/photos/GdkSupport.vala +++ b/src/photos/GdkSupport.vala @@ -1,4 +1,4 @@ -/* Copyright 2010-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/photos/JfifSupport.vala b/src/photos/JfifSupport.vala index 6ac5e4b..3de123e 100644 --- a/src/photos/JfifSupport.vala +++ b/src/photos/JfifSupport.vala @@ -1,4 +1,4 @@ -/* Copyright 2010-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/photos/PhotoFileAdapter.vala b/src/photos/PhotoFileAdapter.vala index 735e153..644917c 100644 --- a/src/photos/PhotoFileAdapter.vala +++ b/src/photos/PhotoFileAdapter.vala @@ -1,4 +1,4 @@ -/* Copyright 2010-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/photos/PhotoFileFormat.vala b/src/photos/PhotoFileFormat.vala index b9d3f63..725bd1d 100644 --- a/src/photos/PhotoFileFormat.vala +++ b/src/photos/PhotoFileFormat.vala @@ -1,4 +1,4 @@ -/* Copyright 2010-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/photos/PhotoFileSniffer.vala b/src/photos/PhotoFileSniffer.vala index cdbdad2..3ea1b9d 100644 --- a/src/photos/PhotoFileSniffer.vala +++ b/src/photos/PhotoFileSniffer.vala @@ -1,4 +1,4 @@ -/* Copyright 2010-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/photos/PhotoMetadata.vala b/src/photos/PhotoMetadata.vala index be781b6..a99e0c1 100644 --- a/src/photos/PhotoMetadata.vala +++ b/src/photos/PhotoMetadata.vala @@ -1,4 +1,4 @@ -/* Copyright 2010-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/photos/Photos.vala b/src/photos/Photos.vala index c9eb357..cae1c6d 100644 --- a/src/photos/Photos.vala +++ b/src/photos/Photos.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/photos/PngSupport.vala b/src/photos/PngSupport.vala index feb409d..c891136 100644 --- a/src/photos/PngSupport.vala +++ b/src/photos/PngSupport.vala @@ -1,4 +1,4 @@ -/* Copyright 2010-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/photos/RawSupport.vala b/src/photos/RawSupport.vala index fb5f864..441b899 100644 --- a/src/photos/RawSupport.vala +++ b/src/photos/RawSupport.vala @@ -1,4 +1,4 @@ -/* Copyright 2010-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/photos/TiffSupport.vala b/src/photos/TiffSupport.vala index ac1eb6d..7ed8b98 100644 --- a/src/photos/TiffSupport.vala +++ b/src/photos/TiffSupport.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/plugins/DataImportsInterfaces.vala b/src/plugins/DataImportsInterfaces.vala index 2f519bd..f2c8a53 100644 --- a/src/plugins/DataImportsInterfaces.vala +++ b/src/plugins/DataImportsInterfaces.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/plugins/ManifestWidget.vala b/src/plugins/ManifestWidget.vala index fe32b91..cad24fc 100644 --- a/src/plugins/ManifestWidget.vala +++ b/src/plugins/ManifestWidget.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/plugins/Plugins.vala b/src/plugins/Plugins.vala index 9a8860b..0e03f67 100644 --- a/src/plugins/Plugins.vala +++ b/src/plugins/Plugins.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/plugins/PublishingInterfaces.vala b/src/plugins/PublishingInterfaces.vala index 7c0a901..6f06cba 100644 --- a/src/plugins/PublishingInterfaces.vala +++ b/src/plugins/PublishingInterfaces.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/plugins/SpitInterfaces.vala b/src/plugins/SpitInterfaces.vala index 0a432c2..3e2c70e 100644 --- a/src/plugins/SpitInterfaces.vala +++ b/src/plugins/SpitInterfaces.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/plugins/StandardHostInterface.vala b/src/plugins/StandardHostInterface.vala index c14d688..857c8ff 100644 --- a/src/plugins/StandardHostInterface.vala +++ b/src/plugins/StandardHostInterface.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/plugins/TransitionsInterfaces.vala b/src/plugins/TransitionsInterfaces.vala index 917f88d..a079146 100644 --- a/src/plugins/TransitionsInterfaces.vala +++ b/src/plugins/TransitionsInterfaces.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/publishing/APIGlue.vala b/src/publishing/APIGlue.vala index 24e10cc..23c4e8c 100644 --- a/src/publishing/APIGlue.vala +++ b/src/publishing/APIGlue.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/publishing/Publishing.vala b/src/publishing/Publishing.vala index c245385..6c30b91 100644 --- a/src/publishing/Publishing.vala +++ b/src/publishing/Publishing.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/publishing/PublishingPluginHost.vala b/src/publishing/PublishingPluginHost.vala index 1a95ef3..fed3802 100644 --- a/src/publishing/PublishingPluginHost.vala +++ b/src/publishing/PublishingPluginHost.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/publishing/PublishingUI.vala b/src/publishing/PublishingUI.vala index a74bfaf..f1e4ce6 100644 --- a/src/publishing/PublishingUI.vala +++ b/src/publishing/PublishingUI.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. @@ -156,8 +156,11 @@ public class PublishingDialog : Gtk.Dialog { protected PublishingDialog(Gee.Collection<MediaSource> to_publish) { assert(to_publish.size > 0); - Object(use_header_bar: 1); - ((Gtk.HeaderBar) get_header_bar()).set_show_close_button(false); + bool use_header; + Gtk.Settings.get_default ().get ("gtk-dialogs-use-header", out use_header); + Object(use_header_bar: use_header ? 1 : 0); + if (use_header) + ((Gtk.HeaderBar) get_header_bar()).set_show_close_button(false); resizable = false; delete_event.connect(on_window_close); @@ -243,6 +246,36 @@ public class PublishingDialog : Gtk.Dialog { service_selector_box.changed.connect(on_service_changed); + if (!use_header) + { + var service_selector_box_label = new Gtk.Label.with_mnemonic(label); + service_selector_box_label.set_mnemonic_widget(service_selector_box); + service_selector_box_label.set_alignment(0.0f, 0.5f); + + /* the wrapper is not an extraneous widget -- it's necessary to prevent the service + selection box from growing and shrinking whenever its parent's size changes. + When wrapped inside a Gtk.Alignment, the Alignment grows and shrinks instead of + the service selection box. */ + Gtk.Alignment service_selector_box_wrapper = new Gtk.Alignment(1.0f, 0.5f, 0.0f, 0.0f); + service_selector_box_wrapper.add(service_selector_box); + + Gtk.Box service_selector_layouter = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 8); + service_selector_layouter.set_border_width(12); + service_selector_layouter.add(service_selector_box_label); + service_selector_layouter.pack_start(service_selector_box_wrapper, true, true, 0); + + /* 'service area' is the selector assembly plus the horizontal rule dividing it from the + rest of the dialog */ + Gtk.Box service_area_layouter = new Gtk.Box(Gtk.Orientation.VERTICAL, 0); + service_area_layouter.add(service_selector_layouter); + service_area_layouter.add(new Gtk.Separator(Gtk.Orientation.HORIZONTAL)); + + Gtk.Alignment service_area_wrapper = new Gtk.Alignment(0.0f, 0.0f, 1.0f, 0.0f); + service_area_wrapper.add(service_area_layouter); + + get_content_area().pack_start(service_area_wrapper, false, false, 0); + } + central_area_layouter = new Gtk.Box(Gtk.Orientation.VERTICAL, 0); get_content_area().pack_start(central_area_layouter, true, true, 0); @@ -250,8 +283,12 @@ public class PublishingDialog : Gtk.Dialog { close_cancel_button = new Gtk.Button.with_mnemonic("_Cancel"); close_cancel_button.set_can_default(true); close_cancel_button.clicked.connect(on_close_cancel_clicked); - ((Gtk.HeaderBar) get_header_bar()).pack_start(close_cancel_button); - ((Gtk.HeaderBar) get_header_bar()).pack_end(service_selector_box); + if (use_header) { + ((Gtk.HeaderBar) get_header_bar()).pack_start(close_cancel_button); + ((Gtk.HeaderBar) get_header_bar()).pack_end(service_selector_box); + } + else + ((Gtk.Container) get_action_area()).add(close_cancel_button); set_standard_window_mode(); diff --git a/src/searches/Branch.vala b/src/searches/Branch.vala index 00a9ea7..b8ed334 100644 --- a/src/searches/Branch.vala +++ b/src/searches/Branch.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/searches/SavedSearchDialog.vala b/src/searches/SavedSearchDialog.vala index eb016d3..7e0b3ec 100644 --- a/src/searches/SavedSearchDialog.vala +++ b/src/searches/SavedSearchDialog.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/searches/SavedSearchPage.vala b/src/searches/SavedSearchPage.vala index 99473fb..1693ca3 100644 --- a/src/searches/SavedSearchPage.vala +++ b/src/searches/SavedSearchPage.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/searches/SearchBoolean.vala b/src/searches/SearchBoolean.vala index 8031814..1c6a5f3 100644 --- a/src/searches/SearchBoolean.vala +++ b/src/searches/SearchBoolean.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/searches/Searches.vala b/src/searches/Searches.vala index 691bcf0..2021381 100644 --- a/src/searches/Searches.vala +++ b/src/searches/Searches.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/sidebar/Branch.vala b/src/sidebar/Branch.vala index a6c3ee8..bba8cc4 100644 --- a/src/sidebar/Branch.vala +++ b/src/sidebar/Branch.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/sidebar/Entry.vala b/src/sidebar/Entry.vala index 5a84f74..f009e40 100644 --- a/src/sidebar/Entry.vala +++ b/src/sidebar/Entry.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/sidebar/Sidebar.vala b/src/sidebar/Sidebar.vala index 0b4c0da..0b43e24 100644 --- a/src/sidebar/Sidebar.vala +++ b/src/sidebar/Sidebar.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/sidebar/Tree.vala b/src/sidebar/Tree.vala index a020b18..765bc36 100644 --- a/src/sidebar/Tree.vala +++ b/src/sidebar/Tree.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/sidebar/common.vala b/src/sidebar/common.vala index 0f1bc05..c5a4764 100644 --- a/src/sidebar/common.vala +++ b/src/sidebar/common.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/slideshow/Slideshow.vala b/src/slideshow/Slideshow.vala index 7d20f91..5d14b64 100644 --- a/src/slideshow/Slideshow.vala +++ b/src/slideshow/Slideshow.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/slideshow/TransitionEffects.vala b/src/slideshow/TransitionEffects.vala index 5acc36d..5f7dc88 100644 --- a/src/slideshow/TransitionEffects.vala +++ b/src/slideshow/TransitionEffects.vala @@ -1,5 +1,5 @@ /* Copyright 2010 Maxim Kartashev - * Copyright 2011-2015 Yorba Foundation + * Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/tags/Branch.vala b/src/tags/Branch.vala index e68b2b1..0663fe4 100644 --- a/src/tags/Branch.vala +++ b/src/tags/Branch.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/tags/HierarchicalTagIndex.vala b/src/tags/HierarchicalTagIndex.vala index abc1f20..afec855 100644 --- a/src/tags/HierarchicalTagIndex.vala +++ b/src/tags/HierarchicalTagIndex.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/tags/HierarchicalTagUtilities.vala b/src/tags/HierarchicalTagUtilities.vala index a455bbf..bbb556b 100644 --- a/src/tags/HierarchicalTagUtilities.vala +++ b/src/tags/HierarchicalTagUtilities.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/tags/TagPage.vala b/src/tags/TagPage.vala index 2eebc42..7e937ad 100644 --- a/src/tags/TagPage.vala +++ b/src/tags/TagPage.vala @@ -1,4 +1,4 @@ -/* Copyright 2010-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/tags/Tags.vala b/src/tags/Tags.vala index 0639cdc..308865b 100644 --- a/src/tags/Tags.vala +++ b/src/tags/Tags.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/threads/BackgroundJob.vala b/src/threads/BackgroundJob.vala index 8203307..2188425 100644 --- a/src/threads/BackgroundJob.vala +++ b/src/threads/BackgroundJob.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/threads/Semaphore.vala b/src/threads/Semaphore.vala index 31d2b2d..05b1f13 100644 --- a/src/threads/Semaphore.vala +++ b/src/threads/Semaphore.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/threads/Threads.vala b/src/threads/Threads.vala index b9bcd55..1a648d0 100644 --- a/src/threads/Threads.vala +++ b/src/threads/Threads.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/threads/Workers.vala b/src/threads/Workers.vala index a97b557..60751a9 100644 --- a/src/threads/Workers.vala +++ b/src/threads/Workers.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. @@ -20,7 +20,7 @@ public class Workers { private EventSemaphore empty_event = new EventSemaphore(); private int enqueued = 0; - public Workers(int max_threads, bool exclusive) { + public Workers(uint max_threads, bool exclusive) { if (max_threads <= 0 && max_threads != UNLIMITED_THREADS) max_threads = 1; @@ -28,22 +28,22 @@ public class Workers { empty_event.notify(); try { - thread_pool = new ThreadPool<void *>.with_owned_data(thread_start, max_threads, exclusive); + thread_pool = new ThreadPool<void *>.with_owned_data(thread_start, (int) max_threads, exclusive); } catch (ThreadError err) { error("Unable to create thread pool: %s", err.message); } } - public static int threads_per_cpu(int per = 1, int max = -1) requires (per > 0) ensures (result > 0) { - int count = number_of_processors() * per; + public static uint threads_per_cpu(int per = 1, int max = -1) requires (per > 0) ensures (result > 0) { + var count = GLib.get_num_processors() * per; return (max < 0) ? count : count.clamp(0, max); } // This is useful when the intent is for the worker threads to use all the CPUs minus one for // the main/UI thread. (No guarantees, of course.) - public static int thread_per_cpu_minus_one() ensures (result > 0) { - return (number_of_processors() - 1).clamp(1, int.MAX); + public static uint thread_per_cpu_minus_one() ensures (result > 0) { + return (GLib.get_num_processors() - 1).clamp(1, int.MAX); } // Enqueues a BackgroundJob for work in a thread context. BackgroundJob.execute() is called diff --git a/src/unit/Unit.vala b/src/unit/Unit.vala index e6c7228..d292335 100644 --- a/src/unit/Unit.vala +++ b/src/unit/Unit.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/unit/rc/Unit.m4 b/src/unit/rc/Unit.m4 index 13ef6a7..2665dd6 100644 --- a/src/unit/rc/Unit.m4 +++ b/src/unit/rc/Unit.m4 @@ -1,4 +1,4 @@ -/* Copyright 2011-2014 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/unit/rc/UnitInternals.m4 b/src/unit/rc/UnitInternals.m4 index 4fe3153..71614d4 100644 --- a/src/unit/rc/UnitInternals.m4 +++ b/src/unit/rc/UnitInternals.m4 @@ -1,4 +1,4 @@ -/* Copyright 2011-2014 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/unit/rc/template.vala b/src/unit/rc/template.vala index 8199c01..31fc93d 100644 --- a/src/unit/rc/template.vala +++ b/src/unit/rc/template.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/unit/rc/unitize_entry.m4 b/src/unit/rc/unitize_entry.m4 index 34407e4..31602b2 100644 --- a/src/unit/rc/unitize_entry.m4 +++ b/src/unit/rc/unitize_entry.m4 @@ -1,4 +1,4 @@ -/* Copyright 2011-2014 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/util/KeyValueMap.vala b/src/util/KeyValueMap.vala index cf52719..dfc1fd2 100644 --- a/src/util/KeyValueMap.vala +++ b/src/util/KeyValueMap.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/util/Util.vala b/src/util/Util.vala index 701ca04..b87ea3a 100644 --- a/src/util/Util.vala +++ b/src/util/Util.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/util/file.vala b/src/util/file.vala index 8af5ca1..32b7762 100644 --- a/src/util/file.vala +++ b/src/util/file.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/util/image.vala b/src/util/image.vala index 4485fc7..92e276a 100644 --- a/src/util/image.vala +++ b/src/util/image.vala @@ -1,9 +1,119 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. */ + +/* XPM */ +private const string fallback_image_missing[] = { +/* columns rows colors chars-per-pixel */ +"48 48 54 1 ", +" c #6A6D67", +". c #6C6E69", +"X c #72746F", +"o c #747672", +"O c #777974", +"+ c #797B77", +"@ c #7C7E7A", +"# c #7F817C", +"$ c #81837F", +"% c #848682", +"& c #878984", +"* c #888A86", +"= c #8C8D8A", +"- c #8F908C", +"; c #90928E", +": c #949591", +"> c #969894", +", c #999B96", +"< c #9C9E9A", +"1 c #9FA09C", +"2 c #A1A39E", +"3 c #A4A6A2", +"4 c #A6A9A4", +"5 c #A9ABA6", +"6 c #ACADA9", +"7 c #AEB1AB", +"8 c #B1B2AF", +"9 c #B3B4B1", +"0 c #B6B9B3", +"q c #B9BCB6", +"w c #BDBEBA", +"e c #BEC2BB", +"r c #C1C4BE", +"t c #C5C5C2", +"y c #C6C9C3", +"u c #C9CCC6", +"i c #CCCDCB", +"p c #CED2CA", +"a c #D2D6CE", +"s c #D5D5D3", +"d c #D7D8D5", +"f c #D9D9D6", +"g c #DCDCDA", +"h c #DFE0DD", +"j c #E0E0DE", +"k c #E4E4E2", +"l c #E7E8E5", +"z c #E9E9E7", +"x c #EDEDEC", +"c c #EFF0EE", +"v c #F1F1EF", +"b c #F2F2F1", +"n c #FFFFFF", +"m c None", +/* pixels */ +"mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm", +"mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm", +"mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm", +"mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm", +"mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm", +"mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm", +"mmaaaaaaaaaasaisaaaaaaaaaaaaaaaaaaapppiipuuuuumm", +"mannnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnym", +"manbbbbbbbbbvbbvvvvxvvvbvvvvvvvvccccccxxvxvxxnym", +"manbt89898888988888888888999999999999999999txnrm", +"manb6======================-;;=;;;;;;;;;;=:7znrm", +"manv6&%%**%*%%%%*%%****=======;==;;;;=;=;==7znem", +"manv4%%%%$%%%%%%%%%%%=****=======;==-======6znwm", +"manx3%%#$$$$##%#$%%%*%**==========-=--=====6znqm", +"manx1$@%#$@$###%%%%=****=*===--;;----====*=5lnqm", +"manx<@@@@@@@@##%$%%%%****========-==-======5kn0m", +"manz<@@@+@+@@@#$%%%%%=%=%===;=:=--------=-*4kn8m", +"manz>O+O+O+@@@#$$%%%%========;;=--------=*=3kn9m", +"mpnl:OOOOO+@@$##%%%%%=%=====;=;;--;-----===3kn8m", +"munl;OooOOO@@@#$%%%%%======;;;;;:;;;;;---==1hn7m", +"munl;oXoOO+@###$%%=%=======;::;::::;;---&#+-gn7m", +"mynk*XXooOO+$$#$%%%%=%===;;:;:::::;:-$#XooX-fn5m", +"mynk*XXOOO@@$$$$%%=%====;::::>::;*#OXXXXXXX*dn5m", +"mrnk*oOO@@@#$$$$%=====::::>>>=%@OXOooXXXooo&dn3m", +"mrnj*++@$$$$**$===-;;::>>:=@Ooo@XOOoo#o#OOO=fn3m", +"menj*@#$$$$$**===;;:::=%@@@@@@O@#O#Oo#o#++@;gn2m", +"menj*$$$$&**===;:;=*#@@@@@@@@@@@#######o##%>gn2m", +"menh*$$%**===;=*%###########%@@@###$####$%=,gn1m", +"m0nj=%***=**&$$$%$$$%$$%$$$$%$$$$$$$$$$%*;:2hn<m", +"m0nj****&&&$$&&$%%%%%%%%%%%%%%%%$$*$%%%*;>13gn,m", +"m0ng****&&&&&&&&&&&&*%*%*%%*%******%**-:,136kz;m", +"m0nh***$&&&&&&&&&&&&%**********%*$***;:,1358r7*m", +"m8ng*&&&&&&&&&*$&*&&&&$=$=$=&&&&&&**=:,<11>$65mm", +"m7ng*&&&&&&&&&**&&&&&&**=$-$&&&&&&*-:,1..&1wi:mm", +"m7ng&&&&&&&&=$*$&&&&&***$$$$&&&***=>,1<onxsi6*mm", +"m6nf*&&&&&*&$***&&&&*$*$--$-&&&%*=;,13,:ztw9%mmm", +"m5nf*%&&&&&&=$=$%*&&**%*$$&&&&**=>,225;5srw%mmmm", +"m4nf3*&&**&&$-$-*******%$;&&*&*->,2365+ui7$mmmmm", +"m3nsfffdddsddaffssssdassgaaaassddfgjg4wu;ommmmmm", +"m3nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnvq3<$.mmmmmmm", +"mm2211111,<,,,,,,>>>>:::;::;----=====@mmmmmmmmmm", +"mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm", +"mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm", +"mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm", +"mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm", +"mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm", +"mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm", +"mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm" +}; + bool is_color_parsable(string spec) { Gdk.Color color; return Gdk.Color.parse(spec, out color); @@ -29,6 +139,22 @@ void set_source_color_from_string(Cairo.Context ctx, string spec) { private const int MIN_SCALED_WIDTH = 10; private const int MIN_SCALED_HEIGHT = 10; +Gdk.Pixbuf get_placeholder_pixbuf () { + // Create empty pixbuf. + Gdk.Pixbuf? pixbuf = null; + + try { + var icon_theme = Gtk.IconTheme.get_default (); + pixbuf = icon_theme.load_icon("image-missing", + Gtk.IconSize.DIALOG, 0); + } catch (Error error) { + pixbuf = new Gdk.Pixbuf.from_xpm_data(fallback_image_missing); + warning("Could not load icon from theme: %s", error.message); + } + + return pixbuf; +} + Gdk.Pixbuf scale_pixbuf(Gdk.Pixbuf pixbuf, int scale, Gdk.InterpType interp, bool scale_up) { Dimensions original = Dimensions.for_pixbuf(pixbuf); Dimensions scaled = original.get_scaled(scale, scale_up); diff --git a/src/util/misc.vala b/src/util/misc.vala index 1507e02..cc6a278 100644 --- a/src/util/misc.vala +++ b/src/util/misc.vala @@ -1,4 +1,4 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. diff --git a/src/util/string.vala b/src/util/string.vala index 3574249..7331780 100644 --- a/src/util/string.vala +++ b/src/util/string.vala @@ -1,4 +1,4 @@ -/* Copyright 2010-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. diff --git a/src/util/system.vala b/src/util/system.vala index 8e5a07f..f2436e4 100644 --- a/src/util/system.vala +++ b/src/util/system.vala @@ -1,26 +1,19 @@ -/* Copyright 2009-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. */ -int number_of_processors() { - int n = (int) ExtendedPosix.sysconf(ExtendedPosix.ConfName._SC_NPROCESSORS_ONLN); - return n <= 0 ? 1 : n; -} - // Return the directory in which Shotwell is installed, or null if uninstalled. File? get_sys_install_dir(File exec_dir) { - // guard against exec_dir being a symlink - File exec_dir1 = exec_dir; - try { - exec_dir1 = File.new_for_path( - FileUtils.read_link("/" + FileUtils.read_link(exec_dir.get_path()))); - } catch (FileError e) { - // exec_dir is not a symlink + // Assume that if the ui folder lives next to the binary, we runn in-tree + File child = exec_dir.get_child("ui"); + + if (!FileUtils.test(child.get_path(), FileTest.IS_DIR | FileTest.EXISTS)) { + return File.new_for_path(Resources.PREFIX); } - File prefix_dir = File.new_for_path(Resources.PREFIX); - return exec_dir1.has_prefix(prefix_dir) ? prefix_dir : null; + + return null; } string get_nautilus_install_location() { @@ -35,6 +28,3 @@ void show_file_in_nautilus(string filename) throws Error { GLib.Process.spawn_command_line_async(get_nautilus_install_location() + " " + filename); } -int posix_wexitstatus(int status) { - return (((status) & 0xff00) >> 8); -} diff --git a/src/util/ui.vala b/src/util/ui.vala index b846f22..a161ebd 100644 --- a/src/util/ui.vala +++ b/src/util/ui.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2015 Yorba Foundation +/* Copyright 2016 Software Freedom Conservancy Inc. * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. |