~karl-qdh/indicator-datetime/monthappointments

« back to all changes in this revision

Viewing changes to src/datetime-prefs-locations.c

  • Committer: Ted Gould
  • Date: 2011-03-30 22:00:38 UTC
  • mfrom: (93.1.2 indicator-datetime)
  • Revision ID: ted@gould.cx-20110330220038-hyqbg8gnvm9xs3jt
Fix up icons and give them tool tips

Show diffs side-by-side

added added

removed removed

Lines of Context:
154
154
  return FALSE; // Do normal action too
155
155
}
156
156
 
 
157
static gboolean
 
158
query_tooltip (GtkTreeView * tree, gint x, gint y, gboolean keyboard_mode,
 
159
               GtkTooltip * tooltip, GtkCellRenderer * cell)
 
160
{
 
161
  GtkTreeModel * model;
 
162
  GtkTreeIter iter;
 
163
  if (!gtk_tree_view_get_tooltip_context (tree, &x, &y, keyboard_mode,
 
164
                                          &model, NULL, &iter))
 
165
    return FALSE;
 
166
 
 
167
  const gchar * icon;
 
168
  gtk_tree_model_get (model, &iter, COL_ICON, &icon, -1);
 
169
  if (icon == NULL)
 
170
    return FALSE;
 
171
 
 
172
  GtkTreeViewColumn * col = gtk_tree_view_get_column (tree, 0);
 
173
  gtk_tree_view_set_tooltip_cell (tree, tooltip, NULL, col, cell);
 
174
  gtk_tooltip_set_text (tooltip, _("You need to complete this location for it to appear in the menu."));
 
175
  return TRUE;
 
176
}
 
177
 
157
178
static void
158
179
handle_edit_started (GtkCellRendererText * renderer, GtkCellEditable * editable,
159
180
                     gchar * path, TimezoneCompletion * completion)
371
392
  gtk_tree_view_column_pack_start (loc_col, cell, FALSE);
372
393
  gtk_tree_view_column_add_attribute (loc_col, cell, "icon-name", COL_ICON);
373
394
 
 
395
  gtk_widget_set_has_tooltip (tree, TRUE);
 
396
  g_signal_connect (tree, "query-tooltip", G_CALLBACK (query_tooltip), cell);
 
397
 
374
398
  cell = gtk_cell_renderer_text_new ();
375
399
  gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree), -1,
376
400
                                               _("Time"), cell,