Commit 40208a60 authored by Lucas Beeler's avatar Lucas Beeler

Closes #1958.

Enables use of either GConf or GSettings as a configuration backend.
parent 4b5feb64
......@@ -33,9 +33,14 @@ LOCAL_LANG_DIR=locale-langpack
SYSTEM_LANG_DIR := $(DESTDIR)$(PREFIX)/share/locale
VALAFLAGS := -g --enable-checking --thread --fatal-warnings $(USER_VALAFLAGS)
DEFINES := _PREFIX='"$(PREFIX)"' _VERSION='"$(VERSION)"' GETTEXT_PACKAGE='"$(GETTEXT_PACKAGE)"' \
_LANG_SUPPORT_DIR='"$(SYSTEM_LANG_DIR)"' _LIB='"${LIB}"'
ifdef USE_LEGACY_CONFIG_SYSTEM
VALA_DEFINES := $(VALA_DEFINES) --define USE_LEGACY_CONFIG_SYSTEM
endif
EXPORT_FLAGS = -export-dynamic
include units.mk
......@@ -95,7 +100,7 @@ UNUNITIZED_SRC_FILES = \
PhotoMonitor.vala \
VideoMonitor.vala \
SearchFilter.vala \
MediaViewTracker.vala
MediaViewTracker.vala \
THUMBNAILER_SRC_FILES = \
shotwell-video-thumbnailer.vala
......@@ -130,7 +135,8 @@ RESOURCE_FILES = \
SYS_INTEGRATION_FILES = \
shotwell.desktop.head \
shotwell-viewer.desktop.head \
shotwell.schemas
shotwell.schemas \
org.yorba.shotwell.gschema.xml
SRC_HEADER_FILES = \
gphoto.h
......@@ -253,7 +259,6 @@ LOCAL_PKGS = \
# added to this list
EXT_PKGS = \
atk \
gconf-2.0 \
gdk-2.0 \
gdk-x11-2.0 \
gee-1.0 \
......@@ -272,6 +277,9 @@ EXT_PKGS = \
sqlite3 \
unique-1.0 \
webkit-1.0
ifdef USE_LEGACY_CONFIG_SYSTEM
EXT_PKGS += gconf-2.0
endif
THUMBNAILER_PKGS = \
gtk+-2.0 \
......@@ -287,7 +295,6 @@ LIBRAW_PKG = \
# libraw is handled separately (see note below); when libraw-config is no longer needed, the version
# should be added to this list
EXT_PKG_VERSIONS = \
gconf-2.0 >= 2.22.0 \
gee-1.0 >= 0.5.0 \
gexiv2 >= 0.2.0 \
gio-unix-2.0 >= 2.20 \
......@@ -304,6 +311,9 @@ EXT_PKG_VERSIONS = \
sqlite3 >= 3.5.9 \
unique-1.0 >= 1.0.0 \
webkit-1.0 >= 1.1.5
ifdef USE_LEGACY_CONFIG_SYSTEM
EXT_PKG_VERSIONS += gconf-2.0 >= 2.22.0
endif
ifdef ENABLE_TESTS
EXT_PKGS += valadate-1.0
......@@ -382,7 +392,7 @@ DIST_TAR_BZ2 = $(DIST_TAR).bz2
DIST_TAR_GZ = $(DIST_TAR).gz
PACKAGE_ORIG_GZ = $(PROGRAM)_`parsechangelog | grep Version | sed 's/.*: //'`.orig.tar.gz
VALAFLAGS := $(VALAFLAGS) --vapidir=plugins/
VALAFLAGS := $(VALAFLAGS) $(VALA_DEFINES) --vapidir=plugins/
ifdef ENABLE_TESTS
VALAFLAGS := $(VALAFLAGS) --vapi=libshotwell.vapi --define=ENABLE_TESTS
......@@ -486,6 +496,7 @@ cleantemps:
rm -f $(LANG_STAMP)
rm -f $(TEMPORARY_DESKTOP_FILES)
@$(MAKE) --directory=plugins cleantemps
rm -f misc/gschemas.compiled
package:
$(MAKE) dist
......@@ -534,6 +545,9 @@ install:
$(INSTALL_DATA) icons/shotwell-16.svg $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/shotwell.svg
mkdir -p $(DESTDIR)$(PREFIX)/share/icons/hicolor/24x24/apps
$(INSTALL_DATA) icons/shotwell-24.svg $(DESTDIR)$(PREFIX)/share/icons/hicolor/24x24/apps/shotwell.svg
mkdir -p $(DESTDIR)$(PREFIX)/share/glib-2.0/schemas
$(INSTALL_DATA) misc/org.yorba.shotwell.gschema.xml $(DESTDIR)$(PREFIX)/share/glib-2.0/schemas
glib-compile-schemas $(DESTDIR)$(PREFIX)/share/glib-2.0/schemas
ifndef DISABLE_ICON_UPDATE
-gtk-update-icon-cache -t -f $(DESTDIR)$(PREFIX)/share/icons/hicolor || :
endif
......@@ -620,6 +634,8 @@ ifdef INSTALL_HEADERS
rm -f $(foreach dep,$(PLUGIN_DEPS),$(DESTDIR)$(PREFIX)/share/vala/vapi/$(notdir $(dep)))
rm -f $(DESTDIR)$(PREFIX)/$(LIB)/pkgconfig/$(PC_FILE)
endif
rm -f $(DESTDIR)$(PREFIX)/share/glib-2.0/schemas/org.yorba.shotwell.gschema.xml
glib-compile-schemas $(DESTDIR)$(PREFIX)/share/glib-2.0/schemas
$(PC_FILE): $(PC_INPUT) $(MAKE_FILES)
m4 '-D_VERSION_=$(VERSION)' '-D_PREFIX_=$(PREFIX)' '-D_REQUIREMENTS_=$(PLUGIN_PKG_REQS)' \
......@@ -659,6 +675,7 @@ $(EXPANDED_OBJ_FILES): %.o: %.c $(CONFIG_IN) Makefile
$(PROGRAM): $(EXPANDED_OBJ_FILES) $(RESOURCES) $(LANG_STAMP) $(THUMBNAILER_BIN)
$(CC) $(EXPANDED_OBJ_FILES) $(CFLAGS) $(RESOURCES) $(VALA_LDFLAGS) `$(LIBRAW_CONFIG) --libs` $(EXPORT_FLAGS) -o $@
glib-compile-schemas misc
$(THUMBNAILER_BIN): $(EXPANDED_THUMBNAILER_SRC_FILES)
$(VALAC) $(EXPANDED_THUMBNAILER_SRC_FILES) $(VALAFLAGS) -o $@ $(foreach pkg,$(THUMBNAILER_PKGS),--pkg=$(pkg))
......
......@@ -26,7 +26,7 @@ configure_help() {
printf "\t--with-gconf-schema-file-dir=DIR\n"
printf "\t\t\t\tDirectory for installing schema files.\n"
printf "\t--disable-schemas-install\n"
printf "\t\t\t\tDisable the schemas installation.\n"
printf "\t\t\t\tDisable installation of GConf schemas;\n\t\t\t\tGSettings schemas are always installed\n"
printf "\t--disable-desktop-update\n"
printf "\t\t\t\tDisable desktop database update.\n"
printf "\t--disable-icon-update\n"
......@@ -36,7 +36,9 @@ configure_help() {
printf "\t--disable-help-install\n"
printf "\t\t\t\tDisable installation of online help.\n"
printf "\t--disable-extra-plugins-install\n"
printf "\t\t\t\tDisable installtion of extra (non-core) plugins.\n"
printf "\t\t\t\tDisable installation of extra (non-core) plugins.\n"
printf "\t--use-legacy-config-system\n"
printf "\t\t\t\tUse GConf instead of GSettings as the configuration\n\t\t\t\tbackend for Shotwell.\n"
printf "\t--install-headers\n"
printf "\t\t\t\tInstall headers and VAPI files (developers only).\n"
printf "\n"
......@@ -118,9 +120,10 @@ do
;;
--enable-tests) variables="${variables}ENABLE_TESTS=1\n"
;;
--use-legacy-config-system) variables="${variables}USE_LEGACY_CONFIG_SYSTEM=1\n"
;;
--disable-help-install) variables="${variables}DISABLE_HELP_INSTALL=1\n"
;;
--disable-extra-plugins-install) variables="${variables}DISABLE_EXTRA_PLUGINS_INSTALL=1\n"
;;
......
<schemalist>
<schema id="org.yorba.shotwell" path="/apps/shotwell/">
<child name="preferences" schema="org.yorba.shotwell.preferences" />
<child name="sharing" schema="org.yorba.shotwell.sharing" />
<child name="video" schema="org.yorba.shotwell.video" />
<child name="printing" schema="org.yorba.shotwell.printing" />
<child name="plugins" schema="org.yorba.shotwell.plugins" />
</schema>
<schema id="org.yorba.shotwell.preferences" path="/apps/shotwell/preferences/">
<child name="ui" schema="org.yorba.shotwell.preferences.ui" />
<child name="slideshow" schema="org.yorba.shotwell.preferences.slideshow" />
<child name="window" schema="org.yorba.shotwell.preferences.window" />
<child name="files" schema="org.yorba.shotwell.preferences.files" />
<child name="editing" schema="org.yorba.shotwell.preferences.editing" />
</schema>
<schema id="org.yorba.shotwell.preferences.ui" path="/apps/shotwell/preferences/ui/">
<key name="display-basic-properties" type="b">
<default>true</default>
<summary>display basic properties</summary>
<description>True if the basic properties pane is to be displayed, false otherwise.</description>
</key>
<key name="display-extended-properties" type="b">
<default>false</default>
<summary>display extended properties</summary>
<description>True if the extended properties window is to be displayed, false otherwise.</description>
</key>
<key name="display-photo-titles" type="b">
<default>false</default>
<summary>display photo titles</summary>
<description>True if photo titles are to be displayed beneath thumbnails in collection views, false otherwise.</description>
</key>
<key name="display-photo-tags" type="b">
<default>true</default>
<summary>display photo tags</summary>
<description>True if photo tags are to be listed beneath thumbnails in collection views, false otherwise.</description>
</key>
<key name="display-photo-ratings" type="b">
<default>true</default>
<summary>display photo ratings</summary>
<description>True if a photo's rating should be displayed as overlaid trinket, false otherwise.</description>
</key>
<key name="photo-rating-filter" type="i">
<default>0</default>
<summary>rating filter level</summary>
<description>Determines how to filter photos based on their ratings. 1: Rejected or better, 2: Unrated or better, 3: One or better, 4: Two or better, 5: Three or better, 6: Four or better, 7: Five or better.</description>
</key>
<key name="events-sort-ascending" type="b">
<default>false</default>
<summary>sort events ascending</summary>
<description>True if events should be sorted ascending, false if descending.</description>
</key>
<key name="library-photos-sort-ascending" type="b">
<default>false</default>
<summary>sort library photos ascending</summary>
<description>True if library photos should be sorted ascending, false if descending.</description>
</key>
<key name="library-photos-sort-by" type="i">
<default>2</default>
<summary>sort library photos criteria</summary>
<description>A numeric code that specifies the sort criteria for photos in library views.</description>
</key>
<key name="event-photos-sort-ascending" type="b">
<default>true</default>
<summary>sort event photos ascending</summary>
<description>True if event photos should be sorted ascending, false if descending.</description>
</key>
<key name="event-photos-sort-by" type="i">
<default>2</default>
<summary>sort event photos criteria</summary>
<description>Specifies the sort criteria for event photos.</description>
</key>
<key name="use-24-hour-time" type="b">
<default>false</default>
<summary>use 24 hour time</summary>
<description>True if should display times with a 24 hour clock, false if times should use AM/PM notation.</description>
</key>
<key name="keep-relativity" type="b">
<default>true</default>
<summary>keep relative time between photos</summary>
<description>True if when adjusting time/date of photos, relative time should be maintained. False if all photos should be set to the same time.</description>
</key>
<key name="modify-originals" type="b">
<default>false</default>
<summary>modify original photo files</summary>
<description>True if when adjusting time/date of photos, the original files should be modified as well. False if changes are made only in the database.</description>
</key>
<key name="show-welcome-dialog" type="b">
<default>true</default>
<summary>show welcome dialog on startup</summary>
<description>True if, when on startup, a welcome dialog should be shown. False if it should not be shown.</description>
</key>
<key name="sidebar-position" type="i">
<default>180</default>
<summary>sidebar position</summary>
<description>The width, in pixels, of the sidebar</description>
</key>
<key name="photo-thumbnail-scale" type="i">
<default>128</default>
<summary>photo thumbnail scale</summary>
<description>The scale of photo thumbnails, ranging from 72 to 360.</description>
</key>
<key name="background-color" type="s">
<default>'#444'</default>
<summary>background color</summary>
<description>A grayscale color for use as the background color.</description>
</key>
</schema>
<schema id="org.yorba.shotwell.preferences.slideshow" path="/apps/shotwell/preferences/slideshow/">
<key name="delay" type="d">
<default>3.0</default>
<summary>delay</summary>
<description>Delay (in seconds) between photos in the slideshow.</description>
</key>
<key name="transition-delay" type="d">
<default>0.3</default>
<summary>transition delay</summary>
<description>The time (in seconds) that a transition runs between photos in a slideshow</description>
</key>
<key name="transition-effect-id" type="s">
<default>""</default>
<summary>transition effect id</summary>
<description>The name of the transition effect that will be used between photos when running a slideshow</description>
</key>
</schema>
<schema id="org.yorba.shotwell.preferences.window" path="/apps/shotwell/preferences/window/">
<key name="library-maximize" type="b">
<default>false</default>
<summary>maximize library window</summary>
<description>True if library application is maximized, false otherwise.</description>
</key>
<key name="library-width" type="i">
<default>1024</default>
<summary>width of library window</summary>
<description>The last recorded width of the library application window.</description>
</key>
<key name="library-height" type="i">
<default>768</default>
<summary>height of library window</summary>
<description>The last recorded height of the library application window.</description>
</key>
<key name="direct-maximize" type="b">
<default>false</default>
<summary>maximize direct-edit window</summary>
<description>True if direct-edit application is maximized, false otherwise.</description>
</key>
<key name="direct-width" type="i">
<default>1024</default>
<summary>width of direct-edit window</summary>
<description>The last recorded width of the direct-edit application window.</description>
</key>
<key name="direct-height" type="i">
<default>768</default>
<summary>height of direct-edit window</summary>
<description>The last recorded height of the direct-edit application window.</description>
</key>
<key name="sidebar-position" type="i">
<default>180</default>
<summary>sidebar divider position</summary>
<description>The last recorded position of the divider between the sidebar and view in library application window.</description>
</key>
</schema>
<schema id="org.yorba.shotwell.preferences.files" path="/apps/shotwell/preferences/files/">
<key name="import-dir" type="s">
<default>""</default>
<summary>import directory</summary>
<description>Directory in which imported photo files are placed.</description>
</key>
<key name="auto-import" type="b">
<default>false</default>
<summary>watch library directory for new files</summary>
<description>If true, files added to the library directory are automatically imported.</description>
</key>
<key name="commit-metadata" type="b">
<default>false</default>
<summary>write metadata to master files</summary>
<description>If true, changes to metadata (tags, titles, etc.) are written to the master photo file.</description>
</key>
<key name="use-lowercase-filenames" type="b">
<default>false</default>
<summary>use lowercase filenames</summary>
<description>If true, Shotwell will convert all filenames to lowercase when importing photo files</description>
</key>
<key name="directory-pattern" type="s">
<default>""</default>
<summary>directory pattern</summary>
<description>A string encoding a naming pattern that will be used to name photo directories on import.</description>
</key>
<key name="directory-pattern-custom" type="s">
<default>""</default>
<summary>directory pattern custom</summary>
<description>A string encoding a custom naming pattern that will be used to name photo directories on import.</description>
</key>
</schema>
<schema id="org.yorba.shotwell.preferences.editing" path="/apps/shotwell/preferences/editing/">
<key name="external-photo-editor" type="s">
<default>""</default>
<summary>external photo editor</summary>
<description>External application used to edit photos.</description>
</key>
<key name="external-raw-editor" type="s">
<default>""</default>
<summary>external raw editor</summary>
<description>External application used to edit RAW photos.</description>
</key>
</schema>
<schema id="org.yorba.shotwell.sharing" path="/apps/shotwell/sharing/">
<key name="last-used-service" type="s">
<default>""</default>
<summary>last used publishing service</summary>
<description>A numeric code representing the last service to which photos were published</description>
</key>
<child name="facebook" schema="org.yorba.shotwell.sharing.facebook" />
<child name="flickr" schema="org.yorba.shotwell.sharing.flickr" />
<child name="picasa" schema="org.yorba.shotwell.sharing.picasa" />
</schema>
<schema id="org.yorba.shotwell.sharing.facebook" path="/apps/shotwell/sharing/facebook/">
<key name="session-key" type="s">
<default>""</default>
<summary>session key</summary>
<description>Facebook API session key for the currently logged in session, if any</description>
</key>
<key name="session-secret" type="s">
<default>""</default>
<summary>session secret</summary>
<description>Facebook API session secret for the currently logged in session, if any</description>
</key>
<key name="uid" type="s">
<default>""</default>
<summary>user i.d.</summary>
<description>Facebook user i.d. for the currently logged in user, if any</description>
</key>
<key name="user-name" type="s">
<default>""</default>
<summary>user name</summary>
<description>The name of the currently logged in Facebook user, if any</description>
</key>
</schema>
<schema id="org.yorba.shotwell.sharing.flickr" path="/apps/shotwell/sharing/flickr/">
<key name="auth-token" type="s">
<default>""</default>
<summary>auth token</summary>
<description>The authorization token for the currently logged in Flickr user, if any</description>
</key>
<key name="username" type="s">
<default>""</default>
<summary>username</summary>
<description>The user name of the currently logged in Flickr user, if any</description>
</key>
<key name="default-size" type="i">
<default>2</default>
<summary>default size code</summary>
<description>A numeric code representing the default size for photos published to Flickr</description>
</key>
<key name="visibility" type="i">
<default>1</default>
<summary>default visibility</summary>
<description>A numeric code representing the default visibility for photos published to Flickr</description>
</key>
</schema>
<schema id="org.yorba.shotwell.sharing.picasa" path="/apps/shotwell/sharing/picasa/">
<key name="auth-token" type="s">
<default>""</default>
<summary>auth token</summary>
<description>The authorization token for the currently logged in Picasa Web Albums user, if any</description>
</key>
<key name="user-name" type="s">
<default>""</default>
<summary>username</summary>
<description>The user name of the currently logged in Picasa Web Albums user, if any</description>
</key>
<key name="default-size" type="i">
<default>2</default>
<summary>default size</summary>
<description>A numeric code representing the default size for photos uploaded to Picasa Web Albums</description>
</key>
</schema>
<schema id="org.yorba.shotwell.video" path="/apps/shotwell/video/">
<key name="interpreter-state-cookie" type="i">
<default>-1</default>
<summary>interpreter state cookie</summary>
<description>A numeric code that captures the state of the GStreamer plug-in environment</description>
</key>
</schema>
<schema id="org.yorba.shotwell.printing" path="/apps/shotwell/printing/">
<key name="content-layout" type="i">
<default>3</default>
<summary>content layout mode</summary>
<description>A numeric code that describes how photos are laid out on the page during printing</description>
</key>
<key name="content-ppi" type="i">
<default>600</default>
<summary>content ppi</summary>
<description>The number of pixels per inch (ppi) sent to the printer during printing</description>
</key>
<key name="content-width" type="d">
<default>7.0</default>
<summary>content width</summary>
<description>The width of the printed emulsion on the page when printing</description>
</key>
<key name="content-height" type="d">
<default>5.0</default>
<summary>content height</summary>
<description>The height of the printed emulsion on the page when printing</description>
</key>
<key name="content-units" type="i">
<default>1</default>
<summary>content units</summary>
<description>A numeric code representing unit of measure (inches or centimeters) used when printing</description>
</key>
<key name="images-per-page" type="i">
<default>1</default>
<summary>images per page code</summary>
<description>A numeric code representing the currently selected images per page mode used when printing</description>
</key>
<key name="size-selection" type="i">
<default>3</default>
<summary>size selection</summary>
<description>The index of the current print size in a pre-defined list of standard sizes</description>
</key>
<key name="match-aspect-ratio" type="b">
<default>true</default>
<summary>match aspect ratio</summary>
<description>Determines whether custom print sizes must match the aspect ratio of the original photo</description>
</key>
<key name="print-titles" type="b">
<default>false</default>
<summary>print titles</summary>
<description>True if the title of a photo should be printed when the photo is printed, false otherwise.</description>
</key>
<key name="titles-font" type="s">
<default>"Sans Bold 12"</default>
<summary>titles font</summary>
<description>The name of the font to use for photo titles when they are printed.</description>
</key>
</schema>
<schema id="org.yorba.shotwell.plugins" path="/apps/shotwell/plugins/" >
<child name="enable-state" schema="org.yorba.shotwell.plugins.enable-state" />
</schema>
<schema id="org.yorba.shotwell.plugins.enable-state" path="/apps/shotwell/plugins/enable-state/" >
<key name="publishing-facebook" type="b">
<default>true</default>
<summary>enable facebook publishing plugin</summary>
<description>True if the Facebook publishing plugin is enabled, false otherwise</description>
</key>
<key name="publishing-flickr" type="b">
<default>true</default>
<summary>enable flickr publishing plugin</summary>
<description>True if the Flickr publishing plugin is enabled, false otherwise</description>
</key>
<key name="publishing-picasa" type="b">
<default>true</default>
<summary>enable picasa publishing plugin</summary>
<description>True if the Picasa Web Albums publishing plugin is enabled, false otherwise</description>
</key>
<key name="publishing-youtube" type="b">
<default>true</default>
<summary>enable youtube publishing plugin</summary>
<description>True if the YouTube publishing plugin is enabled, false otherwise</description>
</key>
<key name="publishing-piwigo" type="b">
<default>false</default>
<summary>enable piwigo publishing plugin</summary>
<description>True if the Piwigo publishing plugin is enabled, false otherwise</description>
</key>
<key name="publishing-yandex-fotki" type="b">
<default>false</default>
<summary>enable yandex publishing plugin</summary>
<description>True if the Yandex.Fotki publishing plugin is enabled, false otherwise</description>
</key>
<key name="transitions-crumble" type="b">
<default>true</default>
<summary>enable slideshow crumble transition</summary>
<description>True if the Crumble slideshow transition plugin is enabled, false otherwise</description>
</key>
<key name="transitions-fade" type="b">
<default>true</default>
<summary>enable slideshow fade transition</summary>
<description>True if the Fade slideshow transition plugin is enabled, false otherwise</description>
</key>
<key name="transitions-slide" type="b">
<default>true</default>
<summary>enable slideshow slide transision</summary>
<description>True if the Slide slideshow transition plugin is enabled, false otherwise</description>
</key>
</schema>
</schemalist>
......@@ -62,7 +62,7 @@ class AppDirs {
// The "import directory" is the same as the library directory, and are often used
// interchangeably throughout the code.
public static File get_import_dir() {
string path = Config.get_instance().get_import_dir();
string path = Config.Facade.get_instance().get_import_dir();
if (!is_string_empty(path)) {
// tilde -> home directory
path = strip_pretty_path(path);
......@@ -86,9 +86,9 @@ class AppDirs {
// Library folder + photo folder, based on user's prefered directory pattern.
public static File get_baked_import_dir(time_t tm) {
string? pattern = Config.get_instance().get_directory_pattern();
string? pattern = Config.Facade.get_instance().get_directory_pattern();
if (is_string_empty(pattern))
pattern = Config.get_instance().get_directory_pattern_custom();
pattern = Config.Facade.get_instance().get_directory_pattern_custom();
if (is_string_empty(pattern))
pattern = "%Y" + Path.DIR_SEPARATOR_S + "%m" + Path.DIR_SEPARATOR_S + "%d"; // default
......@@ -104,7 +104,7 @@ class AppDirs {
}
public static void set_import_dir(string path) {
Config.get_instance().set_import_dir(path);
Config.Facade.get_instance().set_import_dir(path);
}
public static File get_exec_dir() {
......
......@@ -433,10 +433,10 @@ public abstract class AppWindow : PageWindow {
// restore previous size and maximization state
if (this is LibraryWindow) {
Config.get_instance().get_library_window_state(out maximized, out dimensions);
Config.Facade.get_instance().get_library_window_state(out maximized, out dimensions);
} else {
assert(this is DirectWindow);
Config.get_instance().get_direct_window_state(out maximized, out dimensions);
Config.Facade.get_instance().get_direct_window_state(out maximized, out dimensions);
}
set_default_size(dimensions.width, dimensions.height);
......@@ -901,8 +901,7 @@ public abstract class AppWindow : PageWindow {
}
public override bool configure_event(Gdk.EventConfigure event) {
if (window.get_state() == Gdk.WindowState.MAXIMIZED)
maximized = !maximized;
maximized = (window.get_state() == Gdk.WindowState.MAXIMIZED);
if (!maximized)
get_size(out dimensions.width, out dimensions.height);
......
......@@ -661,9 +661,9 @@ public class CheckerboardLayout : Gtk.DrawingArea {
view.items_selected.connect(on_items_selection_changed);
view.items_unselected.connect(on_items_selection_changed);
modify_bg(Gtk.StateType.NORMAL, Config.get_instance().get_bg_color());
modify_bg(Gtk.StateType.NORMAL, Config.Facade.get_instance().get_bg_color());
Config.get_instance().colors_changed.connect(on_colors_changed);
Config.Facade.get_instance().colors_changed.connect(on_colors_changed);
// CheckerboardItems offer tooltips
has_tooltip = true;
......@@ -693,7 +693,7 @@ public class CheckerboardLayout : Gtk.DrawingArea {
if (parent != null)
parent.size_allocate.disconnect(on_viewport_resized);
Config.get_instance().colors_changed.disconnect(on_colors_changed);
Config.Facade.get_instance().colors_changed.disconnect(on_colors_changed);
}
public void set_adjustments(Gtk.Adjustment hadjustment, Gtk.Adjustment vadjustment) {
......@@ -1572,11 +1572,11 @@ public class CheckerboardLayout : Gtk.DrawingArea {
private void set_colors(bool in_focus = true) {
// set up selected/unselected colors
selected_color = fetch_color(
Config.get_instance().get_selected_color(in_focus).to_string(), window);
Config.Facade.get_instance().get_selected_color(in_focus).to_string(), window);
unselected_color = fetch_color(
Config.get_instance().get_unselected_color().to_string(), window);
Config.Facade.get_instance().get_unselected_color().to_string(), window);
border_color = fetch_color(
Config.get_instance().get_border_color().to_string(), window);
Config.Facade.get_instance().get_border_color().to_string(), window);
bg_color = this.get_style().bg[Gtk.StateType.NORMAL];
}
......@@ -1676,7 +1676,7 @@ public class CheckerboardLayout : Gtk.DrawingArea {
}
private void on_colors_changed() {
modify_bg(Gtk.StateType.NORMAL, Config.get_instance().get_bg_color());
modify_bg(Gtk.StateType.NORMAL, Config.Facade.get_instance().get_bg_color());
set_colors();
}
......
......@@ -57,7 +57,7 @@ public abstract class CollectionPage : MediaPage {
show_all();
// watch for updates to the external app settings
Config.get_instance().external_app_changed.connect(on_external_app_changed);
Config.Facade.get_instance().external_app_changed.connect(on_external_app_changed);
}
private static InjectionGroup create_file_menu_injectables() {
......@@ -268,12 +268,12 @@ public abstract class CollectionPage : MediaPage {
set_action_sensitive("Duplicate", has_selected && (!selection_has_videos));
set_action_visible("ExternalEdit", (!primary_is_video));
set_action_sensitive("ExternalEdit",
one_selected && !is_string_empty(Config.get_instance().get_external_photo_app()));
one_selected && !is_string_empty(Config.Facade.get_instance().get_external_photo_app()));
set_action_visible("ExternalEditRAW",
one_selected && (!primary_is_video)
&& ((Photo) get_view().get_selected_at(0).get_source()).get_master_file_format() ==
PhotoFileFormat.RAW
&& !is_string_empty(Config.get_instance().get_external_raw_app()));
&& !is_string_empty(Config.Facade.get_instance().get_external_raw_app()));
set_action_sensitive("Revert", (!selection_has_videos) && can_revert_selected());
set_action_sensitive("Enhance", (!selection_has_videos) && has_selected);
set_action_sensitive("RotateClockwise", (!selection_has_videos) && has_selected);
......@@ -334,7 +334,7 @@ public abstract class CollectionPage : MediaPage {
private void on_external_app_changed() {
int selected_count = get_view().get_selected_count();
set_action_sensitiv