Mercurial > pidgin
comparison src/gtkprefs.c @ 6979:bdd046deec7e
[gaim-migrate @ 7535]
Two string corrections from KAMO Tomoyuki. Thanks dude
I fiddled with the prefs away message stuff...
Changed a function to static and renamed it to have a _cb at the end.
Added an away_message_click_cb() callback--double clicking on an
away message in the list brings up the edit away message window.
I want to add an "Activate" button, but I don't have time now, and
away.c needs to be core/ui split, I think, with the ability to
activate a chosen message.
The Second Annual Chips & Dip night was good. We watched The Unborn
2, which is supposed to be one of the worst movies ever. It rocked.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sat, 27 Sep 2003 05:11:11 +0000 |
parents | 31c45d99e1a8 |
children | 083d1e4a9c78 |
comparison
equal
deleted
inserted
replaced
6978:755462e647e5 | 6979:bdd046deec7e |
---|---|
2097 gtk_widget_show_all (ret); | 2097 gtk_widget_show_all (ret); |
2098 | 2098 |
2099 return ret; | 2099 return ret; |
2100 } | 2100 } |
2101 | 2101 |
2102 void away_message_sel(GtkTreeSelection *sel, GtkTreeModel *model) | 2102 static void away_message_sel_cb(GtkTreeSelection *sel, GtkTreeModel *model) |
2103 { | 2103 { |
2104 GtkTreeIter iter; | 2104 GtkTreeIter iter; |
2105 GValue val = { 0, }; | 2105 GValue val = { 0, }; |
2106 gchar buffer[BUF_LONG]; | 2106 gchar buffer[BUF_LONG]; |
2107 char *tmp; | 2107 char *tmp; |
2119 gtk_imhtml_append_text(GTK_IMHTML(away_text), "<BR>", -1, GTK_IMHTML_NO_TITLE | | 2119 gtk_imhtml_append_text(GTK_IMHTML(away_text), "<BR>", -1, GTK_IMHTML_NO_TITLE | |
2120 GTK_IMHTML_NO_COMMENTS | GTK_IMHTML_NO_SCROLL); | 2120 GTK_IMHTML_NO_COMMENTS | GTK_IMHTML_NO_SCROLL); |
2121 g_free(tmp); | 2121 g_free(tmp); |
2122 g_value_unset (&val); | 2122 g_value_unset (&val); |
2123 | 2123 |
2124 } | |
2125 | |
2126 static gboolean away_message_click_cb(GtkWidget *tv, GdkEventButton *event, gpointer null) | |
2127 { | |
2128 /* Only respond to double click on button 1 */ | |
2129 if ((event->button != 1) || (event->type != GDK_2BUTTON_PRESS)) | |
2130 return FALSE; | |
2131 | |
2132 /* Show the edit away message dialog */ | |
2133 create_away_mess(NULL, tv); | |
2134 | |
2135 return FALSE; | |
2124 } | 2136 } |
2125 | 2137 |
2126 void remove_away_message(GtkWidget *widget, GtkTreeView *tv) { | 2138 void remove_away_message(GtkWidget *widget, GtkTreeView *tv) { |
2127 struct away_message *am; | 2139 struct away_message *am; |
2128 GtkTreeIter iter; | 2140 GtkTreeIter iter; |
2159 sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); | 2171 sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); |
2160 | 2172 |
2161 sw = gtk_scrolled_window_new(NULL,NULL); | 2173 sw = gtk_scrolled_window_new(NULL,NULL); |
2162 away_text = gtk_imhtml_new(NULL, NULL); | 2174 away_text = gtk_imhtml_new(NULL, NULL); |
2163 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); | 2175 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); |
2164 /* | |
2165 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | |
2166 */ | |
2167 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); | 2176 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); |
2168 | 2177 |
2169 prefs_away_store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER); | 2178 prefs_away_store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER); |
2170 while (awy) { | 2179 while (awy) { |
2171 a = (struct away_message *)awy->data; | 2180 a = (struct away_message *)awy->data; |
2194 gtk_box_pack_start(GTK_BOX(ret), sw2, TRUE, TRUE, 0); | 2203 gtk_box_pack_start(GTK_BOX(ret), sw2, TRUE, TRUE, 0); |
2195 | 2204 |
2196 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw2), away_text); | 2205 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw2), away_text); |
2197 gaim_setup_imhtml(away_text); | 2206 gaim_setup_imhtml(away_text); |
2198 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | 2207 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); |
2199 g_signal_connect (G_OBJECT (sel), "changed", | 2208 g_signal_connect(G_OBJECT(sel), "changed", |
2200 G_CALLBACK (away_message_sel), | 2209 G_CALLBACK(away_message_sel_cb), NULL); |
2201 NULL); | 2210 g_signal_connect(G_OBJECT(event_view), "button-press-event", |
2211 G_CALLBACK(away_message_click_cb), NULL); | |
2202 hbox = gtk_hbox_new(TRUE, 5); | 2212 hbox = gtk_hbox_new(TRUE, 5); |
2203 gtk_box_pack_start(GTK_BOX(ret), hbox, FALSE, FALSE, 0); | 2213 gtk_box_pack_start(GTK_BOX(ret), hbox, FALSE, FALSE, 0); |
2204 button = gtk_button_new_from_stock (GTK_STOCK_ADD); | 2214 button = gtk_button_new_from_stock (GTK_STOCK_ADD); |
2205 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); | 2215 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
2206 gtk_size_group_add_widget(sg, button); | 2216 gtk_size_group_add_widget(sg, button); |