aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDidier Roche <didier.roche@canonical.com>2010-02-26 10:39:44 +0100
committerDidier Roche <didier.roche@canonical.com>2010-02-26 10:39:44 +0100
commit8f5b8f3d0af565f140e145d895cf45243a4a322b (patch)
treeb8c7a98543d00bf4c26ebbeadd4b8400db993fe9 /src
parent2c193e71a9e62ecf27c2484434c6a05443dc9c61 (diff)
parent21c86ebac1e28b32a1ce6908e9b76ab401a99205 (diff)
downloadayatana-indicator-datetime-8f5b8f3d0af565f140e145d895cf45243a4a322b.tar.gz
ayatana-indicator-datetime-8f5b8f3d0af565f140e145d895cf45243a4a322b.tar.bz2
ayatana-indicator-datetime-8f5b8f3d0af565f140e145d895cf45243a4a322b.zip
Import upstream version 0.0.1
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am13
-rw-r--r--src/Makefile.in137
-rw-r--r--src/datetime-service.c7
-rw-r--r--src/indicator-datetime.c108
4 files changed, 230 insertions, 35 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 390f89a..bf9093d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,4 +1,15 @@
+libexec_PROGRAMS = indicator-datetime-service
+
+indicator_datetime_service_SOURCES = \
+ datetime-service.c
+indicator_datetime_service_CFLAGS = \
+ -Wall \
+ -Werror \
+ $(INDICATOR_CFLAGS)
+indicator_datetime_service_LDADD = \
+ $(INDICATOR_LIBS)
+
datetimelibdir = $(INDICATORDIR)
datetimelib_LTLIBRARIES = libdatetime.la
libdatetime_la_SOURCES = \
@@ -11,3 +22,5 @@ libdatetime_la_LIBADD = \
libdatetime_la_LDFLAGS = \
-module \
-avoid-version
+
+EXTRA_DIST = $(libdatetime_la_SOURCES)
diff --git a/src/Makefile.in b/src/Makefile.in
index f3ad827..80e7b27 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -15,6 +15,7 @@
@SET_MAKE@
+
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
@@ -34,6 +35,7 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
+libexec_PROGRAMS = indicator-datetime-service$(EXEEXT)
subdir = src
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -68,7 +70,8 @@ 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)"
+am__installdirs = "$(DESTDIR)$(datetimelibdir)" \
+ "$(DESTDIR)$(libexecdir)"
LTLIBRARIES = $(datetimelib_LTLIBRARIES)
am__DEPENDENCIES_1 =
libdatetime_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
@@ -81,6 +84,16 @@ 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 = $(libexec_PROGRAMS)
+am_indicator_datetime_service_OBJECTS = \
+ indicator_datetime_service-datetime-service.$(OBJEXT)
+indicator_datetime_service_OBJECTS = \
+ $(am_indicator_datetime_service_OBJECTS)
+indicator_datetime_service_DEPENDENCIES = $(am__DEPENDENCIES_1)
+indicator_datetime_service_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
+ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
+ $(indicator_datetime_service_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
@@ -107,8 +120,10 @@ am__v_CCLD_0 = @echo " CCLD " $@;
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)
-DIST_SOURCES = $(libdatetime_la_SOURCES)
+SOURCES = $(libdatetime_la_SOURCES) \
+ $(indicator_datetime_service_SOURCES)
+DIST_SOURCES = $(libdatetime_la_SOURCES) \
+ $(indicator_datetime_service_SOURCES)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -257,6 +272,17 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
+indicator_datetime_service_SOURCES = \
+ datetime-service.c
+
+indicator_datetime_service_CFLAGS = \
+ -Wall \
+ -Werror \
+ $(INDICATOR_CFLAGS)
+
+indicator_datetime_service_LDADD = \
+ $(INDICATOR_LIBS)
+
datetimelibdir = $(INDICATORDIR)
datetimelib_LTLIBRARIES = libdatetime.la
libdatetime_la_SOURCES = \
@@ -273,6 +299,7 @@ libdatetime_la_LDFLAGS = \
-module \
-avoid-version
+EXTRA_DIST = $(libdatetime_la_SOURCES)
all: all-am
.SUFFIXES:
@@ -340,6 +367,52 @@ 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-libexecPROGRAMS: $(libexec_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(libexecdir)" || $(MKDIR_P) "$(DESTDIR)$(libexecdir)"
+ @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || 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)$(libexecdir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-libexecPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || 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)$(libexecdir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(libexecdir)" && rm -f $$files
+
+clean-libexecPROGRAMS:
+ @list='$(libexec_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
+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)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -347,6 +420,7 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_datetime_service-datetime-service.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdatetime_la-indicator-datetime.Plo@am__quote@
.c.o:
@@ -381,6 +455,22 @@ 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_service-datetime-service.o: datetime-service.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-service.o -MD -MP -MF $(DEPDIR)/indicator_datetime_service-datetime-service.Tpo -c -o indicator_datetime_service-datetime-service.o `test -f 'datetime-service.c' || echo '$(srcdir)/'`datetime-service.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_datetime_service-datetime-service.Tpo $(DEPDIR)/indicator_datetime_service-datetime-service.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='datetime-service.c' object='indicator_datetime_service-datetime-service.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_service_CFLAGS) $(CFLAGS) -c -o indicator_datetime_service-datetime-service.o `test -f 'datetime-service.c' || echo '$(srcdir)/'`datetime-service.c
+
+indicator_datetime_service-datetime-service.obj: datetime-service.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-service.obj -MD -MP -MF $(DEPDIR)/indicator_datetime_service-datetime-service.Tpo -c -o indicator_datetime_service-datetime-service.obj `if test -f 'datetime-service.c'; then $(CYGPATH_W) 'datetime-service.c'; else $(CYGPATH_W) '$(srcdir)/datetime-service.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_datetime_service-datetime-service.Tpo $(DEPDIR)/indicator_datetime_service-datetime-service.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='datetime-service.c' object='indicator_datetime_service-datetime-service.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_service_CFLAGS) $(CFLAGS) -c -o indicator_datetime_service-datetime-service.obj `if test -f 'datetime-service.c'; then $(CYGPATH_W) 'datetime-service.c'; else $(CYGPATH_W) '$(srcdir)/datetime-service.c'; fi`
+
mostlyclean-libtool:
-rm -f *.lo
@@ -471,9 +561,9 @@ distdir: $(DISTFILES)
done
check-am: all-am
check: check-am
-all-am: Makefile $(LTLIBRARIES)
+all-am: Makefile $(LTLIBRARIES) $(PROGRAMS)
installdirs:
- for dir in "$(DESTDIR)$(datetimelibdir)"; do \
+ for dir in "$(DESTDIR)$(datetimelibdir)" "$(DESTDIR)$(libexecdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
@@ -503,8 +593,8 @@ maintainer-clean-generic:
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
-clean-am: clean-datetimelibLTLIBRARIES clean-generic clean-libtool \
- mostlyclean-am
+clean-am: clean-datetimelibLTLIBRARIES clean-generic \
+ clean-libexecPROGRAMS clean-libtool mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
@@ -530,7 +620,7 @@ install-dvi: install-dvi-am
install-dvi-am:
-install-exec-am:
+install-exec-am: install-libexecPROGRAMS
install-html: install-html-am
@@ -570,24 +660,27 @@ ps: ps-am
ps-am:
-uninstall-am: uninstall-datetimelibLTLIBRARIES
+uninstall-am: uninstall-datetimelibLTLIBRARIES \
+ uninstall-libexecPROGRAMS
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean \
- clean-datetimelibLTLIBRARIES clean-generic 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-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-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-datetimelibLTLIBRARIES
+ 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-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-datetimelibLTLIBRARIES \
+ uninstall-libexecPROGRAMS
# Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/src/datetime-service.c b/src/datetime-service.c
new file mode 100644
index 0000000..63590c7
--- /dev/null
+++ b/src/datetime-service.c
@@ -0,0 +1,7 @@
+
+int
+main (int argc, char ** argv)
+{
+
+ return 0;
+}
diff --git a/src/indicator-datetime.c b/src/indicator-datetime.c
index 9b4bec4..00854a4 100644
--- a/src/indicator-datetime.c
+++ b/src/indicator-datetime.c
@@ -34,6 +34,8 @@ struct _IndicatorDatetime {
struct _IndicatorDatetimePrivate {
GtkLabel * label;
+ GtkMenuItem * date;
+ GtkMenuItem * calendar;
guint timer;
};
@@ -79,6 +81,8 @@ indicator_datetime_init (IndicatorDatetime *self)
self->priv = INDICATOR_DATETIME_GET_PRIVATE(self);
self->priv->label = NULL;
+ self->priv->date = NULL;
+ self->priv->calendar = NULL;
self->priv->timer = 0;
return;
@@ -94,6 +98,16 @@ indicator_datetime_dispose (GObject *object)
self->priv->label = NULL;
}
+ if (self->priv->date != NULL) {
+ g_object_unref(self->priv->date);
+ self->priv->date = NULL;
+ }
+
+ if (self->priv->calendar != NULL) {
+ g_object_unref(self->priv->calendar);
+ self->priv->calendar = NULL;
+ }
+
if (self->priv->timer != 0) {
g_source_remove(self->priv->timer);
self->priv->timer = 0;
@@ -113,9 +127,11 @@ indicator_datetime_finalize (GObject *object)
/* Updates the label to be the current time. */
static void
-update_label (GtkLabel * label)
+update_label (IndicatorDatetime * io)
{
- if (label == NULL) return;
+ IndicatorDatetime * self = INDICATOR_DATETIME(io);
+
+ if (self->priv->label == NULL) return;
gchar longstr[128];
time_t t;
@@ -125,14 +141,23 @@ update_label (GtkLabel * label)
ltime = localtime(&t);
if (ltime == NULL) {
g_debug("Error getting local time");
- gtk_label_set_label(label, _("Error getting time"));
+ gtk_label_set_label(self->priv->label, _("Error getting time"));
return;
}
strftime(longstr, 128, "%I:%M %p", ltime);
gchar * utf8 = g_locale_to_utf8(longstr, -1, NULL, NULL, NULL);
- gtk_label_set_label(label, utf8);
+ gtk_label_set_label(self->priv->label, utf8);
+ g_free(utf8);
+
+ if (self->priv->date == NULL) return;
+
+ /* Note: may require some localization tweaks */
+ strftime(longstr, 128, "%A, %e %B %Y", ltime);
+
+ utf8 = g_locale_to_utf8(longstr, -1, NULL, NULL, NULL);
+ gtk_menu_item_set_label(self->priv->date, utf8);
g_free(utf8);
return;
@@ -145,7 +170,7 @@ minute_timer_func (gpointer user_data)
IndicatorDatetime * self = INDICATOR_DATETIME(user_data);
if (self->priv->label != NULL) {
- update_label(self->priv->label);
+ update_label(self);
return TRUE;
} else {
self->priv->timer = 0;
@@ -155,6 +180,18 @@ minute_timer_func (gpointer user_data)
return FALSE;
}
+static void
+activate_cb (GtkWidget *widget, const gchar *command)
+{
+ GError * error = NULL;
+
+ if (!g_spawn_command_line_async(command, &error)) {
+ g_warning("Unable to start %s: %s", (char *)command, error->message);
+ g_error_free(error);
+ }
+}
+
+
/* Grabs the label. Creates it if it doesn't
exist already */
static GtkLabel *
@@ -166,10 +203,10 @@ get_label (IndicatorObject * io)
if (self->priv->label == NULL) {
self->priv->label = GTK_LABEL(gtk_label_new("Time"));
g_object_ref(G_OBJECT(self->priv->label));
- update_label(self->priv->label);
+ update_label(self);
gtk_widget_show(GTK_WIDGET(self->priv->label));
}
-
+
if (self->priv->timer == 0) {
self->priv->timer = g_timeout_add_seconds(60, minute_timer_func, self);
}
@@ -177,20 +214,65 @@ get_label (IndicatorObject * io)
return self->priv->label;
}
-/* Build a dummy menu for now */
+static void
+check_for_calendar_application (IndicatorDatetime * self)
+{
+ GtkMenuItem * item = self->priv->calendar;
+ g_return_if_fail (item != NULL);
+
+ gchar *evo = g_find_program_in_path("evolution");
+ if (evo != NULL) {
+ g_signal_connect (GTK_MENU_ITEM (item), "activate",
+ G_CALLBACK (activate_cb), "evolution -c calendar");
+ gtk_widget_set_sensitive (GTK_WIDGET (item), TRUE);
+ gtk_widget_show(GTK_WIDGET(item));
+ g_free(evo);
+ } else {
+ gtk_widget_hide(GTK_WIDGET(item));
+ }
+}
+
static GtkMenu *
get_menu (IndicatorObject * io)
{
+ IndicatorDatetime * self = INDICATOR_DATETIME(io);
+
GtkWidget * menu = NULL;
GtkWidget * item = NULL;
menu = gtk_menu_new();
+
+ if (self->priv->date == NULL) {
+ item = gtk_menu_item_new_with_label("No date yet...");
+ gtk_widget_set_sensitive (GTK_WIDGET (item), FALSE);
+ gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
+ self->priv->date = GTK_MENU_ITEM (item);
+ update_label(self);
+ }
- item = gtk_menu_item_new_with_label("No menu yet.");
- gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
- gtk_widget_show(item);
-
- gtk_widget_show(menu);
+ if (self->priv->calendar == NULL) {
+ item = gtk_menu_item_new_with_label(_("Open Calendar"));
+ /* insensitive until we check for available apps */
+ gtk_widget_set_sensitive (GTK_WIDGET (item), FALSE);
+ gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
+ self->priv->calendar = GTK_MENU_ITEM (item);
+ }
+
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu),
+ gtk_separator_menu_item_new ());
+
+ GtkWidget *settings_mi = gtk_menu_item_new_with_label (_("Set Time and Date..."));
+ g_signal_connect (GTK_MENU_ITEM (settings_mi), "activate",
+ G_CALLBACK (activate_cb), "time-admin");
+ gtk_menu_shell_append (GTK_MENU_SHELL(menu), settings_mi);
+ gtk_widget_show(settings_mi);
+
+ /* show_all to reveal the separator */
+ gtk_widget_show_all(menu);
+
+ /* Note: maybe should move that to an idle loop if that helps with
+ boot performance */
+ check_for_calendar_application (self);
return GTK_MENU(menu);
}