--- a/libpurple/proxy.c Wed May 30 22:05:28 2012 +0000
+++ b/libpurple/proxy.c Sat Jun 02 02:39:29 2012 +0000
@@ -232,41 +232,105 @@
global_proxy_info = info;
+/* index in gproxycmds below, keep them in sync */ +#define GNOME_PROXY_MODE 0 +#define GNOME_PROXY_USE_SAME_PROXY 1 +#define GNOME_PROXY_SOCKS_HOST 2 +#define GNOME_PROXY_SOCKS_PORT 3 +#define GNOME_PROXY_HTTP_HOST 4 +#define GNOME_PROXY_HTTP_PORT 5 +#define GNOME_PROXY_HTTP_USER 6 +#define GNOME_PROXY_HTTP_PASS 7 +/* detect proxy settings for gnome2/gnome3 */ +static const char* gproxycmds[][2] = { + { "gconftool-2 -g /system/proxy/mode" , "gsettings get org.gnome.system.proxy mode" }, + { "gconftool-2 -g /system/http_proxy/use_same_proxy", "gsettings get org.gnome.system.proxy use-same-proxy" }, + { "gconftool-2 -g /system/proxy/socks_host", "gsettings get org.gnome.system.proxy.socks host" }, + { "gconftool-2 -g /system/proxy/socks_port", "gsettings get org.gnome.system.proxy.socks port" }, + { "gconftool-2 -g /system/http_proxy/host", "gsettings get org.gnome.system.proxy.http host" }, + { "gconftool-2 -g /system/http_proxy/port", "gsettings get org.gnome.system.proxy.http port"}, + { "gconftool-2 -g /system/http_proxy/authentication_user", "gsettings get org.gnome.system.proxy.http authentication-user" }, + { "gconftool-2 -g /system/http_proxy/authentication_password", "gsettings get org.gnome.system.proxy.http authentication-password" }, + * This is a utility function used to retrieve proxy parameter values from + * GNOME 2/3 environment. + * @param parameter One of the GNOME_PROXY_x constants defined above + * @param gnome_version GNOME2_CMDS or GNOME3_CMDS + * @return The value of requested proxy parameter +purple_gnome_proxy_get_parameter(guint8 parameter, guint8 gnome_version) + if (parameter > GNOME_PROXY_HTTP_PASS) + if (gnome_version > GNOME3_CMDS) + if (!g_spawn_command_line_sync(gproxycmds[parameter][gnome_version], + ¶m, &err, NULL, NULL)) + if (param[0] == '\'' || param[0] == '\"') { + param_len = strlen(param); + memmove(param, param + 1, param_len); /* copy last \0 too */ + if (param_len > 0 && (param[param_len - 1] == '\'' || param[param_len - 1] == '\"')) + param[param_len - 1] = '\0'; purple_gnome_proxy_get_info(void)
static PurpleProxyInfo info = {0, NULL, 0, NULL, NULL};
gboolean use_same_proxy = FALSE;
- gchar *tmp, *err = NULL;
- tmp = g_find_program_in_path("gconftool-2");
+ guint8 gnome_version = GNOME3_CMDS; + tmp = g_find_program_in_path("gsettings"); + tmp = g_find_program_in_path("gconftool-2"); + gnome_version = GNOME2_CMDS; return purple_global_proxy_get_info();
/* Check whether to use a proxy. */
- if (!g_spawn_command_line_sync("gconftool-2 -g /system/proxy/mode",
- &tmp, &err, NULL, NULL))
+ tmp = purple_gnome_proxy_get_parameter(GNOME_PROXY_MODE, gnome_version); return purple_global_proxy_get_info();
- if (purple_strequal(tmp, "none\n")) {
+ if (purple_strequal(tmp, "none")) { info.type = PURPLE_PROXY_NONE;
- if (!purple_strequal(tmp, "manual\n")) {
+ if (!purple_strequal(tmp, "manual")) { /* Unknown setting. Fallback to using our global proxy settings. */
return purple_global_proxy_get_info();
/* Free the old fields */
@@ -282,52 +346,40 @@
- if (!g_spawn_command_line_sync("gconftool-2 -g /system/http_proxy/use_same_proxy",
- &tmp, &err, NULL, NULL))
+ tmp = purple_gnome_proxy_get_parameter(GNOME_PROXY_USE_SAME_PROXY, gnome_version); return purple_global_proxy_get_info();
- if (purple_strequal(tmp, "true\n"))
+ if (purple_strequal(tmp, "true"))
- if (!g_spawn_command_line_sync("gconftool-2 -g /system/proxy/socks_host",
- &info.host, &err, NULL, NULL))
+ info.host = purple_gnome_proxy_get_parameter(GNOME_PROXY_SOCKS_HOST, gnome_version); return purple_global_proxy_get_info();
if (!use_same_proxy && (info.host != NULL) && (*info.host != '\0')) {
info.type = PURPLE_PROXY_SOCKS5;
- if (!g_spawn_command_line_sync("gconftool-2 -g /system/proxy/socks_port",
- &tmp, &err, NULL, NULL))
+ tmp = purple_gnome_proxy_get_parameter(GNOME_PROXY_SOCKS_PORT, gnome_version); return purple_global_proxy_get_info();
- if (!g_spawn_command_line_sync("gconftool-2 -g /system/http_proxy/host",
- &info.host, &err, NULL, NULL))
+ info.host = purple_gnome_proxy_get_parameter(GNOME_PROXY_HTTP_HOST, gnome_version); return purple_global_proxy_get_info();
/* If we get this far then we know we're using an HTTP proxy */
info.type = PURPLE_PROXY_HTTP;
purple_debug_info("proxy", "Gnome proxy settings are set to "
@@ -338,19 +390,16 @@
return purple_global_proxy_get_info();
- if (!g_spawn_command_line_sync("gconftool-2 -g /system/http_proxy/authentication_user",
- &info.username, &err, NULL, NULL))
+ info.username = purple_gnome_proxy_get_parameter(GNOME_PROXY_HTTP_USER, gnome_version); return purple_global_proxy_get_info();
- g_strchomp(info.username);
- if (!g_spawn_command_line_sync("gconftool-2 -g /system/http_proxy/authentication_password",
- &info.password, &err, NULL, NULL))
+ info.password = purple_gnome_proxy_get_parameter(GNOME_PROXY_HTTP_PASS, gnome_version); @@ -358,12 +407,9 @@
return purple_global_proxy_get_info();
- g_strchomp(info.password);
- if (!g_spawn_command_line_sync("gconftool-2 -g /system/http_proxy/port",
- &tmp, &err, NULL, NULL))
+ tmp = purple_gnome_proxy_get_parameter(GNOME_PROXY_HTTP_PORT, gnome_version); @@ -373,7 +419,6 @@
return purple_global_proxy_get_info();
--- a/pidgin/gtkblist.c Wed May 30 22:05:28 2012 +0000
+++ b/pidgin/gtkblist.c Sat Jun 02 02:39:29 2012 +0000
@@ -5958,8 +5958,6 @@
gtk_widget_set_name(gtkblist->headline_hbox, "gtk-tooltips");
- gtkblist->headline_close = gtk_widget_render_icon(ebox, GTK_STOCK_CLOSE,
- gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_MICROSCOPIC), NULL);
gtkblist->hand_cursor = gdk_cursor_new (GDK_HAND2);
gtkblist->arrow_cursor = gdk_cursor_new (GDK_LEFT_PTR);
@@ -6066,19 +6064,10 @@
gtkblist->scrollbook = pidgin_scroll_book_new();
gtk_box_pack_start(GTK_BOX(gtkblist->vbox), gtkblist->scrollbook, FALSE, FALSE, 0);
- /* Create an vbox which holds the scrollbook which is actually used to
- * display connection errors. The vbox needs to still exist for
- * backwards compatibility.
- gtkblist->error_buttons = gtk_vbox_new(FALSE, 0);
- gtk_box_pack_start(GTK_BOX(gtkblist->vbox), gtkblist->error_buttons, FALSE, FALSE, 0);
- gtk_container_set_border_width(GTK_CONTAINER(gtkblist->error_buttons), 0);
priv->error_scrollbook = PIDGIN_SCROLL_BOOK(pidgin_scroll_book_new());
- gtk_box_pack_start(GTK_BOX(gtkblist->error_buttons),
+ gtk_box_pack_start(GTK_BOX(gtkblist->vbox), GTK_WIDGET(priv->error_scrollbook), FALSE, FALSE, 0);
gtkblist->statusbox = pidgin_status_box_new();
gtk_box_pack_start(GTK_BOX(gtkblist->vbox), gtkblist->statusbox, FALSE, TRUE, 0);
@@ -6963,9 +6952,6 @@
purple_signals_disconnect_by_handle(gtkblist);
- if (gtkblist->headline_close)
- g_object_unref(G_OBJECT(gtkblist->headline_close));
gtk_widget_destroy(gtkblist->window);
pidgin_blist_tooltip_destroy();
--- a/pidgin/gtkblist.h Wed May 30 22:05:28 2012 +0000
+++ b/pidgin/gtkblist.h Sat Jun 02 02:39:29 2012 +0000
@@ -110,13 +110,11 @@
GtkWidget *headline_hbox; /**< Hbox for headline notification */
GtkWidget *headline_label; /**< Label for headline notifications */
GtkWidget *headline_image; /**< Image for headline notifications */
- GdkPixbuf *headline_close; /**< @deprecated: Close image for closing the headline without triggering the callback */
GCallback headline_callback; /**< Callback for headline notifications */
gpointer headline_data; /**< User data for headline notifications */
GDestroyNotify headline_destroy; /**< Callback to use for destroying the headline-data */
gboolean changing_style; /**< True when changing GTK+ theme style */
- GtkWidget *error_buttons; /**< Box containing the connection error buttons */
GtkWidget *statusbox; /**< The status selector dropdown */
GdkPixbuf *empty_avatar; /**< A 32x32 transparent pixbuf */
--- a/pidgin/gtkconv.c Wed May 30 22:05:28 2012 +0000
+++ b/pidgin/gtkconv.c Sat Jun 02 02:39:29 2012 +0000
@@ -1500,13 +1500,6 @@
-menu_timestamps_cb(GtkAction *action, gpointer data)
- purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/show_timestamps",
- gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(action)));
chat_do_im(PidginConversation *gtkconv, const char *who)
PurpleConversation *conv = gtkconv->active_conv;
@@ -3160,7 +3153,6 @@
{ "EnableLogging", NULL, N_("Enable _Logging"), NULL, NULL, G_CALLBACK(menu_logging_cb), FALSE },
{ "EnableSounds", NULL, N_("Enable _Sounds"), NULL, NULL, G_CALLBACK(menu_sounds_cb), FALSE },
{ "ShowFormattingToolbars", NULL, N_("Show Formatting _Toolbars"), NULL, NULL, G_CALLBACK(menu_toolbar_cb), FALSE },
- { "ShowTimestamps", NULL, N_("Show Ti_mestamps"), NULL, NULL, G_CALLBACK(menu_timestamps_cb), FALSE },
static const char *conversation_menu =
@@ -3205,7 +3197,6 @@
"<menuitem action='EnableSounds'/>"
"<menuitem action='ShowFormattingToolbars'/>"
- "<menuitem action='ShowTimestamps'/>"
@@ -3694,9 +3685,6 @@
win->menu.show_formatting_toolbar =
gtk_ui_manager_get_action(win->menu.ui,
"/Conversation/OptionsMenu/ShowFormattingToolbars");
- win->menu.show_timestamps =
- gtk_ui_manager_get_action(win->menu.ui,
- "/Conversation/OptionsMenu/ShowTimestamps");
win->menu.tray = pidgin_menu_tray_new();
gtk_menu_shell_append(GTK_MENU_SHELL(win->menu.menubar),
@@ -6671,10 +6659,13 @@
static gboolean get_iter_from_chatbuddy(PurpleConvChatBuddy *cb, GtkTreeIter *iter)
- GtkTreeRowReference *ref = purple_conv_chat_cb_get_ui_data(cb);
+ GtkTreeRowReference *ref; + g_return_val_if_fail(cb != NULL, FALSE); + ref = purple_conv_chat_cb_get_ui_data(cb); @@ -6854,6 +6845,9 @@
cbuddy = purple_conv_chat_cb_find(chat, user);
if (get_iter_from_chatbuddy(cbuddy, &iter)) {
GtkTreeRowReference *ref = purple_conv_chat_cb_get_ui_data(cbuddy);
gtk_list_store_remove(GTK_LIST_STORE(model), &iter);
@@ -7878,37 +7872,6 @@
-show_timestamps_pref_cb(const char *name, PurplePrefType type,
- gconstpointer value, gpointer data)
- PurpleConversation *conv;
- PidginConversation *gtkconv;
- for (l = purple_get_conversations(); l != NULL; l = l->next)
- conv = (PurpleConversation *)l->data;
- if (!PIDGIN_IS_PIDGIN_CONVERSATION(conv))
- gtkconv = PIDGIN_CONVERSATION(conv);
- gtk_toggle_action_set_active(
- GTK_TOGGLE_ACTION(win->menu.show_timestamps),
- (gboolean)GPOINTER_TO_INT(value));
-/* TODO WEBKIT: Use WebKit version of this. */
- gtk_imhtml_show_comments(GTK_IMHTML(gtkconv->imhtml),
- (gboolean)GPOINTER_TO_INT(value));
show_formatting_toolbar_pref_cb(const char *name, PurplePrefType type,
gconstpointer value, gpointer data)
@@ -8448,6 +8411,12 @@
+pidgin_conversations_get_default_theme(void) + return default_conv_theme; pidgin_conversations_get_handle(void)
@@ -8478,7 +8447,6 @@
purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/custom_smileys_size", 96);
purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/minimum_entry_lines", 2);
- purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/show_timestamps", TRUE);
purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/show_formatting_toolbar", TRUE);
purple_prefs_add_string(PIDGIN_PREFS_ROOT "/conversations/placement", "last");
@@ -8527,8 +8495,6 @@
purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/conversations/close_on_tabs",
close_on_tabs_pref_cb, NULL);
- purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/conversations/show_timestamps",
- show_timestamps_pref_cb, NULL);
purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/conversations/show_formatting_toolbar",
show_formatting_toolbar_pref_cb, NULL);
purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/conversations/spellcheck",
@@ -9747,9 +9713,6 @@
gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(win->menu.show_formatting_toolbar),
purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/show_formatting_toolbar"));
- gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(win->menu.show_timestamps),
- purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/show_timestamps"));
* We pause icons when they are not visible. If this icon should
* be animated then start it back up again.
--- a/pidgin/gtknotify.c Wed May 30 22:05:28 2012 +0000
+++ b/pidgin/gtknotify.c Sat Jun 02 02:39:29 2012 +0000
@@ -882,7 +882,7 @@
/* Make sure URLs are clickable */
linked_text = purple_markup_linkify(text);
- webkit_web_view_load_html_string(WEBKIT_WEB_VIEW(web_view), linked_text, "");
+ gtk_webview_load_html_string(GTK_WEBVIEW(web_view), linked_text); g_object_set_data(G_OBJECT(window), "webview-widget", web_view);
@@ -1142,7 +1142,7 @@
GtkWidget *webview = g_object_get_data(G_OBJECT(pinfo->window), "webview-widget");
char *linked_text = purple_markup_linkify(info);
- gtk_webview_load_html_string_with_imgstore(GTK_WEBVIEW(webview), linked_text);
+ gtk_webview_load_html_string(GTK_WEBVIEW(webview), linked_text); ui_handle = pinfo->window;
--- a/pidgin/gtkprefs.c Wed May 30 22:05:28 2012 +0000
+++ b/pidgin/gtkprefs.c Sat Jun 02 02:39:29 2012 +0000
@@ -1108,7 +1108,10 @@
if (gtk_combo_box_get_active_iter(GTK_COMBO_BOX(prefs_conv_themes_combo_box), &iter)) {
gtk_tree_model_get(GTK_TREE_MODEL(prefs_conv_themes), &iter, 2, &name, -1);
- theme = PIDGIN_CONV_THEME(purple_theme_manager_find_theme(name, "conversation"));
+ theme = PIDGIN_CONV_THEME(purple_theme_manager_find_theme(name, "conversation")); + theme = PIDGIN_CONV_THEME(pidgin_conversations_get_default_theme()); if (gtk_combo_box_get_active_iter(combo_box, &iter)) {
@@ -1127,6 +1130,10 @@
if (gtk_combo_box_get_active_iter(combo_box, &iter)) {
+ PidginConvTheme *theme; + const char *current_variant; gtk_tree_model_get(GTK_TREE_MODEL(prefs_conv_themes), &iter, 2, &name, -1);
@@ -1138,30 +1145,27 @@
/* Update list of variants */
gtk_list_store_clear(prefs_conv_variants);
- PidginConvTheme *theme;
- const char *current_variant;
theme = PIDGIN_CONV_THEME(purple_theme_manager_find_theme(name, "conversation"));
- current_variant = pidgin_conversation_theme_get_variant(theme);
- variants = pidgin_conversation_theme_get_variants(theme);
- for (; variants && current_variant; variants = g_list_next(variants)) {
- gtk_list_store_append(prefs_conv_variants, &iter);
- gtk_list_store_set(prefs_conv_variants, &iter, 0, variants->data, -1);
+ theme = PIDGIN_CONV_THEME(pidgin_conversations_get_default_theme()); + current_variant = pidgin_conversation_theme_get_variant(theme); + variants = pidgin_conversation_theme_get_variants(theme); + for (; variants && current_variant; variants = g_list_next(variants)) { + gtk_list_store_append(prefs_conv_variants, &iter); + gtk_list_store_set(prefs_conv_variants, &iter, 0, variants->data, -1); - if (g_str_equal(variants->data, current_variant)) {
- gtk_combo_box_set_active_iter(GTK_COMBO_BOX(prefs_conv_variants_combo_box), &iter);
+ if (g_str_equal(variants->data, current_variant)) { + gtk_combo_box_set_active_iter(GTK_COMBO_BOX(prefs_conv_variants_combo_box), &iter);
- gtk_combo_box_set_active(GTK_COMBO_BOX(prefs_conv_variants_combo_box), 0);
+ gtk_combo_box_set_active(GTK_COMBO_BOX(prefs_conv_variants_combo_box), 0); g_signal_handlers_unblock_by_func(prefs_conv_variants_combo_box,
prefs_set_conv_variant_cb, NULL);
--- a/pidgin/plugins/xmppconsole.c Wed May 30 22:05:28 2012 +0000
+++ b/pidgin/plugins/xmppconsole.c Sat Jun 02 02:39:29 2012 +0000
@@ -26,6 +26,7 @@
@@ -33,7 +34,7 @@
@@ -43,31 +44,34 @@
XmppConsole *console = NULL;
static void *xmpp_console_handle = NULL;
-#define BRACKET_COLOR "#940f8c"
-#define TAG_COLOR "#8b1dab"
-#define ATTR_NAME_COLOR "#a02961"
-#define ATTR_VALUE_COLOR "#324aa4"
-#define XMLNS_COLOR "#2cb12f"
+"<html><head><style type='text/css'>" \ + "body { word-wrap: break-word; margin: 0; }" \ + "div.tab { padding-left: 1em; }" \ + "div.info { color: #777777; }" \ + "div.incoming { background-color: #ffcece; }" \ + "div.outgoing { background-color: #dcecc4; }" \ + "span.bracket { color: #940f8c; }" \ + "span.tag { color: #8b1dab; font-weight: bold; }" \ + "span.attr { color: #a02961; font-weight: bold; }" \ + "span.value { color: #324aa4; }" \ + "span.xmlns { color: #2cb12f; font-weight: bold;}" \ +"</style></head></html>" -xmlnode_to_pretty_str(xmlnode *node, int *len, int depth)
+xmlnode_to_pretty_str(xmlnode *node, int *len) GString *text = g_string_new("");
- char *node_name, *esc, *esc2, *tab = NULL;
+ char *node_name, *esc, *esc2; gboolean need_end = FALSE, pretty = TRUE;
g_return_val_if_fail(node != NULL, NULL);
- tab = g_strnfill(depth, '\t');
- text = g_string_append(text, tab);
node_name = g_markup_escape_text(node->name, -1);
g_string_append_printf(text,
- "<font color='" BRACKET_COLOR "'><</font>"
- "<font color='" TAG_COLOR "'><b>%s</b></font>",
+ "<span class=bracket><</span>" + "<span class=tag>%s</span>", @@ -78,8 +82,8 @@
char *xmlns = g_markup_escape_text(node->xmlns, -1);
g_string_append_printf(text,
- " <font color='" ATTR_NAME_COLOR "'><b>xmlns</b></font>="
- "'<font color='" XMLNS_COLOR "'><b>%s</b></font>'",
+ " <span class=attr>xmlns</span>=" + "'<span class=xmlns>%s</span>'", @@ -90,8 +94,8 @@
esc = g_markup_escape_text(c->name, -1);
esc2 = g_markup_escape_text(c->data, -1);
g_string_append_printf(text,
- " <font color='" ATTR_NAME_COLOR "'><b>%s</b></font>="
- "'<font color='" ATTR_VALUE_COLOR "'>%s</font>'",
+ " <span class=attr>%s</span>=" + "'<span class=value>%s</span>'", @@ -104,14 +108,19 @@
g_string_append_printf(text,
- "<font color='"BRACKET_COLOR"'>></font>%s",
+ "<span class=bracket>></span>%s", for (c = node->child; c; c = c->next)
if (c->type == XMLNODE_TYPE_TAG) {
- esc = xmlnode_to_pretty_str(c, &esc_len, depth+1);
+ esc = xmlnode_to_pretty_str(c, &esc_len); + g_string_append(text, "<div class=tab>"); text = g_string_append_len(text, esc, esc_len);
} else if (c->type == XMLNODE_TYPE_DATA && c->data_sz > 0) {
@@ -121,23 +130,22 @@
- text = g_string_append(text, tab);
+ g_string_append(text, "</div>"); g_string_append_printf(text,
- "<font color='" BRACKET_COLOR "'><</font>/"
- "<font color='" TAG_COLOR "'><b>%s</b></font>"
- "<font color='" BRACKET_COLOR "'>></font><br>",
+ "<span class=bracket><</span>/" + "<span class=tag>%s</span>" + "<span class=bracket>></span><br>", g_string_append_printf(text,
- "/<font color='" BRACKET_COLOR "'>></font><br>");
+ "/<span class=bracket>></span><br>");
return g_string_free(text, FALSE);
@@ -150,9 +158,9 @@
if (!console || console->gc != gc)
- str = xmlnode_to_pretty_str(*packet, NULL, 0);
- formatted = g_strdup_printf("<body bgcolor='#ffcece'><pre>%s</pre></body>", str);
- gtk_imhtml_append_text(GTK_IMHTML(console->imhtml), formatted, 0);
+ str = xmlnode_to_pretty_str(*packet, NULL); + formatted = g_strdup_printf("<div class=incoming>%s</div>", str); + gtk_webview_append_html(GTK_WEBVIEW(console->webview), formatted); @@ -171,9 +179,9 @@
- str = xmlnode_to_pretty_str(node, NULL, 0);
- formatted = g_strdup_printf("<body bgcolor='#dcecc4'><pre>%s</pre></body>", str);
- gtk_imhtml_append_text(GTK_IMHTML(console->imhtml), formatted, 0);
+ str = xmlnode_to_pretty_str(node, NULL); + formatted = g_strdup_printf("<div class=outgoing>%s</div>", str); + gtk_webview_append_html(GTK_WEBVIEW(console->webview), formatted); @@ -274,7 +282,9 @@
- /* TODO: how to set no separator for GtkDialog in gtk+ 3.0... */
+#if !GTK_CHECK_VERSION(2,22,0) + gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE); gtk_dialog_set_default_response (GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT);
gtk_container_set_border_width(GTK_CONTAINER(dialog), 12);
#if GTK_CHECK_VERSION(2,14,0)
@@ -362,9 +372,9 @@
- /* TODO: find a way to specify no separator for a dialog in gtk+ 3 */
- /*gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE);*/
+#if !GTK_CHECK_VERSION(2,22,0) + gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE); gtk_dialog_set_default_response (GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT);
gtk_container_set_border_width(GTK_CONTAINER(dialog), 12);
#if GTK_CHECK_VERSION(2,14,0)
@@ -522,8 +532,9 @@
- /* TODO: find a way to create a dialog without separtor in gtk+ 3 */
- /*gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE);*/
+#if !GTK_CHECK_VERSION(2,22,0) + gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE); gtk_dialog_set_default_response (GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT);
gtk_container_set_border_width(GTK_CONTAINER(dialog), 12);
#if GTK_CHECK_VERSION(2,14,0)
@@ -644,17 +655,25 @@
signing_on_cb(PurpleConnection *gc)
+ PurpleAccount *account; + account = purple_connection_get_account(gc); + if (strcmp(purple_account_get_protocol_id(account), "prpl-jabber")) gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(console->dropdown),
- purple_account_get_username(purple_connection_get_account(gc)));
+ purple_account_get_username(account)); console->accounts = g_list_append(console->accounts, gc);
- if (console->count == 1)
+ if (console->count == 1) {
+ gtk_webview_load_html_string(GTK_WEBVIEW(console->webview), EMPTY_HTML); + gtk_combo_box_set_active(GTK_COMBO_BOX(console->dropdown), 0); gtk_widget_show_all(console->hbox);
@@ -684,9 +703,11 @@
+ char *tmp = g_strdup_printf("<div class=info>%s</div>", + gtk_webview_append_html(GTK_WEBVIEW(console->webview), tmp); - gtk_imhtml_append_text(GTK_IMHTML(console->imhtml),
- _("<font color='#777777'>Logged out.</font>"), 0);
@@ -731,19 +752,11 @@
dropdown_changed_cb(GtkComboBox *widget, gpointer nul)
- PurpleAccount *account;
- purple_accounts_find(gtk_combo_box_text_get_active_text(
- GTK_COMBO_BOX_TEXT(console->dropdown)), "prpl-jabber");
- if (!account || !purple_account_get_connection(account))
- console->gc = purple_account_get_connection(account);
- gtk_imhtml_clear(GTK_IMHTML(console->imhtml));
+ console->gc = g_list_nth_data(console->accounts, gtk_combo_box_get_active(GTK_COMBO_BOX(console->dropdown))); + gtk_webview_load_html_string(GTK_WEBVIEW(console->webview), EMPTY_HTML); @@ -785,16 +798,20 @@
- gtk_combo_box_set_active(GTK_COMBO_BOX(console->dropdown),0);
+ gtk_combo_box_set_active(GTK_COMBO_BOX(console->dropdown), 0); gtk_box_pack_start(GTK_BOX(console->hbox), console->dropdown, TRUE, TRUE, 0);
g_signal_connect(G_OBJECT(console->dropdown), "changed", G_CALLBACK(dropdown_changed_cb), NULL);
- console->imhtml = gtk_imhtml_new(NULL, NULL);
- if (console->count == 0)
- gtk_imhtml_append_text(GTK_IMHTML(console->imhtml),
- _("<font color='#777777'>Not connected to XMPP</font>"), 0);
+ console->webview = gtk_webview_new(); + gtk_webview_load_html_string(GTK_WEBVIEW(console->webview), EMPTY_HTML); + if (console->count == 0) { + char *tmp = g_strdup_printf("<div class=info>%s</div>", + _("Not connected to XMPP")); + gtk_webview_append_html(GTK_WEBVIEW(console->webview), tmp); gtk_box_pack_start(GTK_BOX(vbox),
- pidgin_make_scrollable(console->imhtml, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC, GTK_SHADOW_ETCHED_IN, -1, -1),
+ pidgin_make_scrollable(console->webview, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC, GTK_SHADOW_ETCHED_IN, -1, -1), toolbar = gtk_toolbar_new();