Commit 60e2d548 authored by Ignacio Casal Quinteiro's avatar Ignacio Casal Quinteiro
Browse files

Port gtranslator to gsettings.

parent 6bfbae5d
......@@ -64,6 +64,12 @@ GNOME_COMPILE_WARNINGS([maximum])
AC_PATH_PROG([GLIB_GENMARSHAL], [glib-genmarshal])
AC_PATH_PROG([GLIB_MKENUMS], [glib-mkenums])
dnl ================================================================
dnl GSettings stuff
dnl ================================================================
GLIB_GSETTINGS
dnl ==========================================================================
dnl
dnl If you add a version number here, you *must* add an AC_SUBST line for
......@@ -73,8 +79,7 @@ dnl ==========================================================================
GTHREAD_REQUIRED=2.13.0
GTK_REQUIRED=2.21.5
GLIB_REQUIRED=2.15.5
GCONF_REQUIRED=2.18.0
GLIB_REQUIRED=2.25.10
LIBXML_REQUIRED=2.4.12
SOURCEVIEW_REQUIRED=2.4.0
GDL_REQUIRED=2.26.0
......@@ -84,7 +89,6 @@ LIBSOUP_OPTIONAL=2.4.0
AC_SUBST(GTK_REQUIRED)
AC_SUBST(GLIB_REQUIRED)
AC_SUBST(GCONF_REQUIRED)
AC_SUBST(LIBXML_REQUIRED)
AC_SUBST(SOURCEVIEW_REQUIRED)
AC_SUBST(GDL_REQUIDED)
......@@ -99,7 +103,6 @@ PKG_CHECK_MODULES(GTRANSLATOR, [
gtk+-2.0 >= $GTK_REQUIRED
gtksourceview-2.0 >= $SOURCEVIEW_REQUIRED
gdl-1.0 >= $GDL_REQUIRED
gconf-2.0 >= $GCONF_REQUIRED
unique-1.0
libgda-4.0
])
......@@ -136,18 +139,6 @@ else
fi
AC_SUBST(PLUGIN_LIBTOOL_FLAGS)
dnl ------
dnl GCONF
dnl ------
AM_GCONF_SOURCE_2
AC_PATH_PROG([GCONFTOOL], [gconftool-2], [no])
if test "$GCONFTOOL" = "no"; then
AC_MSG_ERROR([gconftool-2 not found])
fi
dnl -------------------------------------------------------------------
dnl Check for gtkspell >= 2.0 and use it if found
dnl -------------------------------------------------------------------
......@@ -270,6 +261,7 @@ data/gtranslator.pc
data/desktop/Makefile
data/desktop/gtranslator.desktop.in
data/desktop/icons/Makefile
data/org.gnome.gtranslator.gschema.xml.in
data/pixmaps/Makefile
doc/Makefile
doc/reference/Makefile
......
......@@ -4,35 +4,33 @@ SUBDIRS = \
desktop \
pixmaps
schemasdir = $(GCONF_SCHEMA_FILE_DIR)
schemas_in_files = gtranslator.schemas.in
schemas_DATA = $(schemas_in_files:.schemas.in=.schemas)
@INTLTOOL_SCHEMAS_RULE@
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = gtranslator.pc
uidir = $(pkgdatadir)
ui_DATA = \
gtranslator-ui.xml \
gtr-toolbar.xml \
po.lang \
layout.xml
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 $(top_builddir)/data/$$p; \
done \
fi
EXTRA_DIST = \
$(schemas_in_files) \
$(ui_DATA) \
ui_DATA = \
gtranslator-ui.xml \
gtr-toolbar.xml \
po.lang \
layout.xml
gsettings_SCHEMAS = org.gnome.gtranslator.gschema.xml
@INTLTOOL_XML_NOMERGE_RULE@
@GSETTINGS_RULES@
EXTRA_DIST = \
$(ui_DATA) \
org.gnome.gtranslator.gschema.xml.in \
gtranslator.pc.in
CLEANFILES = \
$(schemas_DATA) \
CLEANFILES = \
$(gsettings_SCHEMAS) \
$(pkgconfig_DATA)
DISTCLEANFILES = \
$(gsettings_SCHEMAS) \
$(pkgconfig_DATA)
-include $(top_srcdir)/git.mk
<gconfschemafile>
<schemalist>
<schema>
<key>/schemas/apps/gtranslator/preferences/files/warn_if_contains_fuzzy</key>
<applyto>/apps/gtranslator/preferences/files/warn_if_contains_fuzzy</applyto>
<owner>gtranslator</owner>
<type>bool</type>
<default>TRUE</default>
<locale name="C">
<short>Warn if file contains fuzzy translations</short>
<long>If true, warn the user when saving a PO translation file containing fuzzy strings.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gtranslator/preferences/files/delete_compiled</key>
<applyto>/apps/gtranslator/preferences/files/delete_compiled</applyto>
<owner>gtranslator</owner>
<type>bool</type>
<default>FALSE</default>
<locale name="C">
<short>Delete compiled GMO files</short>
<long>If true, remove compiled GMO binary files when saving.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gtranslator/preferences/files/autosave</key>
<applyto>/apps/gtranslator/preferences/files/autosave</applyto>
<owner>gtranslator</owner>
<type>bool</type>
<default>FALSE</default>
<locale name="C">
<short>Autosave files</short>
<long>If true, automatically save files at specified intervals.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gtranslator/preferences/files/autosave_interval</key>
<applyto>/apps/gtranslator/preferences/files/autosave_interval</applyto>
<owner>gtranslator</owner>
<type>int</type>
<default>4</default>
<locale name="C">
<short>Autosave interval</short>
<long>Interval in minutes at which to automatically save files.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gtranslator/preferences/files/create_backup</key>
<applyto>/apps/gtranslator/preferences/files/create_backup</applyto>
<owner>gtranslator</owner>
<type>bool</type>
<default>TRUE</default>
<locale name="C">
<short>Create backup before saving</short>
<long>If true, create a backup copy of a file before saving it.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gtranslator/preferences/files/use_profile_values</key>
<applyto>/apps/gtranslator/preferences/files/use_profile_values</applyto>
<owner>gtranslator</owner>
<type>bool</type>
<default>TRUE</default>
<locale name="C">
<short>Use profile values for header</short>
<long>If true, overwrite the values in the PO header with those in the active profile.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gtranslator/preferences/editor/highlight_syntax</key>
<applyto>/apps/gtranslator/preferences/editor/highlight_syntax</applyto>
<owner>gtranslator</owner>
<type>bool</type>
<default>TRUE</default>
<locale name="C">
<short>Highlight syntax in edit fields</short>
<long>If true, apply syntax highlighting to strings in edit fields.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gtranslator/preferences/editor/visible_whitespace</key>
<applyto>/apps/gtranslator/preferences/editor/visible_whitespace</applyto>
<owner>gtranslator</owner>
<type>bool</type>
<default>TRUE</default>
<locale name="C">
<short>Make whitespace visible</short>
<long>If true, display whitespace in strings as representative symbols.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gtranslator/preferences/editor/use_custom_font</key>
<applyto>/apps/gtranslator/preferences/editor/use_custom_font</applyto>
<owner>gtranslator</owner>
<type>bool</type>
<default>FALSE</default>
<locale name="C">
<short>Use custom font</short>
<long>If true, use a custom font for edit fields.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gtranslator/preferences/editor/editor_font</key>
<applyto>/apps/gtranslator/preferences/editor/editor_font</applyto>
<owner>gtranslator</owner>
<type>string</type>
<default>Sans 10</default>
<locale name="C">
<short>Editor font</short>
<long>Custom font to use for edit fields.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gtranslator/preferences/editor/unmark_fuzzy_when_changed</key>
<applyto>/apps/gtranslator/preferences/editor/unmark_fuzzy_when_changed</applyto>
<owner>gtranslator</owner>
<type>bool</type>
<default>TRUE</default>
<locale name="C">
<short>Remove fuzzy status when message is changed</short>
<long>If true, remove fuzzy status from translations when they are changed.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gtranslator/preferences/editor/spellcheck</key>
<applyto>/apps/gtranslator/preferences/editor/spellcheck</applyto>
<owner>gtranslator</owner>
<type>bool</type>
<default>TRUE</default>
<locale name="C">
<short>Check spelling</short>
<long>If true, check the spelling of translated messages.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gtranslator/preferences/tm/po_directory</key>
<applyto>/apps/gtranslator/preferences/tm/po_directory</applyto>
<owner>gtranslator</owner>
<type>string</type>
<default></default>
<locale name="C">
<short>PO directory</short>
<long>Directory containing PO files to add to the translation memory.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gtranslator/preferences/tm/restrict_to_filename</key>
<applyto>/apps/gtranslator/preferences/tm/restrict_to_filename</applyto>
<owner>gtranslator</owner>
<type>bool</type>
<default>FALSE</default>
<locale name="C">
<short>Restrict search by filename</short>
<long>If true, only include files with a specified filename when searching the translation memory.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gtranslator/preferences/tm/filename_restriction</key>
<applyto>/apps/gtranslator/preferences/tm/filename_restriction</applyto>
<owner>gtranslator</owner>
<type>string</type>
<default></default>
<locale name="C">
<short>Filename to restrict search to</short>
<long>Filename to which searching of the translation memory should be restricted.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gtranslator/preferences/tm/max_missing_words</key>
<applyto>/apps/gtranslator/preferences/tm/max_missing_words</applyto>
<owner>gtranslator</owner>
<type>int</type>
<default>2</default>
<locale name="C">
<short>Maximum number of missing words</short>
<long>
Maximum number of words that can be missing from a message displayed
as a match by the translation memory.
</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gtranslator/preferences/tm/max_length_diff</key>
<applyto>/apps/gtranslator/preferences/tm/max_length_diff</applyto>
<owner>gtranslator</owner>
<type>int</type>
<default>2</default>
<locale name="C">
<short>Maximum difference in message length</short>
<long>
Maximum difference in length between messages displayed as matches
by the translation memory.
</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gtranslator/preferences/ui/pane_switcher_style</key>
<applyto>/apps/gtranslator/preferences/ui/pane_switcher_style</applyto>
<owner>gtranslator</owner>
<type>string</type>
<!-- Keep synced with default in prefs-manager.c -->
<default>icons_and_text</default>
<locale name="C">
<short>Side pane switcher style</short>
<long>
Style for switchers in the side pane. Possible values are "icons",
"text", "icons_and_text", "tabs" and "system".
</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gtranslator/preferences/ui/color_scheme</key>
<applyto>/apps/gtranslator/preferences/ui/color_scheme</applyto>
<owner>gtranslator</owner>
<type>string</type>
<default>classic</default>
<locale name="C">
<short>Color scheme</short>
<long>Name of a gtksourceview color scheme to use for syntax highlighting.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gtranslator/preferences/ui/sort_order</key>
<applyto>/apps/gtranslator/preferences/ui/sort_order</applyto>
<owner>gtranslator</owner>
<type>string</type>
<!-- Keep synced with default in prefs-manager.c -->
<default>id</default>
<locale name="C">
<short>Message list sort order</short>
<long>
Sort order to use in the message list. Possible values are "status",
"id", "original_text" and "translated_text".
</long>
</locale>
</schema>
</schemalist>
</gconfschemafile>
<schemalist>
<enum id="org.gnome.gtranslator.SwitcherStyle">
<value nick="text" value="0"/>
<value nick="icon" value="1"/>
<value nick="both" value="2"/>
<value nick="toolbar" value="3"/>
<value nick="tabs" value="4"/>
<value nick="none" value="5"/>
</enum>
<schema gettext-domain="@GETTEXT_PACKAGE@" id="org.gnome.gtranslator" path="/apps/gtranslator/">
<child name="preferences" schema="org.gnome.gtranslator.preferences"/>
<child name="state" schema="org.gnome.gtranslator.state"/>
<child name="plugins" schema="org.gnome.gtranslator.plugins"/>
</schema>
<schema gettext-domain="@GETTEXT_PACKAGE@" id="org.gnome.gtranslator.preferences" path="/apps/gtranslator/preferences/">
<child name="files" schema="org.gnome.gtranslator.preferences.files"/>
<child name="editor" schema="org.gnome.gtranslator.preferences.editor"/>
<child name="tm" schema="org.gnome.gtranslator.preferences.tm"/>
<child name="ui" schema="org.gnome.gtranslator.preferences.ui"/>
</schema>
<schema gettext-domain="@GETTEXT_PACKAGE@" id="org.gnome.gtranslator.preferences.files" path="/apps/gtranslator/preferences/files/">
<key name="warn-if-contains-fuzzy" type="b">
<default>true</default>
<_summary>Warn if file contains fuzzy translations</_summary>
<_description>
If true, warn the user when saving a PO translation file containing
fuzzy strings.
</_description>
</key>
<key name="delete-compiled" type="b">
<default>false</default>
<_summary>Delete compiled GMO files</_summary>
<_description>
If true, remove compiled GMO binary files when saving.
</_description>
</key>
<key name="auto-save" type="b">
<default>false</default>
<_summary>Auto save files</_summary>
<_description>
If true, automatically save files at specified intervals.
</_description>
</key>
<key name="auto-save-interval" type="i">
<default>4</default>
<_summary>Auto save interval</_summary>
<_description>
Interval in minutes at which to automatically save files.
</_description>
</key>
<key name="create-backup" type="b">
<default>true</default>
<_summary>Create backup before saving</_summary>
<_description>
If true, create a backup copy of a file before saving it.
</_description>
</key>
<key name="use-profile-values" type="b">
<default>true</default>
<_summary>Use profile values for header</_summary>
<_description>
If true, overwrite the values in the PO header with those in the active
profile.
</_description>
</key>
</schema>
<schema gettext-domain="@GETTEXT_PACKAGE@" id="org.gnome.gtranslator.preferences.editor" path="/apps/gtranslator/preferences/editor/">
<key name="highlight-syntax" type="b">
<default>true</default>
<_summary>Highlight syntax in edit fields</_summary>
<_description>
If true, apply syntax highlighting to strings in edit fields.
</_description>
</key>
<key name="visible-whitespace" type="b">
<default>true</default>
<_summary>Make whitespace visible</_summary>
<_description>
If true, display whitespace in strings as representative symbols.
</_description>
</key>
<key name="use-custom-font" type="b">
<default>false</default>
<_summary>Use custom font</_summary>
<_description>
If true, use a custom font for edit fields.
</_description>
</key>
<key name="editor-font" type="s">
<default>'Sans 10'</default>
<_summary>Editor font</_summary>
<_description>
Custom font to use for edit fields.
</_description>
</key>
<key name="unmark-fuzzy-when-changed" type="b">
<default>true</default>
<_summary>Remove fuzzy status when message is changed</_summary>
<_description>
If true, remove fuzzy status from translations when they are changed.
</_description>
</key>
<key name="spellcheck" type="b">
<default>true</default>
<_summary>Check spelling</_summary>
<_description>
If true, check the spelling of translated messages.
</_description>
</key>
</schema>
<schema gettext-domain="@GETTEXT_PACKAGE@" id="org.gnome.gtranslator.preferences.tm" path="/apps/gtranslator/preferences/tm/">
<key name="po-directory" type="s">
<default>''</default>
<_summary>PO directory</_summary>
<_description>
Directory containing PO files to add to the translation memory.
</_description>
</key>
<key name="restrict-to-filename" type="b">
<default>false</default>
<_summary>Restrict search by filename</_summary>
<_description>
If true, only include files with a specified filename when searching
the translation memory.
</_description>
</key>
<key name="filename-restriction" type="s">
<default>''</default>
<_summary>Filename to restrict search to</_summary>
<_description>
Filename to which searching of the translation memory should be
restricted.
</_description>
</key>
<key name="max-missing-words" type="i">
<default>2</default>
<_summary>Maximum number of missing words</_summary>
<_description>
Maximum number of words that can be missing from a message displayed as
a match by the translation memory.
</_description>
</key>
<key name="max-length-diff" type="i">
<default>2</default>
<_summary>Maximum difference in message length</_summary>
<_description>
Maximum difference in length between messages displayed as matches by
the translation memory.
</_description>
</key>
</schema>
<schema gettext-domain="@GETTEXT_PACKAGE@" id="org.gnome.gtranslator.preferences.ui" path="/apps/gtranslator/preferences/ui/">
<key name="panel-switcher-style" enum="org.gnome.gtranslator.SwitcherStyle">
<default>'both'</default>
<_summary>Side panel switcher style</_summary>
<_description>
Style for switchers in the side panel.
</_description>
</key>
<key name="color-scheme" type="s">
<default>'classic'</default>
<_summary>Color scheme</_summary>
<_description>
Name of a gtksourceview color scheme to use for syntax highlighting.
</_description>
</key>
<key name="sort-order" type="s">
<default>'id'</default>
<_summary>Message list sort order</_summary>
<_description>
Sort order to use in the message list. Possible values are "status",
"id", "original-text" and "translated-text".
</_description>
</key>
</schema>
<schema id="org.gnome.gtranslator.state" path="/apps/gtranslator/state/">
<child name="window" schema="org.gnome.gtranslator.state.window"/>
<child name="history-entry" schema="org.gnome.gtranslator.state.history-entry"/>
</schema>
<schema id="org.gnome.gtranslator.state.window" path="/apps/gtranslator/state/window/">
<key name="state" type="i">
<default>0</default>
</key>
<key name="size" type="(ii)">
<default>(775, 500)</default>
</key>
<key name="content-panel-size" type="i">
<default>325</default>
</key>
<key name="context-panel-size" type="i">
<default>525</default>
</key>
</schema>
<schema id="org.gnome.gtranslator.state.history-entry" path="/apps/gtranslator/state/history-entry/">
<key name="search-for-entry" type="as">
<default>['']</default>
</key>
<key name="replace-with-entry" type="as">
<default>['']</default>
</key>
</schema>
<schema gettext-domain="@GETTEXT_PACKAGE@" id="org.gnome.gtranslator.plugins" path="/apps/gtranslator/plugins/">
<key name="active-plugins" type="as">
<default>['']</default>
<_summary>Active plugins</_summary>
<_description>List of active plugins. It contains the "Location" of the active plugins. See the .gtranslator-plugin file for obtaining the "Location" of a given plugin.</_description>
</key>
</schema>
</schemalist>
......@@ -2,7 +2,7 @@
# Please keep this file sorted alphabetically.
[encoding: UTF-8]
data/desktop/gtranslator.desktop.in.in
data/gtranslator.schemas.in
data/org.gnome.gtranslator.gschema.xml.in.in
data/po.lang
plugins/alternate-language/gtr-alternate-language-panel.c
plugins/alternate-language/gtr-alternate-language-plugin.c
......@@ -49,7 +49,6 @@ src/gtr-message-table.c
src/gtr-notebook.c
src/gtr-po.c
src/plugin-system/gtr-plugin-manager.c
src/gtr-prefs-manager.c
src/gtr-statusbar.c
src/gtr-tab.c
src/gtr-tab-label.c
......
......@@ -29,8 +29,6 @@ INCLUDES = \
$(WARN_CFLAGS) \
$(DISABLE_DEPRECATED) \
-DG_LOG_DOMAIN=\""$(PACKAGE)"\" \
-DSCRIPTSDIR=\""$(pkgdatadir)"/scripts\" \
-DWINDOW_ICON=\""$(datadir)"/pixmaps/gtranslator.png\" \
-DPIXMAPSDIR=\""$(datadir)"/pixmaps/gtranslator\"
bin_PROGRAMS = \
......@@ -52,9 +50,9 @@ endif
libgtranslator_la_LDFLAGS = -export-dynamic -no-undefined -export-symbols-regex "^[[^_]].*"
BUILT_SOURCES = \
gtr-marshal.h \
gtr-marshal.c \
BUILT_SOURCES = \
gtr-marshal.h \
gtr-marshal.c \
gtr-enum-types.h \
gtr-enum-types.c
......@@ -65,7 +63,7 @@ gtranslator-res.o: gtranslator.rc
gtranslator_LDADD += gtranslator-res.o
endif
INST_H_FILES = \
INST_H_FILES = \
gtr-application.h \
gtr-context.h \
gtr-debug.h \
......@@ -115,11 +113,6 @@ libgtranslator_la_SOURCES = \
gtr-actions-view.c \
gtr-actions-help.c \
gtr-io-error-info-bar.c \
gtr-prefs-manager.c \
gtr-prefs-manager.h \
gtr-prefs-manager-private.h \
gtr-prefs-manager-app.c \