diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Dialogs.vala | 14 | ||||
-rw-r--r-- | src/VideoSupport.vala | 40 | ||||
-rw-r--r-- | src/config/Config.vala | 2 | ||||
-rw-r--r-- | src/config/ConfigurationInterfaces.vala | 27 | ||||
-rw-r--r-- | src/config/GSettingsEngine.vala | 3 | ||||
-rw-r--r-- | src/direct/DirectPhotoPage.vala | 7 | ||||
-rw-r--r-- | src/library/LibraryWindow.vala | 7 | ||||
-rw-r--r-- | src/photos/PhotoMetadata.vala | 9 | ||||
-rw-r--r-- | src/util/file.vala | 2 |
9 files changed, 23 insertions, 88 deletions
diff --git a/src/Dialogs.vala b/src/Dialogs.vala index c4e4f3d..b1f6e08 100644 --- a/src/Dialogs.vala +++ b/src/Dialogs.vala @@ -69,9 +69,8 @@ public File? choose_file(string current_file_basename) { string file_chooser_title = VideoReader.is_supported_video_filename(current_file_basename) ? _("Export Video") : _("Export Photo"); - Gtk.FileChooserDialog chooser = new Gtk.FileChooserDialog(file_chooser_title, - AppWindow.get_instance(), Gtk.FileChooserAction.SAVE, Resources.CANCEL_LABEL, - Gtk.ResponseType.CANCEL, Resources.SAVE_LABEL, Gtk.ResponseType.ACCEPT, null); + var chooser = new Gtk.FileChooserNative(file_chooser_title, + AppWindow.get_instance(), Gtk.FileChooserAction.SAVE, Resources.SAVE_LABEL, Resources.CANCEL_LABEL); chooser.set_do_overwrite_confirmation(true); chooser.set_current_folder(current_export_dir.get_path()); chooser.set_current_name(current_file_basename); @@ -94,9 +93,8 @@ public File? choose_dir(string? user_title = null) { if (user_title == null) user_title = _("Export Photos"); - Gtk.FileChooserDialog chooser = new Gtk.FileChooserDialog(user_title, - AppWindow.get_instance(), Gtk.FileChooserAction.SELECT_FOLDER, Resources.CANCEL_LABEL, - Gtk.ResponseType.CANCEL, Resources.OK_LABEL, Gtk.ResponseType.ACCEPT, null); + var chooser = new Gtk.FileChooserNative(user_title, + AppWindow.get_instance(), Gtk.FileChooserAction.SELECT_FOLDER, Resources.OK_LABEL, Resources.CANCEL_LABEL); chooser.set_current_folder(current_export_dir.get_path()); chooser.set_local_only(false); @@ -578,9 +576,9 @@ public bool report_manifest(ImportManifest manifest, bool show_dest_id, } internal void save_import_results(Gtk.Window? chooser_dialog_parent, string results_log) { - Gtk.FileChooserDialog chooser_dialog = new Gtk.FileChooserDialog( + var chooser_dialog = new Gtk.FileChooserNative( ImportUI.SAVE_RESULTS_FILE_CHOOSER_TITLE, chooser_dialog_parent, Gtk.FileChooserAction.SAVE, - Resources.CANCEL_LABEL, Gtk.ResponseType.CANCEL, Resources.SAVE_AS_LABEL, Gtk.ResponseType.ACCEPT, null); + Resources.SAVE_AS_LABEL, Resources.CANCEL_LABEL); chooser_dialog.set_do_overwrite_confirmation(true); chooser_dialog.set_current_folder(Environment.get_home_dir()); chooser_dialog.set_current_name("Shotwell Import Log.txt"); diff --git a/src/VideoSupport.vala b/src/VideoSupport.vala index 533dfe6..ec827ea 100644 --- a/src/VideoSupport.vala +++ b/src/VideoSupport.vala @@ -359,8 +359,6 @@ public class Video : VideoSource, Flaggable, Monitorable, Dateable { } } - private static bool interpreter_state_changed; - private static int current_state; private static bool normal_regen_complete; private static bool offline_regen_complete; public static VideoSourceCollection global; @@ -381,8 +379,6 @@ public class Video : VideoSource, Flaggable, Monitorable, Dateable { // Must initialize static variables here. // TODO: set values at declaration time once the following Vala bug is fixed: // https://bugzilla.gnome.org/show_bug.cgi?id=655594 - interpreter_state_changed = false; - current_state = -1; normal_regen_complete = false; offline_regen_complete = false; @@ -392,19 +388,9 @@ public class Video : VideoSource, Flaggable, Monitorable, Dateable { Gst.init(ref args); var registry = Gst.Registry.@get (); - int saved_state = Config.Facade.get_instance().get_video_interpreter_state_cookie(); - current_state = (int) registry.get_feature_list_cookie(); - if (saved_state == Config.Facade.NO_VIDEO_INTERPRETER_STATE) { - message("interpreter state cookie not found; assuming all video thumbnails are out of date"); - interpreter_state_changed = true; - } else if (saved_state != current_state) { - message("interpreter state has changed; video thumbnails may be out of date"); - interpreter_state_changed = true; - } - /* First do the cookie state handling, then update our local registry - * to not include vaapi stuff. This is basically to work-around - * concurrent access to VAAPI/X11 which it doesn't like, cf + /* Update our local registr to not include vaapi stuff. This is basically to + * work-around concurrent access to VAAPI/X11 which it doesn't like, cf * https://bugzilla.gnome.org/show_bug.cgi?id=762416 */ @@ -427,9 +413,6 @@ public class Video : VideoSource, Flaggable, Monitorable, Dateable { for (int ctr = 0; ctr < count; ctr++) { Video video = new Video(all.get(ctr)); - if (interpreter_state_changed) - video.set_is_interpretable(false); - if (video.is_trashed()) trashed_videos.add(video); else if (video.is_offline()) @@ -446,10 +429,6 @@ public class Video : VideoSource, Flaggable, Monitorable, Dateable { global.add_many(all_videos); } - public static bool has_interpreter_state_changed() { - return interpreter_state_changed; - } - public static void notify_normal_thumbs_regenerated() { if (normal_regen_complete) return; @@ -457,8 +436,6 @@ public class Video : VideoSource, Flaggable, Monitorable, Dateable { message("normal video thumbnail regeneration completed"); normal_regen_complete = true; - if (normal_regen_complete && offline_regen_complete) - save_interpreter_state(); } public static void notify_offline_thumbs_regenerated() { @@ -468,17 +445,6 @@ public class Video : VideoSource, Flaggable, Monitorable, Dateable { message("offline video thumbnail regeneration completed"); offline_regen_complete = true; - if (normal_regen_complete && offline_regen_complete) - save_interpreter_state(); - } - - private static void save_interpreter_state() { - if (interpreter_state_changed) { - message("saving video interpreter state to configuration system"); - - Config.Facade.get_instance().set_video_interpreter_state_cookie(current_state); - interpreter_state_changed = false; - } } public static void terminate() { @@ -749,7 +715,7 @@ public class Video : VideoSource, Flaggable, Monitorable, Dateable { public override void mark_online() { remove_flags(FLAG_OFFLINE); - if ((!get_is_interpretable()) && has_interpreter_state_changed()) + if ((!get_is_interpretable())) check_is_interpretable().foreground_finish(); } diff --git a/src/config/Config.vala b/src/config/Config.vala index 5675567..0e2798a 100644 --- a/src/config/Config.vala +++ b/src/config/Config.vala @@ -20,8 +20,6 @@ public class Facade : ConfigurationFacade { public const int HEIGHT_DEFAULT = 768; public const int SIDEBAR_MIN_POSITION = 180; public const int SIDEBAR_MAX_POSITION = 1000; - public const int NO_VIDEO_INTERPRETER_STATE = -1; - private static Facade instance = null; diff --git a/src/config/ConfigurationInterfaces.vala b/src/config/ConfigurationInterfaces.vala index 8af5a73..a8d8192 100644 --- a/src/config/ConfigurationInterfaces.vala +++ b/src/config/ConfigurationInterfaces.vala @@ -90,7 +90,6 @@ public enum ConfigurableProperty { SLIDESHOW_SHOW_TITLE, USE_24_HOUR_TIME, USE_LOWERCASE_FILENAMES, - VIDEO_INTERPRETER_STATE_COOKIE, NUM_PROPERTIES; @@ -307,9 +306,6 @@ public enum ConfigurableProperty { case USE_LOWERCASE_FILENAMES: return "USE_LOWERCASE_FILENAMES"; - case VIDEO_INTERPRETER_STATE_COOKIE: - return "VIDEO_INTERPRETER_STATE_COOKIE"; - default: error("unknown ConfigurableProperty enumeration value"); } @@ -1804,29 +1800,6 @@ public abstract class ConfigurationFacade : Object { } // - // video interpreter state cookie - // - public virtual int get_video_interpreter_state_cookie() { - try { - return get_engine().get_int_property( - ConfigurableProperty.VIDEO_INTERPRETER_STATE_COOKIE); - } catch (ConfigurationError err) { - on_configuration_error(err); - - return -1; - } - } - - public virtual void set_video_interpreter_state_cookie(int state_cookie) { - try { - get_engine().set_int_property(ConfigurableProperty.VIDEO_INTERPRETER_STATE_COOKIE, - state_cookie); - } catch (ConfigurationError err) { - on_configuration_error(err); - } - } - - // // allow plugins to get & set arbitrary properties // public virtual bool get_plugin_bool(string domain, string id, string key, bool def) { diff --git a/src/config/GSettingsEngine.vala b/src/config/GSettingsEngine.vala index 53c4e3f..d35eb93 100644 --- a/src/config/GSettingsEngine.vala +++ b/src/config/GSettingsEngine.vala @@ -13,7 +13,6 @@ public class GSettingsConfigurationEngine : ConfigurationEngine, GLib.Object { private const string FILES_PREFS_SCHEMA_NAME = PREFS_SCHEMA_NAME + ".files"; private const string EDITING_PREFS_SCHEMA_NAME = PREFS_SCHEMA_NAME + ".editing"; private const string EXPORT_PREFS_SCHEMA_NAME = PREFS_SCHEMA_NAME + ".export"; - private const string VIDEO_SCHEMA_NAME = ROOT_SCHEMA_NAME + ".video"; private const string PRINTING_SCHEMA_NAME = ROOT_SCHEMA_NAME + ".printing"; private const string SHARING_SCHEMA_NAME = ROOT_SCHEMA_NAME + ".sharing"; private const string IMPORTING_SCHEMA_NAME = ROOT_SCHEMA_NAME + ".dataimports"; @@ -100,7 +99,6 @@ public class GSettingsConfigurationEngine : ConfigurationEngine, GLib.Object { schema_names[ConfigurableProperty.SLIDESHOW_SHOW_TITLE] = SLIDESHOW_PREFS_SCHEMA_NAME; schema_names[ConfigurableProperty.USE_24_HOUR_TIME] = UI_PREFS_SCHEMA_NAME; schema_names[ConfigurableProperty.USE_LOWERCASE_FILENAMES] = FILES_PREFS_SCHEMA_NAME; - schema_names[ConfigurableProperty.VIDEO_INTERPRETER_STATE_COOKIE] = VIDEO_SCHEMA_NAME; key_names = new string[ConfigurableProperty.NUM_PROPERTIES]; @@ -174,7 +172,6 @@ public class GSettingsConfigurationEngine : ConfigurationEngine, GLib.Object { key_names[ConfigurableProperty.SLIDESHOW_SHOW_TITLE] = "show-title"; key_names[ConfigurableProperty.USE_24_HOUR_TIME] = "use-24-hour-time"; key_names[ConfigurableProperty.USE_LOWERCASE_FILENAMES] = "use-lowercase-filenames"; - key_names[ConfigurableProperty.VIDEO_INTERPRETER_STATE_COOKIE] = "interpreter-state-cookie"; } private Settings get_settings(string schema) { diff --git a/src/direct/DirectPhotoPage.vala b/src/direct/DirectPhotoPage.vala index ad0d4d0..39a87f1 100644 --- a/src/direct/DirectPhotoPage.vala +++ b/src/direct/DirectPhotoPage.vala @@ -407,9 +407,8 @@ public class DirectPhotoPage : EditingHostPage { output_format_filter.add_pattern("*." + uppercase_extension); } - Gtk.FileChooserDialog save_as_dialog = new Gtk.FileChooserDialog(_("Save As"), - AppWindow.get_instance(), Gtk.FileChooserAction.SAVE, Resources.CANCEL_LABEL, - Gtk.ResponseType.CANCEL, Resources.OK_LABEL, Gtk.ResponseType.OK); + var save_as_dialog = new Gtk.FileChooserNative(_("Save As"), + AppWindow.get_instance(), Gtk.FileChooserAction.SAVE, Resources.OK_LABEL, Resources.CANCEL_LABEL); save_as_dialog.set_select_multiple(false); save_as_dialog.set_current_name(filename); save_as_dialog.set_current_folder(current_save_dir.get_path()); @@ -418,7 +417,7 @@ public class DirectPhotoPage : EditingHostPage { save_as_dialog.set_local_only(false); int response = save_as_dialog.run(); - if (response == Gtk.ResponseType.OK) { + if (response == Gtk.ResponseType.ACCEPT) { // flag to prevent asking user about losing changes to the old file (since they'll be // loaded right into the new one) drop_if_dirty = true; diff --git a/src/library/LibraryWindow.vala b/src/library/LibraryWindow.vala index 3aa397e..53b3a7b 100644 --- a/src/library/LibraryWindow.vala +++ b/src/library/LibraryWindow.vala @@ -516,9 +516,8 @@ public class LibraryWindow : AppWindow { } private void on_file_import() { - Gtk.FileChooserDialog import_dialog = new Gtk.FileChooserDialog(_("Import From Folder"), null, - Gtk.FileChooserAction.SELECT_FOLDER, Resources.CANCEL_LABEL, Gtk.ResponseType.CANCEL, - Resources.OK_LABEL, Gtk.ResponseType.OK); + var import_dialog = new Gtk.FileChooserNative(_("Import From Folder"), null, + Gtk.FileChooserAction.SELECT_FOLDER, Resources.OK_LABEL, Resources.CANCEL_LABEL); import_dialog.set_local_only(false); import_dialog.set_select_multiple(true); import_dialog.set_current_folder(import_dir); @@ -529,7 +528,7 @@ public class LibraryWindow : AppWindow { int response = import_dialog.run(); - if (response == Gtk.ResponseType.OK) { + if (response == Gtk.ResponseType.ACCEPT) { import_dialog.hide(); // force file linking if directory is inside current library directory Gtk.ResponseType copy_files_response = diff --git a/src/photos/PhotoMetadata.vala b/src/photos/PhotoMetadata.vala index 7c100c0..a9b7457 100644 --- a/src/photos/PhotoMetadata.vala +++ b/src/photos/PhotoMetadata.vala @@ -1161,19 +1161,24 @@ public class PhotoMetadata : MediaMetadata { public bool get_gps(out double longitude, out string long_ref, out double latitude, out string lat_ref, out double altitude) { - if (!exiv2.get_gps_info(out longitude, out latitude, out altitude)) { + longitude = 0.0; + latitude = 0.0; + altitude = 0.0; + if (!exiv2.get_gps_longitude(out longitude) || !exiv2.get_gps_latitude(out latitude)) { long_ref = null; lat_ref = null; return false; } + + exiv2.get_gps_altitude(out altitude); long_ref = get_string("Exif.GPSInfo.GPSLongitudeRef"); lat_ref = get_string("Exif.GPSInfo.GPSLatitudeRef"); return true; } - + public bool get_exposure(out MetadataRational exposure) { return get_rational("Exif.Photo.ExposureTime", out exposure); } diff --git a/src/util/file.vala b/src/util/file.vala index 32b7762..c1ee06d 100644 --- a/src/util/file.vala +++ b/src/util/file.vala @@ -159,7 +159,7 @@ public time_t query_file_modified(File file) throws Error { } public bool query_is_directory(File file) { - return file.query_file_type(FileQueryInfoFlags.NOFOLLOW_SYMLINKS, null) == FileType.DIRECTORY; + return file.query_file_type(FileQueryInfoFlags.NONE, null) == FileType.DIRECTORY; } public bool query_is_directory_empty(File dir) throws Error { |