From: Jean-Philippe Orsini Date: Thu, 24 Oct 2013 20:55:35 +0000 (+0000) Subject: added schema X-Git-Tag: v0.0.6~100 X-Git-Url: http://git.wpitchoune.net/gitweb/?p=ptask.git;a=commitdiff_plain;h=98da9e03d15320c6a0d685c0088ca69748433628 added schema start refactoring to ui --- diff --git a/Makefile.in b/Makefile.in index 5371af5..89d2f37 100644 --- a/Makefile.in +++ b/Makefile.in @@ -178,9 +178,11 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ +GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ HAVE_CPPCHECK = @HAVE_CPPCHECK@ @@ -255,6 +257,7 @@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ +gsettingsschemadir = @gsettingsschemadir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/aclocal.m4 b/aclocal.m4 index f87f4e5..617022e 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -404,6 +404,90 @@ AC_DEFUN([AM_GNU_GETTEXT_NEED], dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) +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) if test -f "$<"; then d=; else d="$(srcdir)/"; fi; $(GLIB_COMPILE_SCHEMAS) --strict --dry-run $(addprefix --schema-file=,$(gsettings__enum_file)) --schema-file=$${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 '\'''\'' --fhead "" --vhead " <@type@ id='\''$(gsettings_ENUM_NAMESPACE).@EnumName@'\''>" --vprod " " --vtail " " --ftail "" [$]^ > [$]@.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])]) +] +) + # iconv.m4 serial 11 (gettext-0.18.1) dnl Copyright (C) 2000-2002, 2007-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation diff --git a/config.status b/config.status index 7a9ef8b..2070dac 100755 --- a/config.status +++ b/config.status @@ -428,7 +428,7 @@ $config_commands Report bugs to . ptask home page: ." -ac_cs_config="'--prefix=/tmp'" +ac_cs_config="" ac_cs_version="\ ptask config.status 0.0.x configured by ./configure, generated by GNU Autoconf 2.69, @@ -520,7 +520,7 @@ if $ac_cs_silent; then fi if $ac_cs_recheck; then - set X /bin/bash './configure' '--prefix=/tmp' $ac_configure_extra_args --no-create --no-recursion + set X /bin/bash './configure' $ac_configure_extra_args --no-create --no-recursion shift $as_echo "running CONFIG_SHELL=/bin/bash $*" >&6 CONFIG_SHELL='/bin/bash' @@ -635,6 +635,52 @@ S["CPPCHECK_FALSE"]="#" S["CPPCHECK_TRUE"]="" S["HAVE_CPPCHECK"]="yes" S["HELP2MAN"]="help2man" +S["GSETTINGS_RULES"]="\n"\ +".PHONY : uninstall-gsettings-schemas install-gsettings-schemas clean-gsettings-schemas\n"\ +"\n"\ +"mostlyclean-am: clean-gsettings-schemas\n"\ +"\n"\ +"gsettings__enum_file = $(addsuffix .enums.xml,$(gsettings_ENUM_NAMESPACE))\n"\ +"\n"\ +"%.gschema.valid: %.gschema.xml $(gsettings__enum_file)\n"\ +" $(AM_V_GEN) if test -f \"$<\"; then d=; else d=\"$(srcdir)/\"; fi; $(GLIB_COMPILE_SCHEMAS) --strict --dry-run $(addprefix --schema-file=,$(gsettings__e"\ +"num_file)) --schema-file=$${d}$< && touch $@\n"\ +"\n"\ +"all-am: $(gsettings_SCHEMAS:.xml=.valid)\n"\ +"uninstall-am: uninstall-gsettings-schemas\n"\ +"install-data-am: install-gsettings-schemas\n"\ +"\n"\ +".SECONDARY: $(gsettings_SCHEMAS)\n"\ +"\n"\ +"install-gsettings-schemas: $(gsettings_SCHEMAS) $(gsettings__enum_file)\n"\ +" @$(NORMAL_INSTALL)\n"\ +" if test -n \"$^\"; then \\\n"\ +" test -z \"$(gsettingsschemadir)\" || $(MKDIR_P) \"$(DESTDIR)$(gsettingsschemadir)\"; \\\n"\ +" $(INSTALL_DATA) $^ \"$(DESTDIR)$(gsettingsschemadir)\"; \\\n"\ +" test -n \"$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)\" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir); \\\n"\ +" fi\n"\ +"\n"\ +"uninstall-gsettings-schemas:\n"\ +" @$(NORMAL_UNINSTALL)\n"\ +" @list='$(gsettings_SCHEMAS) $(gsettings__enum_file)'; test -n \"$(gsettingsschemadir)\" || list=; \\\n"\ +" files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \\\n"\ +" test -n \"$$files\" || exit 0; \\\n"\ +" echo \" ( cd '$(DESTDIR)$(gsettingsschemadir)' && rm -f\" $$files \")\"; \\\n"\ +" cd \"$(DESTDIR)$(gsettingsschemadir)\" && rm -f $$files\n"\ +" test -n \"$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)\" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir)\n"\ +"\n"\ +"clean-gsettings-schemas:\n"\ +" rm -f $(gsettings_SCHEMAS:.xml=.valid) $(gsettings__enum_file)\n"\ +"\n"\ +"ifdef gsettings_ENUM_NAMESPACE\n"\ +"$(gsettings__enum_file): $(gsettings_ENUM_FILES)\n"\ +" $(AM_V_GEN) glib-mkenums --comments '' --fhead \"\" --vhead \" <@type@ id='$(gsettings_ENUM_NAMESPACE).@EnumName@'>\" --"\ +"vprod \" \" --vtail \" \" --ftail \"\" $^ > $@.tmp && mv $@.tmp $@\n"\ +"endif\n"\ +"" +S["GLIB_COMPILE_SCHEMAS"]="/usr/lib/x86_64-linux-gnu/glib-2.0/glib-compile-schemas" +S["gsettingsschemadir"]="${datarootdir}/glib-2.0/schemas" +S["GSETTINGS_DISABLE_SCHEMAS_COMPILE"]="" S["JSON_LIBS"]="-ljson-c " S["JSON_CFLAGS"]="-I/usr/include/json-c " S["GTK_LIBS"]="-lgtk-3 -lgdk-3 -latk-1.0 -lgio-2.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lpango-1.0 -lcairo -lgobject-2.0 -lglib-2.0 " @@ -746,7 +792,7 @@ S["libexecdir"]="${exec_prefix}/libexec" S["sbindir"]="${exec_prefix}/sbin" S["bindir"]="${exec_prefix}/bin" S["program_transform_name"]="s,x,x," -S["prefix"]="/tmp" +S["prefix"]="/usr/local" S["exec_prefix"]="${prefix}" S["PACKAGE_URL"]="http://wpitchoune.net/ptask" S["PACKAGE_BUGREPORT"]="jeanfi@gmail.com" diff --git a/configure b/configure index a76efb3..47df5c1 100755 --- a/configure +++ b/configure @@ -595,6 +595,10 @@ CPPCHECK_FALSE CPPCHECK_TRUE HAVE_CPPCHECK HELP2MAN +GSETTINGS_RULES +GLIB_COMPILE_SCHEMAS +gsettingsschemadir +GSETTINGS_DISABLE_SCHEMAS_COMPILE JSON_LIBS JSON_CFLAGS GTK_LIBS @@ -723,6 +727,7 @@ with_gnu_ld enable_rpath with_libiconv_prefix with_libintl_prefix +enable_schemas_compile ' ac_precious_vars='build_alias host_alias @@ -1371,6 +1376,8 @@ Optional Features: --enable-dependency-tracking do not reject slow dependency extractors --disable-nls do not use Native Language Support --disable-rpath do not hardcode runtime library paths + --disable-schemas-compile + Disable regeneration of gschemas.compiled on install Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -6687,6 +6694,240 @@ fi +# Gsettings + + + # 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_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$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_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 +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 + + +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$ac_pt_PKG_CONFIG" = x; then + PKG_CONFIG="" + else + 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 + +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 + + + fi + + if test "x$GLIB_COMPILE_SCHEMAS" = "x"; then + as_fn_error $? "glib-compile-schemas not found." "$LINENO" 5 + else + : + 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) if test -f "$<"; then d=; else d="$(srcdir)/"; fi; $(GLIB_COMPILE_SCHEMAS) --strict --dry-run $(addprefix --schema-file=,$(gsettings__enum_file)) --schema-file=$${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 '\'''\'' --fhead "" --vhead " <@type@ id='\''$(gsettings_ENUM_NAMESPACE).@EnumName@'\''>" --vprod " " --vtail " " --ftail "" $^ > $@.tmp && mv $@.tmp $@ +endif +' + + + + + + + ac_config_files="$ac_config_files Makefile po/Makefile.in src/Makefile src/glade/Makefile tests/Makefile" diff --git a/configure.ac b/configure.ac index 43620a7..c9eff51 100644 --- a/configure.ac +++ b/configure.ac @@ -47,6 +47,9 @@ PKG_CHECK_MODULES(JSON, json) AC_SUBST(JSON_CFLAGS) AC_SUBST(JSON_LIBS) +# Gsettings +GLIB_GSETTINGS + AC_CONFIG_FILES([ Makefile po/Makefile.in diff --git a/po/Makefile b/po/Makefile index ea8150b..430bf0b 100644 --- a/po/Makefile +++ b/po/Makefile @@ -21,7 +21,7 @@ srcdir = . top_srcdir = .. -prefix = /tmp +prefix = /usr/local exec_prefix = ${prefix} datarootdir = ${prefix}/share datadir = ${datarootdir} diff --git a/po/Makefile.in b/po/Makefile.in index ca508b4..9db3564 100644 --- a/po/Makefile.in +++ b/po/Makefile.in @@ -21,7 +21,7 @@ srcdir = . top_srcdir = .. -prefix = /tmp +prefix = /usr/local exec_prefix = ${prefix} datarootdir = ${prefix}/share datadir = ${datarootdir} diff --git a/src/Makefile.am b/src/Makefile.am index 27a5ad9..84f2093 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -16,7 +16,8 @@ ptask_SOURCES = main.c \ note.c note.h \ pstr.c pstr.h \ ptime.c ptime.h \ - tw.c tw.h + tw.c tw.h \ + ui.c ui.h dist_man_MANS = ptask.1 @@ -24,3 +25,7 @@ ptask.1: main.c $(top_srcdir)/configure.ac $(MAKE) $(AM_MAKEFLAGS) ptask$(EXEEXT) help2man -N --name="GTk+ Task application" --output=ptask.1 ./ptask$(EXEEXT) +gsettings_SCHEMAS=ptask.gschema.xml +EXTRA_DIST=$(gsettings_SCHEMAS) + +@GSETTINGS_RULES@ diff --git a/src/Makefile.in b/src/Makefile.in index 64d74c8..ccfd917 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -66,7 +66,7 @@ CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) am_ptask_OBJECTS = main.$(OBJEXT) log.$(OBJEXT) note.$(OBJEXT) \ - pstr.$(OBJEXT) ptime.$(OBJEXT) tw.$(OBJEXT) + pstr.$(OBJEXT) ptime.$(OBJEXT) tw.$(OBJEXT) ui.$(OBJEXT) ptask_OBJECTS = $(am_ptask_OBJECTS) ptask_LDADD = $(LDADD) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) @@ -175,9 +175,11 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ +GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ HAVE_CPPCHECK = @HAVE_CPPCHECK@ @@ -252,6 +254,7 @@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ +gsettingsschemadir = @gsettingsschemadir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -290,9 +293,12 @@ ptask_SOURCES = main.c \ note.c note.h \ pstr.c pstr.h \ ptime.c ptime.h \ - tw.c tw.h + tw.c tw.h \ + ui.c ui.h dist_man_MANS = ptask.1 +gsettings_SCHEMAS = ptask.gschema.xml +EXTRA_DIST = $(gsettings_SCHEMAS) all: all-recursive .SUFFIXES: @@ -383,6 +389,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pstr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ptime.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tw.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ui.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -777,6 +784,8 @@ ptask.1: main.c $(top_srcdir)/configure.ac $(MAKE) $(AM_MAKEFLAGS) ptask$(EXEEXT) help2man -N --name="GTk+ Task application" --output=ptask.1 ./ptask$(EXEEXT) +@GSETTINGS_RULES@ + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/src/glade/Makefile.in b/src/glade/Makefile.in index f9eadec..3a05422 100644 --- a/src/glade/Makefile.in +++ b/src/glade/Makefile.in @@ -118,9 +118,11 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ +GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ HAVE_CPPCHECK = @HAVE_CPPCHECK@ @@ -195,6 +197,7 @@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ +gsettingsschemadir = @gsettingsschemadir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/src/main.c b/src/main.c index 36c0d19..e34503b 100644 --- a/src/main.c +++ b/src/main.c @@ -25,13 +25,13 @@ #include #include -#include #include #include "log.h" #include "note.h" #include "tw.h" +#include static const char *program_name; static struct task **tasks; @@ -43,6 +43,7 @@ static GtkWidget *w_tasksave_btn; static GtkWidget *w_taskdone_btn; static GtkComboBox *w_status; static GtkComboBox *w_priority; +static GSettings *settings; enum { COL_ID, @@ -458,7 +459,8 @@ static void log_init() int main(int argc, char **argv) { - GtkWidget *window, *btn; + GtkWindow *window; + GtkWidget *btn; GtkBuilder *builder; GtkTreeModel *model; int optc, cmdok, opti; @@ -501,12 +503,19 @@ int main(int argc, char **argv) log_init(); gtk_init(NULL, NULL); + + settings = g_settings_new("ptask"); + + printf("%d\n", g_settings_get_int(settings, "windows_x")); + + builder = gtk_builder_new(); gtk_builder_add_from_file (builder, PACKAGE_DATA_DIR G_DIR_SEPARATOR_S "ptask.glade", NULL); - window = GTK_WIDGET(gtk_builder_get_object(builder, "window")); + window = create_window(); + window = GTK_WINDOW(gtk_builder_get_object(builder, "window")); g_signal_connect(window, "delete_event", G_CALLBACK(delete_event_cbk), NULL); @@ -551,7 +560,7 @@ int main(int argc, char **argv) g_object_unref(G_OBJECT(builder)); - gtk_widget_show_all(window); + gtk_widget_show_all(GTK_WIDGET(window)); gtk_main(); diff --git a/src/ptask.gschema.xml b/src/ptask.gschema.xml new file mode 100644 index 0000000..a781ba9 --- /dev/null +++ b/src/ptask.gschema.xml @@ -0,0 +1,10 @@ + + + + 100 + + + 100 + + + \ No newline at end of file diff --git a/src/ui.c b/src/ui.c new file mode 100644 index 0000000..8567d4f --- /dev/null +++ b/src/ui.c @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2012-2013 jeanfi@gmail.com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#include + +GtkWindow *create_window() +{ + return NULL; +} diff --git a/src/ui.h b/src/ui.h new file mode 100644 index 0000000..d560094 --- /dev/null +++ b/src/ui.h @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2012-2013 jeanfi@gmail.com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#ifndef _PTASK_UI_H_ +#define _PTASK_UI_H_ + +#include + +GtkWindow *create_window(); + +#endif diff --git a/tests/Makefile.in b/tests/Makefile.in index 15b3bc2..7c3464e 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -91,9 +91,11 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ +GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ HAVE_CPPCHECK = @HAVE_CPPCHECK@ @@ -168,6 +170,7 @@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ +gsettingsschemadir = @gsettingsschemadir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@