[gnome-video-arcade] Port from GConf to GSettings.
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-video-arcade] Port from GConf to GSettings.
- Date: Sat, 26 Feb 2011 18:24:29 +0000 (UTC)
commit 2a8f8e2f3b3a77664221988af9a7f17a90b959b9
Author: Matthew Barnes <mbarnes redhat com>
Date: Sat Feb 26 11:26:51 2011 -0500
Port from GConf to GSettings.
Makefile.am | 2 +-
configure.ac | 11 +-
data/Makefile.am | 28 +-
data/gnome-video-arcade.convert | 23 +
data/gnome-video-arcade.schemas | 313 ------
data/org.gnome.VideoArcade.gschema.xml.in | 175 ++++
docs/reference/Makefile.am | 8 +-
docs/reference/gnome-video-arcade-sections.txt | 1 +
docs/reference/tmpl/gva-util.sgml | 9 +
git.mk | 188 ++--
maint/Makefile.am | 6 +-
po/POTFILES.in | 2 +-
src/Makefile.am | 11 +-
src/gconf-bridge.c | 1255 ------------------------
src/gconf-bridge.h | 116 ---
src/gva-audit.c | 15 +-
src/gva-columns.c | 85 +-
src/gva-common.h | 39 +-
src/gva-favorites.c | 60 +-
src/gva-favorites.h | 2 +-
src/gva-main.c | 73 +-
src/gva-preferences.c | 35 +-
src/gva-properties.c | 18 +-
src/gva-tree-view.c | 56 +-
src/gva-util.c | 52 +-
src/gva-util.h | 1 +
src/main.c | 12 +-
27 files changed, 574 insertions(+), 2022 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index f455404..8f139d8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,6 @@
### Process this file with automake to produce Makefile.in
-SUBDIRS = data po src docs help
+SUBDIRS = po data src docs help
if GLADE_CATALOG
SUBDIRS += maint
diff --git a/configure.ac b/configure.ac
index 053be37..5504857 100644
--- a/configure.ac
+++ b/configure.ac
@@ -33,11 +33,6 @@ PKG_CHECK_MODULES(GTK, $GTK_MODULES)
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
-GCONF_MODULES="gconf-2.0 >= 2.0.0"
-PKG_CHECK_MODULES(GCONF, $GCONF_MODULES)
-AC_SUBST(GCONF_CFLAGS)
-AC_SUBST(GCONF_LIBS)
-
GIT_MODULES="gnome-icon-theme >= 2.18.0"
PKG_CHECK_MODULES(GIT, $GIT_MODULES)
AC_SUBST(GIT_CFLAGS)
@@ -53,6 +48,10 @@ PKG_CHECK_MODULES(UNIQUE, $UNIQUE_MODULES)
AC_SUBST(UNIQUE_CFLAGS)
AC_SUBST(UNIQUE_LIBS)
+# Needed for the monospace font name.
+GDS_MODULES="gsettings-desktop-schemas"
+PKG_CHECK_MODULES(GSETTINGS_DESKTOP_SCHEMAS, $GDS_MODULES)
+
# --with-dbus=[yes|no]
DBUS_CFLAGS=
DBUS_LIBS=
@@ -168,7 +167,7 @@ AC_SUBST(GETTEXT_PACKAGE)
AM_GLIB_GNU_GETTEXT
# Miscellaneous
-AM_GCONF_SOURCE_2
+GLIB_GSETTINGS
GTK_DOC_CHECK(1.6)
GNOME_DOC_INIT
diff --git a/data/Makefile.am b/data/Makefile.am
index d4234df..afaae3f 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -5,29 +5,27 @@ desktop_in_files = gnome-video-arcade.desktop.in
desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
@INTLTOOL_DESKTOP_RULE@
-schemadir = @GCONF_SCHEMA_FILE_DIR@
-schema_DATA = gnome-video-arcade.schemas
+gsettingsschema_in_files = org.gnome.VideoArcade.gschema.xml.in
+gsettings_SCHEMAS = $(gsettingsschema_in_files:.xml.in=.xml)
+ INTLTOOL_XML_NOMERGE_RULE@
+ GSETTINGS_RULES@
+
+gsettingsconvertdir = $(datadir)/GConf/gsettings
+gsettingsconvert_DATA = gnome-video-arcade.convert
svgicondir = $(datadir)/icons/hicolor/scalable/apps
svgicon_DATA = gnome-video-arcade.svg
-gtk_update_icon_cache = gtk-update-icon-cache -f -t $(datadir)/icons/hicolor
-
uidir = $(datadir)/gnome-video-arcade
ui_DATA = \
gnome-video-arcade.builder \
gnome-video-arcade.ui
-if GCONF_SCHEMAS_INSTALL
-install-data-local:
- GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) \
- $(GCONFTOOL) --makefile-install-rule $(srcdir)/$(schema_DATA)
-else
-install-data-local:
-endif
+gtk_update_icon_cache = gtk-update-icon-cache -f -t $(datadir)/icons/hicolor
install-data-hook: update-icon-cache
uninstall-hook: update-icon-cache
+
update-icon-cache:
@-if test -z "$(DESTDIR)"; then \
echo "Updating Gtk icon cache."; \
@@ -38,13 +36,15 @@ update-icon-cache:
fi
EXTRA_DIST = \
- $(schema_DATA) \
+ $(desktop_in_files) \
+ $(gsettingsschema_in_files) \
$(svgicon_DATA) \
$(ui_DATA) \
- gnome-video-arcade.desktop.in
+ gnome-video-arcade.convert
DISTCLEANFILES = \
- $(desktop_DATA)
+ $(desktop_DATA) \
+ $(gsettings_SCHEMAS)
MAINTAINERCLEANFILES = \
gnome-video-arcade.builder.bak
diff --git a/data/gnome-video-arcade.convert b/data/gnome-video-arcade.convert
new file mode 100644
index 0000000..bc152ec
--- /dev/null
+++ b/data/gnome-video-arcade.convert
@@ -0,0 +1,23 @@
+[org.gnome.VideoArcade]
+all-columns = /apps/gnome-video-arcade/all-columns
+auto-play = /apps/gnome-video-arcade/auto-play
+auto-save = /apps/gnome-video-arcade/auto-save
+columns = /apps/gnome-video-arcade/columns
+favorites = /apps/gnome-video-arcade/favorites
+full-screen = /apps/gnome-video-arcade/full-screen
+error-file = /apps/gnome-video-arcade/error-file
+properties-height = /apps/gnome-video-arcade/properties-height
+properties-maximized = /apps/gnome-video-arcade/properties-maximized
+properties-page = /apps/gnome-video-arcade/properties-page
+properties-width = /apps/gnome-video-arcade/properties-width
+search = /apps/gnome-video-arcade/search
+selected-game = /apps/gnome-video-arcade/selected-game
+selected-view = /apps/gnome-video-arcade/selected-view
+show-clones = /apps/gnome-video-arcade/show-clones
+sound-muted = /apps/gnome-video-arcade/sound-muted
+version = /apps/gnome-video-arcade/version
+window-height = /apps/gnome-video-arcade/window-height
+window-maximized = /apps/gnome-video-arcade/window-maximized
+window-width = /apps/gnome-video-arcade/window-width
+window-x = /apps/gnome-video-arcade/window-x
+window-y = /apps/gnome-video-arcade/window-y
diff --git a/data/org.gnome.VideoArcade.gschema.xml.in b/data/org.gnome.VideoArcade.gschema.xml.in
new file mode 100644
index 0000000..62ff698
--- /dev/null
+++ b/data/org.gnome.VideoArcade.gschema.xml.in
@@ -0,0 +1,175 @@
+<schemalist>
+
+ <schema id="org.gnome.VideoArcade" path="/org/gnome/video-arcade/" gettext-domain="gnome-video-arcade">
+
+ <key name="all-columns" type="as">
+ <default>['favorite','description']</default>
+ <_summary>All available column names</_summary>
+ <_description>List of all available column names. The user may choose
+ to only display a subset of them (see "columns").</_description>
+ </key>
+
+ <key name="auto-play" type="b">
+ <default>false</default>
+ <_summary>Auto-play music clip</_summary>
+ <_description>Enable automatic playing of in-game music clips.
+ If true, and a music clip is available for the selected game,
+ the clip will automatically begin playing when the user opens the
+ Properties window or when the user selects a different game while
+ the Properties window is visible. Music clips are streamed from
+ http://www.arcade-history.com/.</_description>
+ </key>
+
+ <key name="auto-save" type="b">
+ <default>false</default>
+ <_summary>Save and restore state</_summary>
+ <_description>Enable automatic restore at startup and save at exit.
+ If true, the emulator will try to restore the previous state of
+ the arcade machine when starting a game. If false, the emulator
+ will boot the arcade machine from a cold start. This setting does
+ not apply to recording games or playing back previously recorded
+ games. In those cases the emulator will always reboot the arcade
+ machine.</_description>
+ </key>
+
+ <key name="columns" type="as">
+ <default>['favorite','description']</default>
+ <_summary>Column names</_summary>
+ <_description>List of column names to display.</_description>
+ </key>
+
+ <key name="favorites" type="as">
+ <default>[]</default>
+ <_summary>Favorite games</_summary>
+ <_description>List of the user's favorite games.</_description>
+ </key>
+
+ <key name="full-screen" type="b">
+ <default>true</default>
+ <_summary>Start games in full screen mode</_summary>
+ <_description>If true, automatically switch to full screen mode when
+ starting a game. If false, start the game in a window.</_description>
+ </key>
+
+ <key name="error-file" type="s">
+ <default>''</default>
+ <_summary>ROM error filename</_summary>
+ <_description>Suggested filename for the ROM error "Save As" dialog.
+ </_description>
+ </key>
+
+ <key name="properties-height" type="i">
+ <default>400</default>
+ <_summary>Properties height</_summary>
+ <_description>The height of the Properties window.</_description>
+ </key>
+
+ <key name="properties-maximized" type="b">
+ <default>false</default>
+ <_summary>Properties maximized</_summary>
+ <_description>True if the Properties window is maximized.</_description>
+ </key>
+
+ <key name="properties-page" type="i">
+ <default>0</default>
+ <_summary>Properties page</_summary>
+ <_description>The most recently selected page in the Properties window.
+ </_description>
+ </key>
+
+ <key name="properties-width" type="i">
+ <default>500</default>
+ <_summary>Properties width</_summary>
+ <_description>The width of the Properties window.</_description>
+ </key>
+
+ <key name="search" type="s">
+ <default>''</default>
+ <_summary>Search text</_summary>
+ <_description>The most recent text in the search entry.</_description>
+ </key>
+
+ <key name="selected-game" type="s">
+ <default>''</default>
+ <_summary>Selected game</_summary>
+ <_description>The most recently selected game.</_description>
+ </key>
+
+ <key name="selected-match" type="(ss)">
+ <default>('','')</default>
+ <_summary>Selected completion match</_summary>
+ <_description>The most recently selected match from a search completion
+ list. The first value is the column name of the match, and the second
+ value is the text of the match. Example: (manufacturer, Williams).
+ Empty values indicate the completion feature was not used in the most
+ recent search.</_description>
+ </key>
+
+ <key name="selected-view" type="i">
+ <default>0</default>
+ <_summary>Selected view</_summary>
+ <_description>The most recently selected view.</_description>
+ </key>
+
+ <key name="show-clones" type="b">
+ <default>true</default>
+ <_summary>Show cloned games</_summary>
+ <_description>If true, show both original and cloned games in the
+ main window. If false, show only original games.</_description>
+ </key>
+
+ <key name="sort-column" type="(sb)">
+ <default>('default',false)</default>
+ <_summary>Sort column and sort order</_summary>
+ <_description>The first value is the most recently sorted column name
+ (or "default" for default sorting), and the second value is the
+ sort order. True indicates descending order; False indicates
+ ascending order.</_description>
+ </key>
+
+ <key name="sound-muted" type="b">
+ <default>false</default>
+ <_summary>Sound muted</_summary>
+ <_description>If true, games are started without sound.</_description>
+ </key>
+
+ <key name="version" type="s">
+ <default>''</default>
+ <_summary>Program version</_summary>
+ <_description>The most recently run version of GNOME Video Arcade.
+ </_description>
+ </key>
+
+ <key name="window-height" type="i">
+ <default>400</default>
+ <_summary>Window height</_summary>
+ <_description>The height of the main window.</_description>
+ </key>
+
+ <key name="window-maximized" type="b">
+ <default>false</default>
+ <_summary>Window maximized</_summary>
+ <_description>True if the main window is maximized.</_description>
+ </key>
+
+ <key name="window-width" type="i">
+ <default>500</default>
+ <_summary>Window width</_summary>
+ <_description>The width of the main window.</_description>
+ </key>
+
+ <key name="window-x" type="i">
+ <default>0</default>
+ <_summary>Window X coordinate</_summary>
+ <_description>The X coordinate of the main window.</_description>
+ </key>
+
+ <key name="window-y" type="i">
+ <default>0</default>
+ <_summary>Window Y coordinate</_summary>
+ <_description>The Y coordinate of the main window.</_description>
+ </key>
+
+ </schema>
+
+</schemalist>
diff --git a/docs/reference/Makefile.am b/docs/reference/Makefile.am
index f732a7e..140a4e2 100644
--- a/docs/reference/Makefile.am
+++ b/docs/reference/Makefile.am
@@ -29,7 +29,7 @@ SCAN_OPTIONS=
# Extra options to supply to gtkdoc-mkdb.
# e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml
-MKDB_OPTIONS=--sgml-mode --output-format=xml
+MKDB_OPTIONS=--sgml-mode --output-format=xml --name-space=gva
# Extra options to supply to gtkdoc-mktmpl
# e.g. MKTMPL_OPTIONS=--only-section-tmpl
@@ -47,7 +47,7 @@ CFILE_GLOB=$(top_srcdir)/src/*.c
# Header files to ignore when scanning.
# e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h
-IGNORE_HFILES=gconf-bridge.h gva-common.h
+IGNORE_HFILES=gva-common.h
# Images to copy into HTML directory.
# e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png
@@ -78,7 +78,6 @@ INCLUDES= \
$(GLIB_CFLAGS) \
$(GTK_CFLAGS) \
$(GIT_CFLAGS) \
- $(GCONF_CFLAGS) \
$(GSTREAMER_CFLAGS) \
$(SQLITE_CFLAGS) \
$(UNIQUE_CFLAGS) \
@@ -89,7 +88,6 @@ DBUS_OBJECTS = $(top_builddir)/src/gva-dbus.o
endif
GTKDOC_LIBS= \
- $(top_builddir)/src/gconf-bridge.o \
$(top_builddir)/src/gva-audit.o \
$(top_builddir)/src/gva-categories.o \
$(top_builddir)/src/gva-cell-renderer-pixbuf.o \
@@ -122,7 +120,6 @@ GTKDOC_LIBS= \
$(GLIB_LIBS) \
$(GTK_LIBS) \
$(GIT_LIBS) \
- $(GCONF_LIBS) \
$(GSTREAMER_LIBS) \
$(SQLITE_LIBS) \
$(UNIQUE_LIBS) \
@@ -135,6 +132,7 @@ include $(top_srcdir)/gtk-doc.make
# e.g. EXTRA_DIST += version.xml.in
EXTRA_DIST += version.xml.in
+TESTS_ENVIRONMENT = cd $(srcdir)
TESTS = $(GTKDOC_CHECK)
-include $(top_srcdir)/git.mk
diff --git a/docs/reference/gnome-video-arcade-sections.txt b/docs/reference/gnome-video-arcade-sections.txt
index c0936bb..0dc9b10 100644
--- a/docs/reference/gnome-video-arcade-sections.txt
+++ b/docs/reference/gnome-video-arcade-sections.txt
@@ -496,6 +496,7 @@ gva_get_debug_flags
GvaDebugFlags
gva_get_last_version
gva_get_monospace_font_name
+gva_get_settings
gva_get_time_elapsed
gva_get_user_data_dir
gva_help_display
diff --git a/docs/reference/tmpl/gva-util.sgml b/docs/reference/tmpl/gva-util.sgml
index 8357d39..5d22b11 100644
--- a/docs/reference/tmpl/gva-util.sgml
+++ b/docs/reference/tmpl/gva-util.sgml
@@ -77,6 +77,15 @@
@Returns:
+<!-- ##### FUNCTION gva_get_settings ##### -->
+<para>
+
+</para>
+
+ void:
+ Returns:
+
+
<!-- ##### FUNCTION gva_get_time_elapsed ##### -->
<para>
diff --git a/git.mk b/git.mk
index 739ba92..f244116 100644
--- a/git.mk
+++ b/git.mk
@@ -40,7 +40,7 @@
# build dir.
#
# This file knows how to handle autoconf, automake, libtool, gtk-doc,
-# gnome-doc-utils, intltool.
+# gnome-doc-utils, intltool, GSettings.
#
#
# KNOWN ISSUES:
@@ -82,97 +82,115 @@ git-mk-install:
### .gitignore generation
$(srcdir)/.gitignore: Makefile.am $(top_srcdir)/git.mk
- @echo Generating $@; \
- GTKDOCGITIGNOREFILES=; \
- test "x$(DOC_MODULE)" = x -o "x$(DOC_MAIN_SGML_FILE)" = x || \
- GTKDOCGITIGNOREFILES=" \
- $(DOC_MODULE)-decl-list.txt \
- $(DOC_MODULE)-decl.txt \
- tmpl/$(DOC_MODULE)-unused.sgml \
- tmpl/*.bak \
- xml html \
- "; \
- GNOMEDOCUTILSGITIGNOREFILES=; \
- test "x$(DOC_MODULE)" = x -o "x$(DOC_LINGUAS)" = x || \
- GNOMEDOCUTILSGITIGNOREFILES=" \
- $(_DOC_C_DOCS) \
- $(_DOC_LC_DOCS) \
- $(_DOC_OMF_ALL) \
- $(_DOC_DSK_ALL) \
- $(_DOC_HTML_ALL) \
- $(_DOC_POFILES) \
- */.xml2po.mo \
- */*.omf.out \
- "; \
- INTLTOOLGITIGNOREFILES=; test -f $(srcdir)/po/Makefile.in.in && \
- INTLTOOLGITIGNOREFILES=" \
- po/Makefile.in.in \
- po/Makefile.in \
- po/Makefile \
- po/*.gmo \
- po/*.mo \
- po/POTFILES \
- po/stamp-it \
- po/.intltool-merge-cache \
- intltool-extract.in \
- intltool-merge.in \
- intltool-update.in \
- "; \
- AUTOCONFGITIGNOREFILES=; test -f $(srcdir)/configure && \
- AUTOCONFGITIGNOREFILES=" \
- autom4te.cache \
- configure \
- config.h \
- stamp-h1 \
- libtool \
- config.lt \
- "; \
- for x in \
- .gitignore \
- $$GTKDOCGITIGNOREFILES \
- $$GNOMEDOCUTILSGITIGNOREFILES \
- $$INTLTOOLGITIGNOREFILES \
- $$AUTOCONFGITIGNOREFILES \
- $(GITIGNOREFILES) \
- $(CLEANFILES) \
- $(PROGRAMS) \
- $(EXTRA_PROGRAMS) \
- $(LTLIBRARIES) \
- so_locations \
- .libs _libs \
- $(MOSTLYCLEANFILES) \
- "*.$(OBJEXT)" \
- "*.lo" \
- $(DISTCLEANFILES) \
- $(am__CONFIG_DISTCLEAN_FILES) \
- $(CONFIG_CLEAN_FILES) \
- TAGS ID GTAGS GRTAGS GSYMS GPATH tags \
- "*.tab.c" \
- $(MAINTAINERCLEANFILES) \
- $(BUILT_SOURCES) \
- $(DEPDIR) \
- Makefile \
- Makefile.in \
- "*.orig" \
- "*.rej" \
- "*.bak" \
- "*~" \
- ".*.sw[nop]" \
- ; do echo /$$x; done | \
+ $(AM_V_GEN) \
+ { \
+ if test "x$(DOC_MODULE)" = x -o "x$(DOC_MAIN_SGML_FILE)" = x; then :; else \
+ for x in \
+ $(DOC_MODULE)-decl-list.txt \
+ $(DOC_MODULE)-decl.txt \
+ tmpl/$(DOC_MODULE)-unused.sgml \
+ "tmpl/*.bak" \
+ xml html \
+ ; do echo /$$x; done; \
+ fi; \
+ if test "x$(DOC_MODULE)" = x -o "x$(DOC_LINGUAS)" = x; then :; else \
+ for x in \
+ $(_DOC_C_DOCS) \
+ $(_DOC_LC_DOCS) \
+ $(_DOC_OMF_ALL) \
+ $(_DOC_DSK_ALL) \
+ $(_DOC_HTML_ALL) \
+ $(_DOC_POFILES) \
+ $(_DOC_MOFILES) \
+ $(DOC_H_FILE) \
+ "*/.xml2po.mo" \
+ "*/*.omf.out" \
+ ; do echo /$$x; done; \
+ fi; \
+ if test "x$(gsettings_SCHEMAS)" = x; then :; else \
+ for x in \
+ $(gsettings_SCHEMAS:.xml=.valid) \
+ $(gsettings__enum_file) \
+ ; do echo /$$x; done; \
+ fi; \
+ if test -f $(srcdir)/po/Makefile.in.in; then \
+ for x in \
+ po/Makefile.in.in \
+ po/Makefile.in \
+ po/Makefile \
+ po/POTFILES \
+ po/stamp-it \
+ po/.intltool-merge-cache \
+ "po/*.gmo" \
+ "po/*.mo" \
+ po/$(GETTEXT_PACKAGE).pot \
+ intltool-extract.in \
+ intltool-merge.in \
+ intltool-update.in \
+ ; do echo /$$x; done; \
+ fi; \
+ if test -f $(srcdir)/configure; then \
+ for x in \
+ autom4te.cache \
+ configure \
+ config.h \
+ stamp-h1 \
+ libtool \
+ config.lt \
+ ; do echo /$$x; done; \
+ fi; \
+ for x in \
+ .gitignore \
+ $(GITIGNOREFILES) \
+ $(CLEANFILES) \
+ $(PROGRAMS) \
+ $(check_PROGRAMS) \
+ $(EXTRA_PROGRAMS) \
+ $(LTLIBRARIES) \
+ so_locations \
+ .libs _libs \
+ $(MOSTLYCLEANFILES) \
+ "*.$(OBJEXT)" \
+ "*.lo" \
+ $(DISTCLEANFILES) \
+ $(am__CONFIG_DISTCLEAN_FILES) \
+ $(CONFIG_CLEAN_FILES) \
+ TAGS ID GTAGS GRTAGS GSYMS GPATH tags \
+ "*.tab.c" \
+ $(MAINTAINERCLEANFILES) \
+ $(BUILT_SOURCES) \
+ $(DEPDIR) \
+ Makefile \
+ Makefile.in \
+ "*.orig" \
+ "*.rej" \
+ "*.bak" \
+ "*~" \
+ ".*.sw[nop]" \
+ ".dirstamp" \
+ ; do echo /$$x; done; \
+ } | \
sed "s ^/`echo "$(srcdir)" | sed 's/\(.\)/[\1]/g'`/@/@" | \
sed 's@/[.]/@/@g' | \
- LANG=C sort | uniq > $ tmp && \
+ LC_ALL=C sort | uniq > $ tmp && \
mv $ tmp $@;
-all: $(srcdir)/.gitignore gitignore-recurse
-gitignore-recurse:
+all: $(srcdir)/.gitignore gitignore-recurse-maybe
+gitignore-recurse-maybe:
@if test "x$(SUBDIRS)" = "x$(DIST_SUBDIRS)"; then :; else \
- list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) .gitignore); \
- done; \
+ $(MAKE) $(AM_MAKEFLAGS) gitignore-recurse; \
fi;
+gitignore-recurse:
+ @for subdir in $(DIST_SUBDIRS); do \
+ case " $(SUBDIRS) " in \
+ *" $$subdir "*) :;; \
+ *) test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) .gitignore gitignore-recurse || echo "Skipping $$subdir");; \
+ esac; \
+ done
+gitignore: $(srcdir)/.gitignore gitignore-recurse
+
maintainer-clean: gitignore-clean
gitignore-clean:
-rm -f $(srcdir)/.gitignore
-.PHONY: gitignore-clean gitignore-recurse
+.PHONY: gitignore-clean gitignore gitignore-recurse gitignore-recurse-maybe
diff --git a/maint/Makefile.am b/maint/Makefile.am
index 103c8be..061d35f 100644
--- a/maint/Makefile.am
+++ b/maint/Makefile.am
@@ -13,8 +13,7 @@ gladegvadir = `$(PKG_CONFIG) --variable=moduledir gladeui-1.0`
libgladegva_la_CFLAGS = \
@GLIB_CFLAGS@ @GTK_CFLAGS@ \
- @GCONF_CFLAGS@ @GSTREAMER_CFLAGS@ \
- @UNIQUE_CFLAGS@
+ @GSTREAMER_CFLAGS@ @UNIQUE_CFLAGS@
libgladegva_la_SOURCES = \
$(top_srcdir)/src/gva-column-manager.c \
@@ -26,8 +25,7 @@ libgladegva_la_LDFLAGS = \
libgladegva_la_LIBADD = \
@GLIB_LIBS@ @GTK_LIBS@ \
- @GCONF_LIBS@ @GSTREAMER_LIBS@ \
- @UNIQUE_LIBS@
+ @GSTREAMER_LIBS@ @UNIQUE_LIBS@
EXTRA_DIST = \
$(gladecatalog_DATA) \
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 5843b27..290038e 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -2,7 +2,7 @@
[encoding: UTF-8]
[type: gettext/glade]data/gnome-video-arcade.builder
-src/gconf-bridge.c
+data/org.gnome.VideoArcade.gschema.xml.in
src/gva-audit.c
src/gva-categories.c
src/gva-column-manager.c
diff --git a/src/Makefile.am b/src/Makefile.am
index d15fffe..c9f73e9 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -5,8 +5,8 @@ bin_PROGRAMS = gnome-video-arcade
AM_CFLAGS = \
-Wall \
@DBUS_CFLAGS@ @GLIB_CFLAGS@ @GTK_CFLAGS@ \
- @GIT_CFLAGS@ @GCONF_CFLAGS@ @GSTREAMER_CFLAGS@ \
- @SQLITE_CFLAGS@ @UNIQUE_CFLAGS@ @WNCK_CFLAGS@
+ @GIT_CFLAGS@ @GSTREAMER_CFLAGS@ @SQLITE_CFLAGS@ \
+ @UNIQUE_CFLAGS@ @WNCK_CFLAGS@
AM_CPPFLAGS = \
-DG_LOG_DOMAIN=\"Gva\" \
@@ -23,8 +23,6 @@ DBUS_SOURCES = \
endif
gnome_video_arcade_SOURCES = \
- gconf-bridge.c \
- gconf-bridge.h \
gva-audit.c \
gva-audit.h \
gva-categories.h \
@@ -88,9 +86,8 @@ EXTRA_gnome_video_arcade_SOURCES = \
gnome_video_arcade_LDADD = \
@DBUS_LIBS@ @GLIB_LIBS@ @GTK_LIBS@ \
- @GIT_LIBS@ @GCONF_LIBS@ @GSTREAMER_LIBS@ \
- @MAME_BACKEND@ @SQLITE_LIBS@ @UNIQUE_LIBS@ \
- @WNCK_LIBS@
+ @GIT_LIBS@ @GSTREAMER_LIBS@ @MAME_BACKEND@ \
+ @SQLITE_LIBS@ @UNIQUE_LIBS@ @WNCK_LIBS@
gnome_video_arcade_DEPENDENCIES = \
@MAME_BACKEND@
diff --git a/src/gva-audit.c b/src/gva-audit.c
index 13b354c..babe35b 100644
--- a/src/gva-audit.c
+++ b/src/gva-audit.c
@@ -26,6 +26,7 @@
#include "gva-game-store.h"
#include "gva-mame.h"
#include "gva-ui.h"
+#include "gva-util.h"
#define SQL_SELECT_BAD_GAMES \
"SELECT name, description FROM game WHERE romset == 'bad'"
@@ -223,16 +224,15 @@ audit_exit (GvaProcess *process,
static gchar *
audit_run_save_dialog (void)
{
- const gchar *key = GVA_GCONF_ERROR_FILE_KEY;
+ const gchar *key = GVA_SETTING_ERROR_FILE;
GtkFileChooser *file_chooser;
GtkWidget *dialog;
- GConfClient *client;
+ GSettings *settings;
gchar *filename;
gchar *folder;
gchar *name;
- GError *error = NULL;
- client = gconf_client_get_default ();
+ settings = gva_get_settings ();
dialog = gtk_file_chooser_dialog_new (
_("Save As"),
@@ -246,8 +246,7 @@ audit_run_save_dialog (void)
/* Suggest the previous filename, if available. */
- filename = gconf_client_get_string (client, key, &error);
- gva_error_handle (&error);
+ filename = g_settings_get_string (settings, key);
if (filename != NULL && *filename != '\0')
{
@@ -273,12 +272,10 @@ audit_run_save_dialog (void)
if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
{
filename = gtk_file_chooser_get_filename (file_chooser);
- gconf_client_set_string (client, key, filename, &error);
- gva_error_handle (&error);
+ g_settings_set_string (settings, key, filename);
}
gtk_widget_destroy (dialog);
- g_object_unref (client);
return filename;
}
diff --git a/src/gva-columns.c b/src/gva-columns.c
index b3a9956..944bd95 100644
--- a/src/gva-columns.c
+++ b/src/gva-columns.c
@@ -27,6 +27,7 @@
#include "gva-nplayers.h"
#include "gva-tree-view.h"
#include "gva-ui.h"
+#include "gva-util.h"
#define MAX_PLAYER_ICONS 8
@@ -350,7 +351,6 @@ columns_setup_popup_menu (GtkTreeViewColumn *column)
g_signal_connect_swapped (
button, "popup-menu",
G_CALLBACK (columns_popup_menu_cb), column);
-
}
/*****************************************************************************
@@ -1188,17 +1188,17 @@ gva_columns_lookup_title (GvaGameStoreColumn column_id)
/* Helper for gva_columns_load() */
static gboolean
-columns_load_remove_name (GSList **p_list, const gchar *name)
+columns_load_remove_name (GList **p_list, const gchar *name)
{
- GSList *link;
+ GList *link;
- link = g_slist_find_custom (*p_list, name, (GCompareFunc) strcmp);
+ link = g_list_find_custom (*p_list, name, (GCompareFunc) strcmp);
if (link == NULL)
return FALSE;
g_free (link->data);
- *p_list = g_slist_delete_link (*p_list, link);
+ *p_list = g_list_delete_link (*p_list, link);
return TRUE;
}
@@ -1220,12 +1220,13 @@ columns_load_remove_name (GSList **p_list, const gchar *name)
void
gva_columns_load (GtkTreeView *view)
{
- GConfClient *client;
- GSList *all_columns;
- GSList *new_columns;
- GSList *visible_columns;
+ GSettings *settings;
+ GVariantIter *iter;
+ GList *all_columns = NULL;
+ GList *new_columns = NULL;
+ GList *visible_columns = NULL;
+ gchar *string;
gint ii;
- GError *error = NULL;
g_return_if_fail (GTK_IS_TREE_VIEW (view));
@@ -1235,21 +1236,26 @@ gva_columns_load (GtkTreeView *view)
* we're loading. */
g_signal_handlers_block_by_func (view, gva_columns_save, NULL);
- client = gconf_client_get_default ();
- all_columns = gconf_client_get_list (
- client, GVA_GCONF_ALL_COLUMNS_KEY, GCONF_VALUE_STRING, &error);
- gva_error_handle (&error);
- visible_columns = gconf_client_get_list (
- client, GVA_GCONF_COLUMNS_KEY, GCONF_VALUE_STRING, &error);
- gva_error_handle (&error);
- g_object_unref (client);
+ settings = gva_get_settings ();
+
+ g_settings_get (settings, GVA_SETTING_ALL_COLUMNS, "as", &iter);
+ while (g_variant_iter_next (iter, "s", &string))
+ all_columns = g_list_prepend (all_columns, string);
+ all_columns = g_list_reverse (all_columns);
+ g_variant_iter_free (iter);
+
+ g_settings_get (settings, GVA_SETTING_COLUMNS, "as", &iter);
+ while (g_variant_iter_next (iter, "s", &string))
+ visible_columns = g_list_prepend (visible_columns, string);
+ visible_columns = g_list_reverse (visible_columns);
+ g_variant_iter_free (iter);
if (visible_columns == NULL)
{
/* Fall back to the default columns. */
- visible_columns = g_slist_append (
+ visible_columns = g_list_append (
visible_columns, g_strdup ("favorite"));
- visible_columns = g_slist_append (
+ visible_columns = g_list_append (
visible_columns, g_strdup ("description"));
}
@@ -1257,7 +1263,7 @@ gva_columns_load (GtkTreeView *view)
for (ii = 0; ii < G_N_ELEMENTS (default_column_order); ii++)
{
gchar *name = g_strdup (default_column_order[ii]);
- new_columns = g_slist_append (new_columns, name);
+ new_columns = g_list_append (new_columns, name);
}
while (all_columns != NULL)
@@ -1271,7 +1277,7 @@ gva_columns_load (GtkTreeView *view)
visible = columns_load_remove_name (&visible_columns, name);
g_free (name);
- all_columns = g_slist_delete_link (all_columns, all_columns);
+ all_columns = g_list_delete_link (all_columns, all_columns);
if (column != NULL)
{
@@ -1294,7 +1300,7 @@ gva_columns_load (GtkTreeView *view)
columns_load_remove_name (&new_columns, name);
g_free (name);
- visible_columns = g_slist_delete_link (
+ visible_columns = g_list_delete_link (
visible_columns, visible_columns);
if (column != NULL)
@@ -1317,7 +1323,7 @@ gva_columns_load (GtkTreeView *view)
column = gva_columns_new_from_name (name);
g_free (name);
- new_columns = g_slist_delete_link (new_columns, new_columns);
+ new_columns = g_list_delete_link (new_columns, new_columns);
if (column != NULL)
{
@@ -1348,9 +1354,10 @@ gva_columns_load (GtkTreeView *view)
void
gva_columns_save (GtkTreeView *view)
{
- GConfClient *client;
- GSList *list;
- GError *error = NULL;
+ GSettings *settings;
+ GVariantBuilder builder;
+ GVariant *variant;
+ GSList *list, *iter;
g_return_if_fail (GTK_IS_TREE_VIEW (view));
@@ -1362,23 +1369,27 @@ gva_columns_save (GtkTreeView *view)
return;
#endif
- client = gconf_client_get_default ();
+ settings = gva_get_settings ();
+ g_variant_builder_init (&builder, (GVariantType *) "as");
list = gva_columns_get_names (view, FALSE);
- gconf_client_set_list (
- client, GVA_GCONF_ALL_COLUMNS_KEY,
- GCONF_VALUE_STRING, list, &error);
- gva_error_handle (&error);
+ for (iter = list; iter != NULL; iter = iter->next)
+ g_variant_builder_add (&builder, "s", iter->data);
+ variant = g_variant_builder_end (&builder);
g_slist_free (list);
+ /* This sinks the floating GVariant reference. */
+ g_settings_set_value (settings, GVA_SETTING_ALL_COLUMNS, variant);
+
+ g_variant_builder_init (&builder, (GVariantType *) "as");
list = gva_columns_get_names (view, TRUE);
- gconf_client_set_list (
- client, GVA_GCONF_COLUMNS_KEY,
- GCONF_VALUE_STRING, list, &error);
- gva_error_handle (&error);
+ for (iter = list; iter != NULL; iter = iter->next)
+ g_variant_builder_add (&builder, "s", iter->data);
+ variant = g_variant_builder_end (&builder);
g_slist_free (list);
- g_object_unref (client);
+ /* This sinks the floating GVariant reference. */
+ g_settings_set_value (settings, GVA_SETTING_COLUMNS, variant);
}
/**
diff --git a/src/gva-common.h b/src/gva-common.h
index a3e95b0..7b996c1 100644
--- a/src/gva-common.h
+++ b/src/gva-common.h
@@ -40,28 +40,25 @@
#include <sqlite3.h>
#include <unique/unique.h>
-#include <gconf/gconf-client.h>
-#include "gconf-bridge.h" /* Embedded in GVA */
-#define GVA_GCONF_PREFIX "/apps/" PACKAGE
-#define GVA_GCONF_ALL_COLUMNS_KEY GVA_GCONF_PREFIX "/all-columns"
-#define GVA_GCONF_AUTO_PLAY_KEY GVA_GCONF_PREFIX "/auto-play"
-#define GVA_GCONF_AUTO_SAVE_KEY GVA_GCONF_PREFIX "/auto-save"
-#define GVA_GCONF_COLUMNS_KEY GVA_GCONF_PREFIX "/columns"
-#define GVA_GCONF_FAVORITES_KEY GVA_GCONF_PREFIX "/favorites"
-#define GVA_GCONF_FULL_SCREEN_KEY GVA_GCONF_PREFIX "/full-screen"
-#define GVA_GCONF_ERROR_FILE_KEY GVA_GCONF_PREFIX "/error-file"
-#define GVA_GCONF_PROPERTIES_PAGE_KEY GVA_GCONF_PREFIX "/properties-page"
-#define GVA_GCONF_PROPERTIES_PREFIX GVA_GCONF_PREFIX "/properties"
-#define GVA_GCONF_SEARCH_KEY GVA_GCONF_PREFIX "/search"
-#define GVA_GCONF_SELECTED_GAME_KEY GVA_GCONF_PREFIX "/selected-game"
-#define GVA_GCONF_SELECTED_MATCH_KEY GVA_GCONF_PREFIX "/selected-match"
-#define GVA_GCONF_SELECTED_VIEW_KEY GVA_GCONF_PREFIX "/selected-view"
-#define GVA_GCONF_SHOW_CLONES_KEY GVA_GCONF_PREFIX "/show-clones"
-#define GVA_GCONF_SORT_COLUMN_KEY GVA_GCONF_PREFIX "/sort-column"
-#define GVA_GCONF_SOUND_MUTED GVA_GCONF_PREFIX "/sound-muted"
-#define GVA_GCONF_VERSION_KEY GVA_GCONF_PREFIX "/version"
-#define GVA_GCONF_WINDOW_PREFIX GVA_GCONF_PREFIX "/window"
+#define GVA_SETTING_ALL_COLUMNS "all-columns"
+#define GVA_SETTING_AUTO_PLAY "auto-play"
+#define GVA_SETTING_AUTO_SAVE "auto-save"
+#define GVA_SETTING_COLUMNS "columns"
+#define GVA_SETTING_FAVORITES "favorites"
+#define GVA_SETTING_FULL_SCREEN "full-screen"
+#define GVA_SETTING_ERROR_FILE "error-file"
+#define GVA_SETTING_PROPERTIES_PAGE "properties-page"
+#define GVA_SETTING_PROPERTIES_PREFIX "properties"
+#define GVA_SETTING_SEARCH "search"
+#define GVA_SETTING_SELECTED_GAME "selected-game"
+#define GVA_SETTING_SELECTED_MATCH "selected-match"
+#define GVA_SETTING_SELECTED_VIEW "selected-view"
+#define GVA_SETTING_SHOW_CLONES "show-clones"
+#define GVA_SETTING_SORT_COLUMN "sort-column"
+#define GVA_SETTING_SOUND_MUTED "sound-muted"
+#define GVA_SETTING_VERSION "version"
+#define GVA_SETTING_WINDOW_PREFIX "window"
G_BEGIN_DECLS
diff --git a/src/gva-favorites.c b/src/gva-favorites.c
index 103a0cb..2e7eb72 100644
--- a/src/gva-favorites.c
+++ b/src/gva-favorites.c
@@ -21,32 +21,30 @@
#include <string.h>
#include "gva-error.h"
+#include "gva-util.h"
-static GSList *favorites = NULL;
-static GConfClient *client = NULL;
+static GList *favorites = NULL;
static gboolean initialized = FALSE;
static void
favorites_load (void)
{
- GSList *iter;
- GError *error = NULL;
+ GSettings *settings;
+ GVariantIter *iter;
+ gchar *string;
- client = gconf_client_get_default ();
+ g_return_if_fail (favorites == NULL);
- favorites = gconf_client_get_list (
- client, GVA_GCONF_FAVORITES_KEY,
- GCONF_VALUE_STRING, &error);
- gva_error_handle (&error);
-
- for (iter = favorites; iter != NULL; iter = iter->next)
+ settings = gva_get_settings ();
+ g_settings_get (settings, GVA_SETTING_FAVORITES, "as", &iter);
+ while (g_variant_iter_loop (iter, "s", &string))
{
- gchar *game = iter->data;
- iter->data = (gchar *) g_intern_string (game);
- g_free (game);
+ const gchar *game = g_intern_string (string);
+ favorites = g_list_prepend (favorites, (gpointer) game);
}
+ g_variant_iter_free (iter);
- favorites = g_slist_sort (favorites, (GCompareFunc) strcmp);
+ favorites = g_list_sort (favorites, (GCompareFunc) strcmp);
initialized = TRUE;
}
@@ -54,29 +52,37 @@ favorites_load (void)
static void
favorites_save (void)
{
- GError *error = NULL;
+ GSettings *settings;
+ GVariantBuilder builder;
+ GVariant *variant;
+ GList *iter;
+
+ settings = gva_get_settings ();
+
+ g_variant_builder_init (&builder, (GVariantType *) "as");
+ for (iter = favorites; iter != NULL; iter = iter->next)
+ g_variant_builder_add (&builder, "s", iter->data);
+ variant = g_variant_builder_end (&builder);
- gconf_client_set_list (
- client, GVA_GCONF_FAVORITES_KEY,
- GCONF_VALUE_STRING, favorites, &error);
- gva_error_handle (&error);
+ /* This consumes the floating GVariant reference. */
+ g_settings_set_value (settings, GVA_SETTING_FAVORITES, variant);
}
/**
* gva_favorites_copy:
*
* Returns a copy of the favorite games list. The contents of the list
- * must not be freed. The list itself should be freed with g_slist_free().
+ * must not be freed. The list itself should be freed with g_list_free().
*
* Returns: a copy of the favorite games list
**/
-GSList *
+GList *
gva_favorites_copy (void)
{
if (G_UNLIKELY (!initialized))
favorites_load ();
- return g_slist_copy (favorites);
+ return g_list_copy (favorites);
}
/**
@@ -95,10 +101,10 @@ gva_favorites_insert (const gchar *game)
game = g_intern_string (game);
- if (g_slist_find (favorites, game) != NULL)
+ if (g_list_find (favorites, game) != NULL)
return;
- favorites = g_slist_insert_sorted (
+ favorites = g_list_insert_sorted (
favorites, (gchar *) game, (GCompareFunc) strcmp);
favorites_save ();
@@ -120,7 +126,7 @@ gva_favorites_remove (const gchar *game)
game = g_intern_string (game);
- favorites = g_slist_remove_all (favorites, game);
+ favorites = g_list_remove_all (favorites, game);
favorites_save ();
}
@@ -143,5 +149,5 @@ gva_favorites_contains (const gchar *game)
game = g_intern_string (game);
- return (g_slist_find (favorites, game) != NULL);
+ return (g_list_find (favorites, game) != NULL);
}
diff --git a/src/gva-favorites.h b/src/gva-favorites.h
index 83ef68c..46f5dbd 100644
--- a/src/gva-favorites.h
+++ b/src/gva-favorites.h
@@ -30,7 +30,7 @@
G_BEGIN_DECLS
-GSList * gva_favorites_copy (void);
+GList * gva_favorites_copy (void);
void gva_favorites_insert (const gchar *game);
void gva_favorites_remove (const gchar *game);
gboolean gva_favorites_contains (const gchar *game);
diff --git a/src/gva-main.c b/src/gva-main.c
index f630188..c96e4ba 100644
--- a/src/gva-main.c
+++ b/src/gva-main.c
@@ -143,8 +143,11 @@ main_menu_item_deselect_cb (GtkMenuItem *item)
void
gva_main_init (void)
{
+ GSettings *settings;
gchar *text;
+ settings = gva_get_settings ();
+
gva_tree_view_init ();
gtk_box_pack_start (
@@ -180,13 +183,16 @@ gva_main_init (void)
GVA_WIDGET_MAIN_MUTE_BUTTON,
gva_mame_supports_sound ());
- gconf_bridge_bind_property (
- gconf_bridge_get (), GVA_GCONF_SOUND_MUTED,
- G_OBJECT (GVA_WIDGET_MAIN_MUTE_BUTTON), "muted");
+ g_settings_bind (
+ settings, GVA_SETTING_SOUND_MUTED,
+ GVA_WIDGET_MAIN_MUTE_BUTTON, "muted",
+ G_SETTINGS_BIND_DEFAULT);
+#if 0 /* GSETTINGS */
gconf_bridge_bind_window (
gconf_bridge_get (), GVA_GCONF_WINDOW_PREFIX,
GTK_WINDOW (GVA_WIDGET_MAIN_WINDOW), TRUE, TRUE);
+#endif
/* Initialize the search entry. */
text = gva_main_get_last_search_text ();
@@ -748,14 +754,11 @@ gva_main_execute_search (void)
gchar *
gva_main_get_last_search_text (void)
{
- GConfClient *client;
+ GSettings *settings;
gchar *text;
- GError *error = NULL;
- client = gconf_client_get_default ();
- text = gconf_client_get_string (client, GVA_GCONF_SEARCH_KEY, &error);
- gva_error_handle (&error);
- g_object_unref (client);
+ settings = gva_get_settings ();
+ text = g_settings_get_string (settings, GVA_SETTING_SEARCH);
return (text != NULL) ? g_strstrip (text) : g_strdup ("");
}
@@ -774,15 +777,12 @@ gva_main_get_last_search_text (void)
void
gva_main_set_last_search_text (const gchar *text)
{
- GConfClient *client;
- GError *error = NULL;
+ GSettings *settings;
g_return_if_fail (text != NULL);
- client = gconf_client_get_default ();
- gconf_client_set_string (client, GVA_GCONF_SEARCH_KEY, text, &error);
- gva_error_handle (&error);
- g_object_unref (client);
+ settings = gva_get_settings ();
+ g_settings_set_string (settings, GVA_SETTING_SEARCH, text);
}
/**
@@ -803,25 +803,18 @@ gboolean
gva_main_get_last_selected_match (gchar **column_name,
gchar **search_text)
{
- GConfClient *client;
- gboolean success;
- GError *error = NULL;
+ GSettings *settings;
g_return_val_if_fail (column_name != NULL, FALSE);
g_return_val_if_fail (search_text != NULL, FALSE);
- *column_name = *search_text = NULL;
+ settings = gva_get_settings ();
- client = gconf_client_get_default ();
- success = gconf_client_get_pair (
- client, GVA_GCONF_SELECTED_MATCH_KEY,
- GCONF_VALUE_STRING, GCONF_VALUE_STRING,
- column_name, search_text, &error);
- gva_error_handle (&error);
- g_object_unref (client);
+ *column_name = *search_text = NULL;
- if (!success)
- return FALSE;
+ g_settings_get (
+ settings, GVA_SETTING_SELECTED_MATCH,
+ "(ss)", column_name, search_text);
/* The value may be unset. Treat it as a failure. */
if (*column_name == NULL || *search_text == NULL)
@@ -863,22 +856,14 @@ void
gva_main_set_last_selected_match (const gchar *column_name,
const gchar *search_text)
{
- GConfClient *client;
- GError *error = NULL;
-
- if (column_name == NULL)
- column_name = "";
-
- if (search_text == NULL)
- search_text = "";
-
- client = gconf_client_get_default ();
- gconf_client_set_pair (
- client, GVA_GCONF_SELECTED_MATCH_KEY,
- GCONF_VALUE_STRING, GCONF_VALUE_STRING,
- &column_name, &search_text, &error);
- gva_error_handle (&error);
- g_object_unref (client);
+ GSettings *settings;
+
+ settings = gva_get_settings ();
+
+ g_settings_set (
+ settings, GVA_SETTING_SELECTED_MATCH, "(ss)",
+ (column_name != NULL) ? column_name : "",
+ (search_text != NULL) ? search_text : "");
}
/**
diff --git a/src/gva-preferences.c b/src/gva-preferences.c
index 765493a..b8f4468 100644
--- a/src/gva-preferences.c
+++ b/src/gva-preferences.c
@@ -22,6 +22,7 @@
#include "gva-error.h"
#include "gva-mame.h"
#include "gva-ui.h"
+#include "gva-util.h"
/**
* gva_preferences_init:
@@ -33,6 +34,10 @@
void
gva_preferences_init (void)
{
+ GSettings *settings;
+
+ settings = gva_get_settings ();
+
/* Auto Play */
/* This actually appears in the Properties window,
@@ -42,9 +47,10 @@ gva_preferences_init (void)
GTK_ACTIVATABLE (GVA_WIDGET_PROPERTIES_MUSIC_AUTO_PLAY),
GVA_ACTION_AUTO_PLAY);
- gconf_bridge_bind_property (
- gconf_bridge_get (), GVA_GCONF_AUTO_PLAY_KEY,
- G_OBJECT (GVA_ACTION_AUTO_PLAY), "active");
+ g_settings_bind (
+ settings, GVA_SETTING_AUTO_PLAY,
+ GVA_ACTION_AUTO_PLAY, "active",
+ G_SETTINGS_BIND_DEFAULT);
/* Auto Save */
@@ -56,9 +62,11 @@ gva_preferences_init (void)
GVA_ACTION_AUTO_SAVE,
gva_mame_supports_auto_save ());
- gconf_bridge_bind_property (
- gconf_bridge_get (), GVA_GCONF_AUTO_SAVE_KEY,
- G_OBJECT (GVA_ACTION_AUTO_SAVE), "active");
+ g_settings_bind (
+ settings, GVA_SETTING_AUTO_SAVE,
+ GVA_ACTION_AUTO_SAVE, "active",
+ G_SETTINGS_BIND_DEFAULT |
+ G_SETTINGS_BIND_NO_SENSITIVITY);
/* Full Screen */
@@ -71,9 +79,11 @@ gva_preferences_init (void)
gva_mame_supports_full_screen () ||
gva_mame_supports_window ());
- gconf_bridge_bind_property (
- gconf_bridge_get (), GVA_GCONF_FULL_SCREEN_KEY,
- G_OBJECT (GVA_ACTION_FULL_SCREEN), "active");
+ g_settings_bind (
+ settings, GVA_SETTING_FULL_SCREEN,
+ GVA_ACTION_FULL_SCREEN, "active",
+ G_SETTINGS_BIND_DEFAULT |
+ G_SETTINGS_BIND_NO_SENSITIVITY);
/* Show Clones */
@@ -81,9 +91,10 @@ gva_preferences_init (void)
GTK_ACTIVATABLE (GVA_WIDGET_PREFERENCES_SHOW_CLONES),
GVA_ACTION_SHOW_CLONES);
- gconf_bridge_bind_property (
- gconf_bridge_get (), GVA_GCONF_SHOW_CLONES_KEY,
- G_OBJECT (GVA_ACTION_SHOW_CLONES), "active");
+ g_settings_bind (
+ settings, GVA_SETTING_SHOW_CLONES,
+ GVA_ACTION_SHOW_CLONES, "active",
+ G_SETTINGS_BIND_DEFAULT);
}
/**
diff --git a/src/gva-properties.c b/src/gva-properties.c
index f632df4..e98dbc3 100644
--- a/src/gva-properties.c
+++ b/src/gva-properties.c
@@ -763,7 +763,8 @@ void
gva_properties_init (void)
{
GtkTreeView *view;
- GtkSettings *settings;
+ GSettings *settings;
+ GtkSettings *gtk_settings;
GtkWidget *text_view;
GHashTable *color_hash;
PangoFontDescription *desc;
@@ -775,6 +776,8 @@ gva_properties_init (void)
GtkNotebook *notebook;
#endif
+ settings = gva_get_settings ();
+
view = GTK_TREE_VIEW (GVA_WIDGET_MAIN_TREE_VIEW);
text_view = GVA_WIDGET_PROPERTIES_HISTORY_TEXT_VIEW;
@@ -786,9 +789,10 @@ gva_properties_init (void)
GTK_ACTIVATABLE (GVA_WIDGET_PROPERTIES_FORWARD_BUTTON),
GVA_ACTION_NEXT_GAME);
- gconf_bridge_bind_property (
- gconf_bridge_get (), GVA_GCONF_PROPERTIES_PAGE_KEY,
- G_OBJECT (GVA_WIDGET_PROPERTIES_NOTEBOOK), "page");
+ g_settings_bind (
+ settings, GVA_SETTING_PROPERTIES_PAGE,
+ GVA_WIDGET_PROPERTIES_NOTEBOOK, "page",
+ G_SETTINGS_BIND_DEFAULT);
g_signal_connect (
gtk_tree_view_get_selection (view), "changed",
@@ -798,9 +802,11 @@ gva_properties_init (void)
GVA_WIDGET_PROPERTIES_MUSIC_BUTTON, "notify::status",
G_CALLBACK (properties_notify_music_status_cb), NULL);
+#if 0 /* GSETTINGS */
gconf_bridge_bind_window (
gconf_bridge_get (), GVA_GCONF_PROPERTIES_PREFIX,
GTK_WINDOW (GVA_WIDGET_PROPERTIES_WINDOW), TRUE, FALSE);
+#endif
font_name = gva_get_monospace_font_name ();
desc = pango_font_description_from_string (font_name);
@@ -808,8 +814,8 @@ gva_properties_init (void)
pango_font_description_free (desc);
g_free (font_name);
- settings = gtk_settings_get_default ();
- g_object_get (settings, "color-hash", &color_hash, NULL);
+ gtk_settings = gtk_settings_get_default ();
+ g_object_get (gtk_settings, "color-hash", &color_hash, NULL);
color = g_hash_table_lookup (color_hash, "tooltip_bg_color");
widget = GVA_WIDGET_PROPERTIES_STATUS_EVENT_BOX;
gtk_widget_modify_bg (widget, GTK_STATE_NORMAL, color);
diff --git a/src/gva-tree-view.c b/src/gva-tree-view.c
index 585fdb7..3986662 100644
--- a/src/gva-tree-view.c
+++ b/src/gva-tree-view.c
@@ -587,16 +587,13 @@ gva_tree_view_set_selected_view (gint view)
const gchar *
gva_tree_view_get_last_selected_game (void)
{
+ GSettings *settings;
const gchar *retval = NULL;
- GConfClient *client;
gchar *game;
- GError *error = NULL;
- client = gconf_client_get_default ();
- game = gconf_client_get_string (
- client, GVA_GCONF_SELECTED_GAME_KEY, &error);
- gva_error_handle (&error);
- g_object_unref (client);
+ settings = gva_get_settings ();
+
+ game = g_settings_get_string (settings, GVA_SETTING_SELECTED_GAME);
if (game != NULL)
{
@@ -621,16 +618,13 @@ gva_tree_view_get_last_selected_game (void)
void
gva_tree_view_set_last_selected_game (const gchar *game)
{
- GConfClient *client;
- GError *error = NULL;
+ GSettings *settings;
g_return_if_fail (game != NULL);
- client = gconf_client_get_default ();
- gconf_client_set_string (
- client, GVA_GCONF_SELECTED_GAME_KEY, game, &error);
- gva_error_handle (&error);
- g_object_unref (client);
+ settings = gva_get_settings ();
+
+ g_settings_set_string (settings, GVA_SETTING_SELECTED_GAME, game);
}
/**
@@ -646,26 +640,25 @@ void
gva_tree_view_get_last_sort_column_id (GvaGameStoreColumn *column_id,
GtkSortType *order)
{
- GConfClient *client;
+ GSettings *settings;
gchar *column_name = NULL;
gboolean descending;
- GError *error = NULL;
g_return_if_fail (column_id != NULL);
g_return_if_fail (order != NULL);
- client = gconf_client_get_default ();
- gconf_client_get_pair (
- client, GVA_GCONF_SORT_COLUMN_KEY,
- GCONF_VALUE_STRING, GCONF_VALUE_BOOL,
- &column_name, &descending, &error);
- gva_error_handle (&error);
+ settings = gva_get_settings ();
+
+ g_settings_get (
+ settings, GVA_SETTING_SORT_COLUMN,
+ "(sb)", &column_name, &descending);
+
if (column_name == NULL)
*column_id = GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID;
else if (!gva_columns_lookup_id (column_name, column_id))
*column_id = GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID;
+
*order = descending ? GTK_SORT_DESCENDING : GTK_SORT_ASCENDING;
- g_object_unref (client);
}
/**
@@ -684,22 +677,21 @@ void
gva_tree_view_set_last_sort_column_id (GvaGameStoreColumn column_id,
GtkSortType order)
{
- GConfClient *client;
+ GSettings *settings;
const gchar *column_name;
gboolean descending;
- GError *error = NULL;
- client = gconf_client_get_default ();
+ settings = gva_get_settings ();
+
column_name = gva_columns_lookup_name (column_id);
if (column_name == NULL)
column_name = "default";
+
descending = (order == GTK_SORT_DESCENDING);
- gconf_client_set_pair (
- client, GVA_GCONF_SORT_COLUMN_KEY,
- GCONF_VALUE_STRING, GCONF_VALUE_BOOL,
- &column_name, &descending, &error);
- gva_error_handle (&error);
- g_object_unref (client);
+
+ g_settings_set (
+ settings, GVA_SETTING_SORT_COLUMN,
+ "(sb)", column_name, descending);
}
/**
diff --git a/src/gva-util.c b/src/gva-util.c
index 5420e42..22ac7c2 100644
--- a/src/gva-util.c
+++ b/src/gva-util.c
@@ -25,9 +25,6 @@
#define DEFAULT_MONOSPACE_FONT_NAME "Monospace 10"
-#define GCONF_MONOSPACE_FONT_NAME_KEY \
- "/desktop/gnome/interface/monospace_font_name"
-
/* Command Line Options */
gboolean opt_build_database;
gchar *opt_inspect;
@@ -222,21 +219,15 @@ gva_get_last_version (void)
if (G_UNLIKELY (first_time))
{
- GConfClient *client;
- GError *error = NULL;
-
- client = gconf_client_get_default ();
+ GSettings *settings;
- last_version = gconf_client_get_string (
- client, GVA_GCONF_VERSION_KEY, &error);
- gva_error_handle (&error);
+ settings = gva_get_settings ();
- gconf_client_set_string (
- client, GVA_GCONF_VERSION_KEY,
- PACKAGE_VERSION, &error);
- gva_error_handle (&error);
+ last_version = g_settings_get_string (
+ settings, GVA_SETTING_VERSION);
- g_object_unref (client);
+ g_settings_set_string (
+ settings, GVA_SETTING_VERSION, PACKAGE_VERSION);
first_time = FALSE;
}
@@ -255,15 +246,12 @@ gva_get_last_version (void)
gchar *
gva_get_monospace_font_name (void)
{
- GConfClient *client;
+ GSettings *settings;
gchar *font_name;
- GError *error = NULL;
- client = gconf_client_get_default ();
- font_name = gconf_client_get_string (
- client, GCONF_MONOSPACE_FONT_NAME_KEY, &error);
- gva_error_handle (&error);
- g_object_unref (client);
+ settings = g_settings_new ("org.gnome.desktop.interface");
+ font_name = g_settings_get_string (settings, "monospace-font-name");
+ g_object_unref (settings);
/* Fallback to a reasonable default. */
if (font_name == NULL)
@@ -273,6 +261,26 @@ gva_get_monospace_font_name (void)
}
/**
+ * gva_get_settings:
+ *
+ * Returns the #GSettings object loaded with the schema for
+ * <emphasis>GNOME Video Arcade</emphasis>.
+ *
+ * Returns: the #GSettings object for
+ * <emphasis>GNOME Video Arcade</emphasis>
+ **/
+GSettings *
+gva_get_settings (void)
+{
+ static GSettings *settings = NULL;
+
+ if (G_UNLIKELY (settings == NULL))
+ settings = g_settings_new ("org.gnome.VideoArcade");
+
+ return settings;
+}
+
+/**
* gva_get_time_elapsed:
* @start_time: a start time
* @time_elapsed: location to put the time elasped
diff --git a/src/gva-util.h b/src/gva-util.h
index 9991df9..aeb8df1 100644
--- a/src/gva-util.h
+++ b/src/gva-util.h
@@ -65,6 +65,7 @@ gchar * gva_find_data_file (const gchar *basename);
GvaDebugFlags gva_get_debug_flags (void);
const gchar * gva_get_last_version (void);
gchar * gva_get_monospace_font_name (void);
+GSettings * gva_get_settings (void);
void gva_get_time_elapsed (GTimeVal *start_time,
GTimeVal *time_elapsed);
const gchar * gva_get_user_data_dir (void);
diff --git a/src/main.c b/src/main.c
index 7532ae2..4c8ca29 100644
--- a/src/main.c
+++ b/src/main.c
@@ -125,8 +125,11 @@ warn_if_no_roms (void)
static gboolean
start (void)
{
+ GSettings *settings;
GError *error = NULL;
+ settings = gva_get_settings ();
+
if (gva_db_needs_rebuilt ())
{
if (!gva_main_build_database (&error))
@@ -147,9 +150,10 @@ start (void)
gva_ui_unlock ();
- gconf_bridge_bind_property (
- gconf_bridge_get (), GVA_GCONF_SELECTED_VIEW_KEY,
- G_OBJECT (GVA_ACTION_VIEW_AVAILABLE), "current-value");
+ g_settings_bind (
+ settings, GVA_SETTING_SELECTED_VIEW,
+ GVA_ACTION_VIEW_AVAILABLE, "current-value",
+ G_SETTINGS_BIND_DEFAULT);
/* Present a helpful dialog if no ROMs were found. */
warn_if_no_roms ();
@@ -341,7 +345,7 @@ main (gint argc, gchar **argv)
}
/* If another instance is running, exit now. */
- app = unique_app_new ("org.gnome.GnomeVideoArcade", NULL);
+ app = unique_app_new ("org.gnome.VideoArcade", NULL);
if (unique_app_is_running (app))
{
gint exit_status;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]