Commit 526b579a authored by Jonas Bushart's avatar Jonas Bushart Committed by Jim Nelson

Remember "Hide photos already imported" setting: #3090

Persists the "hide photos already imported" checkbox on the camera import page.  Courtesy Jonas Bushart.
parent d1845ec2
......@@ -130,6 +130,12 @@
<summary>RAW developer default</summary>
<description>Default option for which RAW developer Shotwell will use.</description>
</key>
<key name="hide-photos-already-imported" type="b">
<default>false</default>
<summary>Selection state of "hide photos" option</summary>
<description>Last used selection state of the "hide photos already imported" option in the import page.</description>
</key>
</schema>
<schema id="org.yorba.shotwell.preferences.slideshow" path="/apps/shotwell/preferences/slideshow/">
......
......@@ -69,6 +69,19 @@
</locale>
</schema>
<schema>
<key>/schemas/apps/shotwell/preferences/ui/hide_photos_already_imported</key>
<applyto>/apps/shotwell/preferences/ui/hide_photos_already_imported</applyto>
<type>bool</type>
<owner>shotwell</owner>
<default>false</default>
<locale name="en">
<short>selection state of "hide photos" option</short>
<long>Last used selection state of the "hide photos already imported" option in the import page.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/shotwell/preferences/slideshow/delay</key>
<applyto>/apps/shotwell/preferences/slideshow/delay</applyto>
......
......@@ -737,7 +737,7 @@ public class ImportPage : CheckerboardPage {
hide_imported.set_tooltip_text(_("Only display photos that have not been imported"));
hide_imported.clicked.connect(on_hide_imported);
hide_imported.sensitive = false;
hide_imported.active = false;
hide_imported.active = Config.Facade.get_instance().get_hide_photos_already_imported();
Gtk.ToolItem hide_item = new Gtk.ToolItem();
hide_item.is_important = true;
hide_item.add(hide_imported);
......@@ -1474,11 +1474,12 @@ public class ImportPage : CheckerboardPage {
}
private void on_hide_imported() {
if (hide_imported.get_active()) {
if (hide_imported.get_active())
get_view().install_view_filter(hide_imported_filter);
} else {
else
get_view().remove_view_filter(hide_imported_filter);
}
Config.Facade.get_instance().set_hide_photos_already_imported(hide_imported.get_active());
}
private void on_import_selected() {
......
......@@ -40,6 +40,7 @@ public enum ConfigurableProperty {
EVENTS_SORT_ASCENDING,
EXTERNAL_PHOTO_APP,
EXTERNAL_RAW_APP,
HIDE_PHOTOS_ALREADY_IMPORTED,
IMPORT_DIR,
KEEP_RELATIVITY,
LAST_USED_SERVICE,
......@@ -134,6 +135,9 @@ public enum ConfigurableProperty {
case EXTERNAL_RAW_APP:
return "EXTERNAL_RAW_APP";
case HIDE_PHOTOS_ALREADY_IMPORTED:
return "HIDE_PHOTOS_ALREADY_IMPORTED";
case IMPORT_DIR:
return "IMPORT_DIR";
......@@ -713,7 +717,28 @@ public abstract class ConfigurationFacade : Object {
return;
}
}
//
// hide photos already imported
//
public virtual bool get_hide_photos_already_imported() {
try {
return get_engine().get_bool_property(ConfigurableProperty.HIDE_PHOTOS_ALREADY_IMPORTED);
} catch (ConfigurationError err) {
on_configuration_error(err);
return true;
}
}
public virtual void set_hide_photos_already_imported(bool hide_imported) {
try {
get_engine().set_bool_property(ConfigurableProperty.HIDE_PHOTOS_ALREADY_IMPORTED, hide_imported);
} catch (ConfigurationError err) {
on_configuration_error(err);
}
}
//
// import dir
//
......
......@@ -76,6 +76,9 @@ public class GConfConfigurationEngine : ConfigurationEngine, GLib.Object {
property_paths[ConfigurableProperty.EXTERNAL_RAW_APP] =
PATH_SHOTWELL_PREFS + "/editing/external_raw_editor";
property_paths[ConfigurableProperty.HIDE_PHOTOS_ALREADY_IMPORTED] =
PATH_SHOTWELL_PREFS + "/ui/hide_photos_already_imported";
property_paths[ConfigurableProperty.IMPORT_DIR] =
PATH_SHOTWELL_PREFS + "/files/import_dir";
......
......@@ -51,6 +51,7 @@ public class GSettingsConfigurationEngine : ConfigurationEngine, GLib.Object {
schema_names[ConfigurableProperty.EVENTS_SORT_ASCENDING] = UI_PREFS_SCHEMA_NAME;
schema_names[ConfigurableProperty.EXTERNAL_PHOTO_APP] = EDITING_PREFS_SCHEMA_NAME;
schema_names[ConfigurableProperty.EXTERNAL_RAW_APP] = EDITING_PREFS_SCHEMA_NAME;
schema_names[ConfigurableProperty.HIDE_PHOTOS_ALREADY_IMPORTED] = UI_PREFS_SCHEMA_NAME;
schema_names[ConfigurableProperty.IMPORT_DIR] = FILES_PREFS_SCHEMA_NAME;
schema_names[ConfigurableProperty.KEEP_RELATIVITY] = UI_PREFS_SCHEMA_NAME;
schema_names[ConfigurableProperty.LAST_USED_SERVICE] = SHARING_SCHEMA_NAME;
......@@ -103,6 +104,7 @@ public class GSettingsConfigurationEngine : ConfigurationEngine, GLib.Object {
key_names[ConfigurableProperty.EVENTS_SORT_ASCENDING] = "events-sort-ascending";
key_names[ConfigurableProperty.EXTERNAL_PHOTO_APP] = "external-photo-editor";
key_names[ConfigurableProperty.EXTERNAL_RAW_APP] = "external-raw-editor";
key_names[ConfigurableProperty.HIDE_PHOTOS_ALREADY_IMPORTED] = "hide-photos-already-imported";
key_names[ConfigurableProperty.IMPORT_DIR] = "import-dir";
key_names[ConfigurableProperty.KEEP_RELATIVITY] = "keep-relativity";
key_names[ConfigurableProperty.LAST_USED_SERVICE] = "last-used-service";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment