gtk/plugins/gevolution/add_buddy_dialog.c

changeset 14747
61aa25e4f18a
parent 14253
b63ebf84c42b
child 20470
77693555855f
child 20472
6a6d2ef151e6
equal deleted inserted replaced
14746:050c5dc5ec76 14747:61aa25e4f18a
93 const char *username; 93 const char *username;
94 EContact *contact; 94 EContact *contact;
95 95
96 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(dialog->treeview)); 96 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(dialog->treeview));
97 97
98 gtk_tree_selection_get_selected(selection, NULL, &iter); 98 if (!gtk_tree_selection_get_selected(selection, NULL, &iter))
99 return;
99 100
100 gtk_tree_model_get(GTK_TREE_MODEL(dialog->model), &iter, 101 gtk_tree_model_get(GTK_TREE_MODEL(dialog->model), &iter,
101 COLUMN_NAME, &fullname, 102 COLUMN_NAME, &fullname,
102 COLUMN_USERNAME, &username, 103 COLUMN_USERNAME, &username,
103 COLUMN_DATA, &contact, 104 COLUMN_DATA, &contact,
341 } 342 }
342 343
343 static void 344 static void
344 selected_cb(GtkTreeSelection *sel, GevoAddBuddyDialog *dialog) 345 selected_cb(GtkTreeSelection *sel, GevoAddBuddyDialog *dialog)
345 { 346 {
346 gtk_widget_set_sensitive(dialog->select_button, TRUE); 347 GtkTreeSelection *selection;
348
349 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(dialog->treeview));
350 gtk_widget_set_sensitive(dialog->select_button,
351 gtk_tree_selection_get_selected(selection, NULL, NULL));
347 } 352 }
348 353
349 static void 354 static void
350 search_changed_cb(GtkEntry *entry, GevoAddBuddyDialog *dialog) 355 search_changed_cb(GtkEntry *entry, GevoAddBuddyDialog *dialog)
351 { 356 {

mercurial