[empathy] Convert to new-style schema



commit a9c56d98390d3c2c592c00ceef0d10151d6f9c49
Author: Danielle Madeley <danielle madeley collabora co uk>
Date:   Thu Jun 10 18:47:38 2010 +1000

    Convert to new-style schema

 configure.ac                       |    5 +-
 data/.gitignore                    |    2 +-
 data/Makefile.am                   |   22 +-
 data/empathy.schemas.in            |  651 ------------------------------------
 data/org.gnome.Empathy.gschema.xml |  253 ++++++++++++++
 m4/gsettings.m4                    |   80 +++++
 6 files changed, 342 insertions(+), 671 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 8e09f4d..1809400 100644
--- a/configure.ac
+++ b/configure.ac
@@ -29,7 +29,7 @@ AC_COPYRIGHT([
 ])
 
 # Minimal version required
-GLIB_REQUIRED=2.22.0
+GLIB_REQUIRED=2.25.9
 GTK_REQUIRED=2.21.2
 GCONF_REQUIRED=1.2.0
 TELEPATHY_GLIB_REQUIRED=0.11.7
@@ -82,8 +82,7 @@ IT_PROG_INTLTOOL([0.35.0])
 GNOME_DOC_INIT([0.17.3])
 IDT_COMPILE_WARNINGS
 AC_PATH_PROG(DBUS_BINDING_TOOL, dbus-binding-tool)
-AC_PATH_PROG(GCONFTOOL, gconftool-2)
-AM_GCONF_SOURCE_2
+GLIB_GSETTINGS
 GLIB_GENMARSHAL=`$PKG_CONFIG glib-2.0 --variable=glib_genmarshal`
 AC_SUBST(GLIB_GENMARSHAL)
 CONTROL_CENTER_EXTENSIONDIR=`$PKG_CONFIG --variable=extensiondir libgnome-control-center-extension`
diff --git a/data/.gitignore b/data/.gitignore
index 423507e..56560b3 100644
--- a/data/.gitignore
+++ b/data/.gitignore
@@ -1,6 +1,6 @@
 empathy.desktop
 empathy.desktop.in
-empathy.schemas
+org.gnome.Empathy.gschema.valid
 org.freedesktop.Telepathy.Client.Empathy.service
 empathy-accounts.desktop
 empathy-accounts.desktop.in
diff --git a/data/Makefile.am b/data/Makefile.am
index 8ba57bd..13276a2 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -8,10 +8,11 @@ desktop_in_files = \
 desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
 @INTLTOOL_DESKTOP_RULE@
 
-schemasdir	 = $(GCONF_SCHEMA_FILE_DIR)
-schemas_in_files = empathy.schemas.in
-schemas_DATA 	 = $(schemas_in_files:.schemas.in=.schemas)
- INTLTOOL_SCHEMAS_RULE@
+gsettings_SCHEMAS = \
+	org.gnome.Empathy.gschema.xml \
+	$(NULL)
+
+ GSETTINGS_RULES@
 
 streamingprefsdir =  $(datadir)/empathy
 streamingprefs_DATA =		\
@@ -28,24 +29,13 @@ org.freedesktop.Telepathy.Client.Empathy.service: org.freedesktop.Telepathy.Clie
 clientfiledir = $(datarootdir)/telepathy/clients
 clientfile_DATA = Empathy.client
 
-if GCONF_SCHEMAS_INSTALL
-install-data-local:
-	if test -z "$(DESTDIR)" ; then \
-	  for p in $(schemas_DATA) ; do \
-	    GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $$p ; \
-	  done \
-	fi
-else
-install-data-local:
-endif
-
 htmldir = $(datadir)/empathy
 html_DATA = Template.html
 
 EXTRA_DIST = 				\
 	$(desktop_in_files)		\
 	$(desktop_DATA)			\
-	$(schemas_in_files)		\
+	$(gsettings_SCHEMAS)		\
 	$(schemas_DATA)			\
 	$(streamingprefs_DATA)		\
 	$(html_DATA)			\
