| 162 } win32; |
162 } win32; |
| 163 GtkWidget *resize_custom_smileys; |
163 GtkWidget *resize_custom_smileys; |
| 164 GtkWidget *custom_smileys_size; |
164 GtkWidget *custom_smileys_size; |
| 165 GtkWidget *minimum_entry_lines; |
165 GtkWidget *minimum_entry_lines; |
| 166 GtkTextBuffer *format_buffer; |
166 GtkTextBuffer *format_buffer; |
| 167 GtkWidget *sample_box; |
167 GtkWidget *format_view; |
| 168 GtkWidget *sample_webview; |
|
| 169 /* Win32 specific frame */ |
168 /* Win32 specific frame */ |
| 170 GtkWidget *font_frame; |
169 GtkWidget *font_frame; |
| 171 GtkWidget *use_theme_font; |
170 GtkWidget *use_theme_font; |
| 172 GtkWidget *custom_font_hbox; |
171 GtkWidget *custom_font_hbox; |
| 173 GtkWidget *custom_font; |
172 GtkWidget *custom_font; |
| 1877 |
1876 |
| 1878 return ret; |
1877 return ret; |
| 1879 } |
1878 } |
| 1880 |
1879 |
| 1881 static void |
1880 static void |
| 1882 formatting_toggle_cb(PidginWebView *webview, PidginWebViewButtons buttons, void *data) |
1881 formatting_toggle_cb(TalkatuActionGroup *ag, GAction *action, const gchar *name, gpointer data) |
| 1883 { |
1882 { |
| 1884 gboolean bold, italic, uline, strike; |
1883 gboolean activated = talkatu_action_group_get_action_activated(ag, name); |
| 1885 |
1884 if(g_ascii_strcasecmp(TALKATU_ACTION_FORMAT_BOLD, name) != 0) { |
| 1886 pidgin_webview_get_current_format(webview, &bold, &italic, &uline, &strike); |
|
| 1887 |
|
| 1888 if (buttons & PIDGIN_WEBVIEW_BOLD) |
|
| 1889 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_bold", |
1885 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_bold", |
| 1890 bold); |
1886 activated); |
| 1891 if (buttons & PIDGIN_WEBVIEW_ITALIC) |
1887 } else if(g_ascii_strcasecmp(TALKATU_ACTION_FORMAT_ITALIC, name) != 0) { |
| 1892 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_italic", |
1888 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_italic", |
| 1893 italic); |
1889 activated); |
| 1894 if (buttons & PIDGIN_WEBVIEW_UNDERLINE) |
1890 } else if(g_ascii_strcasecmp(TALKATU_ACTION_FORMAT_UNDERLINE, name) != 0) { |
| 1895 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_underline", |
1891 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_underline", |
| 1896 uline); |
1892 activated); |
| 1897 if (buttons & PIDGIN_WEBVIEW_STRIKE) |
1893 } else if(g_ascii_strcasecmp(TALKATU_ACTION_FORMAT_STRIKETHROUGH, name) != 0) { |
| 1898 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_strike", |
1894 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_strike", |
| 1899 strike); |
1895 activated); |
| 1900 |
1896 } |
| 1901 if (buttons & PIDGIN_WEBVIEW_GROW || buttons & PIDGIN_WEBVIEW_SHRINK) |
1897 } |
| 1902 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/font_size", |
|
| 1903 pidgin_webview_get_current_fontsize(webview)); |
|
| 1904 if (buttons & PIDGIN_WEBVIEW_FACE) { |
|
| 1905 char *face = pidgin_webview_get_current_fontface(webview); |
|
| 1906 |
|
| 1907 if (face) |
|
| 1908 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/font_face", face); |
|
| 1909 else |
|
| 1910 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/font_face", ""); |
|
| 1911 |
|
| 1912 g_free(face); |
|
| 1913 } |
|
| 1914 |
|
| 1915 if (buttons & PIDGIN_WEBVIEW_FORECOLOR) { |
|
| 1916 char *color = pidgin_webview_get_current_forecolor(webview); |
|
| 1917 |
|
| 1918 if (color) |
|
| 1919 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/fgcolor", color); |
|
| 1920 else |
|
| 1921 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/fgcolor", ""); |
|
| 1922 |
|
| 1923 g_free(color); |
|
| 1924 } |
|
| 1925 |
|
| 1926 if (buttons & PIDGIN_WEBVIEW_BACKCOLOR) { |
|
| 1927 char *color = pidgin_webview_get_current_backcolor(webview); |
|
| 1928 |
|
| 1929 if (color) |
|
| 1930 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/bgcolor", color); |
|
| 1931 else |
|
| 1932 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/bgcolor", ""); |
|
| 1933 |
|
| 1934 g_free(color); |
|
| 1935 } |
|
| 1936 } |
|
| 1937 |
|
| 1938 static void |
|
| 1939 formatting_clear_cb(PidginWebView *webview, void *data) |
|
| 1940 { |
|
| 1941 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_bold", FALSE); |
|
| 1942 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_italic", FALSE); |
|
| 1943 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_underline", FALSE); |
|
| 1944 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_strike", FALSE); |
|
| 1945 |
|
| 1946 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/font_size", 3); |
|
| 1947 |
|
| 1948 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/font_face", ""); |
|
| 1949 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/fgcolor", ""); |
|
| 1950 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/bgcolor", ""); |
|
| 1951 } |
|
| 1952 |
|
| 1953 |
1898 |
| 1954 #define CONVERSATION_CLOSE_ACCEL_PATH "<Actions>/ConversationActions/Close" |
1899 #define CONVERSATION_CLOSE_ACCEL_PATH "<Actions>/ConversationActions/Close" |
| 1955 |
1900 |
| 1956 /* Filled in in keyboard_shortcuts(). */ |
1901 /* Filled in in keyboard_shortcuts(). */ |
| 1957 static GtkAccelKey ctrl_w = { 0, 0, 0 }; |
1902 static GtkAccelKey ctrl_w = { 0, 0, 0 }; |
| 2196 win->conversations.custom_font_hbox, "sensitive", |
2140 win->conversations.custom_font_hbox, "sensitive", |
| 2197 G_BINDING_SYNC_CREATE|G_BINDING_INVERT_BOOLEAN); |
2141 G_BINDING_SYNC_CREATE|G_BINDING_INVERT_BOOLEAN); |
| 2198 } |
2142 } |
| 2199 #endif |
2143 #endif |
| 2200 |
2144 |
| |
2145 ag = talkatu_buffer_get_action_group(TALKATU_BUFFER(win->conversations.format_buffer)); |
| 2201 g_signal_connect_after(G_OBJECT(ag), "action-activated", |
2146 g_signal_connect_after(G_OBJECT(ag), "action-activated", |
| 2202 G_CALLBACK(formatting_action_cb), NULL); |
2147 G_CALLBACK(formatting_toggle_cb), NULL); |
| 2203 g_signal_connect_after(G_OBJECT(webview), "format-cleared", |
|
| 2204 G_CALLBACK(formatting_clear_cb), NULL); |
|
| 2205 win->conversations.sample_webview = webview; |
|
| 2206 } |
2148 } |
| 2207 |
2149 |
| 2208 static void |
2150 static void |
| 2209 network_ip_changed(GtkEntry *entry, gpointer data) |
2151 network_ip_changed(GtkEntry *entry, gpointer data) |
| 2210 { |
2152 { |
| 4075 gtk_widget_class_bind_template_child( |
4017 gtk_widget_class_bind_template_child( |
| 4076 widget_class, PidginPrefsWindow, |
4018 widget_class, PidginPrefsWindow, |
| 4077 conversations.minimum_entry_lines); |
4019 conversations.minimum_entry_lines); |
| 4078 gtk_widget_class_bind_template_child( |
4020 gtk_widget_class_bind_template_child( |
| 4079 widget_class, PidginPrefsWindow, |
4021 widget_class, PidginPrefsWindow, |
| 4080 conversations.sample_box); |
4022 conversations.format_buffer); |
| |
4023 gtk_widget_class_bind_template_child( |
| |
4024 widget_class, PidginPrefsWindow, |
| |
4025 conversations.format_view); |
| 4081 #ifdef WIN32 |
4026 #ifdef WIN32 |
| 4082 gtk_widget_class_bind_template_child( |
4027 gtk_widget_class_bind_template_child( |
| 4083 widget_class, PidginPrefsWindow, |
4028 widget_class, PidginPrefsWindow, |
| 4084 conversations.font_frame); |
4029 conversations.font_frame); |
| 4085 gtk_widget_class_bind_template_child( |
4030 gtk_widget_class_bind_template_child( |