aboutsummaryrefslogtreecommitdiff
path: root/src/datetime-prefs-locations.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-03-30 17:02:29 -0500
committerTed Gould <ted@gould.cx>2011-03-30 17:02:29 -0500
commited20abdc770ff71372ad967e7aad376bcc9a1311 (patch)
treebc138bb68b364eb84656038dd6fbc24108e32b2f /src/datetime-prefs-locations.c
parent6f36075655f0be9070b221528158133f068673f9 (diff)
parent51f85a5e06af1dec9fcbd25901b4a65ead6aa2cd (diff)
downloadayatana-indicator-datetime-ed20abdc770ff71372ad967e7aad376bcc9a1311.tar.gz
ayatana-indicator-datetime-ed20abdc770ff71372ad967e7aad376bcc9a1311.tar.bz2
ayatana-indicator-datetime-ed20abdc770ff71372ad967e7aad376bcc9a1311.zip
* Upstream Merge
* Add tooltips on the error icons * Fix marking to refresh as the calendar changes * Recycle old entries to make the refresh cleaner * Use day when timezone is set to 'locale'
Diffstat (limited to 'src/datetime-prefs-locations.c')
-rw-r--r--src/datetime-prefs-locations.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/datetime-prefs-locations.c b/src/datetime-prefs-locations.c
index 2862022..9c23a40 100644
--- a/src/datetime-prefs-locations.c
+++ b/src/datetime-prefs-locations.c
@@ -154,6 +154,27 @@ timezone_selected (GtkEntryCompletion * widget, GtkTreeModel * model,
return FALSE; // Do normal action too
}
+static gboolean
+query_tooltip (GtkTreeView * tree, gint x, gint y, gboolean keyboard_mode,
+ GtkTooltip * tooltip, GtkCellRenderer * cell)
+{
+ GtkTreeModel * model;
+ GtkTreeIter iter;
+ if (!gtk_tree_view_get_tooltip_context (tree, &x, &y, keyboard_mode,
+ &model, NULL, &iter))
+ return FALSE;
+
+ const gchar * icon;
+ gtk_tree_model_get (model, &iter, COL_ICON, &icon, -1);
+ if (icon == NULL)
+ return FALSE;
+
+ GtkTreeViewColumn * col = gtk_tree_view_get_column (tree, 0);
+ gtk_tree_view_set_tooltip_cell (tree, tooltip, NULL, col, cell);
+ gtk_tooltip_set_text (tooltip, _("You need to complete this location for it to appear in the menu."));
+ return TRUE;
+}
+
static void
handle_edit_started (GtkCellRendererText * renderer, GtkCellEditable * editable,
gchar * path, TimezoneCompletion * completion)
@@ -371,6 +392,9 @@ datetime_setup_locations_dialog (CcTimezoneMap * map)
gtk_tree_view_column_pack_start (loc_col, cell, FALSE);
gtk_tree_view_column_add_attribute (loc_col, cell, "icon-name", COL_ICON);
+ gtk_widget_set_has_tooltip (tree, TRUE);
+ g_signal_connect (tree, "query-tooltip", G_CALLBACK (query_tooltip), cell);
+
cell = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree), -1,
_("Time"), cell,