aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac4
-rw-r--r--libmap/cc-timezone-map.c30
-rw-r--r--src/datetime-service.c7
-rw-r--r--src/indicator-datetime.c16
-rw-r--r--src/timezone-completion.c10
5 files changed, 35 insertions, 32 deletions
diff --git a/configure.ac b/configure.ac
index b05f3f1..ef49e53 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,11 +1,11 @@
-AC_INIT(indicator-datetime, 0.1.98, ted@canonical.com)
+AC_INIT(indicator-datetime, 0.2.0, ted@canonical.com)
AC_COPYRIGHT([Copyright 2009,2010 Canonical])
AC_PREREQ(2.53)
AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(indicator-datetime, 0.1.98)
+AM_INIT_AUTOMAKE(indicator-datetime, 0.2.0)
AM_MAINTAINER_MODE
diff --git a/libmap/cc-timezone-map.c b/libmap/cc-timezone-map.c
index 8e4a5b8..7b7d704 100644
--- a/libmap/cc-timezone-map.c
+++ b/libmap/cc-timezone-map.c
@@ -766,13 +766,23 @@ cc_timezone_map_draw (GtkWidget *widget,
gchar *file;
GError *err = NULL;
gdouble pointx, pointy;
+ gdouble alpha = 1.0;
+ GtkStyle *style;
char buf[16];
gtk_widget_get_allocation (widget, &alloc);
+ style = gtk_widget_get_style (widget);
+
+ /* Check if insensitive */
+ if (gtk_widget_get_state (widget) == GTK_STATE_INSENSITIVE)
+ alpha = 0.5;
+
/* paint background */
- gdk_cairo_set_source_pixbuf (cr, priv->background, 0, 0);
+ gdk_cairo_set_source_color (cr, &style->bg[gtk_widget_get_state (widget)]);
cairo_paint (cr);
+ gdk_cairo_set_source_pixbuf (cr, priv->background, 0, 0);
+ cairo_paint_with_alpha (cr, alpha);
/* paint watermark */
if (priv->watermark) {
@@ -788,13 +798,6 @@ cc_timezone_map_draw (GtkWidget *widget,
}
if (!priv->location) {
- /* Check if insensitive */
- if (gtk_widget_get_state (widget) == GTK_STATE_INSENSITIVE) {
- cairo_set_source_rgba(cr, 1, 1, 1, 0.5);
- cairo_rectangle(cr, 0, 0, alloc.width, alloc.height);
- cairo_fill(cr);
- }
-
return TRUE;
}
@@ -820,7 +823,7 @@ cc_timezone_map_draw (GtkWidget *widget,
alloc.height, GDK_INTERP_BILINEAR);
gdk_cairo_set_source_pixbuf (cr, hilight, 0, 0);
- cairo_paint (cr);
+ cairo_paint_with_alpha (cr, alpha);
g_object_unref (hilight);
g_object_unref (orig_hilight);
}
@@ -843,17 +846,10 @@ cc_timezone_map_draw (GtkWidget *widget,
if (pin)
{
gdk_cairo_set_source_pixbuf (cr, pin, pointx - 8, pointy - 14);
- cairo_paint (cr);
+ cairo_paint_with_alpha (cr, alpha);
g_object_unref (pin);
}
- /* Check if insensitive */
- if (gtk_widget_get_state (widget) == GTK_STATE_INSENSITIVE) {
- cairo_set_source_rgba(cr, 1, 1, 1, 0.5);
- cairo_rectangle(cr, 0, 0, alloc.width, alloc.height);
- cairo_fill(cr);
- }
-
return TRUE;
}
diff --git a/src/datetime-service.c b/src/datetime-service.c
index b166f3c..905128b 100644
--- a/src/datetime-service.c
+++ b/src/datetime-service.c
@@ -364,12 +364,13 @@ static gboolean
check_for_calendar (gpointer user_data)
{
g_return_val_if_fail (calendar != NULL, FALSE);
-
+ // Always enable the calendar even if it does nothing
+ dbusmenu_menuitem_property_set_bool(calendar, DBUSMENU_MENUITEM_PROP_ENABLED, TRUE);
+ dbusmenu_menuitem_property_set_bool(calendar, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE);
+
gchar *evo = g_find_program_in_path("evolution");
if (evo != NULL) {
g_debug("Found the calendar application: %s", evo);
- dbusmenu_menuitem_property_set_bool(calendar, DBUSMENU_MENUITEM_PROP_ENABLED, TRUE);
- dbusmenu_menuitem_property_set_bool(calendar, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE);
dbusmenu_menuitem_property_set_bool(date, DBUSMENU_MENUITEM_PROP_ENABLED, TRUE);
g_signal_connect (G_OBJECT(date), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED,
diff --git a/src/indicator-datetime.c b/src/indicator-datetime.c
index 1cdcd3f..aed498d 100644
--- a/src/indicator-datetime.c
+++ b/src/indicator-datetime.c
@@ -525,7 +525,7 @@ set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec
}
break;
}
- case PROP_SHOW_SECONDS:
+ case PROP_SHOW_SECONDS: {
if (g_value_get_boolean(value) != self->priv->show_seconds) {
self->priv->show_seconds = !self->priv->show_seconds;
if (self->priv->time_mode != SETTINGS_TIME_CUSTOM) {
@@ -534,7 +534,8 @@ set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec
}
}
break;
- case PROP_SHOW_DAY:
+ }
+ case PROP_SHOW_DAY: {
if (g_value_get_boolean(value) != self->priv->show_day) {
self->priv->show_day = !self->priv->show_day;
if (self->priv->time_mode != SETTINGS_TIME_CUSTOM) {
@@ -542,7 +543,8 @@ set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec
}
}
break;
- case PROP_SHOW_DATE:
+ }
+ case PROP_SHOW_DATE: {
if (g_value_get_boolean(value) != self->priv->show_date) {
self->priv->show_date = !self->priv->show_date;
if (self->priv->time_mode != SETTINGS_TIME_CUSTOM) {
@@ -550,6 +552,7 @@ set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec
}
}
break;
+ }
case PROP_CUSTOM_TIME_FORMAT: {
const gchar * newstr = g_value_get_string(value);
if (g_strcmp0(newstr, self->priv->custom_string) != 0) {
@@ -585,11 +588,12 @@ set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec
gtk_widget_set_visible (GTK_WIDGET (self->priv->ido_calendar), self->priv->show_calendar);
}
break;
- }
- default:
+ }
+ default: {
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
return;
}
+ }
if (!update) {
return;
@@ -813,7 +817,7 @@ setup_timer (IndicatorDatetime * self, GDateTime * datetime)
if (self->priv->show_seconds ||
(self->priv->time_mode == SETTINGS_TIME_CUSTOM && self->priv->custom_show_seconds)) {
- self->priv->timer = g_timeout_add_full(G_PRIORITY_HIGH, 865, timer_func, self, NULL);
+ self->priv->timer = g_timeout_add_full(G_PRIORITY_HIGH, 999, timer_func, self, NULL);
} else {
if (datetime == NULL) {
datetime = g_date_time_new_now_local();
diff --git a/src/timezone-completion.c b/src/timezone-completion.c
index c1ffb42..2e1afc0 100644
--- a/src/timezone-completion.c
+++ b/src/timezone-completion.c
@@ -132,14 +132,15 @@ json_parse_ready (GObject *object, GAsyncResult *res, gpointer user_data)
json_parser_load_from_stream_finish (JSON_PARSER (object), res, &error);
- if (priv->cancel && (error == NULL || error->code != G_IO_ERROR_CANCELLED)) {
+ if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED) && priv->cancel) {
g_cancellable_reset (priv->cancel);
}
if (error != NULL) {
+ if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+ save_and_use_model (completion, priv->initial_model);
g_warning ("Could not parse geoname JSON data: %s", error->message);
g_error_free (error);
- save_and_use_model (completion, priv->initial_model);
return;
}
@@ -257,14 +258,15 @@ geonames_data_ready (GObject *object, GAsyncResult *res, gpointer user_data)
stream = g_file_read_finish (G_FILE (object), res, &error);
- if (priv->cancel && (error == NULL || error->code != G_IO_ERROR_CANCELLED)) {
+ if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED) && priv->cancel) {
g_cancellable_reset (priv->cancel);
}
if (error != NULL) {
+ if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+ save_and_use_model (completion, priv->initial_model);
g_warning ("Could not connect to geoname lookup server: %s", error->message);
g_error_free (error);
- save_and_use_model (completion, priv->initial_model);
return;
}