| 53 GtkDialog parent; |
53 GtkDialog parent; |
| 54 |
54 |
| 55 /* Stack */ |
55 /* Stack */ |
| 56 GtkWidget *stack; |
56 GtkWidget *stack; |
| 57 |
57 |
| 58 /* Conversations page */ |
|
| 59 struct { |
|
| 60 GtkWidget *show_incoming_formatting; |
|
| 61 struct { |
|
| 62 GtkWidget *send_typing; |
|
| 63 } im; |
|
| 64 GtkWidget *use_smooth_scrolling; |
|
| 65 struct { |
|
| 66 GtkWidget *blink_im; |
|
| 67 } win32; |
|
| 68 GtkWidget *minimum_entry_lines; |
|
| 69 GtkTextBuffer *format_buffer; |
|
| 70 GtkWidget *format_view; |
|
| 71 } conversations; |
|
| 72 |
|
| 73 #ifdef USE_VV |
58 #ifdef USE_VV |
| 74 /* Voice/Video page */ |
59 /* Voice/Video page */ |
| 75 struct { |
60 struct { |
| 76 struct { |
61 struct { |
| 77 PidginPrefCombo input; |
62 PidginPrefCombo input; |
| 681 |
666 |
| 682 /* Unregister callbacks. */ |
667 /* Unregister callbacks. */ |
| 683 purple_prefs_disconnect_by_handle(prefs); |
668 purple_prefs_disconnect_by_handle(prefs); |
| 684 |
669 |
| 685 prefs = NULL; |
670 prefs = NULL; |
| 686 } |
|
| 687 |
|
| 688 static void |
|
| 689 formatting_toggle_cb(TalkatuActionGroup *ag, GAction *action, const gchar *name, gpointer data) |
|
| 690 { |
|
| 691 gboolean activated = talkatu_action_group_get_action_activated(ag, name); |
|
| 692 if(g_ascii_strcasecmp(TALKATU_ACTION_FORMAT_BOLD, name) != 0) { |
|
| 693 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_bold", |
|
| 694 activated); |
|
| 695 } else if(g_ascii_strcasecmp(TALKATU_ACTION_FORMAT_ITALIC, name) != 0) { |
|
| 696 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_italic", |
|
| 697 activated); |
|
| 698 } else if(g_ascii_strcasecmp(TALKATU_ACTION_FORMAT_UNDERLINE, name) != 0) { |
|
| 699 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_underline", |
|
| 700 activated); |
|
| 701 } else if(g_ascii_strcasecmp(TALKATU_ACTION_FORMAT_STRIKETHROUGH, name) != 0) { |
|
| 702 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_strike", |
|
| 703 activated); |
|
| 704 } |
|
| 705 } |
|
| 706 |
|
| 707 static void |
|
| 708 bind_conv_page(PidginPrefsWindow *win) |
|
| 709 { |
|
| 710 GSimpleActionGroup *ag = NULL; |
|
| 711 |
|
| 712 pidgin_prefs_bind_checkbox(PIDGIN_PREFS_ROOT "/conversations/show_incoming_formatting", |
|
| 713 win->conversations.show_incoming_formatting); |
|
| 714 |
|
| 715 pidgin_prefs_bind_checkbox("/purple/conversations/im/send_typing", |
|
| 716 win->conversations.im.send_typing); |
|
| 717 |
|
| 718 pidgin_prefs_bind_checkbox(PIDGIN_PREFS_ROOT "/conversations/use_smooth_scrolling", |
|
| 719 win->conversations.use_smooth_scrolling); |
|
| 720 |
|
| 721 #ifdef _WIN32 |
|
| 722 pidgin_prefs_bind_checkbox(PIDGIN_PREFS_ROOT "/win32/blink_im", |
|
| 723 win->conversations.win32.blink_im); |
|
| 724 #else |
|
| 725 gtk_widget_hide(win->conversations.win32.blink_im); |
|
| 726 #endif |
|
| 727 |
|
| 728 pidgin_prefs_bind_spin_button( |
|
| 729 PIDGIN_PREFS_ROOT "/conversations/minimum_entry_lines", |
|
| 730 win->conversations.minimum_entry_lines); |
|
| 731 |
|
| 732 ag = talkatu_buffer_get_action_group(TALKATU_BUFFER(win->conversations.format_buffer)); |
|
| 733 g_signal_connect_after(G_OBJECT(ag), "action-activated", |
|
| 734 G_CALLBACK(formatting_toggle_cb), NULL); |
|
| 735 } |
671 } |
| 736 |
672 |
| 737 #ifdef USE_VV |
673 #ifdef USE_VV |
| 738 static GList * |
674 static GList * |
| 739 get_vv_device_menuitems(PurpleMediaElementType type) |
675 get_vv_device_menuitems(PurpleMediaElementType type) |
| 1247 #ifdef USE_VV |
1183 #ifdef USE_VV |
| 1248 GtkStack *stack = GTK_STACK(win->stack); |
1184 GtkStack *stack = GTK_STACK(win->stack); |
| 1249 GtkWidget *vv; |
1185 GtkWidget *vv; |
| 1250 #endif |
1186 #endif |
| 1251 |
1187 |
| 1252 bind_conv_page(win); |
|
| 1253 #ifdef USE_VV |
1188 #ifdef USE_VV |
| 1254 vv = vv_page(win); |
1189 vv = vv_page(win); |
| 1255 gtk_container_add_with_properties(GTK_CONTAINER(stack), vv, "name", |
1190 gtk_container_add_with_properties(GTK_CONTAINER(stack), vv, "name", |
| 1256 "vv", "title", _("Voice/Video"), |
1191 "vv", "title", _("Voice/Video"), |
| 1257 NULL); |
1192 NULL); |
| 1271 |
1206 |
| 1272 /* Main window */ |
1207 /* Main window */ |
| 1273 gtk_widget_class_bind_template_child(widget_class, PidginPrefsWindow, |
1208 gtk_widget_class_bind_template_child(widget_class, PidginPrefsWindow, |
| 1274 stack); |
1209 stack); |
| 1275 gtk_widget_class_bind_template_callback(widget_class, delete_prefs); |
1210 gtk_widget_class_bind_template_callback(widget_class, delete_prefs); |
| 1276 |
|
| 1277 /* Conversations page */ |
|
| 1278 gtk_widget_class_bind_template_child( |
|
| 1279 widget_class, PidginPrefsWindow, |
|
| 1280 conversations.show_incoming_formatting); |
|
| 1281 gtk_widget_class_bind_template_child( |
|
| 1282 widget_class, PidginPrefsWindow, |
|
| 1283 conversations.im.send_typing); |
|
| 1284 gtk_widget_class_bind_template_child( |
|
| 1285 widget_class, PidginPrefsWindow, |
|
| 1286 conversations.use_smooth_scrolling); |
|
| 1287 gtk_widget_class_bind_template_child( |
|
| 1288 widget_class, PidginPrefsWindow, |
|
| 1289 conversations.win32.blink_im); |
|
| 1290 gtk_widget_class_bind_template_child( |
|
| 1291 widget_class, PidginPrefsWindow, |
|
| 1292 conversations.minimum_entry_lines); |
|
| 1293 gtk_widget_class_bind_template_child( |
|
| 1294 widget_class, PidginPrefsWindow, |
|
| 1295 conversations.format_buffer); |
|
| 1296 gtk_widget_class_bind_template_child( |
|
| 1297 widget_class, PidginPrefsWindow, |
|
| 1298 conversations.format_view); |
|
| 1299 } |
1211 } |
| 1300 |
1212 |
| 1301 static void |
1213 static void |
| 1302 pidgin_prefs_window_init(PidginPrefsWindow *win) |
1214 pidgin_prefs_window_init(PidginPrefsWindow *win) |
| 1303 { |
1215 { |