tags 886071 + patch thanks I couldn't test it properly as I don't have access to Windows machines. Let me know if there are problems.
You may wish to demote gconf2 to Recommends; see the discussion at #907826.
Description: Port to GSettings. Bug-Debian: https://bugs.debian.org/886071 Author: Yavor Doganov <ya...@gnu.org> Forwarded: no Last-Update: 2018-10-09 --- --- grdesktop-0.23+d040330.orig/configure.ac +++ grdesktop-0.23+d040330/configure.ac @@ -46,18 +46,14 @@ AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["${GETTEXT_PACKAGE}"], [gettext domain]) dnl Searching for GTK+ 2 includes/libs and export compiler flags -PKG_CHECK_MODULES(GTK2, [gtk+-2.0 gconf-2.0], HAVE_GTK=yes, HAVE_GTK=no) +PKG_CHECK_MODULES(GTK2, [gtk+-2.0], HAVE_GTK=yes, HAVE_GTK=no) if test "$HAVE_GTK" = "no"; then AC_MSG_ERROR([cannot find GTK+ 2.0!]) fi AC_SUBST(GTK2_CFLAGS) AC_SUBST(GTK2_LIBS) -AC_PATH_PROG(GCONFTOOL, gconftool-2, no) -if test "$GCONFTOOL" = "no"; then - AC_MSG_ERROR([cannot find gconf 2.0!]) -fi -AM_GCONF_SOURCE_2 +GLIB_GSETTINGS AC_CHECK_PROG(rdesktop, rdesktop, "yes", "no") if test "$rdesktop" = "no"; then --- grdesktop-0.23+d040330.orig/configure +++ grdesktop-0.23+d040330/configure @@ -625,11 +625,10 @@ LIBOBJS kbpath rdesktop -GCONF_SCHEMAS_INSTALL_FALSE -GCONF_SCHEMAS_INSTALL_TRUE -GCONF_SCHEMA_FILE_DIR -GCONF_SCHEMA_CONFIG_SOURCE -GCONFTOOL +GSETTINGS_RULES +GLIB_COMPILE_SCHEMAS +gsettingsschemadir +GSETTINGS_DISABLE_SCHEMAS_COMPILE GTK2_LIBS GTK2_CFLAGS PKG_CONFIG_LIBDIR @@ -748,9 +747,7 @@ enable_silent_rules enable_maintainer_mode enable_dependency_tracking -with_gconf_source -with_gconf_schema_file_dir -enable_schemas_install +enable_schemas_compile with_keymap_path ' ac_precious_vars='build_alias @@ -1399,16 +1396,12 @@ do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build - --disable-schemas-install - Disable the schemas installation + --disable-schemas-compile + Disable regeneration of gschemas.compiled on install Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-gconf-source=sourceaddress - Config database for installing schema files. - --with-gconf-schema-file-dir=dir - Directory for installing schema files. --with-keymap-path=DIR search for rdesktop keymap files in DIR/ Some influential environment variables: @@ -5657,12 +5650,12 @@ pkg_cv_GTK2_CFLAGS="$GTK2_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0 gconf-2.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gtk+-2.0 gconf-2.0") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gtk+-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_GTK2_CFLAGS=`$PKG_CONFIG --cflags "gtk+-2.0 gconf-2.0" 2>/dev/null` + pkg_cv_GTK2_CFLAGS=`$PKG_CONFIG --cflags "gtk+-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -5674,12 +5667,12 @@ pkg_cv_GTK2_LIBS="$GTK2_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0 gconf-2.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gtk+-2.0 gconf-2.0") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gtk+-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_GTK2_LIBS=`$PKG_CONFIG --libs "gtk+-2.0 gconf-2.0" 2>/dev/null` + pkg_cv_GTK2_LIBS=`$PKG_CONFIG --libs "gtk+-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -5700,9 +5693,9 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - GTK2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gtk+-2.0 gconf-2.0" 2>&1` + GTK2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gtk+-2.0" 2>&1` else - GTK2_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gtk+-2.0 gconf-2.0" 2>&1` + GTK2_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gtk+-2.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GTK2_PKG_ERRORS" >&5 @@ -5725,16 +5718,37 @@ -# Extract the first word of "gconftool-2", so it can be a program name with args. -set dummy gconftool-2; ac_word=$2 + + + # Check whether --enable-schemas-compile was given. +if test "${enable_schemas_compile+set}" = set; then : + enableval=$enable_schemas_compile; case ${enableval} in + yes) GSETTINGS_DISABLE_SCHEMAS_COMPILE="" ;; + no) GSETTINGS_DISABLE_SCHEMAS_COMPILE="1" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-schemas-compile" "$LINENO" 5 ;; + esac +fi + + + + + + + + + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_GCONFTOOL+:} false; then : +if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else - case $GCONFTOOL in + case $PKG_CONFIG in [\\/]* | ?:[\\/]*) - ac_cv_path_GCONFTOOL="$GCONFTOOL" # Let the user override the test with a path. + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -5744,7 +5758,7 @@ test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_GCONFTOOL="$as_dir/$ac_word$ac_exec_ext" + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -5752,71 +5766,188 @@ done IFS=$as_save_IFS - test -z "$ac_cv_path_GCONFTOOL" && ac_cv_path_GCONFTOOL="no" ;; esac fi -GCONFTOOL=$ac_cv_path_GCONFTOOL -if test -n "$GCONFTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GCONFTOOL" >&5 -$as_echo "$GCONFTOOL" >&6; } +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi -if test "$GCONFTOOL" = "no"; then - as_fn_error $? "cannot find gconf 2.0!" "$LINENO" 5 +fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG +if test -n "$ac_pt_PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 +$as_echo "$ac_pt_PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi - if test "x$GCONF_SCHEMA_INSTALL_SOURCE" = "x"; then - GCONF_SCHEMA_CONFIG_SOURCE=`gconftool-2 --get-default-source` + if test "x$ac_pt_PKG_CONFIG" = x; then + PKG_CONFIG="" else - GCONF_SCHEMA_CONFIG_SOURCE=$GCONF_SCHEMA_INSTALL_SOURCE + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKG_CONFIG=$ac_pt_PKG_CONFIG fi +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi - -# Check whether --with-gconf-source was given. -if test "${with_gconf_source+set}" = set; then : - withval=$with_gconf_source; GCONF_SCHEMA_CONFIG_SOURCE="$withval" fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.16 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 +$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + PKG_CONFIG="" + fi +fi + gsettingsschemadir=${datadir}/glib-2.0/schemas + if test x$cross_compiling != xyes; then + GLIB_COMPILE_SCHEMAS=`$PKG_CONFIG --variable glib_compile_schemas gio-2.0` + else + # Extract the first word of "glib-compile-schemas", so it can be a program name with args. +set dummy glib-compile-schemas; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_GLIB_COMPILE_SCHEMAS+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $GLIB_COMPILE_SCHEMAS in + [\\/]* | ?:[\\/]*) + ac_cv_path_GLIB_COMPILE_SCHEMAS="$GLIB_COMPILE_SCHEMAS" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GLIB_COMPILE_SCHEMAS="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + ;; +esac +fi +GLIB_COMPILE_SCHEMAS=$ac_cv_path_GLIB_COMPILE_SCHEMAS +if test -n "$GLIB_COMPILE_SCHEMAS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GLIB_COMPILE_SCHEMAS" >&5 +$as_echo "$GLIB_COMPILE_SCHEMAS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using config source $GCONF_SCHEMA_CONFIG_SOURCE for schema installation" >&5 -$as_echo "Using config source $GCONF_SCHEMA_CONFIG_SOURCE for schema installation" >&6; } - if test "x$GCONF_SCHEMA_FILE_DIR" = "x"; then - GCONF_SCHEMA_FILE_DIR='$(sysconfdir)/gconf/schemas' fi + if test "x$GLIB_COMPILE_SCHEMAS" = "x"; then + as_fn_error $? "glib-compile-schemas not found." "$LINENO" 5 + else + : + fi -# Check whether --with-gconf-schema-file-dir was given. -if test "${with_gconf_schema_file_dir+set}" = set; then : - withval=$with_gconf_schema_file_dir; GCONF_SCHEMA_FILE_DIR="$withval" -fi + GSETTINGS_RULES=' +.PHONY : uninstall-gsettings-schemas install-gsettings-schemas clean-gsettings-schemas +mostlyclean-am: clean-gsettings-schemas + +gsettings__enum_file = $(addsuffix .enums.xml,$(gsettings_ENUM_NAMESPACE)) + +%.gschema.valid: %.gschema.xml $(gsettings__enum_file) + $(AM_V_GEN) $(GLIB_COMPILE_SCHEMAS) --strict --dry-run $(addprefix --schema-file=,$(gsettings__enum_file)) --schema-file=$< && mkdir -p $(@D) && touch $@ + +all-am: $(gsettings_SCHEMAS:.xml=.valid) +uninstall-am: uninstall-gsettings-schemas +install-data-am: install-gsettings-schemas + +.SECONDARY: $(gsettings_SCHEMAS) + +install-gsettings-schemas: $(gsettings_SCHEMAS) $(gsettings__enum_file) + @$(NORMAL_INSTALL) + if test -n "$^"; then \ + test -z "$(gsettingsschemadir)" || $(MKDIR_P) "$(DESTDIR)$(gsettingsschemadir)"; \ + $(INSTALL_DATA) $^ "$(DESTDIR)$(gsettingsschemadir)"; \ + test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir); \ + fi + +uninstall-gsettings-schemas: + @$(NORMAL_UNINSTALL) + @list='\''$(gsettings_SCHEMAS) $(gsettings__enum_file)'\''; 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) $(gsettingsschemadir) + +clean-gsettings-schemas: + rm -f $(gsettings_SCHEMAS:.xml=.valid) $(gsettings__enum_file) + +ifdef gsettings_ENUM_NAMESPACE +$(gsettings__enum_file): $(gsettings_ENUM_FILES) + $(AM_V_GEN) glib-mkenums --comments '\''<!-- @comment@ -->'\'' --fhead "<schemalist>" --vhead " <@type@ id='\''$(gsettings_ENUM_NAMESPACE).@EnumName@'\''>" --vprod " <value nick='\''@valuenick@'\'' value='\''@valuenum@'\''/>" --vtail " </@type@>" --ftail "</schemalist>" $^ > $@.tmp && mv $@.tmp $@ +endif +' - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using $GCONF_SCHEMA_FILE_DIR as install directory for schema files" >&5 -$as_echo "Using $GCONF_SCHEMA_FILE_DIR as install directory for schema files" >&6; } - # Check whether --enable-schemas-install was given. -if test "${enable_schemas_install+set}" = set; then : - enableval=$enable_schemas_install; case ${enableval} in - yes|no) ;; - *) as_fn_error $? "bad value ${enableval} for --enable-schemas-install" "$LINENO" 5 ;; - esac -fi - if test "$enable_schemas_install" != no; then - GCONF_SCHEMAS_INSTALL_TRUE= - GCONF_SCHEMAS_INSTALL_FALSE='#' -else - GCONF_SCHEMAS_INSTALL_TRUE='#' - GCONF_SCHEMAS_INSTALL_FALSE= -fi @@ -6017,10 +6148,6 @@ as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${GCONF_SCHEMAS_INSTALL_TRUE}" && test -z "${GCONF_SCHEMAS_INSTALL_FALSE}"; then - as_fn_error $? "conditional \"GCONF_SCHEMAS_INSTALL\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 --- grdesktop-0.23+d040330.orig/aclocal.m4 +++ grdesktop-0.23+d040330/aclocal.m4 @@ -20,51 +20,6 @@ If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -dnl AM_GCONF_SOURCE_2 -dnl Defines GCONF_SCHEMA_CONFIG_SOURCE which is where you should install schemas -dnl (i.e. pass to gconftool-2 -dnl Defines GCONF_SCHEMA_FILE_DIR which is a filesystem directory where -dnl you should install foo.schemas files -dnl - -AC_DEFUN([AM_GCONF_SOURCE_2], -[ - if test "x$GCONF_SCHEMA_INSTALL_SOURCE" = "x"; then - GCONF_SCHEMA_CONFIG_SOURCE=`gconftool-2 --get-default-source` - else - GCONF_SCHEMA_CONFIG_SOURCE=$GCONF_SCHEMA_INSTALL_SOURCE - fi - - AC_ARG_WITH([gconf-source], - AC_HELP_STRING([--with-gconf-source=sourceaddress], - [Config database for installing schema files.]), - [GCONF_SCHEMA_CONFIG_SOURCE="$withval"],) - - AC_SUBST(GCONF_SCHEMA_CONFIG_SOURCE) - AC_MSG_RESULT([Using config source $GCONF_SCHEMA_CONFIG_SOURCE for schema installation]) - - if test "x$GCONF_SCHEMA_FILE_DIR" = "x"; then - GCONF_SCHEMA_FILE_DIR='$(sysconfdir)/gconf/schemas' - fi - - AC_ARG_WITH([gconf-schema-file-dir], - AC_HELP_STRING([--with-gconf-schema-file-dir=dir], - [Directory for installing schema files.]), - [GCONF_SCHEMA_FILE_DIR="$withval"],) - - AC_SUBST(GCONF_SCHEMA_FILE_DIR) - AC_MSG_RESULT([Using $GCONF_SCHEMA_FILE_DIR as install directory for schema files]) - - AC_ARG_ENABLE(schemas-install, - AC_HELP_STRING([--disable-schemas-install], - [Disable the schemas installation]), - [case ${enableval} in - yes|no) ;; - *) AC_MSG_ERROR([bad value ${enableval} for --enable-schemas-install]) ;; - esac]) - AM_CONDITIONAL([GCONF_SCHEMAS_INSTALL], [test "$enable_schemas_install" != no]) -]) - # Copyright (C) 1995-2002 Free Software Foundation, Inc. # Copyright (C) 2001-2003,2004 Red Hat, Inc. # @@ -552,6 +507,93 @@ fi]) +# Increment this whenever this file is changed. +#serial 1 + +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, + AS_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]) + if test x$cross_compiling != xyes; then + GLIB_COMPILE_SCHEMAS=`$PKG_CONFIG --variable glib_compile_schemas gio-2.0` + else + AC_PATH_PROG(GLIB_COMPILE_SCHEMAS, glib-compile-schemas) + fi + AC_SUBST(GLIB_COMPILE_SCHEMAS) + if test "x$GLIB_COMPILE_SCHEMAS" = "x"; then + ifelse([$2],,[AC_MSG_ERROR([glib-compile-schemas not found.])],[$2]) + else + ifelse([$1],,[:],[$1]) + fi + + GSETTINGS_RULES=' +.PHONY : uninstall-gsettings-schemas install-gsettings-schemas clean-gsettings-schemas + +mostlyclean-am: clean-gsettings-schemas + +gsettings__enum_file = $(addsuffix .enums.xml,$(gsettings_ENUM_NAMESPACE)) + +%.gschema.valid: %.gschema.xml $(gsettings__enum_file) + $(AM_V_GEN) $(GLIB_COMPILE_SCHEMAS) --strict --dry-run $(addprefix --schema-file=,$(gsettings__enum_file)) --schema-file=$< && mkdir -p [$](@D) && touch [$]@ + +all-am: $(gsettings_SCHEMAS:.xml=.valid) +uninstall-am: uninstall-gsettings-schemas +install-data-am: install-gsettings-schemas + +.SECONDARY: $(gsettings_SCHEMAS) + +install-gsettings-schemas: $(gsettings_SCHEMAS) $(gsettings__enum_file) + @$(NORMAL_INSTALL) + if test -n "$^"; then \ + test -z "$(gsettingsschemadir)" || $(MKDIR_P) "$(DESTDIR)$(gsettingsschemadir)"; \ + $(INSTALL_DATA) $^ "$(DESTDIR)$(gsettingsschemadir)"; \ + test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir); \ + fi + +uninstall-gsettings-schemas: + @$(NORMAL_UNINSTALL) + @list='\''$(gsettings_SCHEMAS) $(gsettings__enum_file)'\''; 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) $(gsettingsschemadir) + +clean-gsettings-schemas: + rm -f $(gsettings_SCHEMAS:.xml=.valid) $(gsettings__enum_file) + +ifdef gsettings_ENUM_NAMESPACE +$(gsettings__enum_file): $(gsettings_ENUM_FILES) + $(AM_V_GEN) glib-mkenums --comments '\''<!-- @comment@ -->'\'' --fhead "<schemalist>" --vhead " <@type@ id='\''$(gsettings_ENUM_NAMESPACE).@EnumName@'\''>" --vprod " <value nick='\''@valuenick@'\'' value='\''@valuenum@'\''/>" --vtail " </@type@>" --ftail "</schemalist>" [$]^ > [$]@.tmp && mv [$]@.tmp [$]@ +endif +' + _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])]) +] +) + dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- dnl serial 11 (pkg-config-0.29) dnl --- grdesktop-0.23+d040330.orig/src/Makefile.am +++ grdesktop-0.23+d040330/src/Makefile.am @@ -44,9 +44,12 @@ grdesktopdir = $(datadir)/applications grdesktop_DATA = grdesktop.desktop -schemadir = $(sysconfdir)/gconf/schemas -schema_DATA = grdesktop.schemas -schema_source_data = $(schema_DATA) +gsettings_SCHEMAS = org.nongnu.grdesktop.gschema.xml + +@GSETTINGS_RULES@ + +data_convertdir = $(datadir)/GConf/gsettings +dist_data_convert_DATA = grdesktop.convert install-data-local: if test -z "$(DESTDIR)"; then \ @@ -55,5 +58,5 @@ EXTRA_DIST = \ $(grdesktop_DATA) \ - $(schema_DATA) + $(gsettings_SCHEMAS) --- grdesktop-0.23+d040330.orig/src/Makefile.in +++ grdesktop-0.23+d040330/src/Makefile.in @@ -93,13 +93,14 @@ am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +DIST_COMMON = $(srcdir)/Makefile.am $(dist_data_convert_DATA) \ + $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = -am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(grdesktopdir)" \ - "$(DESTDIR)$(schemadir)" +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(data_convertdir)" \ + "$(DESTDIR)$(grdesktopdir)" PROGRAMS = $(bin_PROGRAMS) am_grdesktop_OBJECTS = main.$(OBJEXT) srvsel.$(OBJEXT) run.$(OBJEXT) \ btnbox.$(OBJEXT) optbox.$(OBJEXT) options.$(OBJEXT) \ @@ -175,7 +176,7 @@ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } -DATA = $(grdesktop_DATA) $(schema_DATA) +DATA = $(dist_data_convert_DATA) $(grdesktop_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -221,12 +222,11 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -GCONFTOOL = @GCONFTOOL@ -GCONF_SCHEMA_CONFIG_SOURCE = @GCONF_SCHEMA_CONFIG_SOURCE@ -GCONF_SCHEMA_FILE_DIR = @GCONF_SCHEMA_FILE_DIR@ +GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ +GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@ GTK2_CFLAGS = @GTK2_CFLAGS@ GTK2_LIBS = @GTK2_LIBS@ INSTALL = @INSTALL@ @@ -288,6 +288,7 @@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ +gsettingsschemadir = @gsettingsschemadir@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ @@ -336,12 +337,12 @@ grdesktop_LDADD = $(GTK2_LIBS) grdesktopdir = $(datadir)/applications grdesktop_DATA = grdesktop.desktop -schemadir = $(sysconfdir)/gconf/schemas -schema_DATA = grdesktop.schemas -schema_source_data = $(schema_DATA) +gsettings_SCHEMAS = org.nongnu.grdesktop.gschema.xml +data_convertdir = $(datadir)/GConf/gsettings +dist_data_convert_DATA = grdesktop.convert EXTRA_DIST = \ $(grdesktop_DATA) \ - $(schema_DATA) + $(gsettings_SCHEMAS) all: all-am @@ -457,48 +458,48 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` -install-grdesktopDATA: $(grdesktop_DATA) +install-dist_data_convertDATA: $(dist_data_convert_DATA) @$(NORMAL_INSTALL) - @list='$(grdesktop_DATA)'; test -n "$(grdesktopdir)" || list=; \ + @list='$(dist_data_convert_DATA)'; test -n "$(data_convertdir)" || list=; \ if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(grdesktopdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(grdesktopdir)" || exit 1; \ + echo " $(MKDIR_P) '$(DESTDIR)$(data_convertdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(data_convertdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(grdesktopdir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(grdesktopdir)" || exit $$?; \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(data_convertdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(data_convertdir)" || exit $$?; \ done -uninstall-grdesktopDATA: +uninstall-dist_data_convertDATA: @$(NORMAL_UNINSTALL) - @list='$(grdesktop_DATA)'; test -n "$(grdesktopdir)" || list=; \ + @list='$(dist_data_convert_DATA)'; test -n "$(data_convertdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(grdesktopdir)'; $(am__uninstall_files_from_dir) -install-schemaDATA: $(schema_DATA) + dir='$(DESTDIR)$(data_convertdir)'; $(am__uninstall_files_from_dir) +install-grdesktopDATA: $(grdesktop_DATA) @$(NORMAL_INSTALL) - @list='$(schema_DATA)'; test -n "$(schemadir)" || list=; \ + @list='$(grdesktop_DATA)'; test -n "$(grdesktopdir)" || list=; \ if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(schemadir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(schemadir)" || exit 1; \ + echo " $(MKDIR_P) '$(DESTDIR)$(grdesktopdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(grdesktopdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(schemadir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(schemadir)" || exit $$?; \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(grdesktopdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(grdesktopdir)" || exit $$?; \ done -uninstall-schemaDATA: +uninstall-grdesktopDATA: @$(NORMAL_UNINSTALL) - @list='$(schema_DATA)'; test -n "$(schemadir)" || list=; \ + @list='$(grdesktop_DATA)'; test -n "$(grdesktopdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(schemadir)'; $(am__uninstall_files_from_dir) + dir='$(DESTDIR)$(grdesktopdir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique @@ -589,7 +590,7 @@ check: check-am all-am: Makefile $(PROGRAMS) $(DATA) installdirs: - for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(grdesktopdir)" "$(DESTDIR)$(schemadir)"; do \ + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(data_convertdir)" "$(DESTDIR)$(grdesktopdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am @@ -651,8 +652,8 @@ info-am: -install-data-am: install-data-local install-grdesktopDATA \ - install-schemaDATA +install-data-am: install-data-local install-dist_data_convertDATA \ + install-grdesktopDATA install-dvi: install-dvi-am @@ -704,8 +705,8 @@ ps-am: -uninstall-am: uninstall-binPROGRAMS uninstall-grdesktopDATA \ - uninstall-schemaDATA +uninstall-am: uninstall-binPROGRAMS uninstall-dist_data_convertDATA \ + uninstall-grdesktopDATA .MAKE: install-am install-strip @@ -714,20 +715,22 @@ distclean distclean-compile distclean-generic distclean-tags \ distdir dvi dvi-am html html-am info info-am install \ install-am install-binPROGRAMS install-data install-data-am \ - install-data-local install-dvi install-dvi-am install-exec \ - install-exec-am install-grdesktopDATA install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-schemaDATA install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ - ps ps-am tags tags-am uninstall uninstall-am \ - uninstall-binPROGRAMS uninstall-grdesktopDATA \ - uninstall-schemaDATA + install-data-local install-dist_data_convertDATA install-dvi \ + install-dvi-am install-exec install-exec-am \ + install-grdesktopDATA install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am uninstall-binPROGRAMS \ + uninstall-dist_data_convertDATA uninstall-grdesktopDATA .PRECIOUS: Makefile +@GSETTINGS_RULES@ + install-data-local: if test -z "$(DESTDIR)"; then \ GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(schema_source_data); \ --- grdesktop-0.23+d040330.orig/src/global.h +++ grdesktop-0.23+d040330/src/global.h @@ -24,7 +24,6 @@ #define __CONFIG_H__ #include <gtk/gtk.h> -#include <gconf/gconf-client.h> #include <stdlib.h> #include <stdio.h> @@ -65,15 +64,13 @@ #define KBPATH "/usr/local/share/rdesktop/keymaps/" #endif -#define GCONF_BASE "/apps/grdesktop/options" - GList *hostnames; GList *rdp_protocols; GList *screensize; GList *colors; GList *sound_options; GHashTable *config; -GConfClient *gcfg; +GSettings *gcfg; /* these widgets are used global */ GtkWidget *window_main; @@ -110,6 +107,7 @@ GtkWidget *combo_clientname; GtkWidget *check_sshopts; GtkWidget *btn_sshopts; +GtkWidget *gconf_migration; void error_dialog(gchar *msg, ...); --- grdesktop-0.23+d040330.orig/src/main.c +++ grdesktop-0.23+d040330/src/main.c @@ -46,8 +46,7 @@ } void destroy(GtkWidget *widget, gpointer data) { - gconf_client_set_bool(gcfg, GCONF_BASE"/showopts", - iSHASH("showopts"), NULL); + g_settings_set_boolean(gcfg, "showopts", iSHASH("showopts")); gtk_main_quit(); } @@ -73,6 +72,11 @@ g_signal_connect(G_OBJECT(window_main), "destroy", G_CALLBACK(destroy), NULL); + if (gconf_migration) { + gtk_dialog_run(GTK_DIALOG(gconf_migration)); + gtk_widget_destroy(gconf_migration); + } + winBox = gtk_vbox_new(FALSE, 0); gtk_container_add(GTK_CONTAINER(window_main), winBox); gtk_widget_show(winBox); @@ -177,8 +181,7 @@ gtk_window_set_default_icon_from_file(icon, NULL); g_free(dir); g_free(icon); - gconf_init(argc, argv, NULL); - gcfg = gconf_client_get_default(); + gcfg = g_settings_new("org.nongnu.grdesktop"); while((c = getopt(argc, argv, "shv")) != -1) { switch(c) { --- grdesktop-0.23+d040330.orig/src/btnbox.c +++ grdesktop-0.23+d040330/src/btnbox.c @@ -87,8 +87,7 @@ if(child_pid != 0) return; - gconf_client_set_bool(gcfg, GCONF_BASE"/showopts", - iSHASH("showopts"), NULL); + g_settings_set_boolean(gcfg, "showopts", iSHASH("showopts")); gtk_main_quit(); } --- grdesktop-0.23+d040330.orig/src/options.c +++ grdesktop-0.23+d040330/src/options.c @@ -208,7 +208,7 @@ } gint loadServers() { - GSList *names; + gchar **names; gint count, i; if(g_list_length(hostnames) != 0) { /* empty the glist */ @@ -219,14 +219,14 @@ } } - names = gconf_client_get_list(gcfg, GCONF_BASE"/hostnames", - GCONF_VALUE_STRING, NULL); - count = g_slist_length(names); + names = g_settings_get_strv(gcfg, "hostnames"); + count = g_strv_length(names); for(i=0; i<count; i++) { gchar *name; - name = g_slist_nth_data(names, i); + name = names[i]; hostnames = g_list_append(hostnames, g_strdup(name)); } + g_strfreev(names); if(g_list_length(hostnames) == 0) return(1); @@ -234,7 +234,8 @@ } gint saveServers(gchar *newitem) { - GList *tmplist = NULL; + GList *walk, *tmplist = NULL; + gchar **names; gint i, max=0; guint count; @@ -262,86 +263,193 @@ tmplist = g_list_append(tmplist, item); } - gconf_client_set_list(gcfg, GCONF_BASE"/hostnames", - GCONF_VALUE_STRING, (GSList*)tmplist, NULL); + names = g_new0(gchar *, g_list_length(tmplist) + 1); + for (i = 0, walk = tmplist; walk; walk = walk->next) + names[i++] = g_strdup(walk->data); + + names[i] = NULL; + + g_settings_set_strv(gcfg, "hostnames", (const gchar**)names); + g_strfreev(names); return(0); } -gint loadOptions() { - GSList *values; - gint i; - gint count; +static void migrate_gconf_settings(const gchar *name) { + gboolean needed = TRUE; + GError *error = NULL; + GKeyFile *kf; + GtkWidget *dlg; + GtkMessageType type; + gchar **list; + gchar *msg; + gsize i, n; + + kf = g_key_file_new(); + + g_key_file_load_from_data_dirs(kf, "gsettings-data-convert", + NULL, G_KEY_FILE_NONE, NULL); + list = g_key_file_get_string_list(kf, "State", "converted", &n, NULL); + + if (list) { + for (i = 0; i < n; i++) + if (!g_strcmp0(list[i], name)) { + needed = FALSE; + break; + } + g_strfreev(list); + } + g_key_file_free(kf); - values = gconf_client_all_entries(gcfg, GCONF_BASE, NULL); - count = g_slist_length(values); - for(i=0; i<count; i++) { - GConfEntry *item; - GConfValue *typ; - gchar *value; - gchar **path = NULL; - gint y = 0; - - item = g_slist_nth_data(values, i); - typ = gconf_entry_get_value(item); - if(typ == NULL) { -#ifdef _DEBUG_ - g_warning("Gconf item \"%s\" is unassigned!", - gconf_entry_get_key(item)); -#endif - continue; - } + if (needed) { + g_spawn_command_line_sync("gsettings-data-convert", + NULL, NULL, NULL, &error); + if (error) { + msg = g_strdup_printf( + _("Could not migrate old GConf settings: %s\n" + "Please make sure that GConf is installed " + "and the gsettings-data-convert tool is in " + "your PATH.\nAlternatively, ignore this " + "message and convert your old settings " + "manually."), error->message); + type = GTK_MESSAGE_WARNING; + g_error_free(error); + } else { + msg = g_strdup(_("Old GConf settings were either " + "missing or migrated successfully.")); + type = GTK_MESSAGE_INFO; + + /* Allow some time for the GSettings backend + to record the changes, otherwise the + default values from the new schema might be + set. */ + sleep(1); + } + + dlg = gtk_message_dialog_new(GTK_WINDOW(window_main), + GTK_DIALOG_DESTROY_WITH_PARENT, + type, GTK_BUTTONS_CLOSE, + "%s", msg); + g_free(msg); + gconf_migration = dlg; + } +} - path = g_strsplit(gconf_entry_get_key(item), "/", 0); - while(path[y] != NULL) - y++; - - if(!g_ascii_strcasecmp(path[y-1], "hostnames")) { - if(path != NULL) - g_strfreev(path); - continue; - } - switch(typ->type) { - case GCONF_VALUE_STRING: - value = g_strdup_printf("%s", - gconf_client_get_string(gcfg, - gconf_entry_get_key(item), NULL)); - break; - case GCONF_VALUE_INT: - value = g_strdup_printf("%d", - gconf_client_get_int(gcfg, - gconf_entry_get_key(item), NULL)); - break; - case GCONF_VALUE_FLOAT: - value = g_strdup_printf("%f", - gconf_client_get_float(gcfg, - gconf_entry_get_key(item), NULL)); - break; - case GCONF_VALUE_BOOL: - value = g_strdup_printf("%d", - gconf_client_get_bool(gcfg, - gconf_entry_get_key(item), NULL)); - break; - default: - g_warning("Unsupported gconf value type (%d)", - typ->type); - continue; - } - -#ifdef _DEBUG_ - g_warning("Option: %s->%s", path[y-1], value); -#endif +gint loadOptions() { + gchar *value; + gint i; - g_hash_table_insert(config, g_strdup(path[y-1]), - g_strdup(value)); + migrate_gconf_settings("grdesktop.convert"); - if(path != NULL) - g_strfreev(path); - } + i = g_settings_get_boolean(gcfg, "bitmapupd"); + value = g_strdup_printf("%d", i); + g_hash_table_insert(config, g_strdup("bitmapupd"), g_strdup(value)); + g_free(value); + + value = g_settings_get_string(gcfg, "clientname"); + g_hash_table_insert(config, g_strdup("clientname"), g_strdup(value)); + g_free(value); + + i = g_settings_get_int(gcfg, "colorsize"); + value = g_strdup_printf("%d", i); + g_hash_table_insert(config, g_strdup("colorsize"), g_strdup(value)); + g_free(value); + + value = g_settings_get_string(gcfg, "username"); + g_hash_table_insert(config, g_strdup("username"), g_strdup(value)); + g_free(value); + + value = g_settings_get_string(gcfg, "password"); + g_hash_table_insert(config, g_strdup("password"), g_strdup(value)); + g_free(value); + + i = g_settings_get_boolean(gcfg, "savepw"); + value = g_strdup_printf("%d", i); + g_hash_table_insert(config, g_strdup("savepw"), g_strdup(value)); + g_free(value); + + value = g_settings_get_string(gcfg, "domain"); + g_hash_table_insert(config, g_strdup("domain"), g_strdup(value)); + g_free(value); + + value = g_settings_get_string(gcfg, "geometry"); + g_hash_table_insert(config, g_strdup("geometry"), g_strdup(value)); + g_free(value); + + i = g_settings_get_boolean(gcfg, "hidewmdecoration"); + value = g_strdup_printf("%d", i); + g_hash_table_insert(config, g_strdup("hidewmdecoration"), + g_strdup(value)); + g_free(value); + + i = g_settings_get_boolean(gcfg, "showopts"); + value = g_strdup_printf("%d", i); + g_hash_table_insert(config, g_strdup("showopts"), g_strdup(value)); + g_free(value); + + i = g_settings_get_int(gcfg, "rdp-protocol"); + value = g_strdup_printf("%d", i); + g_hash_table_insert(config, g_strdup("rdp-protocol"), g_strdup(value)); + g_free(value); + + value = g_settings_get_string(gcfg, "keymap"); + g_hash_table_insert(config, g_strdup("keymap"), g_strdup(value)); + g_free(value); + + i = g_settings_get_int(gcfg, "sound"); + value = g_strdup_printf("%d", i); + g_hash_table_insert(config, g_strdup("sound"), g_strdup(value)); + g_free(value); + + value = g_settings_get_string(gcfg, "program"); + g_hash_table_insert(config, g_strdup("program"), g_strdup(value)); + g_free(value); + + value = g_settings_get_string(gcfg, "ppath"); + g_hash_table_insert(config, g_strdup("ppath"), g_strdup(value)); + g_free(value); + + i = g_settings_get_boolean(gcfg, "runprog"); + value = g_strdup_printf("%d", i); + g_hash_table_insert(config, g_strdup("runprog"), g_strdup(value)); + g_free(value); + + i = g_settings_get_boolean(gcfg, "motionevt"); + value = g_strdup_printf("%d", i); + g_hash_table_insert(config, g_strdup("motionevt"), g_strdup(value)); + g_free(value); + + i = g_settings_get_boolean(gcfg, "noencryption"); + value = g_strdup_printf("%d", i); + g_hash_table_insert(config, g_strdup("noencryption"), g_strdup(value)); + g_free(value); + + i = g_settings_get_boolean(gcfg, "wmkeybindings"); + value = g_strdup_printf("%d", i); + g_hash_table_insert(config, g_strdup("wmkeybindings"), g_strdup(value)); + g_free(value); + + i = g_settings_get_boolean(gcfg, "attconsole"); + value = g_strdup_printf("%d", i); + g_hash_table_insert(config, g_strdup("attconsole"), g_strdup(value)); + g_free(value); + + i = g_settings_get_boolean(gcfg, "usessh"); + value = g_strdup_printf("%d", i); + g_hash_table_insert(config, g_strdup("usessh"), g_strdup(value)); + g_free(value); + + value = g_settings_get_string(gcfg, "sshuser"); + g_hash_table_insert(config, g_strdup("sshuser"), g_strdup(value)); + g_free(value); + + value = g_settings_get_string(gcfg, "sshhost"); + g_hash_table_insert(config, g_strdup("sshhost"), g_strdup(value)); + g_free(value); /* get the current username */ - if(SHASH("username") == NULL) { + if(!strlen(SHASH("username"))) { g_hash_table_insert(config, "username", g_strup((gchar*)g_get_user_name())); } @@ -350,62 +458,45 @@ } gint saveOptions() { + /* Apply all changes at once. */ + g_settings_delay(gcfg); + if(SHASH("username") != NULL) - gconf_client_set_string(gcfg, GCONF_BASE"/username", - SHASH("username"), NULL); + g_settings_set_string(gcfg, "username", SHASH("username")); if((SHASH("password") != NULL) && (iSHASH("savepw") == TRUE)) - gconf_client_set_string(gcfg, GCONF_BASE"/password", - SHASH("password"), NULL); + g_settings_set_string(gcfg, "password", SHASH("password")); if(SHASH("domain") != NULL) - gconf_client_set_string(gcfg, GCONF_BASE"/domain", - SHASH("domain"), NULL); - gconf_client_set_bool(gcfg, GCONF_BASE"/savepw", - iSHASH("savepw"), NULL); - gconf_client_set_int(gcfg, GCONF_BASE"/rdp_protocol", - iSHASH("rdp_protocol"), NULL); + g_settings_set_string(gcfg, "domain", SHASH("domain")); + g_settings_set_boolean(gcfg, "savepw", iSHASH("savepw")); + g_settings_set_int(gcfg, "rdp-protocol", iSHASH("rdp-protocol")); if(SHASH("geometry") != NULL) - gconf_client_set_string(gcfg, GCONF_BASE"/geometry", - SHASH("geometry"), NULL); + g_settings_set_string(gcfg, "geometry", SHASH("geometry")); if(SHASH("keymap") != NULL) - gconf_client_set_string(gcfg, GCONF_BASE"/keymap", - SHASH("keymap"), NULL); - gconf_client_set_int(gcfg, GCONF_BASE"/colorsize", - iSHASH("colorsize"), NULL); - gconf_client_set_int(gcfg, GCONF_BASE"/sound", - iSHASH("sound"), NULL); + g_settings_set_string(gcfg, "keymap", SHASH("keymap")); + g_settings_set_int(gcfg, "colorsize", iSHASH("colorsize")); + g_settings_set_int(gcfg, "sound", iSHASH("sound")); if(SHASH("program") != NULL) - gconf_client_set_string(gcfg, GCONF_BASE"/program", - SHASH("program"), NULL); + g_settings_set_string(gcfg, "program", SHASH("program")); if(SHASH("ppath") != NULL) - gconf_client_set_string(gcfg, GCONF_BASE"/ppath", - SHASH("ppath"), NULL); - gconf_client_set_bool(gcfg, GCONF_BASE"/runprog", - iSHASH("runprog"), NULL); - gconf_client_set_bool(gcfg, GCONF_BASE"/bitmapupd", - iSHASH("bitmapupd"), NULL); - gconf_client_set_bool(gcfg, GCONF_BASE"/motionevt", - iSHASH("motionevt"), NULL); - gconf_client_set_bool(gcfg, GCONF_BASE"/hidewmdecoration", - iSHASH("hidewmdecoration"), NULL); - gconf_client_set_bool(gcfg, GCONF_BASE"/noencryption", - iSHASH("noencryption"), NULL); - gconf_client_set_bool(gcfg, GCONF_BASE"/wmkeybindings", - iSHASH("wmkeybindings"), NULL); - gconf_client_set_bool(gcfg, GCONF_BASE"/attconsole", - iSHASH("attconsole"), NULL); + g_settings_set_string(gcfg, "ppath", SHASH("ppath")); + g_settings_set_boolean(gcfg, "runprog", iSHASH("runprog")); + g_settings_set_boolean(gcfg, "bitmapupd", iSHASH("bitmapupd")); + g_settings_set_boolean(gcfg, "motionevt", iSHASH("motionevt")); + g_settings_set_boolean(gcfg, "hidewmdecoration", + iSHASH("hidewmdecoration")); + g_settings_set_boolean(gcfg, "noencryption", iSHASH("noencryption")); + g_settings_set_boolean(gcfg, "wmkeybindings", iSHASH("wmkeybindings")); + g_settings_set_boolean(gcfg, "attconsole", iSHASH("attconsole")); if(SHASH("clientname") != NULL) - gconf_client_set_string(gcfg, GCONF_BASE"/clientname", - SHASH("clientname"), NULL); - gconf_client_set_bool(gcfg, GCONF_BASE"/usessh", - iSHASH("usessh"), NULL); + g_settings_set_string(gcfg, "clientname", SHASH("clientname")); + g_settings_set_boolean(gcfg, "usessh", iSHASH("usessh")); if(SHASH("sshuser") != NULL) - gconf_client_set_string(gcfg, GCONF_BASE"/sshuser", - SHASH("sshuser"), NULL); + g_settings_set_string(gcfg, "sshuser", SHASH("sshuser")); if(SHASH("sshhost") != NULL) - gconf_client_set_string(gcfg, GCONF_BASE"/sshhost", - SHASH("sshhost"), NULL); - gconf_client_set_bool(gcfg, GCONF_BASE"/showopts", - iSHASH("showopts"), NULL); + g_settings_set_string(gcfg, "sshhost", SHASH("sshhost")); + g_settings_set_boolean(gcfg, "showopts", iSHASH("showopts")); + + g_settings_apply(gcfg); return(0); } --- /dev/null +++ grdesktop-0.23+d040330/src/org.nongnu.grdesktop.gschema.xml @@ -0,0 +1,105 @@ +<schemalist gettext-domain="grdesktop"> + <schema id="org.nongnu.grdesktop" path="/org/nongnu/grdesktop/"> + <key name="bitmapupd" type="b"> + <default>false</default> + <summary>Force bitmap updates</summary> + <description>Force rdesktop to replaint bitmap updates.</description> + </key> + <key name="clientname" type="s"> + <default>''</default> + <summary>Fake clientname</summary> + <description>Fake the local clientname. Used, if the terminal + server runs in user-mode.</description> + </key> + <key name="colorsize" type="i"> + <default>0</default> + <summary>Colorsize for remote server.</summary> + <description>Define the available colors on the remote + server. This value is based on the selection box in + grdesktop.</description> + </key> + <key name="username" type="s"> + <default>''</default> + <summary>Username to use.</summary> + <description>Windows user for login.</description> + </key> + <key name="password" type="s"> + <default>''</default> + <summary>User password.</summary> + </key> + <key name="savepw" type="b"> + <default>false</default> + <summary>Whether to save the password.</summary> + </key> + <key name="domain" type="s"> + <default>''</default> + <summary>Domainname to use.</summary> + <description>Define the Windows-Domain on which rdesktop should + default login.</description> + </key> + <key name="geometry" type="s"> + <default>'640x480'</default> + <summary>Windowssize of rdesktop</summary> + <description>Rdesktop use this windowsize for connection to the + remote host.</description> + </key> + <key name="hidewmdecoration" type="b"> + <default>false</default> + <summary>Hide the window manager decoration</summary> + <description>Don't display the decoration (borders, icons, ...) + from the current window manager.</description> + </key> + <key name="hostnames" type="as"> + <default>[]</default> + <summary>Last used hostnames</summary> + <description>Store the last ten hostnames for hostnames + combobox.</description> + </key> + <key name="showopts" type="b"> + <default>false</default> + <summary>Show options in the connect window</summary> + <description>If set to "false", grdesktop's window will be + compact.</description> + </key> + <key name="rdp-protocol" type="i"> + <default>0</default> + <summary>RDP protocol</summary> + </key> + <key name="keymap" type="s"> + <default>''</default> + </key> + <key name="sound" type="i"> + <default>0</default> + </key> + <key name="program" type="s"> + <default>''</default> + </key> + <key name="ppath" type="s"> + <default>''</default> + </key> + <key name="runprog" type="b"> + <default>false</default> + </key> + <key name="motionevt" type="b"> + <default>false</default> + </key> + <key name="noencryption" type="b"> + <default>false</default> + </key> + <key name="wmkeybindings" type="b"> + <default>false</default> + </key> + <key name="attconsole" type="b"> + <default>false</default> + </key> + <key name="usessh" type="b"> + <default>false</default> + </key> + <key name="sshuser" type="s"> + <default>''</default> + </key> + <key name="sshhost" type="s"> + <default>''</default> + </key> + </schema> +</schemalist> --- /dev/null +++ grdesktop-0.23+d040330/src/grdesktop.convert @@ -0,0 +1,25 @@ +[org.nongnu.grdesktop] +bitmapupd = /apps/grdesktop/options/bitmapupd +clientname = /apps/grdesktop/options/clientname +colorsize = /apps/grdesktop/options/colorsize +username = /apps/grdesktop/options/username +password = /apps/grdesktop/options/password +savepw = /apps/grdesktop/options/savepw +domain = /apps/grdesktop/options/domain +geometry = /apps/grdesktop/options/geometry +hidewmdecoration = /apps/grdesktop/options/hidewmdecoration +hostnames = /apps/grdesktop/options/hostnames +showopts = /apps/grdesktop/options/showopts +rdp-protocol = /apps/grdesktop/options/rdp_protocol +keymap = /apps/grdesktop/options/keymap +sound = /apps/grdesktop/options/sound +program = /apps/grdesktop/options/program +ppath = /apps/grdesktop/options/ppath +runprog = /apps/grdesktop/options/runprog +motionevt = /apps/grdesktop/options/motionevt +noencryption = /apps/grdesktop/options/noencryption +wmkeybindings = /apps/grdesktop/options/wmkeybindings +attconsole = /apps/grdesktop/options/attconsole +usessh = /apps/grdesktop/options/usessh +sshuser = /apps/grdesktop/options/sshuser +sshhost = /apps/grdesktop/options/sshhost --- grdesktop-0.23+d040330.orig/src/grdesktop.schemas +++ /dev/null @@ -1,89 +0,0 @@ -<gconfschemafile> - <schemalist> - <schema> - <key>/schemas/apps/grdesktop/options/bitmapupd</key> - <applyto>/apps/grdesktop/options/bitmapupd</applyto> - <owner>grdesktop</owner> - <type>bool</type> - <default>0</default> - <locale name="C"> - <short>Force bitmap updates</short> - <long>Force rdesktop to replaint bitmap updates.</long> - </locale> - </schema> - <schema> - <key>/schemas/apps/grdesktop/options/clientname</key> - <applyto>/apps/grdesktop/options/clientname</applyto> - <owner>grdesktop</owner> - <type>string</type> - <locale name="C"> - <short>Fake clientname</short> - <long>Fake the local clientname. Used, if the terminal server - runs in user-mode. - </long> - </locale> - </schema> - <schema> - <key>/schemas/apps/grdesktop/options/colorsize</key> - <applyto>/apps/grdesktop/options/colorsize</applyto> - <owner>grdesktop</owner> - <type>int</type> - <default>0</default> - <locale name="C"> - <short>Colorsize for remote server.</short> - <long>Define the available colors on the remote server. This - value is based on the selection box in grdesktop. - </long> - </locale> - </schema> - <schema> - <key>/schemas/apps/grdesktop/options/domain</key> - <applyto>/apps/grdesktop/options/domain</applyto> - <owner>grdesktop</owner> - <type>string</type> - <locale name="C"> - <short>Domainname to use.</short> - <long>Define the Windows-Domain on which rdesktop - should default login. - </long> - </locale> - </schema> - <schema> - <key>/schemas/apps/grdesktop/options/geometry</key> - <applyto>/apps/grdesktop/options/geometry</applyto> - <owner>grdesktop</owner> - <type>string</type> - <default>640x480</default> - <locale name="C"> - <short>Windowssize of rdesktop</short> - <long>Rdesktop use this windowsize for connection to the - remote host. - </long> - </locale> - </schema> - <schema> - <key>/schemas/apps/grdesktop/options/hidewmdecoration</key> - <applyto>/apps/grdesktop/options/hidewmdecoration</applyto> - <owner>grdesktop</owner> - <type>bool</type> - <default>0</default> - <locale name="C"> - <short>Hide the window manager decoration</short> - <long>Don't display the decoration (borders, icons, ...) from the - current window manager. - </long> - </locale> - </schema> - <schema> - <key>/schemas/apps/grdesktop/options/hostnames</key> - <applyto>/apps/grdesktop/options/hostnames</applyto> - <owner>grdesktop</owner> - <type>list</type> - <list_type>string</list_type> - <locale name="C"> - <short>Last used hostnames</short> - <long>Store the last ten hostnames for hostnames combobox.</long> - </locale> - </schema> - </schemalist> -</gconfschemafile> --- grdesktop-0.23+d040330.orig/po/POTFILES.in +++ grdesktop-0.23+d040330/po/POTFILES.in @@ -6,3 +6,4 @@ src/run.c src/srvsel.c src/sshbox.c +src/org.nongnu.grdesktop.gschema.xml