aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac53
-rw-r--r--data/Makefile.am16
-rw-r--r--src/Makefile.am4
-rw-r--r--src/datetime-service.c7
4 files changed, 61 insertions, 19 deletions
diff --git a/configure.ac b/configure.ac
index b563ce8..6931c2e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -103,11 +103,35 @@ PKG_CHECK_MODULES(SERVICE, indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION
gdk-3.0 >= GDK_REQUIRED_VERSION
gconf-2.0 >= GCONF_REQUIRED_VERSION)
-PKG_CHECK_MODULES(PREF, gio-2.0 >= $GIO_REQUIRED_VERSION
- gtk+-3.0 >= $GTK3_REQUIRED_VERSION
- timezonemap
- libgnome-control-center
- polkit-gobject-1)
+###########################
+# Control Center panel
+###########################
+
+AC_ARG_WITH([ccpanel],
+ AS_HELP_STRING([--with-ccpanel], [enable Control Center panel]),,
+ with_ccpanel=auto)
+
+if test x"$with_ccpanel" != x"no" ; then
+ PKG_CHECK_MODULES([PREF],
+ [gio-2.0 >= $GIO_REQUIRED_VERSION
+ gtk+-3.0 >= $GTK3_REQUIRED_VERSION
+ timezonemap
+ libgnome-control-center
+ polkit-gobject-1],
+ [have_ccpanel=yes],
+ [have_ccpanel=no])
+ if test x${have_ccpanel} = xyes; then
+ AC_DEFINE(HAVE_CCPANEL, 1, [Define to 1 to enable Control Center panel])
+ PKG_CHECK_MODULES(LIBMAP, gio-2.0 >= $GIO_REQUIRED_VERSION
+ gtk+-3.0 >= $GTK3_REQUIRED_VERSION)
+ fi
+ if test x${with_ccpanel} = xyes && test x${have_ccpanel} = xno; then
+ AC_MSG_ERROR([Control Center panel configured but not found])
+ fi
+else
+ have_ccpanel=no
+fi
+AM_CONDITIONAL(BUILD_CCPANEL, test x${have_ccpanel} = xyes)
###########################
# Grab the GSettings Macros
@@ -148,16 +172,18 @@ AC_SUBST(INDICATORICONSDIR)
# Control Center Info
###########################
-AS_IF([test "x$with_localinstall" = "xyes"],
- [
- CCPANELDIR="${libdir}/control-center-1/panels/"
- ],
+AS_IF([test "x$have_ccpanel" = "xyes"],
[
- CCPANELDIR=`$PKG_CONFIG --variable=extensiondir libgnome-control-center`
- ])
-
-AC_SUBST(CCPANELDIR)
+ 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
###########################
@@ -220,5 +246,6 @@ Date and Time Indicator Configuration:
Prefix: $prefix
Indicator Dir: $INDICATORDIR
+ CC Panel: $have_ccpanel
CC Panel Dir: $CCPANELDIR
])
diff --git a/data/Makefile.am b/data/Makefile.am
index b9a9532..6b7fe0f 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -10,17 +10,23 @@ dbus_services_DATA = indicator-datetime.service
%.service: %.service.in
sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
+EXTRA_DIST = \
+ $(gsettings_SCHEMAS) \
+ indicator-datetime.service.in
+
+CLEANFILES = indicator-datetime.service
+
+if BUILD_CCPANEL
pkgdata_DATA = datetime-dialog.ui
@INTLTOOL_DESKTOP_RULE@
desktopdir = $(datadir)/applications
desktop_DATA = indicator-datetime-preferences.desktop
-EXTRA_DIST = \
- $(gsettings_SCHEMAS) \
+EXTRA_DIST += \
datetime-dialog.ui \
indicator-datetime-preferences.desktop \
- indicator-datetime-preferences.desktop.in \
- indicator-datetime.service.in
+ indicator-datetime-preferences.desktop.in
-CLEANFILES = indicator-datetime-preferences.desktop indicator-datetime.service
+CLEANFILES += indicator-datetime-preferences.desktop
+endif
diff --git a/src/Makefile.am b/src/Makefile.am
index 328f279..e2d9a92 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,6 +1,8 @@
+if BUILD_CCPANEL
ccpaneldir = $(CCPANELDIR)
ccpanel_LTLIBRARIES = libindicator-datetime.la
+endif
libexec_PROGRAMS = indicator-datetime-service
@@ -42,6 +44,7 @@ libdatetime_la_LDFLAGS = \
-module \
-avoid-version
+if BUILD_CCPANEL
libindicator_datetime_la_SOURCES =\
datetime-prefs.c \
datetime-prefs-locations.c \
@@ -58,6 +61,7 @@ libindicator_datetime_la_CFLAGS = \
libindicator_datetime_la_LIBADD = \
$(PREF_LIBS)
libindicator_datetime_la_LDFLAGS = -module -avoid-version
+endif
gen-%.xml.c: %.xml
@echo "Building $@ from $<"
diff --git a/src/datetime-service.c b/src/datetime-service.c
index dfce637..ef43594 100644
--- a/src/datetime-service.c
+++ b/src/datetime-service.c
@@ -54,6 +54,11 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include "settings-shared.h"
#include "utils.h"
+#ifdef HAVE_CCPANEL
+ #define SETTINGS_APP_INVOCATION "gnome-control-center indicator-datetime"
+#else
+ #define SETTINGS_APP_INVOCATION "gnome-control-center datetime"
+#endif
static void geo_create_client (GeoclueMaster * master, GeoclueMasterClient * client, gchar * path, GError * error, gpointer user_data);
static gboolean update_appointment_menu_items (gpointer user_data);
@@ -1167,7 +1172,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), "gnome-control-center indicator-datetime");
+ g_signal_connect(G_OBJECT(settings), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(activate_cb), SETTINGS_APP_INVOCATION);
dbusmenu_menuitem_child_append(root, settings);
g_idle_add(check_for_timeadmin, NULL);
}