diff options
-rw-r--r-- | AUTHORS | 1 | ||||
-rw-r--r-- | ChangeLog | 28 | ||||
-rw-r--r-- | Makefile.in | 1 | ||||
-rwxr-xr-x | configure | 110 | ||||
-rw-r--r-- | configure.ac | 34 | ||||
-rw-r--r-- | data/Makefile.in | 1 | ||||
-rw-r--r-- | data/datetime-dialog.ui | 6 | ||||
-rw-r--r-- | data/indicator-datetime-preferences.desktop | 10 | ||||
-rw-r--r-- | data/indicator-datetime-preferences.desktop.in | 10 | ||||
-rw-r--r-- | debian/changelog | 10 | ||||
-rw-r--r-- | libmap/Makefile.in | 1 | ||||
-rw-r--r-- | libmap/cc-timezone-map.c | 4 | ||||
-rw-r--r-- | src/Makefile.am | 13 | ||||
-rw-r--r-- | src/Makefile.in | 253 | ||||
-rw-r--r-- | src/datetime-prefs.c | 387 | ||||
-rw-r--r-- | src/datetime-service.c | 32 | ||||
-rw-r--r-- | src/indicator-datetime.c | 22 | ||||
-rw-r--r-- | src/timezone-completion.c | 21 | ||||
-rw-r--r-- | src/utils.c | 24 | ||||
-rw-r--r-- | src/utils.h | 1 | ||||
-rw-r--r-- | tests/Makefile.in | 1 |
21 files changed, 555 insertions, 415 deletions
@@ -11,5 +11,6 @@ Luke Yelavich Marco Trevisan (TreviƱo) Michael Terry + Rodrigo Moya Sebastien Bacher Ted Gould @@ -1,5 +1,33 @@ # Generated by Makefile. Do not edit. +2011-07-07 Ted Gould <ted@gould.cx> + + 0.2.91 + +2011-07-07 Ted Gould <ted@gould.cx> + + Making the preferences a gnome-control-center plugin instead of a stand alone app + +2011-06-29 Michael Terry <michael.terry@canonical.com> + + port preferences to be a control-center panel + +2011-06-28 Michael Terry <michael.terry@canonical.com> + + update to handle latest gnome-settings-daemon dbus API for setting timezones; be more fool-proof when looking up current timezone in indicator + +2011-07-07 Ted Gould <ted@gould.cx> + + Making the preferences call gnome-control-center and the datetime panel + +2011-06-29 Rodrigo Moya <rodrigo.moya@canonical.com> + + Use gnome-control-center datetime panel for settings + +2011-07-07 Ted Gould <ted@gould.cx> + + Fix timezone setting and reading + 2011-06-21 Ted Gould <ted@gould.cx> 0.2.90 diff --git a/Makefile.in b/Makefile.in index 1a6ca6e..0b2cb03 100644 --- a/Makefile.in +++ b/Makefile.in @@ -121,6 +121,7 @@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ +CCPANELDIR = @CCPANELDIR@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for indicator-datetime 0.2.90. +# Generated by GNU Autoconf 2.68 for indicator-datetime 0.2.91. # # Report bugs to <ted@canonical.com>. # @@ -572,8 +572,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='indicator-datetime' PACKAGE_TARNAME='indicator-datetime' -PACKAGE_VERSION='0.2.90' -PACKAGE_STRING='indicator-datetime 0.2.90' +PACKAGE_VERSION='0.2.91' +PACKAGE_STRING='indicator-datetime 0.2.91' PACKAGE_BUGREPORT='ted@canonical.com' PACKAGE_URL='' @@ -631,6 +631,7 @@ MSGFMT_OPTS GNOMELOCALEDIR GETTEXT_PACKAGE DBUSSERVICEDIR +CCPANELDIR INDICATORICONSDIR INDICATORDIR GSETTINGS_RULES @@ -1374,7 +1375,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-datetime 0.2.90 to adapt to many kinds of systems. +\`configure' configures indicator-datetime 0.2.91 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1445,7 +1446,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of indicator-datetime 0.2.90:";; + short | recursive ) echo "Configuration of indicator-datetime 0.2.91:";; esac cat <<\_ACEOF @@ -1576,7 +1577,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -indicator-datetime configure 0.2.90 +indicator-datetime configure 0.2.91 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1947,7 +1948,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-datetime $as_me 0.2.90, which was +It was created by indicator-datetime $as_me 0.2.91, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2768,7 +2769,7 @@ fi # Define the identity of the package. PACKAGE=indicator-datetime - VERSION=0.2.90 + VERSION=0.2.91 cat >>confdefs.h <<_ACEOF @@ -13035,12 +13036,12 @@ if test -n "$INDICATOR_CFLAGS"; then pkg_cv_INDICATOR_CFLAGS="$INDICATOR_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"indicator3 >= \$INDICATOR_REQUIRED_VERSION + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"indicator3-0.4 >= \$INDICATOR_REQUIRED_VERSION glib-2.0 >= \$GLIB_REQUIRED_VERSION dbusmenu-glib-0.4 >= \$DBUSMENUGLIB_REQUIRED_VERSION dbusmenu-gtk3-0.4 >= \$DBUSMENUGTK_REQUIRED_VERSION libido3-0.1 >= \$INDICATOR_DISPLAY_OBJECTS\""; } >&5 - ($PKG_CONFIG --exists --print-errors "indicator3 >= $INDICATOR_REQUIRED_VERSION + ($PKG_CONFIG --exists --print-errors "indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION glib-2.0 >= $GLIB_REQUIRED_VERSION dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION @@ -13048,7 +13049,7 @@ if test -n "$INDICATOR_CFLAGS"; then ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_INDICATOR_CFLAGS=`$PKG_CONFIG --cflags "indicator3 >= $INDICATOR_REQUIRED_VERSION + pkg_cv_INDICATOR_CFLAGS=`$PKG_CONFIG --cflags "indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION glib-2.0 >= $GLIB_REQUIRED_VERSION dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION @@ -13064,12 +13065,12 @@ if test -n "$INDICATOR_LIBS"; then pkg_cv_INDICATOR_LIBS="$INDICATOR_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"indicator3 >= \$INDICATOR_REQUIRED_VERSION + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"indicator3-0.4 >= \$INDICATOR_REQUIRED_VERSION glib-2.0 >= \$GLIB_REQUIRED_VERSION dbusmenu-glib-0.4 >= \$DBUSMENUGLIB_REQUIRED_VERSION dbusmenu-gtk3-0.4 >= \$DBUSMENUGTK_REQUIRED_VERSION libido3-0.1 >= \$INDICATOR_DISPLAY_OBJECTS\""; } >&5 - ($PKG_CONFIG --exists --print-errors "indicator3 >= $INDICATOR_REQUIRED_VERSION + ($PKG_CONFIG --exists --print-errors "indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION glib-2.0 >= $GLIB_REQUIRED_VERSION dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION @@ -13077,7 +13078,7 @@ if test -n "$INDICATOR_LIBS"; then ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_INDICATOR_LIBS=`$PKG_CONFIG --libs "indicator3 >= $INDICATOR_REQUIRED_VERSION + pkg_cv_INDICATOR_LIBS=`$PKG_CONFIG --libs "indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION glib-2.0 >= $GLIB_REQUIRED_VERSION dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION @@ -13102,13 +13103,13 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - INDICATOR_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "indicator3 >= $INDICATOR_REQUIRED_VERSION + INDICATOR_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION glib-2.0 >= $GLIB_REQUIRED_VERSION dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION libido3-0.1 >= $INDICATOR_DISPLAY_OBJECTS" 2>&1` else - INDICATOR_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "indicator3 >= $INDICATOR_REQUIRED_VERSION + INDICATOR_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION glib-2.0 >= $GLIB_REQUIRED_VERSION dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION @@ -13117,7 +13118,7 @@ fi # Put the nasty error message in config.log where it belongs echo "$INDICATOR_PKG_ERRORS" >&5 - as_fn_error $? "Package requirements (indicator3 >= $INDICATOR_REQUIRED_VERSION + as_fn_error $? "Package requirements (indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION glib-2.0 >= $GLIB_REQUIRED_VERSION dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION @@ -13164,12 +13165,12 @@ if test -n "$INDICATOR_CFLAGS"; then pkg_cv_INDICATOR_CFLAGS="$INDICATOR_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"indicator >= \$INDICATOR_REQUIRED_VERSION + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"indicator-0.4 >= \$INDICATOR_REQUIRED_VERSION glib-2.0 >= \$GLIB_REQUIRED_VERSION dbusmenu-glib-0.4 >= \$DBUSMENUGLIB_REQUIRED_VERSION dbusmenu-gtk-0.4 >= \$DBUSMENUGTK_REQUIRED_VERSION libido-0.1 >= \$INDICATOR_DISPLAY_OBJECTS\""; } >&5 - ($PKG_CONFIG --exists --print-errors "indicator >= $INDICATOR_REQUIRED_VERSION + ($PKG_CONFIG --exists --print-errors "indicator-0.4 >= $INDICATOR_REQUIRED_VERSION glib-2.0 >= $GLIB_REQUIRED_VERSION dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION dbusmenu-gtk-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION @@ -13177,7 +13178,7 @@ if test -n "$INDICATOR_CFLAGS"; then ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_INDICATOR_CFLAGS=`$PKG_CONFIG --cflags "indicator >= $INDICATOR_REQUIRED_VERSION + pkg_cv_INDICATOR_CFLAGS=`$PKG_CONFIG --cflags "indicator-0.4 >= $INDICATOR_REQUIRED_VERSION glib-2.0 >= $GLIB_REQUIRED_VERSION dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION dbusmenu-gtk-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION @@ -13193,12 +13194,12 @@ if test -n "$INDICATOR_LIBS"; then pkg_cv_INDICATOR_LIBS="$INDICATOR_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"indicator >= \$INDICATOR_REQUIRED_VERSION + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"indicator-0.4 >= \$INDICATOR_REQUIRED_VERSION glib-2.0 >= \$GLIB_REQUIRED_VERSION dbusmenu-glib-0.4 >= \$DBUSMENUGLIB_REQUIRED_VERSION dbusmenu-gtk-0.4 >= \$DBUSMENUGTK_REQUIRED_VERSION libido-0.1 >= \$INDICATOR_DISPLAY_OBJECTS\""; } >&5 - ($PKG_CONFIG --exists --print-errors "indicator >= $INDICATOR_REQUIRED_VERSION + ($PKG_CONFIG --exists --print-errors "indicator-0.4 >= $INDICATOR_REQUIRED_VERSION glib-2.0 >= $GLIB_REQUIRED_VERSION dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION dbusmenu-gtk-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION @@ -13206,7 +13207,7 @@ if test -n "$INDICATOR_LIBS"; then ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_INDICATOR_LIBS=`$PKG_CONFIG --libs "indicator >= $INDICATOR_REQUIRED_VERSION + pkg_cv_INDICATOR_LIBS=`$PKG_CONFIG --libs "indicator-0.4 >= $INDICATOR_REQUIRED_VERSION glib-2.0 >= $GLIB_REQUIRED_VERSION dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION dbusmenu-gtk-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION @@ -13231,13 +13232,13 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - INDICATOR_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "indicator >= $INDICATOR_REQUIRED_VERSION + INDICATOR_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "indicator-0.4 >= $INDICATOR_REQUIRED_VERSION glib-2.0 >= $GLIB_REQUIRED_VERSION dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION dbusmenu-gtk-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION libido-0.1 >= $INDICATOR_DISPLAY_OBJECTS" 2>&1` else - INDICATOR_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "indicator >= $INDICATOR_REQUIRED_VERSION + INDICATOR_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "indicator-0.4 >= $INDICATOR_REQUIRED_VERSION glib-2.0 >= $GLIB_REQUIRED_VERSION dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION dbusmenu-gtk-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION @@ -13246,7 +13247,7 @@ fi # Put the nasty error message in config.log where it belongs echo "$INDICATOR_PKG_ERRORS" >&5 - as_fn_error $? "Package requirements (indicator >= $INDICATOR_REQUIRED_VERSION + as_fn_error $? "Package requirements (indicator-0.4 >= $INDICATOR_REQUIRED_VERSION glib-2.0 >= $GLIB_REQUIRED_VERSION dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION dbusmenu-gtk-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION @@ -13300,7 +13301,7 @@ if test -n "$SERVICE_CFLAGS"; then pkg_cv_SERVICE_CFLAGS="$SERVICE_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"indicator3 >= \$INDICATOR_REQUIRED_VERSION + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"indicator3-0.4 >= \$INDICATOR_REQUIRED_VERSION glib-2.0 >= \$GLIB_REQUIRED_VERSION dbusmenu-glib-0.4 >= \$DBUSMENUGLIB_REQUIRED_VERSION dbusmenu-gtk3-0.4 >= \$DBUSMENUGTK_REQUIRED_VERSION @@ -13314,7 +13315,7 @@ if test -n "$SERVICE_CFLAGS"; then cairo >= CAIRO_REQUIRED_VERSION gdk-3.0 >= GDK_REQUIRED_VERSION gconf-2.0 >= GCONF_REQUIRED_VERSION\""; } >&5 - ($PKG_CONFIG --exists --print-errors "indicator3 >= $INDICATOR_REQUIRED_VERSION + ($PKG_CONFIG --exists --print-errors "indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION glib-2.0 >= $GLIB_REQUIRED_VERSION dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION @@ -13331,7 +13332,7 @@ if test -n "$SERVICE_CFLAGS"; then ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_SERVICE_CFLAGS=`$PKG_CONFIG --cflags "indicator3 >= $INDICATOR_REQUIRED_VERSION + pkg_cv_SERVICE_CFLAGS=`$PKG_CONFIG --cflags "indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION glib-2.0 >= $GLIB_REQUIRED_VERSION dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION @@ -13356,7 +13357,7 @@ if test -n "$SERVICE_LIBS"; then pkg_cv_SERVICE_LIBS="$SERVICE_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"indicator3 >= \$INDICATOR_REQUIRED_VERSION + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"indicator3-0.4 >= \$INDICATOR_REQUIRED_VERSION glib-2.0 >= \$GLIB_REQUIRED_VERSION dbusmenu-glib-0.4 >= \$DBUSMENUGLIB_REQUIRED_VERSION dbusmenu-gtk3-0.4 >= \$DBUSMENUGTK_REQUIRED_VERSION @@ -13370,7 +13371,7 @@ if test -n "$SERVICE_LIBS"; then cairo >= CAIRO_REQUIRED_VERSION gdk-3.0 >= GDK_REQUIRED_VERSION gconf-2.0 >= GCONF_REQUIRED_VERSION\""; } >&5 - ($PKG_CONFIG --exists --print-errors "indicator3 >= $INDICATOR_REQUIRED_VERSION + ($PKG_CONFIG --exists --print-errors "indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION glib-2.0 >= $GLIB_REQUIRED_VERSION dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION @@ -13387,7 +13388,7 @@ if test -n "$SERVICE_LIBS"; then ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_SERVICE_LIBS=`$PKG_CONFIG --libs "indicator3 >= $INDICATOR_REQUIRED_VERSION + pkg_cv_SERVICE_LIBS=`$PKG_CONFIG --libs "indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION glib-2.0 >= $GLIB_REQUIRED_VERSION dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION @@ -13421,7 +13422,7 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - SERVICE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "indicator3 >= $INDICATOR_REQUIRED_VERSION + SERVICE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION glib-2.0 >= $GLIB_REQUIRED_VERSION dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION @@ -13436,7 +13437,7 @@ fi gdk-3.0 >= GDK_REQUIRED_VERSION gconf-2.0 >= GCONF_REQUIRED_VERSION" 2>&1` else - SERVICE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "indicator3 >= $INDICATOR_REQUIRED_VERSION + SERVICE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION glib-2.0 >= $GLIB_REQUIRED_VERSION dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION @@ -13454,7 +13455,7 @@ fi # Put the nasty error message in config.log where it belongs echo "$SERVICE_PKG_ERRORS" >&5 - as_fn_error $? "Package requirements (indicator3 >= $INDICATOR_REQUIRED_VERSION + as_fn_error $? "Package requirements (indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION glib-2.0 >= $GLIB_REQUIRED_VERSION dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION @@ -13513,11 +13514,13 @@ if test -n "$PREF_CFLAGS"; then gtk+-3.0 >= \$GTK3_REQUIRED_VERSION unique-3.0 json-glib-1.0 + libgnome-control-center polkit-gobject-1\""; } >&5 ($PKG_CONFIG --exists --print-errors "gio-2.0 >= $GIO_REQUIRED_VERSION gtk+-3.0 >= $GTK3_REQUIRED_VERSION unique-3.0 json-glib-1.0 + libgnome-control-center polkit-gobject-1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 @@ -13526,6 +13529,7 @@ if test -n "$PREF_CFLAGS"; then gtk+-3.0 >= $GTK3_REQUIRED_VERSION unique-3.0 json-glib-1.0 + libgnome-control-center polkit-gobject-1" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else @@ -13542,11 +13546,13 @@ if test -n "$PREF_LIBS"; then gtk+-3.0 >= \$GTK3_REQUIRED_VERSION unique-3.0 json-glib-1.0 + libgnome-control-center polkit-gobject-1\""; } >&5 ($PKG_CONFIG --exists --print-errors "gio-2.0 >= $GIO_REQUIRED_VERSION gtk+-3.0 >= $GTK3_REQUIRED_VERSION unique-3.0 json-glib-1.0 + libgnome-control-center polkit-gobject-1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 @@ -13555,6 +13561,7 @@ if test -n "$PREF_LIBS"; then gtk+-3.0 >= $GTK3_REQUIRED_VERSION unique-3.0 json-glib-1.0 + libgnome-control-center polkit-gobject-1" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else @@ -13580,12 +13587,14 @@ fi gtk+-3.0 >= $GTK3_REQUIRED_VERSION unique-3.0 json-glib-1.0 + libgnome-control-center polkit-gobject-1" 2>&1` else PREF_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gio-2.0 >= $GIO_REQUIRED_VERSION gtk+-3.0 >= $GTK3_REQUIRED_VERSION unique-3.0 json-glib-1.0 + libgnome-control-center polkit-gobject-1" 2>&1` fi # Put the nasty error message in config.log where it belongs @@ -13595,6 +13604,7 @@ fi gtk+-3.0 >= $GTK3_REQUIRED_VERSION unique-3.0 json-glib-1.0 + libgnome-control-center polkit-gobject-1) were not met: $PREF_PKG_ERRORS @@ -14004,13 +14014,13 @@ if test "x$with_localinstall" = "xyes"; then : else if test "x$with_gtk" = "x2"; then : - INDICATORDIR=`$PKG_CONFIG --variable=indicatordir indicator` - INDICATORICONSDIR=`$PKG_CONFIG --variable=iconsdir indicator` + INDICATORDIR=`$PKG_CONFIG --variable=indicatordir indicator-0.4` + INDICATORICONSDIR=`$PKG_CONFIG --variable=iconsdir indicator-0.4` else - INDICATORDIR=`$PKG_CONFIG --variable=indicatordir indicator3` - INDICATORICONSDIR=`$PKG_CONFIG --variable=iconsdir indicator3` + INDICATORDIR=`$PKG_CONFIG --variable=indicatordir indicator3-0.4` + INDICATORICONSDIR=`$PKG_CONFIG --variable=iconsdir indicator3-0.4` fi fi @@ -14019,6 +14029,22 @@ fi ########################### +# Control Center Info +########################### + +if test "x$with_localinstall" = "xyes"; then : + + CCPANELDIR="${libdir}/control-center-1/panels/" + +else + + CCPANELDIR=`$PKG_CONFIG --variable=extensiondir libgnome-control-center` + +fi + + + +########################### # DBus Service Info ########################### @@ -15317,7 +15343,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-datetime $as_me 0.2.90, which was +This file was extended by indicator-datetime $as_me 0.2.91, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15383,7 +15409,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-datetime config.status 0.2.90 +indicator-datetime config.status 0.2.91 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" @@ -17194,6 +17220,7 @@ Date and Time Indicator Configuration: Prefix: $prefix Indicator Dir: $INDICATORDIR + CC Panel Dir: $CCPANELDIR " >&5 $as_echo "$as_me: @@ -17201,4 +17228,5 @@ Date and Time Indicator Configuration: Prefix: $prefix Indicator Dir: $INDICATORDIR + CC Panel Dir: $CCPANELDIR " >&6;} diff --git a/configure.ac b/configure.ac index 810bab0..2420923 100644 --- a/configure.ac +++ b/configure.ac @@ -1,11 +1,11 @@ -AC_INIT(indicator-datetime, 0.2.90, ted@canonical.com) +AC_INIT(indicator-datetime, 0.2.91, ted@canonical.com) AC_COPYRIGHT([Copyright 2009,2010 Canonical]) AC_PREREQ(2.53) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(indicator-datetime, 0.2.90) +AM_INIT_AUTOMAKE(indicator-datetime, 0.2.91) AM_MAINTAINER_MODE @@ -67,14 +67,14 @@ GTK3_REQUIRED_VERSION=3.1.4 GCONF_REQUIRED_VERSION=2.31 AS_IF([test "x$with_gtk" = x3], - [PKG_CHECK_MODULES(INDICATOR, indicator3 >= $INDICATOR_REQUIRED_VERSION + [PKG_CHECK_MODULES(INDICATOR, indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION glib-2.0 >= $GLIB_REQUIRED_VERSION dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION libido3-0.1 >= $INDICATOR_DISPLAY_OBJECTS) ], [test "x$with_gtk" = x2], - [PKG_CHECK_MODULES(INDICATOR, indicator >= $INDICATOR_REQUIRED_VERSION + [PKG_CHECK_MODULES(INDICATOR, indicator-0.4 >= $INDICATOR_REQUIRED_VERSION glib-2.0 >= $GLIB_REQUIRED_VERSION dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION dbusmenu-gtk-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION @@ -83,7 +83,7 @@ AS_IF([test "x$with_gtk" = x3], [AC_MSG_FAILURE([Value for --with-gtk was neither 2 nor 3])] ) -PKG_CHECK_MODULES(SERVICE, indicator3 >= $INDICATOR_REQUIRED_VERSION +PKG_CHECK_MODULES(SERVICE, indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION glib-2.0 >= $GLIB_REQUIRED_VERSION dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION @@ -102,6 +102,7 @@ PKG_CHECK_MODULES(PREF, gio-2.0 >= $GIO_REQUIRED_VERSION gtk+-3.0 >= $GTK3_REQUIRED_VERSION unique-3.0 json-glib-1.0 + libgnome-control-center polkit-gobject-1) PKG_CHECK_MODULES(LIBMAP, gio-2.0 >= $GIO_REQUIRED_VERSION @@ -144,18 +145,32 @@ AS_IF([test "x$with_localinstall" = "xyes"], ], [AS_IF([test "x$with_gtk" = "x2"], [ - INDICATORDIR=`$PKG_CONFIG --variable=indicatordir indicator` - INDICATORICONSDIR=`$PKG_CONFIG --variable=iconsdir indicator` + INDICATORDIR=`$PKG_CONFIG --variable=indicatordir indicator-0.4` + INDICATORICONSDIR=`$PKG_CONFIG --variable=iconsdir indicator-0.4` ], [ - INDICATORDIR=`$PKG_CONFIG --variable=indicatordir indicator3` - INDICATORICONSDIR=`$PKG_CONFIG --variable=iconsdir indicator3` + INDICATORDIR=`$PKG_CONFIG --variable=indicatordir indicator3-0.4` + INDICATORICONSDIR=`$PKG_CONFIG --variable=iconsdir indicator3-0.4` ])]) AC_SUBST(INDICATORDIR) AC_SUBST(INDICATORICONSDIR) ########################### +# Control Center Info +########################### + +AS_IF([test "x$with_localinstall" = "xyes"], + [ + CCPANELDIR="${libdir}/control-center-1/panels/" + ], + [ + CCPANELDIR=`$PKG_CONFIG --variable=extensiondir libgnome-control-center` + ]) + +AC_SUBST(CCPANELDIR) + +########################### # DBus Service Info ########################### @@ -216,4 +231,5 @@ Date and Time Indicator Configuration: Prefix: $prefix Indicator Dir: $INDICATORDIR + CC Panel Dir: $CCPANELDIR ]) diff --git a/data/Makefile.in b/data/Makefile.in index 25d74ad..096db98 100644 --- a/data/Makefile.in +++ b/data/Makefile.in @@ -92,6 +92,7 @@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ +CCPANELDIR = @CCPANELDIR@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ diff --git a/data/datetime-dialog.ui b/data/datetime-dialog.ui index 8479482..59d6753 100644 --- a/data/datetime-dialog.ui +++ b/data/datetime-dialog.ui @@ -134,13 +134,9 @@ <property name="step_increment">60</property> <property name="page_increment">3600</property> </object> - <object class="GtkWindow" id="timeDateDialog"> + <object class="GtkEventBox" id="timeDatePanel"> <property name="can_focus">False</property> <property name="border_width">5</property> - <property name="title" translatable="yes">Time & Date</property> - <property name="resizable">False</property> - <property name="icon_name">time-admin</property> - <property name="type_hint">dialog</property> <child> <object class="GtkNotebook" id="notebook1"> <property name="visible">True</property> diff --git a/data/indicator-datetime-preferences.desktop b/data/indicator-datetime-preferences.desktop index 9871ecf..8231e22 100644 --- a/data/indicator-datetime-preferences.desktop +++ b/data/indicator-datetime-preferences.desktop @@ -4,11 +4,13 @@ Version=1.0 Name=Time & Date Comment=Change your clock and date settings -Icon=time-admin -TryExec=indicator-datetime-preferences -Exec=indicator-datetime-preferences +Icon=preferences-system-time +TryExec=gnome-control-center +Exec=gnome-control-center indicator-datetime StartupNotify=true Type=Application -Categories=GNOME;GTK;Utility;DesktopSettings;Settings; +Categories=GNOME;GTK;Utility;DesktopSettings;Settings;X-GNOME-SystemSettings;X-GNOME-Settings-Panel; +X-GNOME-Settings-Panel=indicator-datetime +OnlyShowIn=Unity; diff --git a/data/indicator-datetime-preferences.desktop.in b/data/indicator-datetime-preferences.desktop.in index f37765b..226ae67 100644 --- a/data/indicator-datetime-preferences.desktop.in +++ b/data/indicator-datetime-preferences.desktop.in @@ -4,11 +4,13 @@ Version=1.0 _Name=Time & Date _Comment=Change your clock and date settings -Icon=time-admin -TryExec=indicator-datetime-preferences -Exec=indicator-datetime-preferences +Icon=preferences-system-time +TryExec=gnome-control-center +Exec=gnome-control-center indicator-datetime StartupNotify=true Type=Application -Categories=GNOME;GTK;Utility;DesktopSettings;Settings; +Categories=GNOME;GTK;Utility;DesktopSettings;Settings;X-GNOME-SystemSettings;X-GNOME-Settings-Panel; +X-GNOME-Settings-Panel=indicator-datetime +OnlyShowIn=Unity; diff --git a/debian/changelog b/debian/changelog index 741fa90..0ea9cf3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +indicator-datetime (0.2.91-0ubuntu1~ppa1) UNRELEASED; urgency=low + + * New upstream release. + * libindicator 0.4 transition + * Making preferences a gnome-control-center plugin + * Calling gnome-control-center from the menu + * Fixing timezone setting with new gsd + + -- Ted Gould <ted@ubuntu.com> Thu, 07 Jul 2011 16:23:08 -0500 + indicator-datetime (0.2.90-0ubuntu4) oneiric; urgency=low * No change rebuild to fix badly packaged diff.gz from last time diff --git a/libmap/Makefile.in b/libmap/Makefile.in index 44d6f90..3c4ea45 100644 --- a/libmap/Makefile.in +++ b/libmap/Makefile.in @@ -134,6 +134,7 @@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ +CCPANELDIR = @CCPANELDIR@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ diff --git a/libmap/cc-timezone-map.c b/libmap/cc-timezone-map.c index 5ce1354..aeac9a0 100644 --- a/libmap/cc-timezone-map.c +++ b/libmap/cc-timezone-map.c @@ -686,10 +686,6 @@ cc_timezone_map_realize (GtkWidget *widget) window = gdk_window_new (gtk_widget_get_parent_window (widget), &attr, GDK_WA_X | GDK_WA_Y); - gtk_widget_set_style (widget, - gtk_style_attach (gtk_widget_get_style (widget), - window)); - gdk_window_set_user_data (window, widget); cursor = gdk_cursor_new (GDK_HAND2); diff --git a/src/Makefile.am b/src/Makefile.am index 6d388c7..6ca07a8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,5 +1,7 @@ -bin_PROGRAMS = indicator-datetime-preferences +ccpaneldir = $(CCPANELDIR) +ccpanel_LTLIBRARIES = libindicator-datetime.la + libexec_PROGRAMS = indicator-datetime-service indicator_datetime_service_SOURCES = \ @@ -34,6 +36,7 @@ libdatetime_la_SOURCES = \ libdatetime_la_CFLAGS = \ $(INDICATOR_CFLAGS) \ -Wall -Werror \ + -DTIMEZONE_FILE="\"/etc/timezone\"" \ -DG_LOG_DOMAIN=\"Indicator-Datetime\" libdatetime_la_LIBADD = \ $(INDICATOR_LIBS) @@ -41,7 +44,7 @@ libdatetime_la_LDFLAGS = \ -module \ -avoid-version -indicator_datetime_preferences_SOURCES =\ +libindicator_datetime_la_SOURCES =\ datetime-prefs.c \ datetime-prefs-locations.c \ datetime-prefs-locations.h \ @@ -50,15 +53,17 @@ indicator_datetime_preferences_SOURCES =\ utils.c \ utils.h \ settings-shared.h -indicator_datetime_preferences_CFLAGS = \ +libindicator_datetime_la_CFLAGS = \ -Wall \ -Werror \ -I$(top_srcdir)/libmap \ $(PREF_CFLAGS) \ + -DTIMEZONE_FILE="\"/etc/timezone\"" \ -DPKGDATADIR="\"$(pkgdatadir)\"" -indicator_datetime_preferences_LDADD = \ +libindicator_datetime_la_LIBADD = \ $(top_builddir)/libmap/libmap.la \ $(PREF_LIBS) +libindicator_datetime_la_LDFLAGS = -module -avoid-version gen-%.xml.c: %.xml @echo "Building $@ from $<" diff --git a/src/Makefile.in b/src/Makefile.in index 2d9231f..0b4b885 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -35,7 +35,6 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -bin_PROGRAMS = indicator-datetime-preferences$(EXEEXT) libexec_PROGRAMS = indicator-datetime-service$(EXEEXT) subdir = src DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in @@ -68,9 +67,9 @@ am__nobase_list = $(am__nobase_strip_setup); \ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__installdirs = "$(DESTDIR)$(datetimelibdir)" "$(DESTDIR)$(bindir)" \ - "$(DESTDIR)$(libexecdir)" -LTLIBRARIES = $(datetimelib_LTLIBRARIES) +am__installdirs = "$(DESTDIR)$(ccpaneldir)" \ + "$(DESTDIR)$(datetimelibdir)" "$(DESTDIR)$(libexecdir)" +LTLIBRARIES = $(ccpanel_LTLIBRARIES) $(datetimelib_LTLIBRARIES) am__DEPENDENCIES_1 = libdatetime_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_libdatetime_la_OBJECTS = libdatetime_la-utils.lo \ @@ -83,20 +82,20 @@ libdatetime_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(libdatetime_la_CFLAGS) $(CFLAGS) $(libdatetime_la_LDFLAGS) \ $(LDFLAGS) -o $@ -PROGRAMS = $(bin_PROGRAMS) $(libexec_PROGRAMS) -am_indicator_datetime_preferences_OBJECTS = \ - indicator_datetime_preferences-datetime-prefs.$(OBJEXT) \ - indicator_datetime_preferences-datetime-prefs-locations.$(OBJEXT) \ - indicator_datetime_preferences-timezone-completion.$(OBJEXT) \ - indicator_datetime_preferences-utils.$(OBJEXT) -indicator_datetime_preferences_OBJECTS = \ - $(am_indicator_datetime_preferences_OBJECTS) -indicator_datetime_preferences_DEPENDENCIES = \ +libindicator_datetime_la_DEPENDENCIES = \ $(top_builddir)/libmap/libmap.la $(am__DEPENDENCIES_1) -indicator_datetime_preferences_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ +am_libindicator_datetime_la_OBJECTS = \ + libindicator_datetime_la-datetime-prefs.lo \ + libindicator_datetime_la-datetime-prefs-locations.lo \ + libindicator_datetime_la-timezone-completion.lo \ + libindicator_datetime_la-utils.lo +libindicator_datetime_la_OBJECTS = \ + $(am_libindicator_datetime_la_OBJECTS) +libindicator_datetime_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ - $(indicator_datetime_preferences_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ + $(libindicator_datetime_la_CFLAGS) $(CFLAGS) \ + $(libindicator_datetime_la_LDFLAGS) $(LDFLAGS) -o $@ +PROGRAMS = $(libexec_PROGRAMS) am_indicator_datetime_service_OBJECTS = \ indicator_datetime_service-datetime-interface.$(OBJEXT) \ indicator_datetime_service-gen-datetime-service.xml.$(OBJEXT) \ @@ -137,10 +136,10 @@ AM_V_GEN = $(am__v_GEN_$(V)) am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(libdatetime_la_SOURCES) \ - $(indicator_datetime_preferences_SOURCES) \ + $(libindicator_datetime_la_SOURCES) \ $(indicator_datetime_service_SOURCES) DIST_SOURCES = $(libdatetime_la_SOURCES) \ - $(indicator_datetime_preferences_SOURCES) \ + $(libindicator_datetime_la_SOURCES) \ $(indicator_datetime_service_SOURCES) ETAGS = etags CTAGS = ctags @@ -158,6 +157,7 @@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ +CCPANELDIR = @CCPANELDIR@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -304,6 +304,8 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ +ccpaneldir = $(CCPANELDIR) +ccpanel_LTLIBRARIES = libindicator-datetime.la indicator_datetime_service_SOURCES = \ datetime-interface.c \ datetime-interface.h \ @@ -339,6 +341,7 @@ libdatetime_la_SOURCES = \ libdatetime_la_CFLAGS = \ $(INDICATOR_CFLAGS) \ -Wall -Werror \ + -DTIMEZONE_FILE="\"/etc/timezone\"" \ -DG_LOG_DOMAIN=\"Indicator-Datetime\" libdatetime_la_LIBADD = \ @@ -348,7 +351,7 @@ libdatetime_la_LDFLAGS = \ -module \ -avoid-version -indicator_datetime_preferences_SOURCES = \ +libindicator_datetime_la_SOURCES = \ datetime-prefs.c \ datetime-prefs-locations.c \ datetime-prefs-locations.h \ @@ -358,17 +361,19 @@ indicator_datetime_preferences_SOURCES = \ utils.h \ settings-shared.h -indicator_datetime_preferences_CFLAGS = \ +libindicator_datetime_la_CFLAGS = \ -Wall \ -Werror \ -I$(top_srcdir)/libmap \ $(PREF_CFLAGS) \ + -DTIMEZONE_FILE="\"/etc/timezone\"" \ -DPKGDATADIR="\"$(pkgdatadir)\"" -indicator_datetime_preferences_LDADD = \ +libindicator_datetime_la_LIBADD = \ $(top_builddir)/libmap/libmap.la \ $(PREF_LIBS) +libindicator_datetime_la_LDFLAGS = -module -avoid-version BUILT_SOURCES = \ gen-datetime-service.xml.c \ gen-datetime-service.xml.h @@ -414,6 +419,37 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): +install-ccpanelLTLIBRARIES: $(ccpanel_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(ccpaneldir)" || $(MKDIR_P) "$(DESTDIR)$(ccpaneldir)" + @list='$(ccpanel_LTLIBRARIES)'; test -n "$(ccpaneldir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(ccpaneldir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(ccpaneldir)"; \ + } + +uninstall-ccpanelLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(ccpanel_LTLIBRARIES)'; test -n "$(ccpaneldir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(ccpaneldir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(ccpaneldir)/$$f"; \ + done + +clean-ccpanelLTLIBRARIES: + -test -z "$(ccpanel_LTLIBRARIES)" || rm -f $(ccpanel_LTLIBRARIES) + @list='$(ccpanel_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done install-datetimelibLTLIBRARIES: $(datetimelib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(datetimelibdir)" || $(MKDIR_P) "$(DESTDIR)$(datetimelibdir)" @@ -447,49 +483,8 @@ clean-datetimelibLTLIBRARIES: done libdatetime.la: $(libdatetime_la_OBJECTS) $(libdatetime_la_DEPENDENCIES) $(AM_V_CCLD)$(libdatetime_la_LINK) -rpath $(datetimelibdir) $(libdatetime_la_OBJECTS) $(libdatetime_la_LIBADD) $(LIBS) -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - for p in $$list; do echo "$$p $$p"; done | \ - sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p || test -f $$p1; \ - then echo "$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ - -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ - sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) files[d] = files[d] " " $$1; \ - else { print "f", $$3 "/" $$4, $$1; } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ - -e 's/$$/$(EXEEXT)/' `; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(bindir)" && rm -f $$files - -clean-binPROGRAMS: - @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ - echo " rm -f" $$list; \ - rm -f $$list || exit $$?; \ - test -n "$(EXEEXT)" || exit 0; \ - list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f" $$list; \ - rm -f $$list +libindicator-datetime.la: $(libindicator_datetime_la_OBJECTS) $(libindicator_datetime_la_DEPENDENCIES) + $(AM_V_CCLD)$(libindicator_datetime_la_LINK) -rpath $(ccpaneldir) $(libindicator_datetime_la_OBJECTS) $(libindicator_datetime_la_LIBADD) $(LIBS) install-libexecPROGRAMS: $(libexec_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(libexecdir)" || $(MKDIR_P) "$(DESTDIR)$(libexecdir)" @@ -533,9 +528,6 @@ clean-libexecPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -indicator-datetime-preferences$(EXEEXT): $(indicator_datetime_preferences_OBJECTS) $(indicator_datetime_preferences_DEPENDENCIES) - @rm -f indicator-datetime-preferences$(EXEEXT) - $(AM_V_CCLD)$(indicator_datetime_preferences_LINK) $(indicator_datetime_preferences_OBJECTS) $(indicator_datetime_preferences_LDADD) $(LIBS) indicator-datetime-service$(EXEEXT): $(indicator_datetime_service_OBJECTS) $(indicator_datetime_service_DEPENDENCIES) @rm -f indicator-datetime-service$(EXEEXT) $(AM_V_CCLD)$(indicator_datetime_service_LINK) $(indicator_datetime_service_OBJECTS) $(indicator_datetime_service_LDADD) $(LIBS) @@ -546,10 +538,6 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_datetime_preferences-datetime-prefs-locations.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_datetime_preferences-datetime-prefs.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_datetime_preferences-timezone-completion.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_datetime_preferences-utils.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_datetime_service-calendar-menu-item.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_datetime_service-datetime-interface.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_datetime_service-datetime-service.Po@am__quote@ @@ -557,6 +545,10 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_datetime_service-utils.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdatetime_la-indicator-datetime.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdatetime_la-utils.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libindicator_datetime_la-datetime-prefs-locations.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libindicator_datetime_la-datetime-prefs.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libindicator_datetime_la-timezone-completion.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libindicator_datetime_la-utils.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -598,69 +590,37 @@ libdatetime_la-indicator-datetime.lo: indicator-datetime.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdatetime_la_CFLAGS) $(CFLAGS) -c -o libdatetime_la-indicator-datetime.lo `test -f 'indicator-datetime.c' || echo '$(srcdir)/'`indicator-datetime.c -indicator_datetime_preferences-datetime-prefs.o: datetime-prefs.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_datetime_preferences_CFLAGS) $(CFLAGS) -MT indicator_datetime_preferences-datetime-prefs.o -MD -MP -MF $(DEPDIR)/indicator_datetime_preferences-datetime-prefs.Tpo -c -o indicator_datetime_preferences-datetime-prefs.o `test -f 'datetime-prefs.c' || echo '$(srcdir)/'`datetime-prefs.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_datetime_preferences-datetime-prefs.Tpo $(DEPDIR)/indicator_datetime_preferences-datetime-prefs.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='datetime-prefs.c' object='indicator_datetime_preferences-datetime-prefs.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_datetime_preferences_CFLAGS) $(CFLAGS) -c -o indicator_datetime_preferences-datetime-prefs.o `test -f 'datetime-prefs.c' || echo '$(srcdir)/'`datetime-prefs.c - -indicator_datetime_preferences-datetime-prefs.obj: datetime-prefs.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_datetime_preferences_CFLAGS) $(CFLAGS) -MT indicator_datetime_preferences-datetime-prefs.obj -MD -MP -MF $(DEPDIR)/indicator_datetime_preferences-datetime-prefs.Tpo -c -o indicator_datetime_preferences-datetime-prefs.obj `if test -f 'datetime-prefs.c'; then $(CYGPATH_W) 'datetime-prefs.c'; else $(CYGPATH_W) '$(srcdir)/datetime-prefs.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_datetime_preferences-datetime-prefs.Tpo $(DEPDIR)/indicator_datetime_preferences-datetime-prefs.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='datetime-prefs.c' object='indicator_datetime_preferences-datetime-prefs.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_datetime_preferences_CFLAGS) $(CFLAGS) -c -o indicator_datetime_preferences-datetime-prefs.obj `if test -f 'datetime-prefs.c'; then $(CYGPATH_W) 'datetime-prefs.c'; else $(CYGPATH_W) '$(srcdir)/datetime-prefs.c'; fi` - -indicator_datetime_preferences-datetime-prefs-locations.o: datetime-prefs-locations.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_datetime_preferences_CFLAGS) $(CFLAGS) -MT indicator_datetime_preferences-datetime-prefs-locations.o -MD -MP -MF $(DEPDIR)/indicator_datetime_preferences-datetime-prefs-locations.Tpo -c -o indicator_datetime_preferences-datetime-prefs-locations.o `test -f 'datetime-prefs-locations.c' || echo '$(srcdir)/'`datetime-prefs-locations.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_datetime_preferences-datetime-prefs-locations.Tpo $(DEPDIR)/indicator_datetime_preferences-datetime-prefs-locations.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='datetime-prefs-locations.c' object='indicator_datetime_preferences-datetime-prefs-locations.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_datetime_preferences_CFLAGS) $(CFLAGS) -c -o indicator_datetime_preferences-datetime-prefs-locations.o `test -f 'datetime-prefs-locations.c' || echo '$(srcdir)/'`datetime-prefs-locations.c - -indicator_datetime_preferences-datetime-prefs-locations.obj: datetime-prefs-locations.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_datetime_preferences_CFLAGS) $(CFLAGS) -MT indicator_datetime_preferences-datetime-prefs-locations.obj -MD -MP -MF $(DEPDIR)/indicator_datetime_preferences-datetime-prefs-locations.Tpo -c -o indicator_datetime_preferences-datetime-prefs-locations.obj `if test -f 'datetime-prefs-locations.c'; then $(CYGPATH_W) 'datetime-prefs-locations.c'; else $(CYGPATH_W) '$(srcdir)/datetime-prefs-locations.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_datetime_preferences-datetime-prefs-locations.Tpo $(DEPDIR)/indicator_datetime_preferences-datetime-prefs-locations.Po +libindicator_datetime_la-datetime-prefs.lo: datetime-prefs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libindicator_datetime_la_CFLAGS) $(CFLAGS) -MT libindicator_datetime_la-datetime-prefs.lo -MD -MP -MF $(DEPDIR)/libindicator_datetime_la-datetime-prefs.Tpo -c -o libindicator_datetime_la-datetime-prefs.lo `test -f 'datetime-prefs.c' || echo '$(srcdir)/'`datetime-prefs.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libindicator_datetime_la-datetime-prefs.Tpo $(DEPDIR)/libindicator_datetime_la-datetime-prefs.Plo @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='datetime-prefs-locations.c' object='indicator_datetime_preferences-datetime-prefs-locations.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='datetime-prefs.c' object='libindicator_datetime_la-datetime-prefs.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_datetime_preferences_CFLAGS) $(CFLAGS) -c -o indicator_datetime_preferences-datetime-prefs-locations.obj `if test -f 'datetime-prefs-locations.c'; then $(CYGPATH_W) 'datetime-prefs-locations.c'; else $(CYGPATH_W) '$(srcdir)/datetime-prefs-locations.c'; fi` +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libindicator_datetime_la_CFLAGS) $(CFLAGS) -c -o libindicator_datetime_la-datetime-prefs.lo `test -f 'datetime-prefs.c' || echo '$(srcdir)/'`datetime-prefs.c -indicator_datetime_preferences-timezone-completion.o: timezone-completion.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_datetime_preferences_CFLAGS) $(CFLAGS) -MT indicator_datetime_preferences-timezone-completion.o -MD -MP -MF $(DEPDIR)/indicator_datetime_preferences-timezone-completion.Tpo -c -o indicator_datetime_preferences-timezone-completion.o `test -f 'timezone-completion.c' || echo '$(srcdir)/'`timezone-completion.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_datetime_preferences-timezone-completion.Tpo $(DEPDIR)/indicator_datetime_preferences-timezone-completion.Po +libindicator_datetime_la-datetime-prefs-locations.lo: datetime-prefs-locations.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libindicator_datetime_la_CFLAGS) $(CFLAGS) -MT libindicator_datetime_la-datetime-prefs-locations.lo -MD -MP -MF $(DEPDIR)/libindicator_datetime_la-datetime-prefs-locations.Tpo -c -o libindicator_datetime_la-datetime-prefs-locations.lo `test -f 'datetime-prefs-locations.c' || echo '$(srcdir)/'`datetime-prefs-locations.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libindicator_datetime_la-datetime-prefs-locations.Tpo $(DEPDIR)/libindicator_datetime_la-datetime-prefs-locations.Plo @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='timezone-completion.c' object='indicator_datetime_preferences-timezone-completion.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='datetime-prefs-locations.c' object='libindicator_datetime_la-datetime-prefs-locations.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_datetime_preferences_CFLAGS) $(CFLAGS) -c -o indicator_datetime_preferences-timezone-completion.o `test -f 'timezone-completion.c' || echo '$(srcdir)/'`timezone-completion.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libindicator_datetime_la_CFLAGS) $(CFLAGS) -c -o libindicator_datetime_la-datetime-prefs-locations.lo `test -f 'datetime-prefs-locations.c' || echo '$(srcdir)/'`datetime-prefs-locations.c -indicator_datetime_preferences-timezone-completion.obj: timezone-completion.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_datetime_preferences_CFLAGS) $(CFLAGS) -MT indicator_datetime_preferences-timezone-completion.obj -MD -MP -MF $(DEPDIR)/indicator_datetime_preferences-timezone-completion.Tpo -c -o indicator_datetime_preferences-timezone-completion.obj `if test -f 'timezone-completion.c'; then $(CYGPATH_W) 'timezone-completion.c'; else $(CYGPATH_W) '$(srcdir)/timezone-completion.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_datetime_preferences-timezone-completion.Tpo $(DEPDIR)/indicator_datetime_preferences-timezone-completion.Po +libindicator_datetime_la-timezone-completion.lo: timezone-completion.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libindicator_datetime_la_CFLAGS) $(CFLAGS) -MT libindicator_datetime_la-timezone-completion.lo -MD -MP -MF $(DEPDIR)/libindicator_datetime_la-timezone-completion.Tpo -c -o libindicator_datetime_la-timezone-completion.lo `test -f 'timezone-completion.c' || echo '$(srcdir)/'`timezone-completion.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libindicator_datetime_la-timezone-completion.Tpo $(DEPDIR)/libindicator_datetime_la-timezone-completion.Plo @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='timezone-completion.c' object='indicator_datetime_preferences-timezone-completion.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='timezone-completion.c' object='libindicator_datetime_la-timezone-completion.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_datetime_preferences_CFLAGS) $(CFLAGS) -c -o indicator_datetime_preferences-timezone-completion.obj `if test -f 'timezone-completion.c'; then $(CYGPATH_W) 'timezone-completion.c'; else $(CYGPATH_W) '$(srcdir)/timezone-completion.c'; fi` +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libindicator_datetime_la_CFLAGS) $(CFLAGS) -c -o libindicator_datetime_la-timezone-completion.lo `test -f 'timezone-completion.c' || echo '$(srcdir)/'`timezone-completion.c -indicator_datetime_preferences-utils.o: utils.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_datetime_preferences_CFLAGS) $(CFLAGS) -MT indicator_datetime_preferences-utils.o -MD -MP -MF $(DEPDIR)/indicator_datetime_preferences-utils.Tpo -c -o indicator_datetime_preferences-utils.o `test -f 'utils.c' || echo '$(srcdir)/'`utils.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_datetime_preferences-utils.Tpo $(DEPDIR)/indicator_datetime_preferences-utils.Po +libindicator_datetime_la-utils.lo: utils.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libindicator_datetime_la_CFLAGS) $(CFLAGS) -MT libindicator_datetime_la-utils.lo -MD -MP -MF $(DEPDIR)/libindicator_datetime_la-utils.Tpo -c -o libindicator_datetime_la-utils.lo `test -f 'utils.c' || echo '$(srcdir)/'`utils.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libindicator_datetime_la-utils.Tpo $(DEPDIR)/libindicator_datetime_la-utils.Plo @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='utils.c' object='indicator_datetime_preferences-utils.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='utils.c' object='libindicator_datetime_la-utils.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_datetime_preferences_CFLAGS) $(CFLAGS) -c -o indicator_datetime_preferences-utils.o `test -f 'utils.c' || echo '$(srcdir)/'`utils.c - -indicator_datetime_preferences-utils.obj: utils.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_datetime_preferences_CFLAGS) $(CFLAGS) -MT indicator_datetime_preferences-utils.obj -MD -MP -MF $(DEPDIR)/indicator_datetime_preferences-utils.Tpo -c -o indicator_datetime_preferences-utils.obj `if test -f 'utils.c'; then $(CYGPATH_W) 'utils.c'; else $(CYGPATH_W) '$(srcdir)/utils.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_datetime_preferences-utils.Tpo $(DEPDIR)/indicator_datetime_preferences-utils.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='utils.c' object='indicator_datetime_preferences-utils.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_datetime_preferences_CFLAGS) $(CFLAGS) -c -o indicator_datetime_preferences-utils.obj `if test -f 'utils.c'; then $(CYGPATH_W) 'utils.c'; else $(CYGPATH_W) '$(srcdir)/utils.c'; fi` +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libindicator_datetime_la_CFLAGS) $(CFLAGS) -c -o libindicator_datetime_la-utils.lo `test -f 'utils.c' || echo '$(srcdir)/'`utils.c indicator_datetime_service-datetime-interface.o: datetime-interface.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_datetime_service_CFLAGS) $(CFLAGS) -MT indicator_datetime_service-datetime-interface.o -MD -MP -MF $(DEPDIR)/indicator_datetime_service-datetime-interface.Tpo -c -o indicator_datetime_service-datetime-interface.o `test -f 'datetime-interface.c' || echo '$(srcdir)/'`datetime-interface.c @@ -835,7 +795,7 @@ check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) installdirs: - for dir in "$(DESTDIR)$(datetimelibdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)"; do \ + for dir in "$(DESTDIR)$(ccpaneldir)" "$(DESTDIR)$(datetimelibdir)" "$(DESTDIR)$(libexecdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) @@ -868,8 +828,9 @@ maintainer-clean-generic: -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am -clean-am: clean-binPROGRAMS clean-datetimelibLTLIBRARIES clean-generic \ - clean-libexecPROGRAMS clean-libtool mostlyclean-am +clean-am: clean-ccpanelLTLIBRARIES clean-datetimelibLTLIBRARIES \ + clean-generic clean-libexecPROGRAMS clean-libtool \ + mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) @@ -889,13 +850,14 @@ info: info-am info-am: -install-data-am: install-datetimelibLTLIBRARIES +install-data-am: install-ccpanelLTLIBRARIES \ + install-datetimelibLTLIBRARIES install-dvi: install-dvi-am install-dvi-am: -install-exec-am: install-binPROGRAMS install-libexecPROGRAMS +install-exec-am: install-libexecPROGRAMS install-html: install-html-am @@ -935,26 +897,27 @@ ps: ps-am ps-am: -uninstall-am: uninstall-binPROGRAMS uninstall-datetimelibLTLIBRARIES \ - uninstall-libexecPROGRAMS +uninstall-am: uninstall-ccpanelLTLIBRARIES \ + uninstall-datetimelibLTLIBRARIES uninstall-libexecPROGRAMS .MAKE: all check install install-am install-strip -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ - clean-datetimelibLTLIBRARIES clean-generic \ - clean-libexecPROGRAMS clean-libtool ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-binPROGRAMS install-data \ - install-data-am install-datetimelibLTLIBRARIES install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am \ - install-libexecPROGRAMS 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 mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-binPROGRAMS \ +.PHONY: CTAGS GTAGS all all-am check check-am clean \ + clean-ccpanelLTLIBRARIES clean-datetimelibLTLIBRARIES \ + clean-generic clean-libexecPROGRAMS clean-libtool ctags \ + distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am \ + install-ccpanelLTLIBRARIES install-data install-data-am \ + install-datetimelibLTLIBRARIES install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-libexecPROGRAMS \ + 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 \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-ccpanelLTLIBRARIES \ uninstall-datetimelibLTLIBRARIES uninstall-libexecPROGRAMS diff --git a/src/datetime-prefs.c b/src/datetime-prefs.c index 85068c7..bed5ff1 100644 --- a/src/datetime-prefs.c +++ b/src/datetime-prefs.c @@ -34,6 +34,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #include <gtk/gtk.h> #include <unique/unique.h> #include <polkit/polkit.h> +#include <libgnome-control-center/cc-panel.h> #include "dbus-shared.h" #include "settings-shared.h" @@ -44,16 +45,40 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #define DATETIME_DIALOG_UI_FILE PKGDATADIR "/datetime-dialog.ui" -GDBusProxy * proxy = NULL; -GtkWidget * auto_radio = NULL; -GtkWidget * tz_entry = NULL; -CcTimezoneMap * tzmap = NULL; -GtkWidget * time_spin = NULL; -GtkWidget * date_spin = NULL; -guint save_time_id = 0; -gboolean user_edited_time = FALSE; -gboolean changing_time = FALSE; -GtkWidget * loc_dlg = NULL; +#define INDICATOR_DATETIME_TYPE_PANEL indicator_datetime_panel_get_type() + +typedef struct _IndicatorDatetimePanel IndicatorDatetimePanel; +typedef struct _IndicatorDatetimePanelPrivate IndicatorDatetimePanelPrivate; +typedef struct _IndicatorDatetimePanelClass IndicatorDatetimePanelClass; + +struct _IndicatorDatetimePanel +{ + CcPanel parent; + IndicatorDatetimePanelPrivate * priv; +}; + +struct _IndicatorDatetimePanelPrivate +{ + GtkBuilder * builder; + GDBusProxy * proxy; + GtkWidget * auto_radio; + GtkWidget * tz_entry; + CcTimezoneMap * tzmap; + GtkWidget * time_spin; + GtkWidget * date_spin; + guint save_time_id; + gboolean user_edited_time; + gboolean changing_time; + GtkWidget * loc_dlg; + TimezoneCompletion * completion; +}; + +struct _IndicatorDatetimePanelClass +{ + CcPanelClass parent_class; +}; + +G_DEFINE_DYNAMIC_TYPE (IndicatorDatetimePanel, indicator_datetime_panel, CC_TYPE_PANEL) /* Turns the boolean property into a string gsettings */ static GVariant * @@ -164,7 +189,7 @@ static void dbus_set_answered (GObject *object, GAsyncResult *res, gpointer command) { GError * error = NULL; - GVariant * answers = g_dbus_proxy_call_finish (proxy, res, &error); + GVariant * answers = g_dbus_proxy_call_finish (G_DBUS_PROXY (object), res, &error); if (error != NULL) { g_warning("Could not set '%s' for SettingsDaemon: %s", (gchar *)command, error->message); @@ -176,19 +201,19 @@ dbus_set_answered (GObject *object, GAsyncResult *res, gpointer command) } static void -toggle_ntp (GtkWidget * radio, GParamSpec * pspec, gpointer user_data) +toggle_ntp (GtkWidget * radio, GParamSpec * pspec, IndicatorDatetimePanel * self) { gboolean active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (radio)); - g_dbus_proxy_call (proxy, "SetUsingNtp", g_variant_new ("(b)", active), + g_dbus_proxy_call (self->priv->proxy, "SetUsingNtp", g_variant_new ("(b)", active), G_DBUS_CALL_FLAGS_NONE, -1, NULL, dbus_set_answered, "using_ntp"); } static void -ntp_query_answered (GObject *object, GAsyncResult *res, gpointer user_data) +ntp_query_answered (GObject *object, GAsyncResult *res, IndicatorDatetimePanel * self) { GError * error = NULL; - GVariant * answers = g_dbus_proxy_call_finish (proxy, res, &error); + GVariant * answers = g_dbus_proxy_call_finish (G_DBUS_PROXY (object), res, &error); if (error != NULL) { g_warning("Could not query DBus proxy for SettingsDaemon: %s", error->message); @@ -199,43 +224,42 @@ ntp_query_answered (GObject *object, GAsyncResult *res, gpointer user_data) gboolean can_use_ntp, is_using_ntp; g_variant_get (answers, "(bb)", &can_use_ntp, &is_using_ntp); - gtk_widget_set_sensitive (GTK_WIDGET (auto_radio), can_use_ntp); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (auto_radio), is_using_ntp); + gtk_widget_set_sensitive (GTK_WIDGET (self->priv->auto_radio), can_use_ntp); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (self->priv->auto_radio), is_using_ntp); - g_signal_connect (auto_radio, "notify::active", G_CALLBACK (toggle_ntp), NULL); + g_signal_connect (self->priv->auto_radio, "notify::active", G_CALLBACK (toggle_ntp), self); g_variant_unref (answers); } static void -sync_entry (const gchar * location) +sync_entry (IndicatorDatetimePanel * self, const gchar * location) { gchar * name = get_current_zone_name (location); - gtk_entry_set_text (GTK_ENTRY (tz_entry), name); + gtk_entry_set_text (GTK_ENTRY (self->priv->tz_entry), name); g_free (name); - gtk_entry_set_icon_from_stock (GTK_ENTRY (tz_entry), GTK_ENTRY_ICON_SECONDARY, NULL); + gtk_entry_set_icon_from_stock (GTK_ENTRY (self->priv->tz_entry), + GTK_ENTRY_ICON_SECONDARY, NULL); } static void -tz_changed (CcTimezoneMap * map, TzLocation * location) +tz_changed (CcTimezoneMap * map, TzLocation * location, IndicatorDatetimePanel * self) { if (location == NULL) return; - gchar * file = g_build_filename ("/usr/share/zoneinfo", location->zone, NULL); - g_dbus_proxy_call (proxy, "SetTimezone", g_variant_new ("(s)", file), + g_dbus_proxy_call (self->priv->proxy, "SetTimezone", g_variant_new ("(s)", location->zone), G_DBUS_CALL_FLAGS_NONE, -1, NULL, dbus_set_answered, "timezone"); - g_free (file); - sync_entry (location->zone); + sync_entry (self, location->zone); } static void -tz_query_answered (GObject *object, GAsyncResult *res, gpointer user_data) +tz_query_answered (GObject *object, GAsyncResult *res, IndicatorDatetimePanel * self) { GError * error = NULL; - GVariant * answers = g_dbus_proxy_call_finish (proxy, res, &error); + GVariant * answers = g_dbus_proxy_call_finish (G_DBUS_PROXY (object), res, &error); if (error != NULL) { g_warning("Could not query DBus proxy for SettingsDaemon: %s", error->message); @@ -246,20 +270,20 @@ tz_query_answered (GObject *object, GAsyncResult *res, gpointer user_data) const gchar * timezone; g_variant_get (answers, "(&s)", &timezone); - cc_timezone_map_set_timezone (tzmap, timezone); + cc_timezone_map_set_timezone (self->priv->tzmap, timezone); - sync_entry (timezone); - g_signal_connect (tzmap, "location-changed", G_CALLBACK (tz_changed), NULL); + sync_entry (self, timezone); + g_signal_connect (self->priv->tzmap, "location-changed", G_CALLBACK (tz_changed), self); g_variant_unref (answers); } static void -proxy_ready (GObject *object, GAsyncResult *res, gpointer user_data) +proxy_ready (GObject *object, GAsyncResult *res, IndicatorDatetimePanel * self) { GError * error = NULL; - proxy = g_dbus_proxy_new_for_bus_finish (res, &error); + self->priv->proxy = g_dbus_proxy_new_for_bus_finish (res, &error); if (error != NULL) { g_critical("Could not grab DBus proxy for SettingsDaemon: %s", error->message); @@ -268,10 +292,10 @@ proxy_ready (GObject *object, GAsyncResult *res, gpointer user_data) } /* And now, do initial proxy configuration */ - g_dbus_proxy_call (proxy, "GetUsingNtp", NULL, G_DBUS_CALL_FLAGS_NONE, -1, - NULL, ntp_query_answered, auto_radio); - g_dbus_proxy_call (proxy, "GetTimezone", NULL, G_DBUS_CALL_FLAGS_NONE, -1, - NULL, tz_query_answered, NULL); + g_dbus_proxy_call (self->priv->proxy, "GetUsingNtp", NULL, G_DBUS_CALL_FLAGS_NONE, -1, + NULL, (GAsyncReadyCallback)ntp_query_answered, self); + g_dbus_proxy_call (self->priv->proxy, "GetTimezone", NULL, G_DBUS_CALL_FLAGS_NONE, -1, + NULL, (GAsyncReadyCallback)tz_query_answered, self); } static void @@ -290,7 +314,7 @@ service_proxy_ready (GObject *object, GAsyncResult *res, gpointer user_data) { GError * error = NULL; - proxy = g_dbus_proxy_new_for_bus_finish (res, &error); + GDBusProxy * proxy = g_dbus_proxy_new_for_bus_finish (res, &error); if (error != NULL) { g_critical("Could not grab DBus proxy for indicator-datetime-service: %s", error->message); @@ -304,51 +328,53 @@ service_proxy_ready (GObject *object, GAsyncResult *res, gpointer user_data) } static gboolean -are_spinners_focused (void) +are_spinners_focused (IndicatorDatetimePanel * self) { // save_time_id means that we were in focus and haven't finished our save // yet, so act like we are still focused. - return save_time_id || gtk_widget_has_focus (time_spin) || gtk_widget_has_focus (date_spin); + return self->priv->save_time_id || + gtk_widget_has_focus (self->priv->time_spin) || + gtk_widget_has_focus (self->priv->date_spin); } static gboolean -save_time (gpointer user_data) +save_time (IndicatorDatetimePanel * self) { - if (user_edited_time) { - gdouble current_value = gtk_spin_button_get_value (GTK_SPIN_BUTTON (date_spin)); - g_dbus_proxy_call (proxy, "SetTime", g_variant_new ("(x)", (guint64)current_value), + if (self->priv->user_edited_time) { + gdouble current_value = gtk_spin_button_get_value (GTK_SPIN_BUTTON (self->priv->date_spin)); + g_dbus_proxy_call (self->priv->proxy, "SetTime", g_variant_new ("(x)", (guint64)current_value), G_DBUS_CALL_FLAGS_NONE, -1, NULL, dbus_set_answered, "time"); } - user_edited_time = FALSE; - save_time_id = 0; + self->priv->user_edited_time = FALSE; + self->priv->save_time_id = 0; return FALSE; } static gboolean -spin_focus_in (void) +spin_focus_in (IndicatorDatetimePanel * self) { - if (save_time_id > 0) { - g_source_remove (save_time_id); - save_time_id = 0; + if (self->priv->save_time_id > 0) { + g_source_remove (self->priv->save_time_id); + self->priv->save_time_id = 0; } return FALSE; } static gboolean -spin_focus_out (void) +spin_focus_out (IndicatorDatetimePanel * self) { /* We want to only save when both spinners are unfocused. But it's difficult to tell who is about to get focus during a focus-out. So we set an idle callback to save the time if we don't focus in to another spinner by that time. */ - if (save_time_id == 0) { - save_time_id = g_idle_add ((GSourceFunc)save_time, NULL); + if (self->priv->save_time_id == 0) { + self->priv->save_time_id = g_idle_add ((GSourceFunc)save_time, self); } return FALSE; } static int -input_time_text (GtkWidget * spinner, gdouble * value, gpointer user_data) +input_time_text (GtkWidget * spinner, gdouble * value, IndicatorDatetimePanel * self) { gboolean is_time = (gboolean)GPOINTER_TO_INT (g_object_get_data (G_OBJECT (spinner), "is-time")); const gchar * text = gtk_entry_get_text (GTK_ENTRY (spinner)); @@ -427,13 +453,13 @@ input_time_text (GtkWidget * spinner, gdouble * value, gpointer user_data) return TRUE; } - gboolean prev_changing = changing_time; - changing_time = TRUE; + gboolean prev_changing = self->priv->changing_time; + self->priv->changing_time = TRUE; GDateTime * new_time = g_date_time_new_local (year, month, day, hour, minute, second); *value = g_date_time_to_unix (new_time); - user_edited_time = TRUE; + self->priv->user_edited_time = TRUE; g_date_time_unref (new_time); - changing_time = prev_changing; + self->priv->changing_time = prev_changing; return TRUE; } @@ -464,89 +490,98 @@ format_time_text (GtkWidget * spinner, gpointer user_data) } static void -spin_copy_value (GtkSpinButton * spinner, GtkSpinButton * other) +spin_copy_value (GtkSpinButton * spinner, IndicatorDatetimePanel * self) { + GtkSpinButton * other = NULL; + if (GTK_WIDGET (spinner) == self->priv->date_spin) + other = GTK_SPIN_BUTTON (self->priv->time_spin); + else + other = GTK_SPIN_BUTTON (self->priv->date_spin); + if (gtk_spin_button_get_value (spinner) != gtk_spin_button_get_value (other)) { gtk_spin_button_set_value (other, gtk_spin_button_get_value (spinner)); } - if (!changing_time) { /* Means user pressed spin buttons */ - user_edited_time = TRUE; + if (!self->priv->changing_time) { /* Means user pressed spin buttons */ + self->priv->user_edited_time = TRUE; } } static gboolean -update_spinners (void) +update_spinners (IndicatorDatetimePanel * self) { /* Add datetime object to spinner, which will hold the real time value, rather then using the value of the spinner itself. And don't update while user is editing. */ - if (!are_spinners_focused ()) { - gboolean prev_changing = changing_time; - changing_time = TRUE; + if (!are_spinners_focused (self)) { + gboolean prev_changing = self->priv->changing_time; + self->priv->changing_time = TRUE; GDateTime * now = g_date_time_new_now_local (); - gtk_spin_button_set_value (GTK_SPIN_BUTTON (time_spin), (gdouble)g_date_time_to_unix (now)); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (self->priv->time_spin), + (gdouble)g_date_time_to_unix (now)); /* will be copied to other spin button */ g_date_time_unref (now); - changing_time = prev_changing; + self->priv->changing_time = prev_changing; } return TRUE; } static void -setup_time_spinners (GtkWidget * time, GtkWidget * date) +setup_time_spinners (IndicatorDatetimePanel * self, GtkWidget * time, GtkWidget * date) { - g_signal_connect (time, "input", G_CALLBACK (input_time_text), date); - g_signal_connect (date, "input", G_CALLBACK (input_time_text), time); + g_signal_connect (time, "input", G_CALLBACK (input_time_text), self); + g_signal_connect (date, "input", G_CALLBACK (input_time_text), self); g_signal_connect (time, "output", G_CALLBACK (format_time_text), date); g_signal_connect (date, "output", G_CALLBACK (format_time_text), time); - g_signal_connect (time, "focus-in-event", G_CALLBACK (spin_focus_in), date); - g_signal_connect (date, "focus-in-event", G_CALLBACK (spin_focus_in), time); + g_signal_connect_swapped (time, "focus-in-event", G_CALLBACK (spin_focus_in), self); + g_signal_connect_swapped (date, "focus-in-event", G_CALLBACK (spin_focus_in), self); - g_signal_connect (time, "focus-out-event", G_CALLBACK (spin_focus_out), date); - g_signal_connect (date, "focus-out-event", G_CALLBACK (spin_focus_out), time); + g_signal_connect_swapped (time, "focus-out-event", G_CALLBACK (spin_focus_out), self); + g_signal_connect_swapped (date, "focus-out-event", G_CALLBACK (spin_focus_out), self); - g_signal_connect (time, "value-changed", G_CALLBACK (spin_copy_value), date); - g_signal_connect (date, "value-changed", G_CALLBACK (spin_copy_value), time); + g_signal_connect (time, "value-changed", G_CALLBACK (spin_copy_value), self); + g_signal_connect (date, "value-changed", G_CALLBACK (spin_copy_value), self); g_object_set_data (G_OBJECT (time), "is-time", GINT_TO_POINTER (TRUE)); g_object_set_data (G_OBJECT (date), "is-time", GINT_TO_POINTER (FALSE)); - time_spin = time; - date_spin = date; + self->priv->time_spin = time; + self->priv->date_spin = date; /* 2 seconds is what the indicator itself uses */ - guint time_id = g_timeout_add_seconds (2, (GSourceFunc)update_spinners, NULL); - g_signal_connect_swapped (time_spin, "destroy", G_CALLBACK (g_source_remove), GINT_TO_POINTER (time_id)); - update_spinners (); + guint time_id = g_timeout_add_seconds (2, (GSourceFunc)update_spinners, self); + g_signal_connect_swapped (self->priv->time_spin, "destroy", + G_CALLBACK (g_source_remove), GINT_TO_POINTER (time_id)); + update_spinners (self); } static void -hide_locations () +hide_locations (IndicatorDatetimePanel * self) { - if (loc_dlg != NULL) - gtk_widget_destroy (loc_dlg); + if (self->priv->loc_dlg != NULL) + gtk_widget_destroy (self->priv->loc_dlg); } static void -show_locations (GtkWidget * button, GtkWidget * dlg) -{ - if (loc_dlg == NULL) { - loc_dlg = datetime_setup_locations_dialog (tzmap); - gtk_window_set_transient_for (GTK_WINDOW (loc_dlg), GTK_WINDOW (dlg)); - g_signal_connect (loc_dlg, "destroy", G_CALLBACK (gtk_widget_destroyed), &loc_dlg); - g_signal_connect (dlg, "focus-in-event", G_CALLBACK (hide_locations), NULL); - gtk_widget_show_all (loc_dlg); +show_locations (IndicatorDatetimePanel * self) +{ + if (self->priv->loc_dlg == NULL) { + self->priv->loc_dlg = datetime_setup_locations_dialog (self->priv->tzmap); + GtkWidget * dlg = gtk_widget_get_toplevel (GTK_WIDGET (self)); + gtk_window_set_transient_for (GTK_WINDOW (self->priv->loc_dlg), GTK_WINDOW (dlg)); + g_signal_connect (self->priv->loc_dlg, "destroy", G_CALLBACK (gtk_widget_destroyed), &self->priv->loc_dlg); + g_signal_connect_swapped (dlg, "focus-in-event", G_CALLBACK (hide_locations), self); + gtk_widget_show_all (self->priv->loc_dlg); } else { - gtk_window_present_with_time (GTK_WINDOW (loc_dlg), gtk_get_current_event_time ()); + gtk_window_present_with_time (GTK_WINDOW (self->priv->loc_dlg), gtk_get_current_event_time ()); } } static gboolean timezone_selected (GtkEntryCompletion * widget, GtkTreeModel * model, - GtkTreeIter * iter, gpointer user_data) + GtkTreeIter * iter, IndicatorDatetimePanel * self) { const gchar * name, * zone; @@ -572,7 +607,7 @@ timezone_selected (GtkEntryCompletion * widget, GtkTreeModel * model, lat = strtod(strlat, NULL); } - zone = cc_timezone_map_get_timezone_at_coords (tzmap, lon, lat); + zone = cc_timezone_map_get_timezone_at_coords (self->priv->tzmap, lon, lat); } GSettings * conf = g_settings_new (SETTINGS_INTERFACE); @@ -581,18 +616,18 @@ timezone_selected (GtkEntryCompletion * widget, GtkTreeModel * model, g_free (tz_name); g_object_unref (conf); - cc_timezone_map_set_timezone (tzmap, zone); + cc_timezone_map_set_timezone (self->priv->tzmap, zone); return FALSE; // Do normal action too } static gboolean -entry_focus_out (GtkEntry * entry, GdkEventFocus * event) +entry_focus_out (GtkEntry * entry, GdkEventFocus * event, IndicatorDatetimePanel * self) { // If the name left in the entry doesn't match the current timezone name, // show an error icon. It's always an error for the user to manually type in // a timezone. - TzLocation * location = cc_timezone_map_get_location (tzmap); + TzLocation * location = cc_timezone_map_get_location (self->priv->tzmap); if (location == NULL) return FALSE; @@ -608,36 +643,29 @@ entry_focus_out (GtkEntry * entry, GdkEventFocus * event) return FALSE; } -static gboolean -key_pressed (GtkWidget * widget, GdkEventKey * event, gpointer user_data) +static void +indicator_datetime_panel_init (IndicatorDatetimePanel * self) { - switch (event->keyval) { - case GDK_KEY_Escape: - gtk_widget_destroy (widget); - return TRUE; - } - return FALSE; -} + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, + INDICATOR_DATETIME_TYPE_PANEL, + IndicatorDatetimePanelPrivate); -static GtkWidget * -create_dialog (void) -{ GError * error = NULL; - GtkBuilder * builder = gtk_builder_new (); - gtk_builder_add_from_file (builder, DATETIME_DIALOG_UI_FILE, &error); + self->priv->builder = gtk_builder_new (); + gtk_builder_add_from_file (self->priv->builder, DATETIME_DIALOG_UI_FILE, &error); if (error != NULL) { /* We have to abort, we can't continue without the ui file */ g_error ("Could not load ui file %s: %s", DATETIME_DIALOG_UI_FILE, error->message); g_error_free (error); - return NULL; + return; } - gtk_builder_set_translation_domain (builder, GETTEXT_PACKAGE); + gtk_builder_set_translation_domain (self->priv->builder, GETTEXT_PACKAGE); GSettings * conf = g_settings_new (SETTINGS_INTERFACE); -#define WIG(name) GTK_WIDGET (gtk_builder_get_object (builder, name)) +#define WIG(name) GTK_WIDGET (gtk_builder_get_object (self->priv->builder, name)) /* Add policykit button */ GtkWidget * polkit_button = gtk_lock_button_new (NULL); @@ -653,16 +681,16 @@ create_dialog (void) polkit_permission_new (polkit_name, NULL, NULL, polkit_perm_ready, polkit_button); /* Add map */ - tzmap = cc_timezone_map_new (); - gtk_container_add (GTK_CONTAINER (WIG ("mapBox")), GTK_WIDGET (tzmap)); + self->priv->tzmap = cc_timezone_map_new (); + gtk_container_add (GTK_CONTAINER (WIG ("mapBox")), GTK_WIDGET (self->priv->tzmap)); /* Fufill the CC by Attribution license requirements for the Geonames lookup */ - cc_timezone_map_set_watermark (tzmap, "Geonames.org"); + cc_timezone_map_set_watermark (self->priv->tzmap, "Geonames.org"); /* And completion entry */ - TimezoneCompletion * completion = timezone_completion_new (); - timezone_completion_watch_entry (completion, GTK_ENTRY (WIG ("timezoneEntry"))); - g_signal_connect (completion, "match-selected", G_CALLBACK (timezone_selected), NULL); - g_signal_connect (WIG ("timezoneEntry"), "focus-out-event", G_CALLBACK (entry_focus_out), NULL); + self->priv->completion = timezone_completion_new (); + timezone_completion_watch_entry (self->priv->completion, GTK_ENTRY (WIG ("timezoneEntry"))); + g_signal_connect (self->priv->completion, "match-selected", G_CALLBACK (timezone_selected), self); + g_signal_connect (WIG ("timezoneEntry"), "focus-out-event", G_CALLBACK (entry_focus_out), self); /* Set up settings bindings */ g_settings_bind (conf, SETTINGS_SHOW_CLOCK_S, WIG ("showClockCheck"), @@ -704,21 +732,20 @@ create_dialog (void) gtk_widget_set_sensitive (WIG ("showEventsCheck"), (evo_path != NULL)); g_free (evo_path); - setup_time_spinners (WIG ("timeSpinner"), WIG ("dateSpinner")); + setup_time_spinners (self, WIG ("timeSpinner"), WIG ("dateSpinner")); - GtkWidget * dlg = WIG ("timeDateDialog"); - auto_radio = WIG ("automaticTimeRadio"); - tz_entry = WIG ("timezoneEntry"); + GtkWidget * panel = WIG ("timeDatePanel"); + self->priv->auto_radio = WIG ("automaticTimeRadio"); + self->priv->tz_entry = WIG ("timezoneEntry"); - g_signal_connect (WIG ("locationsButton"), "clicked", G_CALLBACK (show_locations), dlg); - g_signal_connect (dlg, "key-press-event", G_CALLBACK (key_pressed), NULL); + g_signal_connect_swapped (WIG ("locationsButton"), "clicked", G_CALLBACK (show_locations), self); /* Grab proxy for settings daemon */ g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM, G_DBUS_PROXY_FLAGS_NONE, NULL, "org.gnome.SettingsDaemon.DateTimeMechanism", "/", "org.gnome.SettingsDaemon.DateTimeMechanism", - NULL, proxy_ready, NULL); + NULL, (GAsyncReadyCallback)proxy_ready, self); /* Grab proxy for datetime service, to see if it's running. It would actually be more ideal to see if the indicator module itself is running, @@ -727,56 +754,92 @@ create_dialog (void) us if there *was* a datetime module run this session. */ g_dbus_proxy_new_for_bus (G_BUS_TYPE_SESSION, G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, NULL, SERVICE_NAME, SERVICE_OBJ, SERVICE_IFACE, - NULL, service_proxy_ready, WIG ("showClockCheck")); + NULL, (GAsyncReadyCallback)service_proxy_ready, + WIG ("showClockCheck")); #undef WIG g_object_unref (conf); - g_object_unref (builder); - return dlg; + gtk_widget_show_all (panel); + gtk_container_add (GTK_CONTAINER (self), panel); } -static UniqueResponse -message_received (UniqueApp * app, gint command, UniqueMessageData *message_data, - guint time, gpointer user_data) +static void +indicator_datetime_panel_dispose (GObject * object) { - if (command == UNIQUE_ACTIVATE) { - gtk_window_present_with_time (GTK_WINDOW (user_data), time); - return UNIQUE_RESPONSE_OK; + IndicatorDatetimePanel * self = (IndicatorDatetimePanel *) object; + + if (self->priv->builder) { + g_object_unref (self->priv->builder); + self->priv->builder = NULL; } - return UNIQUE_RESPONSE_PASSTHROUGH; -} -int -main (int argc, char ** argv) -{ - g_type_init (); + if (self->priv->proxy) { + g_object_unref (self->priv->proxy); + self->priv->proxy = NULL; + } - /* Setting up i18n and gettext. Apparently, we need - all of these. */ - setlocale (LC_ALL, ""); - bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); - textdomain (GETTEXT_PACKAGE); + if (self->priv->loc_dlg) { + gtk_widget_destroy (self->priv->loc_dlg); + self->priv->loc_dlg = NULL; + } - gtk_init (&argc, &argv); + if (self->priv->save_time_id) { + g_source_remove (self->priv->save_time_id); + self->priv->save_time_id = 0; + } - UniqueApp * app = unique_app_new ("com.canonical.indicator.datetime.preferences", NULL); + if (self->priv->completion) { + timezone_completion_watch_entry (self->priv->completion, NULL); + g_object_unref (self->priv->completion); + self->priv->completion = NULL; + } - if (unique_app_is_running (app)) { - unique_app_send_message (app, UNIQUE_ACTIVATE, NULL); - } else { - // We're first instance. Yay! - GtkWidget * dlg = create_dialog (); + if (self->priv->tz_entry) { + gtk_widget_destroy (self->priv->tz_entry); + self->priv->tz_entry = NULL; + } - g_signal_connect (app, "message-received", G_CALLBACK(message_received), dlg); - unique_app_watch_window (app, GTK_WINDOW (dlg)); + if (self->priv->time_spin) { + gtk_widget_destroy (self->priv->time_spin); + self->priv->time_spin = NULL; + } - gtk_widget_show_all (dlg); - g_signal_connect (dlg, "destroy", G_CALLBACK(gtk_main_quit), NULL); - gtk_main (); + if (self->priv->date_spin) { + gtk_widget_destroy (self->priv->date_spin); + self->priv->date_spin = NULL; } +} - return 0; +static void +indicator_datetime_panel_class_finalize (IndicatorDatetimePanelClass *klass) +{ } +static void +indicator_datetime_panel_class_init (IndicatorDatetimePanelClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (klass, sizeof (IndicatorDatetimePanelPrivate)); + + gobject_class->dispose = indicator_datetime_panel_dispose; +} + +void +g_io_module_load (GIOModule *module) +{ + bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); + + indicator_datetime_panel_register_type (G_TYPE_MODULE (module)); + g_io_extension_point_implement (CC_SHELL_PANEL_EXTENSION_POINT, + INDICATOR_DATETIME_TYPE_PANEL, + "indicator-datetime", 0); +} + +void +g_io_module_unload (GIOModule *module) +{ +} diff --git a/src/datetime-service.c b/src/datetime-service.c index 08ff9ad..6c876aa 100644 --- a/src/datetime-service.c +++ b/src/datetime-service.c @@ -30,7 +30,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #include <math.h> #include <gconf/gconf-client.h> -#include <libdbusmenu-gtk/menuitem.h> +#include <libdbusmenu-gtk3/menuitem.h> #include <libdbusmenu-glib/server.h> #include <libdbusmenu-glib/client.h> #include <libdbusmenu-glib/menuitem.h> @@ -221,29 +221,15 @@ update_current_timezone (void) { current_timezone = NULL; } - GError * error = NULL; - gchar * tempzone = NULL; - if (!g_file_get_contents(TIMEZONE_FILE, &tempzone, NULL, &error)) { - g_warning("Unable to read timezone file '" TIMEZONE_FILE "': %s", error->message); - g_error_free(error); + current_timezone = read_timezone (); + if (current_timezone == NULL) { return; } - /* This shouldn't happen, so let's make it a big boom! */ - g_return_if_fail(tempzone != NULL); - - /* Note: this really makes sense as strstrip works in place - so we end up with something a little odd without the dup - so we have the dup to make sure everything is as expected - for everyone else. */ - current_timezone = g_strdup(g_strstrip(tempzone)); - g_free(tempzone); - g_debug("System timezone is: %s", current_timezone); check_timezone_sync(); - if (error != NULL) g_error_free(error); return; } @@ -276,10 +262,8 @@ quick_set_tz_proxy_cb (GObject *object, GAsyncResult *res, gpointer zone) return; } - gchar * file = g_build_filename ("/usr/share/zoneinfo", (char *)zone, NULL); - g_dbus_proxy_call (proxy, "SetTimezone", g_variant_new ("(s)", file), + g_dbus_proxy_call (proxy, "SetTimezone", g_variant_new ("(s)", zone), G_DBUS_CALL_FLAGS_NONE, -1, NULL, quick_set_tz_cb, NULL); - g_free (file); g_free (zone); g_object_unref (proxy); } @@ -1040,13 +1024,13 @@ check_for_timeadmin (gpointer user_data) { g_return_val_if_fail (settings != NULL, FALSE); - gchar * timeadmin = g_find_program_in_path("indicator-datetime-preferences"); + gchar * timeadmin = g_find_program_in_path("gnome-control-center"); if (timeadmin != NULL) { - g_debug("Found the indicator-datetime-preferences application: %s", timeadmin); + g_debug("Found the gnome-control-center application: %s", timeadmin); dbusmenu_menuitem_property_set_bool(settings, DBUSMENU_MENUITEM_PROP_ENABLED, TRUE); g_free(timeadmin); } else { - g_debug("Unable to find indicator-datetime-preferences app."); + g_debug("Unable to find gnome-control-center app."); dbusmenu_menuitem_property_set_bool(settings, DBUSMENU_MENUITEM_PROP_ENABLED, FALSE); } @@ -1129,7 +1113,7 @@ build_menus (DbusmenuMenuitem * root) dbusmenu_menuitem_property_set (settings, DBUSMENU_MENUITEM_PROP_LABEL, _("Time & Date Settings...")); /* insensitive until we check for available apps */ dbusmenu_menuitem_property_set_bool(settings, DBUSMENU_MENUITEM_PROP_ENABLED, FALSE); - g_signal_connect(G_OBJECT(settings), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(activate_cb), "indicator-datetime-preferences"); + g_signal_connect(G_OBJECT(settings), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(activate_cb), "gnome-control-center indicator-datetime"); dbusmenu_menuitem_child_append(root, settings); g_idle_add(check_for_timeadmin, NULL); diff --git a/src/indicator-datetime.c b/src/indicator-datetime.c index 800fa87..072253b 100644 --- a/src/indicator-datetime.c +++ b/src/indicator-datetime.c @@ -41,9 +41,9 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #include <libindicator/indicator-service-manager.h> /* DBusMenu */ -#include <libdbusmenu-gtk/menu.h> +#include <libdbusmenu-gtk3/menu.h> #include <libido/libido.h> -#include <libdbusmenu-gtk/menuitem.h> +#include <libdbusmenu-gtk3/menuitem.h> #include "utils.h" #include "dbus-shared.h" @@ -761,11 +761,18 @@ set_label_to_time_in_zone (IndicatorDatetime * self, GtkLabel * label, GTimeZone * tz, const gchar * format, GDateTime ** datetime) { + gboolean unref_tz = FALSE; + if (tz == NULL) { + gchar * zone = read_timezone (); + if (zone == NULL) + return; + tz = g_time_zone_new(zone); + unref_tz = TRUE; + g_free (zone); + } + GDateTime * datetime_now; - if (tz == NULL) - datetime_now = g_date_time_new_now_local(); - else - datetime_now = g_date_time_new_now(tz); + datetime_now = g_date_time_new_now(tz); gchar * timestr; if (format == NULL) { @@ -793,6 +800,9 @@ set_label_to_time_in_zone (IndicatorDatetime * self, GtkLabel * label, else g_date_time_unref(datetime_now); + if (unref_tz) + g_time_zone_unref(tz); + return; } diff --git a/src/timezone-completion.c b/src/timezone-completion.c index 6ba1e88..d190035 100644 --- a/src/timezone-completion.c +++ b/src/timezone-completion.c @@ -492,21 +492,26 @@ timezone_completion_watch_entry (TimezoneCompletion * completion, GtkEntry * ent } if (priv->entry) { g_signal_handler_disconnect (priv->entry, priv->changed_id); + priv->changed_id = 0; g_signal_handler_disconnect (priv->entry, priv->keypress_id); + priv->keypress_id = 0; g_object_remove_weak_pointer (G_OBJECT (priv->entry), (gpointer *)&priv->entry); gtk_entry_set_completion (priv->entry, NULL); } - guint id = g_signal_connect (entry, "changed", G_CALLBACK (entry_changed), completion); - priv->changed_id = id; + priv->entry = entry; - id = g_signal_connect (entry, "key-press-event", G_CALLBACK (entry_keypress), completion); - priv->keypress_id = id; + if (entry) { + guint id = g_signal_connect (entry, "changed", G_CALLBACK (entry_changed), completion); + priv->changed_id = id; - priv->entry = entry; - g_object_add_weak_pointer (G_OBJECT (entry), (gpointer *)&priv->entry); + id = g_signal_connect (entry, "key-press-event", G_CALLBACK (entry_keypress), completion); + priv->keypress_id = id; - gtk_entry_set_completion (entry, GTK_ENTRY_COMPLETION (completion)); + g_object_add_weak_pointer (G_OBJECT (entry), (gpointer *)&priv->entry); + + gtk_entry_set_completion (entry, GTK_ENTRY_COMPLETION (completion)); + } } static GtkListStore * @@ -640,7 +645,9 @@ timezone_completion_dispose (GObject * object) } if (priv->entry != NULL) { + gtk_entry_set_completion (priv->entry, NULL); g_object_remove_weak_pointer (G_OBJECT (priv->entry), (gpointer *)&priv->entry); + priv->entry = NULL; } if (priv->initial_model != NULL) { diff --git a/src/utils.c b/src/utils.c index ab93ecf..73c8ab2 100644 --- a/src/utils.c +++ b/src/utils.c @@ -117,6 +117,30 @@ get_current_zone_name (const gchar * location) return rv; } +gchar * +read_timezone () +{ + GError * error = NULL; + gchar * tempzone = NULL; + if (!g_file_get_contents(TIMEZONE_FILE, &tempzone, NULL, &error)) { + g_warning("Unable to read timezone file '" TIMEZONE_FILE "': %s", error->message); + g_error_free(error); + return NULL; + } + + /* This shouldn't happen, so let's make it a big boom! */ + g_return_val_if_fail(tempzone != NULL, NULL); + + /* Note: this really makes sense as strstrip works in place + so we end up with something a little odd without the dup + so we have the dup to make sure everything is as expected + for everyone else. */ + gchar * rv = g_strdup(g_strstrip(tempzone)); + g_free(tempzone); + + return rv; +} + /* Translate msg according to the locale specified by LC_TIME */ static char * T_(const char *msg) diff --git a/src/utils.h b/src/utils.h index c2bc0c5..788d516 100644 --- a/src/utils.h +++ b/src/utils.h @@ -30,6 +30,7 @@ G_BEGIN_DECLS gboolean is_locale_12h (void); void split_settings_location (const gchar * location, gchar ** zone, gchar ** name); gchar * get_current_zone_name (const gchar * location); +gchar * read_timezone (); gchar * generate_format_string_full (gboolean show_day, gboolean show_date); gchar * generate_format_string_at_time (GDateTime * time); diff --git a/tests/Makefile.in b/tests/Makefile.in index 4f408ff..363d587 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -65,6 +65,7 @@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ +CCPANELDIR = @CCPANELDIR@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ |