diff options
author | Ken VanDine <ken.vandine@canonical.com> | 2011-08-23 12:44:57 -0400 |
---|---|---|
committer | Ken VanDine <ken.vandine@canonical.com> | 2011-08-23 12:44:57 -0400 |
commit | 3751cc4b823c5d701456317bb86fc4fc39bf3b9e (patch) | |
tree | 6725806cef45179dc405df717806ea42b7bba6af | |
parent | edfb2ab89822da16fc1150a5350c130830a733b3 (diff) | |
parent | b1a5f6eda8a4b41773e2e7247c2e2a57300a9f9e (diff) | |
download | ayatana-indicator-power-3751cc4b823c5d701456317bb86fc4fc39bf3b9e.tar.gz ayatana-indicator-power-3751cc4b823c5d701456317bb86fc4fc39bf3b9e.tar.bz2 ayatana-indicator-power-3751cc4b823c5d701456317bb86fc4fc39bf3b9e.zip |
Import upstream version 0.7
-rw-r--r-- | ChangeLog | 43 | ||||
-rw-r--r-- | Makefile.am | 20 | ||||
-rw-r--r-- | Makefile.in | 34 | ||||
-rw-r--r-- | aclocal.m4 | 84 | ||||
-rwxr-xr-x | configure | 274 | ||||
-rw-r--r-- | configure.ac | 10 | ||||
-rw-r--r-- | data/org.ubuntu.indicator-power.gschema.xml | 10 | ||||
-rw-r--r-- | po/POTFILES.in | 1 | ||||
-rw-r--r-- | src/indicator-power.c | 42 |
9 files changed, 491 insertions, 27 deletions
@@ -1,5 +1,48 @@ # Generated by Makefile. Do not edit. +2011-08-23 Javier Jardón <javier.jardon@codethink.co.uk> + + Release 0.7 + +2011-08-23 Javier Jardón <javier.jardon@codethink.co.uk> + + Makefile.am: some autotools fixes + +2011-08-22 Javier Jardón <javier.jardon@codethink.co.uk> + + Add gsettings schema to the translatable files + +2011-08-22 Javier Jardón <javier.jardon@codethink.co.uk> + + Fix typo in the gsettings schema: show_time -> show-time + +2011-08-22 Javier Jardón <javier.jardon@codethink.co.uk> + + Use gsettings to store the status of "Show time in Menu Bar" option + + Fixes https://bugs.launchpad.net/indicator-power/+bug/829853 + +2011-08-22 Javier Jardón <javier.jardon@codethink.co.uk> + + Follow standard alignment of icons in menus + + Fixes https://bugs.launchpad.net/ubuntu/+source/indicator-power/+bug/829697 + +2011-08-22 Javier Jardón <javier.jardon@codethink.co.uk> + + Do not use a space before an ellipsis at the end of a string. + +2011-08-12 Javier Jardón <javier.jardon@codethink.co.uk> + + Do not show the default icon by default + + Show the icon can cause problems in machines with no power + devices as the icon will not be updated + +2011-08-12 Javier Jardón <javier.jardon@codethink.co.uk> + + Free memory in the correct place + 2011-08-12 Javier Jardón <javier.jardon@codethink.co.uk> Release 0.6 diff --git a/Makefile.am b/Makefile.am index 932775f..8ae7e6d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,6 +2,13 @@ ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} SUBDIRS = po +gsettings_in_file = data/org.ubuntu.indicator-power.gschema.xml.in +gsettings_SCHEMAS = $(gsettings_in_file:.xml.in=.xml) + +@INTLTOOL_XML_NOMERGE_RULE@ + +@GSETTINGS_RULES@ + ################### # Indicator Stuff ################### @@ -24,7 +31,18 @@ libpower_la_LDFLAGS = \ ############################################################ -EXTRA_DIST = autogen.sh +dist_noinst_SCRIPTS = \ + autogen.sh + +dist_noinst_DATA = \ + data/org.ubuntu.indicator-power.gschema.xml + $(gsettings_in_file) + +CLEANFILES = \ + $(gsettings_SCHEMAS) + +MAINTAINERCLEANFILES = \ + $(gsettings_SCHEMAS:.xml=.valid) DISTCHECK_CONFIGURE_FLAGS = --enable-localinstall diff --git a/Makefile.in b/Makefile.in index f0e5199..7818e41 100644 --- a/Makefile.in +++ b/Makefile.in @@ -15,6 +15,8 @@ @SET_MAKE@ + + VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ @@ -35,7 +37,8 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . -DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \ +DIST_COMMON = $(am__configure_deps) $(dist_noinst_DATA) \ + $(dist_noinst_SCRIPTS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/configure ABOUT-NLS COPYING build-aux/compile \ build-aux/config.guess build-aux/config.rpath \ @@ -93,6 +96,7 @@ am__v_lt_0 = --silent libpower_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libpower_la_CFLAGS) \ $(CFLAGS) $(libpower_la_LDFLAGS) $(LDFLAGS) -o $@ +SCRIPTS = $(dist_noinst_SCRIPTS) DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles @@ -128,6 +132,7 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive +DATA = $(dist_noinst_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ @@ -201,11 +206,13 @@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ GSD_CFLAGS = @GSD_CFLAGS@ GSD_LIBS = @GSD_LIBS@ +GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@ INDICATORDIR = @INDICATORDIR@ INDICATORICONSDIR = @INDICATORICONSDIR@ INDICATOR_CFLAGS = @INDICATOR_CFLAGS@ @@ -294,6 +301,7 @@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ +gsettingsschemadir = @gsettingsschemadir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -324,6 +332,8 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} SUBDIRS = po +gsettings_in_file = data/org.ubuntu.indicator-power.gschema.xml.in +gsettings_SCHEMAS = $(gsettings_in_file:.xml.in=.xml) ################### # Indicator Stuff @@ -349,7 +359,18 @@ libpower_la_LDFLAGS = \ ############################################################ -EXTRA_DIST = autogen.sh +dist_noinst_SCRIPTS = \ + autogen.sh + +dist_noinst_DATA = \ + data/org.ubuntu.indicator-power.gschema.xml + +CLEANFILES = \ + $(gsettings_SCHEMAS) + +MAINTAINERCLEANFILES = \ + $(gsettings_SCHEMAS:.xml=.valid) + DISTCHECK_CONFIGURE_FLAGS = --enable-localinstall all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive @@ -819,7 +840,7 @@ distcleancheck: distclean exit 1; } >&2 check-am: all-am check: check-recursive -all-am: Makefile $(LTLIBRARIES) config.h +all-am: Makefile $(LTLIBRARIES) $(SCRIPTS) $(DATA) config.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(powerlibdir)"; do \ @@ -842,6 +863,7 @@ install-strip: mostlyclean-generic: clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) @@ -852,6 +874,7 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool clean-powerlibLTLIBRARIES \ @@ -949,6 +972,11 @@ uninstall-am: uninstall-powerlibLTLIBRARIES uninstall-powerlibLTLIBRARIES +@INTLTOOL_XML_NOMERGE_RULE@ + +@GSETTINGS_RULES@ + $(gsettings_in_file) + ############################################################ dist-hook: @@ -19,6 +19,90 @@ You have another version of autoconf. It may work, but is not guaranteed to. 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 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 '\''<!-- @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])]) +] +) + # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 1 (pkg-config-0.24) # @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for indicator-power 0.6. +# Generated by GNU Autoconf 2.68 for indicator-power 0.7. # # Report bugs to <http://bugs.launchpad.net/indicator-power>. # @@ -570,8 +570,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='indicator-power' PACKAGE_TARNAME='indicator-power' -PACKAGE_VERSION='0.6' -PACKAGE_STRING='indicator-power 0.6' +PACKAGE_VERSION='0.7' +PACKAGE_STRING='indicator-power 0.7' PACKAGE_BUGREPORT='http://bugs.launchpad.net/indicator-power' PACKAGE_URL='http://launchpad.net/indicator-power' @@ -662,6 +662,10 @@ INTLTOOL_UPDATE USE_NLS INDICATORICONSDIR INDICATORDIR +GSETTINGS_RULES +GLIB_COMPILE_SCHEMAS +gsettingsschemadir +GSETTINGS_DISABLE_SCHEMAS_COMPILE GSD_LIBS GSD_CFLAGS INDICATOR_LIBS @@ -796,6 +800,7 @@ enable_fast_install with_gnu_ld with_sysroot enable_libtool_lock +enable_schemas_compile enable_localinstall enable_nls enable_rpath @@ -1362,7 +1367,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures indicator-power 0.6 to adapt to many kinds of systems. +\`configure' configures indicator-power 0.7 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1432,7 +1437,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of indicator-power 0.6:";; + short | recursive ) echo "Configuration of indicator-power 0.7:";; esac cat <<\_ACEOF @@ -1451,6 +1456,8 @@ Optional Features: --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) + --disable-schemas-compile + Disable regeneration of gschemas.compiled on install --enable-localinstall install all of the files localy instead of system directories (for distcheck) --disable-nls do not use Native Language Support @@ -1561,7 +1568,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -indicator-power configure 0.6 +indicator-power configure 0.7 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1839,7 +1846,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by indicator-power $as_me 0.6, which was +It was created by indicator-power $as_me 0.7, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2663,7 +2670,7 @@ fi # Define the identity of the package. PACKAGE='indicator-power' - VERSION='0.6' + VERSION='0.7' cat >>confdefs.h <<_ACEOF @@ -11399,7 +11406,7 @@ CC="$lt_save_CC" ########################### # Dependencies ########################### - +GIO_REQUIRED_VERSION=2.26 GTK_REQUIRED_VERSION=3.0 INDICATOR_REQUIRED_VERSION=0.3.90 UPOWER_REQUIRED_VERSION=0.9.5 @@ -11626,10 +11633,12 @@ if test -n "$INDICATOR_CFLAGS"; then elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \" + gio-2.0 >= \$GIO_REQUIRED_VERSION gtk+-3.0 >= \$GTK_REQUIRED_VERSION indicator3-0.4 >= \$INDICATOR_REQUIRED_VERSION \""; } >&5 ($PKG_CONFIG --exists --print-errors " + gio-2.0 >= $GIO_REQUIRED_VERSION gtk+-3.0 >= $GTK_REQUIRED_VERSION indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION ") 2>&5 @@ -11637,6 +11646,7 @@ if test -n "$INDICATOR_CFLAGS"; then $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_INDICATOR_CFLAGS=`$PKG_CONFIG --cflags " + gio-2.0 >= $GIO_REQUIRED_VERSION gtk+-3.0 >= $GTK_REQUIRED_VERSION indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION " 2>/dev/null` @@ -11652,10 +11662,12 @@ if test -n "$INDICATOR_LIBS"; then elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \" + gio-2.0 >= \$GIO_REQUIRED_VERSION gtk+-3.0 >= \$GTK_REQUIRED_VERSION indicator3-0.4 >= \$INDICATOR_REQUIRED_VERSION \""; } >&5 ($PKG_CONFIG --exists --print-errors " + gio-2.0 >= $GIO_REQUIRED_VERSION gtk+-3.0 >= $GTK_REQUIRED_VERSION indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION ") 2>&5 @@ -11663,6 +11675,7 @@ if test -n "$INDICATOR_LIBS"; then $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_INDICATOR_LIBS=`$PKG_CONFIG --libs " + gio-2.0 >= $GIO_REQUIRED_VERSION gtk+-3.0 >= $GTK_REQUIRED_VERSION indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION " 2>/dev/null` @@ -11687,11 +11700,13 @@ else fi if test $_pkg_short_errors_supported = yes; then INDICATOR_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs " + gio-2.0 >= $GIO_REQUIRED_VERSION gtk+-3.0 >= $GTK_REQUIRED_VERSION indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION " 2>&1` else INDICATOR_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs " + gio-2.0 >= $GIO_REQUIRED_VERSION gtk+-3.0 >= $GTK_REQUIRED_VERSION indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION " 2>&1` @@ -11700,6 +11715,7 @@ fi echo "$INDICATOR_PKG_ERRORS" >&5 as_fn_error $? "Package requirements ( + gio-2.0 >= $GIO_REQUIRED_VERSION gtk+-3.0 >= $GTK_REQUIRED_VERSION indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION ) were not met: @@ -11827,6 +11843,242 @@ $as_echo "yes" >&6; } 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 '\''<!-- @comment@ -->'\'' --fhead "<schemalist>" --vhead " <@type@ id='\''$(gsettings_ENUM_NAMESPACE).@EnumName@'\''>" --vprod " <value nick='\''@valuenick@'\'' value='\''@valuenum@'\''/>" --vtail " </@type@>" --ftail "</schemalist>" $^ > $@.tmp && mv $@.tmp $@ +endif +' + + + + + + + +########################### # Check to see if we're local ########################### @@ -14867,7 +15119,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by indicator-power $as_me 0.6, which was +This file was extended by indicator-power $as_me 0.7, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14934,7 +15186,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -indicator-power config.status 0.6 +indicator-power config.status 0.7 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 19ca570..8cdded6 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_INIT([indicator-power], - [0.6], + [0.7], [http://bugs.launchpad.net/indicator-power], [indicator-power], [http://launchpad.net/indicator-power]) @@ -28,7 +28,7 @@ LT_INIT ########################### # Dependencies ########################### - +GIO_REQUIRED_VERSION=2.26 GTK_REQUIRED_VERSION=3.0 INDICATOR_REQUIRED_VERSION=0.3.90 UPOWER_REQUIRED_VERSION=0.9.5 @@ -36,12 +36,18 @@ GSD_REQUIRED_VERSION=3.1.4 PKG_CHECK_MODULES([UPOWER],[upower-glib >= UPOWER_REQUIRED_VERSION]) PKG_CHECK_MODULES([INDICATOR],[ + gio-2.0 >= $GIO_REQUIRED_VERSION gtk+-3.0 >= $GTK_REQUIRED_VERSION indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION ]) PKG_CHECK_MODULES([GSD],[gnome-settings-daemon >= $GSD_REQUIRED_VERSION]) ########################### +# GSETTINGS +########################### +GLIB_GSETTINGS + +########################### # Check to see if we're local ########################### diff --git a/data/org.ubuntu.indicator-power.gschema.xml b/data/org.ubuntu.indicator-power.gschema.xml new file mode 100644 index 0000000..a3d2494 --- /dev/null +++ b/data/org.ubuntu.indicator-power.gschema.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<schemalist> + <schema path="/org/ubuntu/indicator-power/" id="org.ubuntu.indicator-power" gettext-domain="@GETTEXT_PACKAGE@"> + <key type="b" name="show-label"> + <default>false</default> + <summary>Show time in Menu Bar</summary> + <description>Whether show the time in the menu bar.</description> + </key> + </schema> +</schemalist>
\ No newline at end of file diff --git a/po/POTFILES.in b/po/POTFILES.in index 5c310d8..62d1e12 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -1 +1,2 @@ +data/org.ubuntu.indicator-power.gschema.xml.in src/indicator-power.c diff --git a/src/indicator-power.c b/src/indicator-power.c index 9211b54..7f9e479 100644 --- a/src/indicator-power.c +++ b/src/indicator-power.c @@ -82,6 +82,8 @@ struct _IndicatorPowerPrivate GVariant *devices; GVariant *device; + + GSettings *settings; }; /* Prototypes */ @@ -138,9 +140,15 @@ option_toggled_cb (GtkCheckMenuItem *item, { IndicatorPower *self = INDICATOR_POWER (user_data); IndicatorPowerPrivate *priv = self->priv; + gboolean visible; + + visible = gtk_check_menu_item_get_active (item); gtk_widget_set_visible (GTK_WIDGET (priv->label), - gtk_check_menu_item_get_active (item)); + visible); + + g_settings_set_boolean (priv->settings, "show-time", + visible); } static void @@ -359,6 +367,8 @@ menu_add_device (GtkMenu *menu, UpDeviceState state; GtkWidget *icon; GtkWidget *item; + GtkWidget *details_label; + GtkWidget *grid; GIcon *device_gicons; gchar *device_icon = NULL; gchar *object_path = NULL; @@ -397,12 +407,19 @@ menu_add_device (GtkMenu *menu, /* Create menu item */ item = gtk_image_menu_item_new (); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), icon); - gtk_menu_item_set_label (GTK_MENU_ITEM (item), details); - gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (item), TRUE); + + grid = gtk_grid_new (); + gtk_grid_set_row_spacing (GTK_GRID (grid), 6); + gtk_grid_attach (GTK_GRID (grid), icon, 0, 0, 1, 1); + details_label = gtk_label_new (details); + gtk_grid_attach_next_to (GTK_GRID (grid), details_label, icon, GTK_POS_RIGHT, 1, 1); + gtk_container_add (GTK_CONTAINER (item), grid); + gtk_widget_show (grid); + + gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); + g_signal_connect (G_OBJECT (item), "activate", G_CALLBACK (show_info_cb), NULL); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); g_free (short_details); g_free (details); @@ -450,6 +467,7 @@ build_menu (IndicatorPower *self) GtkWidget *image; GList *children; gsize n_devices = 0; + gboolean visible; if (priv->menu == NULL) priv->menu = GTK_MENU (gtk_menu_new ()); @@ -473,10 +491,12 @@ build_menu (IndicatorPower *self) item = gtk_check_menu_item_new_with_label (_("Show Time in Menu Bar")); g_signal_connect (G_OBJECT (item), "toggled", G_CALLBACK (option_toggled_cb), self); + visible = g_settings_get_boolean (priv->settings, "show-time"); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), visible); gtk_menu_shell_append (GTK_MENU_SHELL (priv->menu), item); /* preferences */ - item = gtk_image_menu_item_new_with_mnemonic (_("Power Settings ...")); + item = gtk_image_menu_item_new_with_mnemonic (_("Power Settings...")); image = gtk_image_new_from_icon_name (GTK_STOCK_PREFERENCES, GTK_ICON_SIZE_MENU); gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image); g_signal_connect (G_OBJECT (item), "activate", @@ -551,10 +571,10 @@ get_primary_device (GVariant *devices) { primary_device = device; } - } - g_free (device_icon); - g_free (object_path); + g_free (device_icon); + g_free (object_path); + } if (discharging) { @@ -746,6 +766,9 @@ indicator_power_init (IndicatorPower *self) priv->proxy_cancel, service_proxy_cb, self); + + /* GSettings */ + priv->settings = g_settings_new ("org.ubuntu.indicator-power"); } static void @@ -793,7 +816,6 @@ get_image (IndicatorObject *io) gicon = g_themed_icon_new (DEFAULT_ICON); priv->status_image = GTK_IMAGE (gtk_image_new_from_gicon (gicon, GTK_ICON_SIZE_LARGE_TOOLBAR)); - gtk_widget_show (GTK_WIDGET (priv->status_image)); } return priv->status_image; |