comparison src/gtkprefs.c @ 9827:430ef8fc963d

[gaim-migrate @ 10698] Patch 1013229 from Rhett Robinson. See the ChangeLog. "If at first you don't succeed, try try try again." committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 22 Aug 2004 18:24:33 +0000
parents 4a15962c344a
children 54e0322c81fb
comparison
equal deleted inserted replaced
9826:6f2a90c36ee2 9827:430ef8fc963d
2253 g_free(tmp); 2253 g_free(tmp);
2254 g_value_unset (&val); 2254 g_value_unset (&val);
2255 2255
2256 } 2256 }
2257 2257
2258 static void away_edit_sel (GtkWidget *dummy, void *tv)
2259 {
2260 struct away_message *amt;
2261 GtkTreeIter iter;
2262 GtkListStore *ls = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(tv)));
2263 GtkTreeSelection *sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(tv));
2264 GValue val = { 0, };
2265
2266 /* Get the pointer to the away message and pass that */
2267 if (! gtk_tree_selection_get_selected (sel, (GtkTreeModel**)&ls, &iter))
2268 return;
2269 gtk_tree_model_get_value (GTK_TREE_MODEL(ls), &iter, 1, &val);
2270 amt = g_value_get_pointer (&val);
2271 create_away_mess(NULL, amt);
2272 }
2273
2258 static gboolean away_message_click_cb(GtkWidget *tv, GdkEventButton *event, gpointer null) 2274 static gboolean away_message_click_cb(GtkWidget *tv, GdkEventButton *event, gpointer null)
2259 { 2275 {
2260 /* Only respond to double click on button 1 */ 2276 /* Only respond to double click on button 1 */
2261 if ((event->button != 1) || (event->type != GDK_2BUTTON_PRESS)) 2277 if ((event->button != 1) || (event->type != GDK_2BUTTON_PRESS))
2262 return FALSE; 2278 return FALSE;
2263 2279
2264 /* Show the edit away message dialog */ 2280 away_edit_sel (NULL, tv);
2265 create_away_mess(NULL, tv);
2266 2281
2267 return FALSE; 2282 return FALSE;
2268 } 2283 }
2269 2284
2270 void remove_away_message(GtkWidget *widget, GtkTreeView *tv) { 2285 void remove_away_message(GtkWidget *widget, GtkTreeView *tv) {
2358 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); 2373 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
2359 2374
2360 button = gaim_pixbuf_button_from_stock(_("_Edit"), GAIM_STOCK_EDIT, GAIM_BUTTON_HORIZONTAL); 2375 button = gaim_pixbuf_button_from_stock(_("_Edit"), GAIM_STOCK_EDIT, GAIM_BUTTON_HORIZONTAL);
2361 gtk_size_group_add_widget(sg, button); 2376 gtk_size_group_add_widget(sg, button);
2362 g_signal_connect(G_OBJECT(button), "clicked", 2377 g_signal_connect(G_OBJECT(button), "clicked",
2363 G_CALLBACK(create_away_mess), event_view); 2378 G_CALLBACK(away_edit_sel), event_view);
2364 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); 2379 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
2365 2380
2366 gtk_widget_show_all(ret); 2381 gtk_widget_show_all(ret);
2367 return ret; 2382 return ret;
2368 } 2383 }