diff --git a/data/org.gnome.Empathy.gschema.xml b/data/org.gnome.Empathy.gschema.xml
new file mode 100644
index 0000000..ca3c48c
--- /dev/null
+++ b/data/org.gnome.Empathy.gschema.xml
@@ -0,0 +1,253 @@
+<schemalist>
+  <schema id="org.gnome.Empathy" path="/apps/empathy/">
+    <key name="use-conn" type="b">
+      <default>true</default>
+      <summary>Connection managers should be used</summary>
+      <description>Whether connectivity managers should be used to automatically disconnect/reconnect.</description>
+    </key>
+    <key name="autoconnect" type="b">
+      <default>true</default>
+      <summary>Empathy should auto-connect on startup</summary>
+      <description>Whether Empathy should automatically log into your accounts on startup.</description>
+    </key>
+    <key name="autoaway" type="b">
+      <default>true</default>
+      <summary>Empathy should auto-away when idle</summary>
+      <description>Whether Empathy should go into away mode automatically if user is idle.</description>
+    </key>
+    <key name="import-asked" type="b">
+      <default>false</default>
+      <summary>Empathy has asked about importing accounts</summary>
+      <description>Whether Empathy has asked about importing accounts from other programs.</description>
+    </key>
+    <key name="butterfly-logs-migrated" type="b">
+      <default>false</default>
+      <summary>Empathy has migrated butterfly logs</summary>
+      <description>Whether Empathy has migrated butterfly logs.</description>
+    </key>
+    <key name="file-transfer-default-folder" type="s">
+      <default>''</default>
+      <summary>Empathy default download folder</summary>
+      <description>The default folder to save file transfers in.</description>
+    </key>
+    <child name="ui" schema="org.gnome.Empathy.ui"/>
+    <child name="contacts" schema="org.gnome.Empathy.contacts"/>
+    <child name="sounds" schema="org.gnome.Empathy.sounds"/>
+    <child name="notifications" schema="org.gnome.Empathy.notifications"/>
+    <child name="conversation" schema="org.gnome.Empathy.conversation"/>
+    <child name="hints" schema="org.gnome.Empathy.hints"/>
+    <child name="accounts" schema="org.gnome.Empathy.accounts"/>
+    <child name="location" schema="org.gnome.Empathy.location"/>
+  </schema>
+  <schema id="org.gnome.Empathy.ui" path="/apps/empathy/ui/">
+    <key name="show-offline" type="b">
+      <default>true</default>
+      <summary>Show offline contacts</summary>
+      <description>Whether to show contacts that are offline in the contact list.</description>
+    </key>
+    <key name="show-avatars" type="b">
+      <default>true</default>
+      <summary>Show avatars</summary>
+      <description>Whether to show avatars for contacts in the contact list and chat windows.</description>
+    </key>
+    <key name="show-protocols" type="b">
+      <default>false</default>
+      <summary>Show protocols</summary>
+      <description>Whether to show protocols for contacts in the contact list.</description>
+    </key>
+    <key name="compact-contact-list" type="b">
+      <default>false</default>
+      <summary>Compact contact list</summary>
+      <description>Whether to show the contact list in compact mode.</description>
+    </key>
+    <key name="main-window-hidden" type="b">
+      <default>false</default>
+      <summary>Hide main window</summary>
+      <description>Hide the main window.</description>
+    </key>
+    <key name="avatar-directory" type="s">
+      <default>''</default>
+      <summary>Default directory to select an avatar image from</summary>
+      <description>The last directory that an avatar image was chosen from.</description>
+    </key>
+    <key name="separate-chat-windows" type="b">
+      <default>false</default>
+      <summary>Open new chats in separate windows</summary>
+      <description>Always open a separate chat window for new chats.</description>
+    </key>
+  </schema>
+  <schema id="org.gnome.Empathy.contacts" path="/apps/empathy/contacts/">
+    <key name="sort-criterium" type="s">
+      <default>'state'</default>
+      <summary>Contact list sort criterion</summary>
+      <description>Which criterion to use when sorting the contact list. Default is to sort by the contact's name with the value "name". A value of "state" will sort the contact list by state.</description>
+    </key>
+  </schema>
+  <schema id="org.gnome.Empathy.sounds" path="/apps/empathy/sounds/">
+    <key name="sounds-enabled" type="b">
+      <default>true</default>
+      <summary>Use notification sounds</summary>
+      <description>Whether to play a sound to notify of events.</description>
+    </key>
+    <key name="sounds-disabled-away" type="b">
+      <default>true</default>
+      <summary>Disable sounds when away</summary>
+      <description>Whether to play sound notifications when away or busy.</description>
+    </key>
+    <key name="sounds-incoming-message" type="b">
+      <default>true</default>
+      <summary>Play a sound for incoming messages</summary>
+      <description>Whether to play a sound to notify of incoming messages.</description>
+    </key>
+    <key name="sounds-outgoing-message" type="b">
+      <default>false</default>
+      <summary>Play a sound for outgoing messages</summary>
+      <description>Whether to play a sound to notify of outgoing messages.</description>
+    </key>
+    <key name="sounds-new-conversation" type="b">
+      <default>true</default>
+      <summary>Play a sound for new conversations</summary>
+      <description>Whether to play a sound to notify of new conversations.</description>
+    </key>
+    <key name="sounds-contact-login" type="b">
+      <default>false</default>
+      <summary>Play a sound when a contact logs in</summary>
+      <description>Whether to play a sound to notify of contacts logging into the network.</description>
+    </key>
+    <key name="sounds-contact-logout" type="b">
+      <default>false</default>
+      <summary>Play a sound when a contact logs out</summary>
+      <description>Whether to play a sound to notify of contacts logging out of the network.</description>
+    </key>
+    <key name="sounds-service-login" type="b">
+      <default>false</default>
+      <summary>Play a sound when we log in</summary>
+      <description>Whether to play a sound when logging into a network.</description>
+    </key>
+    <key name="sounds-service-logout" type="b">
+      <default>false</default>
+      <summary>Play a sound when we log out</summary>
+      <description>Whether to play a sound when logging out of a network.</description>
+    </key>
+  </schema>
+  <schema id="org.gnome.Empathy.notifications" path="/apps/empathy/notifications/">
+    <key name="notifications-enabled" type="b">
+      <default>true</default>
+      <summary>Enable popup notifications for new messages</summary>
+      <description>Whether to show a popup notification when receiving a new message.</description>
+    </key>
+    <key name="notifications-disabled-away" type="b">
+      <default>true</default>
+      <summary>Disable popup notifications when away</summary>
+      <description>Whether to show popup notifications when away or busy.</description>
+    </key>
+    <key name="notifications-focus" type="b">
+      <default>false</default>
+      <summary>Pop up notifications if the chat isn't focused</summary>
+      <description>Whether to show a popup notification when receiving a new message even if the chat is already opened, but not focused.</description>
+    </key>
+    <key name="notifications-contact-signin" type="b">
+      <default>false</default>
+      <summary>Pop up notifications when a contact logs in</summary>
+      <description>Whether to show a popup notification when a contact goes online.</description>
+    </key>
+    <key name="notifications-contact-signout" type="b">
+      <default>false</default>
+      <summary>Pop up notifications when a contact logs out</summary>
+      <description>Whether to show a popup notification when a contact goes offline.</description>
+    </key>
+  </schema>
+  <schema id="org.gnome.Empathy.conversation" path="/apps/empathy/conversation/">
+    <key name="graphical-smileys" type="b">
+      <default>true</default>
+      <summary>Use graphical smileys</summary>
+      <description>Whether to convert smileys into graphical images in conversations.</description>
+    </key>
+    <key name="show-contacts-in-rooms" type="b">
+      <default>true</default>
+      <summary>Show contact list in rooms</summary>
+      <description>Whether to show the contact list in chat rooms.</description>
+    </key>
+    <key name="theme" type="s">
+      <default>'classic'</default>
+      <summary>Chat window theme</summary>
+      <description>The theme that is used to display the conversation in chat windows.</description>
+    </key>
+    <key name="adium-path" type="s">
+      <default>''</default>
+      <summary>Path of the Adium theme to use</summary>
+      <description>Path of the Adium theme to use if the theme used for chat is Adium.</description>
+    </key>
+    <key name="enable-webkit-developer-tools" type="b">
+      <default>false</default>
+      <summary>Enable WebKit Developer Tools</summary>
+      <description>Whether WebKit developer tools, such as the Web Inspector, should be enabled.</description>
+    </key>
+    <key name="theme-chat-room" type="b">
+      <default>true</default>
+      <summary>Use theme for chat rooms</summary>
+      <description>Whether to use the theme for chat rooms.</description>
+    </key>
+    <key name="spell-checker-languages" type="s">
+      <default>'en'</default>
+      <summary>Spell checking languages</summary>
+      <description>Comma-separated list of spell checker languages to use (e.g. "en, fr, nl").</description>
+    </key>
+    <key name="spell-checker-enabled" type="b">
+      <default>true</default>
+      <summary>Enable spell checker</summary>
+      <description>Whether to check words typed against the languages you want to check with.</description>
+    </key>
+    <key name="nick-completion-char" type="s">
+      <default>':'</default>
+      <summary>Nick completed character</summary>
+      <description>Character to add after nickname when using nick completion (tab) in group chat.</description>
+    </key>
+    <key name="avatar-in-icon" type="b">
+      <default>false</default>
+      <summary>Empathy should use the avatar of the contact as the chat window icon</summary>
+      <description>Whether Empathy should use the avatar of the contact as the chat window icon.</description>
+    </key>
+  </schema>
+  <schema id="org.gnome.Empathy.hints" path="/apps/empathy/hints/">
+    <key name="close-main-window" type="b">
+      <default>true</default>
+      <summary>Show hint about closing the main window</summary>
+      <description>Whether to show the message dialog about closing the main window with the 'x' button in the title bar.</description>
+    </key>
+  </schema>
+  <schema id="org.gnome.Empathy.accounts" path="/apps/empathy/accounts/">
+    <key name="imported-mc4-accounts" type="b">
+      <default>false</default>
+      <summary>MC 4 accounts have been imported</summary>
+      <description>MC 4 accounts have been imported.</description>
+    </key>
+  </schema>
+  <schema id="org.gnome.Empathy.location" path="/apps/empathy/location/">
+    <key name="publish" type="b">
+      <default>false</default>
+      <summary>Empathy can publish the user's location</summary>
+      <description>Whether Empathy can publish the user's location to their contacts.</description>
+    </key>
+    <key name="resource-network" type="b">
+      <default>true</default>
+      <summary>Empathy can use the network to guess the location</summary>
+      <description>Whether Empathy can use the network to guess the location.</description>
+    </key>
+    <key name="resource-cell" type="b">
+      <default>true</default>
+      <summary>Empathy can use the cellular network to guess the location</summary>
+      <description>Whether Empathy can use the cellular network to guess the location.</description>
+    </key>
+    <key name="resource-gps" type="b">
+      <default>false</default>
+      <summary>Empathy can use the GPS to guess the location</summary>
+      <description>Whether Empathy can use the GPS to guess the location.</description>
+    </key>
+    <key name="reduce-accuracy" type="b">
+      <default>true</default>
+      <summary>Empathy should reduce the location's accuracy</summary>
+      <description>Whether Empathy should reduce the location's accuracy for privacy reasons.</description>
+    </key>
+  </schema>
+</schemalist>
diff --git a/m4/gsettings.m4 b/m4/gsettings.m4
new file mode 100644
index 0000000..b686989
--- /dev/null
+++ b/m4/gsettings.m4
@@ -0,0 +1,80 @@
+dnl GLIB_GSETTINGS
+dnl Defines GSETTINGS_SCHEMAS_INSTALL which controls whether
+dnl the schema should be compiled
+dnl
+
+AC_DEFUN([GLIB_GSETTINGS],
+[
+  m4_pattern_allow([AM_V_GEN])
+  AC_ARG_ENABLE(schemas-compile,
+                AC_HELP_STRING([--disable-schemas-compile],
+                               [Disable regeneration of gschemas.compiled on install]),
+                [case ${enableval} in
+                  yes) GSETTINGS_DISABLE_SCHEMAS_COMPILE=""  ;;
+                  no)  GSETTINGS_DISABLE_SCHEMAS_COMPILE="1" ;;
+                  *) AC_MSG_ERROR([bad value ${enableval} for --enable-schemas-compile]) ;;
+                 esac])
+  AC_SUBST([GSETTINGS_DISABLE_SCHEMAS_COMPILE])
+  PKG_PROG_PKG_CONFIG([0.16])
+  AC_SUBST(gsettingsschemadir, [${datadir}/glib-2.0/schemas])
+  AC_SUBST(GLIB_COMPILE_SCHEMAS, `$PKG_CONFIG --variable glib_compile_schemas gio-2.0`)
+  if test "x$GLIB_COMPILE_SCHEMAS" = "x"; then
+    AC_MSG_ERROR([glib-compile-schemas not found.])
+  fi
+
+  GSETTINGS_RULES='
+.PHONY : uninstall-gsettings-schemas install-gsettings-schemas clean-gsettings-schemas
+
+mostlyclean-am: clean-gsettings-schemas
+
+%.gschema.valid: %.gschema.xml
+	$(AM_V_GEN) if test -f "$^"; then d=; else d="$(srcdir)/"; fi; $(GLIB_COMPILE_SCHEMAS) --dry-run --schema-file=$${d}$^ && touch [$]@
+
+all-am: $(gsettings_SCHEMAS:.xml=.valid)
+uninstall-am: uninstall-gsettings-schemas
+install-data-am: install-gsettings-schemas
+
+.SECONDARY: $(gsettings_SCHEMAS)
+
+gsettings__base_list = \
+  sed "$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g" | \
+  sed "$$!N;$$!N;$$!N;$$!N;s/\n/ /g"
+
+install-gsettings-schemas: $(gsettings_SCHEMAS:.xml=.valid)
+	@$(NORMAL_INSTALL)
+	test -z "$(gsettingsschemadir)" || $(MKDIR_P) "$(DESTDIR)$(gsettingsschemadir)"
+	@list='\''$(gsettings_SCHEMAS)'\''; test -n "$(gsettingsschemadir)" || list=; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; \
+	done | $(gsettings__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_DATA) $$files '\''$(DESTDIR)$(gsettingsschemadir)'\''"; \
+	  $(INSTALL_DATA) $$files "$(DESTDIR)$(gsettingsschemadir)" || exit $$?; \
+	done
+	test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir)
+
+uninstall-gsettings-schemas:
+	@$(NORMAL_UNINSTALL)
+	@list='\''$(gsettings_SCHEMAS)'\''; test -n "$(gsettingsschemadir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e '\''s|^.*/||'\''`; \
+	test -n "$$files" || exit 0; \
+	echo " ( cd '\''$(DESTDIR)$(gsettingsschemadir)'\'' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(gsettingsschemadir)" && rm -f $$files
+	test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) --uninstall $(gsettingsschemadir)
+
+clean-gsettings-schemas:
+	rm -f $(gsettings_SCHEMAS:.xml=.valid)
+
+'
+  _GSETTINGS_SUBST(GSETTINGS_RULES)
+])
+
+dnl _GSETTINGS_SUBST(VARIABLE)
+dnl Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST
+AC_DEFUN([_GSETTINGS_SUBST],
+[
+AC_SUBST([$1])
+m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])])
+]
+)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]