Mercurial > pidgin
changeset 29474:551253814063
propagate from branch 'im.pidgin.cpw.rekkanoryo.icqxstatus' (head e5b3d36eb4253a3458d91bf5421f5b8a78152991)
to branch 'im.pidgin.pidgin' (head f6fb60976c8b5d0548af201452be83cafc7a0153)
author | Marcus Lundblad <ml@update.uu.se> |
---|---|
date | Sun, 21 Feb 2010 00:11:56 +0000 |
parents | 185677f47825 (current diff) 8d2a8d07cf85 (diff) |
children | 6d2ba42595fe 6359fde67f4c |
files | pidgin/gtkdocklet-x11.c pidgin/gtkrequest.c pidgin/gtksavedstatuses.c pidgin/pixmaps/emblems/16/mobile.png pidgin/pixmaps/emblems/16/music.png pidgin/pixmaps/emblems/scalable/mobile.svg pidgin/pixmaps/emblems/scalable/music.svg pidgin/pixmaps/emotes/default/24/eat.png pidgin/pixmaps/emotes/default/24/in-love.png pidgin/pixmaps/emotes/default/24/love.png pidgin/pixmaps/emotes/default/24/nailbiting.png pidgin/pixmaps/emotes/default/24/shock.png pidgin/pixmaps/emotes/default/24/smile-big.png pidgin/pixmaps/emotes/default/24/smile.png pidgin/pixmaps/emotes/default/24/sweat.png pidgin/pixmaps/emotes/default/24/tremble.png pidgin/pixmaps/emotes/default/24/yawn.png pidgin/pixmaps/emotes/small/16/love.png pidgin/pixmaps/emotes/small/16/shock.png pidgin/pixmaps/emotes/small/16/smile-big.png pidgin/pixmaps/emotes/small/16/smile.png pidgin/pixmaps/emotes/small/16/yawn.png po/POTFILES.in |
diffstat | 22 files changed, 258 insertions(+), 621 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/Makefile.mingw Thu Feb 18 21:38:43 2010 +0000 +++ b/libpurple/Makefile.mingw Sun Feb 21 00:11:56 2010 +0000 @@ -8,7 +8,7 @@ include $(PIDGIN_TREE_TOP)/libpurple/win32/global.mak TARGET = libpurple -NEEDED_DLLS = $(LIBXML2_TOP)/bin/libxml2.dll +NEEDED_DLLS = $(LIBXML2_TOP)/bin/libxml2-2.dll ## ## INCLUDE PATHS @@ -20,7 +20,7 @@ -I$(GTK_TOP)/include \ -I$(GTK_TOP)/include/glib-2.0 \ -I$(GTK_TOP)/lib/glib-2.0/include \ - -I$(LIBXML2_TOP)/include + -I$(LIBXML2_TOP)/include/libxml2 LIB_PATHS += -L$(GTK_TOP)/lib \ -L$(LIBXML2_TOP)/lib
--- a/libpurple/plugins/log_reader.c Thu Feb 18 21:38:43 2010 +0000 +++ b/libpurple/plugins/log_reader.c Sun Feb 21 00:11:56 2010 +0000 @@ -2644,7 +2644,7 @@ g_free(contents); } g_free(path); -#endif /* !GTK_CHECK_VERSION(2,6,0) */ +#endif /* !GLIB_CHECK_VERSION(2,6,0) */ } /* path */ if (!found) {
--- a/libpurple/protocols/bonjour/Makefile.mingw Thu Feb 18 21:38:43 2010 +0000 +++ b/libpurple/protocols/bonjour/Makefile.mingw Sun Feb 21 00:11:56 2010 +0000 @@ -30,7 +30,7 @@ -I$(GTK_TOP)/include/glib-2.0 \ -I$(GTK_TOP)/lib/glib-2.0/include \ -I$(BONJOUR_TOP)/Include \ - -I$(LIBXML2_TOP)/include \ + -I$(LIBXML2_TOP)/include/libxml2 \ -I$(PURPLE_TOP) \ -I$(PURPLE_TOP)/win32 \ -I$(PIDGIN_TREE_TOP)
--- a/libpurple/protocols/jabber/Makefile.mingw Thu Feb 18 21:38:43 2010 +0000 +++ b/libpurple/protocols/jabber/Makefile.mingw Sun Feb 21 00:11:56 2010 +0000 @@ -29,7 +29,7 @@ -I$(GTK_TOP)/include \ -I$(GTK_TOP)/include/glib-2.0 \ -I$(GTK_TOP)/lib/glib-2.0/include \ - -I$(LIBXML2_TOP)/include \ + -I$(LIBXML2_TOP)/include/libxml2 \ -I$(PURPLE_TOP) \ -I$(PURPLE_TOP)/win32 \ -I$(PIDGIN_TREE_TOP)
--- a/libpurple/protocols/oscar/clientlogin.c Thu Feb 18 21:38:43 2010 +0000 +++ b/libpurple/protocols/oscar/clientlogin.c Sun Feb 21 00:11:56 2010 +0000 @@ -43,7 +43,7 @@ #include "core.h" #define URL_CLIENT_LOGIN "https://api.screenname.aol.com/auth/clientLogin" -#define URL_START_OSCAR_SESSION "http://api.oscar.aol.com/aim/startOSCARSession" +#define URL_START_OSCAR_SESSION "https://api.oscar.aol.com/aim/startOSCARSession" /* * Using clientLogin requires a developer ID. This key is for libpurple. @@ -177,10 +177,23 @@ code = atoi(tmp); if (code != 200) { + xmlnode *status_detail_node; + guint status_detail = 0; + + status_detail_node = xmlnode_get_child(response_node, + "statusDetailCode"); + if (status_detail_node) { + gchar *data = xmlnode_get_data(status_detail_node); + if (data) { + status_detail = atoi(data); + g_free(data); + } + } + purple_debug_error("oscar", "startOSCARSession response statusCode " "was %s: %s\n", tmp, response); - if (code == 401 || code == 607) + if ((code == 401 && status_detail != 1014) || code == 607) purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, _("You have been connecting and disconnecting too " @@ -293,7 +306,11 @@ static void send_start_oscar_session(OscarData *od, const char *token, const char *session_key, time_t hosttime) { char *query_string, *signature, *url; - gboolean use_tls = purple_account_get_bool(purple_connection_get_account(od->gc), "use_ssl", OSCAR_DEFAULT_USE_SSL); + PurpleAccount *account; + gboolean use_tls; + + account = purple_connection_get_account(od->gc); + use_tls = purple_account_get_bool(account, "use_ssl", OSCAR_DEFAULT_USE_SSL); /* * Construct the GET parameters. 0x00000611 is the distid given to @@ -317,7 +334,8 @@ g_free(signature); /* Make the request */ - od->url_data = purple_util_fetch_url(url, TRUE, NULL, FALSE, + od->url_data = purple_util_fetch_url_request_len_with_account(account, + url, TRUE, NULL, FALSE, NULL, FALSE, -1, start_oscar_session_cb, od); g_free(url); } @@ -573,8 +591,9 @@ g_string_free(body, TRUE); /* Send the POST request */ - od->url_data = purple_util_fetch_url_request(URL_CLIENT_LOGIN, - TRUE, NULL, FALSE, request->str, FALSE, + od->url_data = purple_util_fetch_url_request_len_with_account( + purple_connection_get_account(gc), URL_CLIENT_LOGIN, + TRUE, NULL, FALSE, request->str, FALSE, -1, client_login_cb, od); g_string_free(request, TRUE); }
--- a/libpurple/win32/global.mak Thu Feb 18 21:38:43 2010 +0000 +++ b/libpurple/win32/global.mak Sun Feb 21 00:11:56 2010 +0000 @@ -15,7 +15,7 @@ GTK_TOP ?= $(WIN32_DEV_TOP)/gtk_2_0-2.14 GTK_BIN ?= $(GTK_TOP)/bin BONJOUR_TOP ?= $(WIN32_DEV_TOP)/Bonjour_SDK -LIBXML2_TOP ?= $(WIN32_DEV_TOP)/libxml2-2.6.30 +LIBXML2_TOP ?= $(WIN32_DEV_TOP)/libxml2-2.7.3 MEANWHILE_TOP ?= $(WIN32_DEV_TOP)/meanwhile-1.0.2_daa2 NSPR_TOP ?= $(WIN32_DEV_TOP)/nspr-4.6.4 NSS_TOP ?= $(WIN32_DEV_TOP)/nss-3.11.4
--- a/libpurple/win32/libc_interface.c Thu Feb 18 21:38:43 2010 +0000 +++ b/libpurple/win32/libc_interface.c Sun Feb 21 00:11:56 2010 +0000 @@ -33,6 +33,7 @@ #include "libc_internal.h" #include <glib/gstdio.h> +/** This is redefined here because we can't include internal.h */ #ifdef ENABLE_NLS # include <locale.h> # include <libintl.h> @@ -1047,29 +1048,12 @@ return ""; } +int wpurple_g_access (const gchar *filename, int mode); /** - * g_access: - * @filename: a pathname in the GLib file name encoding (UTF-8 on Windows) - * @mode: as in access() - * - * A wrapper for the POSIX access() function. This function is used to - * test a pathname for one or several of read, write or execute - * permissions, or just existence. On Windows, the underlying access() - * function in the C library only checks the READONLY attribute, and - * does not look at the ACL at all. Software that needs to handle file - * permissions on Windows more exactly should use the Win32 API. - * - * See the C library manual for more details about access(). - * - * Returns: zero if the pathname refers to an existing file system - * object that has all the tested permissions, or -1 otherwise or on - * error. - * - * Since: 2.8 + * @deprecated - remove for 3.0.0 */ int -wpurple_g_access (const gchar *filename, - int mode) +wpurple_g_access (const gchar *filename, int mode) { return g_access(filename, mode); }
--- a/libpurple/win32/libc_interface.h Thu Feb 18 21:38:43 2010 +0000 +++ b/libpurple/win32/libc_interface.h Sun Feb 21 00:11:56 2010 +0000 @@ -129,19 +129,14 @@ wpurple_gettimeofday( timeval, timezone ) /* stdio.h */ +#undef snprintf #define snprintf _snprintf +#undef vsnprintf #define vsnprintf _vsnprintf #define rename( oldname, newname ) \ wpurple_rename( oldname, newname ) -#ifdef g_rename -# undef g_rename -#endif -/* This is necessary because we want rename on win32 to be able to overwrite an existing file, it is done in internal.h if GLib < 2.6*/ -#define g_rename(oldname, newname) \ -wpurple_rename(oldname, newname) - /* sys/stat.h */ #define fchmod(a,b)
--- a/pidgin/Makefile.am Thu Feb 18 21:38:43 2010 +0000 +++ b/pidgin/Makefile.am Sun Feb 21 00:11:56 2010 +0000 @@ -89,7 +89,6 @@ gtkdnd-hints.c \ gtkdocklet.c \ gtkdocklet-gtk.c \ - gtkdocklet-x11.c \ gtkeventloop.c \ gtkft.c \ gtkicon-theme.c \
--- a/pidgin/gtkdebug.c Thu Feb 18 21:38:43 2010 +0000 +++ b/pidgin/gtkdebug.c Sun Feb 21 00:11:56 2010 +0000 @@ -250,11 +250,11 @@ static void pause_cb(GtkWidget *w, DebugWindow *win) { - win->paused = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w)); + win->paused = gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(w)); #ifdef HAVE_REGEX_H if(!win->paused) { - if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(win->filter))) + if(gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(win->filter))) regex_filter_all(win); else regex_show_all(win); @@ -445,7 +445,7 @@ /* we check if the filter is on in case it was only of the options that * got changed, and not the expression. */ - if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(win->filter))) + if(gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(win->filter))) regex_filter_all(win); } @@ -459,9 +459,9 @@ if(!win || !win->window) return; - current = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(win->filter)); + current = gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(win->filter)); if(active != current) - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(win->filter), active); + gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(win->filter), active); } static void @@ -483,7 +483,7 @@ win->invert = active; - if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(win->filter))) + if(gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(win->filter))) regex_filter_all(win); } @@ -496,7 +496,7 @@ win->highlight = active; - if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(win->filter))) + if(gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(win->filter))) regex_filter_all(win); } @@ -522,7 +522,7 @@ gtk_tree_model_get(model, iter, 0, &text, 1, &level, -1); if (level >= purple_prefs_get_int(PIDGIN_PREFS_ROOT "/debug/filterlevel")) { - if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(win->filter))) { + if(gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(win->filter))) { regex_match(win, text); } else { gtk_imhtml_append_text(GTK_IMHTML(win->text), text, 0); @@ -546,8 +546,8 @@ static void regex_changed_cb(GtkWidget *w, DebugWindow *win) { - if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(win->filter))) { - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(win->filter), + if(gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(win->filter))) { + gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(win->filter), FALSE); } @@ -561,9 +561,9 @@ regex_key_release_cb(GtkWidget *w, GdkEventKey *e, DebugWindow *win) { if(e->keyval == GDK_Return && GTK_WIDGET_IS_SENSITIVE(win->filter) && - !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(win->filter))) + !gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(win->filter))) { - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(win->filter), TRUE); + gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(win->filter), TRUE); } } @@ -588,10 +588,10 @@ } static void -regex_filter_toggled_cb(GtkToggleButton *button, DebugWindow *win) { +regex_filter_toggled_cb(GtkToggleToolButton *button, DebugWindow *win) { gboolean active; - active = gtk_toggle_button_get_active(button); + active = gtk_toggle_tool_button_get_active(button); purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/debug/filter", active); @@ -611,7 +611,7 @@ if (GPOINTER_TO_INT(value) != gtk_combo_box_get_active(GTK_COMBO_BOX(win->filterlevel))) gtk_combo_box_set_active(GTK_COMBO_BOX(win->filterlevel), GPOINTER_TO_INT(value)); - if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(win->filter))) + if(gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(win->filter))) regex_filter_all(win); else regex_show_all(win); @@ -677,9 +677,12 @@ GtkWidget *vbox; GtkWidget *toolbar; GtkWidget *frame; - GtkWidget *image; gint width, height; void *handle; + GtkToolItem *item; +#if !GTK_CHECK_VERSION(2,12,0) + GtkTooltips *tooltips; +#endif win = g_new0(DebugWindow, 1); @@ -720,7 +723,12 @@ if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/debug/toolbar")) { /* Setup our top button bar thingie. */ toolbar = gtk_toolbar_new(); +#if !GTK_CHECK_VERSION(2,12,0) + tooltips = gtk_tooltips_new(); +#endif +#if !GTK_CHECK_VERSION(2,14,0) gtk_toolbar_set_tooltips(GTK_TOOLBAR(toolbar), TRUE); +#endif gtk_toolbar_set_show_arrow(GTK_TOOLBAR(toolbar), TRUE); g_signal_connect(G_OBJECT(toolbar), "button-press-event", G_CALLBACK(toolbar_context), win); @@ -735,61 +743,93 @@ #ifndef HAVE_REGEX_H /* Find button */ - gtk_toolbar_insert_stock(GTK_TOOLBAR(toolbar), GTK_STOCK_FIND, - _("Find"), NULL, G_CALLBACK(find_cb), - win, -1); + item = gtk_tool_button_new_from_stock(GTK_STOCK_FIND); + gtk_tool_item_set_is_important(item, TRUE); +#if GTK_CHECK_VERSION(2,12,0) + gtk_tool_item_set_tooltip_text(item, _("Find")); +#else + gtk_tool_item_set_tooltip(item, tooltips, _("Find"), NULL); +#endif + g_signal_connect(G_OBJECT(item), "clicked", G_CALLBACK(find_cb), win); + gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); #endif /* HAVE_REGEX_H */ /* Save */ - gtk_toolbar_insert_stock(GTK_TOOLBAR(toolbar), GTK_STOCK_SAVE, - _("Save"), NULL, G_CALLBACK(save_cb), - win, -1); + item = gtk_tool_button_new_from_stock(GTK_STOCK_SAVE); + gtk_tool_item_set_is_important(item, TRUE); +#if GTK_CHECK_VERSION(2,12,0) + gtk_tool_item_set_tooltip_text(item, _("Save")); +#else + gtk_tool_item_set_tooltip(item, tooltips, _("Save"), NULL); +#endif + g_signal_connect(G_OBJECT(item), "clicked", G_CALLBACK(save_cb), win); + gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); /* Clear button */ - gtk_toolbar_insert_stock(GTK_TOOLBAR(toolbar), GTK_STOCK_CLEAR, - _("Clear"), NULL, G_CALLBACK(clear_cb), - win, -1); + item = gtk_tool_button_new_from_stock(GTK_STOCK_CLEAR); + gtk_tool_item_set_is_important(item, TRUE); +#if GTK_CHECK_VERSION(2,12,0) + gtk_tool_item_set_tooltip_text(item, _("Clear")); +#else + gtk_tool_item_set_tooltip(item, tooltips, _("Clear"), NULL); +#endif + g_signal_connect(G_OBJECT(item), "clicked", G_CALLBACK(clear_cb), win); + gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); - gtk_toolbar_insert_space(GTK_TOOLBAR(toolbar), -1); + item = gtk_separator_tool_item_new(); + gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); /* Pause */ - image = gtk_image_new_from_stock(PIDGIN_STOCK_PAUSE, GTK_ICON_SIZE_MENU); - gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), - GTK_TOOLBAR_CHILD_TOGGLEBUTTON, - NULL, _("Pause"), _("Pause"), - NULL, image, - G_CALLBACK(pause_cb), win); + item = gtk_toggle_tool_button_new_from_stock(PIDGIN_STOCK_PAUSE); + gtk_tool_item_set_is_important(item, TRUE); +#if GTK_CHECK_VERSION(2,12,0) + gtk_tool_item_set_tooltip_text(item, _("Pause")); +#else + gtk_tool_item_set_tooltip(item, tooltips, _("Pause"), NULL); +#endif + g_signal_connect(G_OBJECT(item), "clicked", G_CALLBACK(pause_cb), win); + gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); #ifdef HAVE_REGEX_H /* regex stuff */ - gtk_toolbar_insert_space(GTK_TOOLBAR(toolbar), -1); + item = gtk_separator_tool_item_new(); + gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); /* regex toggle button */ - image = gtk_image_new_from_stock(GTK_STOCK_FIND, GTK_ICON_SIZE_MENU); - win->filter = - gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), - GTK_TOOLBAR_CHILD_TOGGLEBUTTON, - NULL, _("Filter"), _("Filter"), - NULL, image, - G_CALLBACK(regex_filter_toggled_cb), - win); + item = gtk_toggle_tool_button_new_from_stock(GTK_STOCK_FIND); + gtk_tool_item_set_is_important(item, TRUE); + win->filter = GTK_WIDGET(item); + gtk_tool_button_set_label(GTK_TOOL_BUTTON(win->filter), _("Filter")); +#if GTK_CHECK_VERSION(2,12,0) + gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(win->filter), _("Filter")); +#else + gtk_tooltips_set_tip(tooltips, win->filter, _("Filter"), NULL); +#endif + g_signal_connect(G_OBJECT(win->filter), "clicked", G_CALLBACK(regex_filter_toggled_cb), win); + gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(win->filter)); + /* we purposely disable the toggle button here in case * /purple/gtk/debug/expression has an empty string. If it does not have * an empty string, the change signal will get called and make the * toggle button sensitive. */ gtk_widget_set_sensitive(win->filter, FALSE); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(win->filter), + gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(win->filter), purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/debug/filter")); purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/debug/filter", regex_pref_filter_cb, win); /* regex entry */ win->expression = gtk_entry_new(); - gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), - GTK_TOOLBAR_CHILD_WIDGET, win->expression, - NULL, _("Right click for more options."), - NULL, NULL, NULL, NULL); + item = gtk_tool_item_new(); +#if GTK_CHECK_VERSION(2,12,0) + gtk_widget_set_tooltip_text(win->expression, _("Right click for more options.")); +#else + gtk_tooltips_set_tip(tooltips, win->expression, _("Right click for more options."), NULL); +#endif + gtk_container_add(GTK_CONTAINER(item), GTK_WIDGET(win->expression)); + gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); + /* this needs to be before the text is set from the pref if we want it * to colorize a stored expression. */ @@ -815,18 +855,23 @@ #endif /* HAVE_REGEX_H */ - gtk_toolbar_insert_space(GTK_TOOLBAR(toolbar), -1); + item = gtk_separator_tool_item_new(); + gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); - gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), - GTK_TOOLBAR_CHILD_WIDGET, gtk_label_new(_("Level ")), - NULL, _("Select the debug filter level."), - NULL, NULL, NULL, NULL); + item = gtk_tool_item_new(); + gtk_container_add(GTK_CONTAINER(item), gtk_label_new(_("Level "))); + gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); win->filterlevel = gtk_combo_box_new_text(); - gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), - GTK_TOOLBAR_CHILD_WIDGET, win->filterlevel, - NULL, _("Select the debug filter level."), - NULL, NULL, NULL, NULL); + item = gtk_tool_item_new(); +#if GTK_CHECK_VERSION(2,12,0) + gtk_widget_set_tooltip_text(win->filterlevel, _("Select the debug filter level.")); +#else + gtk_tooltips_set_tip(tooltips, win->filterlevel, _("Select the debug filter level."), NULL); +#endif + gtk_container_add(GTK_CONTAINER(item), win->filterlevel); + gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); + gtk_combo_box_append_text(GTK_COMBO_BOX(win->filterlevel), _("All")); gtk_combo_box_append_text(GTK_COMBO_BOX(win->filterlevel), _("Misc")); gtk_combo_box_append_text(GTK_COMBO_BOX(win->filterlevel), _("Info"));
--- a/pidgin/gtkdocklet-gtk.c Thu Feb 18 21:38:43 2010 +0000 +++ b/pidgin/gtkdocklet-gtk.c Sun Feb 21 00:11:56 2010 +0000 @@ -26,8 +26,6 @@ #include "pidginstock.h" #include "gtkdocklet.h" -#if GTK_CHECK_VERSION(2,10,0) - /* globals */ GtkStatusIcon *docklet = NULL; @@ -155,6 +153,3 @@ gtk_icon_theme_append_search_path(gtk_icon_theme_get_default(), DATADIR G_DIR_SEPARATOR_S "pixmaps" G_DIR_SEPARATOR_S "pidgin" G_DIR_SEPARATOR_S "tray"); } - -#endif /* GTK_CHECK_VERSION(2,10,0) */ -
--- a/pidgin/gtkdocklet-x11.c Thu Feb 18 21:38:43 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,359 +0,0 @@ -/* - * System tray icon (aka docklet) plugin for Purple - * - * Copyright (C) 2002-3 Robert McQueen <robot101@debian.org> - * Copyright (C) 2003 Herman Bloggs <hermanator12002@yahoo.com> - * Inspired by a similar plugin by: - * John (J5) Palmieri <johnp@martianrock.com> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02111-1301, USA. - */ - -#include "internal.h" -#include "pidgin.h" -#include "debug.h" -#include "prefs.h" -#include "pidginstock.h" - -#include "gtkdialogs.h" - -#include "eggtrayicon.h" -#include "gtkdocklet.h" -#include <gdk/gdkkeysyms.h> - -#if !GTK_CHECK_VERSION(2,10,0) - -#define SHORT_EMBED_TIMEOUT 5000 -#define LONG_EMBED_TIMEOUT 15000 - -/* globals */ -static EggTrayIcon *docklet = NULL; -static GtkWidget *image = NULL; -static GtkTooltips *tooltips = NULL; -static GdkPixbuf *blank_icon = NULL; -static int embed_timeout = 0; -static int docklet_height = 0; - -/* protos */ -static void docklet_x11_create(gboolean); - -static gboolean -docklet_x11_recreate_cb(gpointer data) -{ - docklet_x11_create(TRUE); - - return FALSE; /* for when we're called by the glib idle handler */ -} - -static void -docklet_x11_embedded_cb(GtkWidget *widget, void *data) -{ - purple_debug(PURPLE_DEBUG_INFO, "docklet", "X11 embedded\n"); - - g_source_remove(embed_timeout); - embed_timeout = 0; - pidgin_docklet_embedded(); - purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/docklet/x11/embedded", FALSE); -} - -static void -docklet_x11_destroyed_cb(GtkWidget *widget, void *data) -{ - purple_debug(PURPLE_DEBUG_INFO, "docklet", "X11 destroyed\n"); - - pidgin_docklet_remove(); - - g_object_unref(G_OBJECT(docklet)); - docklet = NULL; - - g_idle_add(docklet_x11_recreate_cb, NULL); -} - -static gboolean -docklet_x11_clicked_cb(GtkWidget *button, GdkEventButton *event, void *data) -{ - if (event->type != GDK_BUTTON_PRESS) - return FALSE; - - pidgin_docklet_clicked(event->button); - return TRUE; -} - -static gboolean -docklet_x11_pressed_cb(GtkWidget *button, GdkEventKey *event) -{ - guint state, keyval; - - state = event->state & gtk_accelerator_get_default_mod_mask(); - keyval = event->keyval; - if (state == 0 && - (keyval == GDK_Return || - keyval == GDK_KP_Enter || - keyval == GDK_ISO_Enter || - keyval == GDK_space || - keyval == GDK_KP_Space)) - { - pidgin_docklet_clicked(1); - return TRUE; - } - - return FALSE; -} - -static void -docklet_x11_popup_cb(GtkWidget *button) -{ - pidgin_docklet_clicked(3); -} - -static void -docklet_x11_update_icon(PurpleStatusPrimitive status, gboolean connecting, gboolean pending) -{ - const gchar *icon_name = NULL; - - g_return_if_fail(image != NULL); - - switch (status) { - case PURPLE_STATUS_OFFLINE: - icon_name = PIDGIN_STOCK_TRAY_OFFLINE; - break; - case PURPLE_STATUS_AWAY: - icon_name = PIDGIN_STOCK_TRAY_AWAY; - break; - case PURPLE_STATUS_UNAVAILABLE: - icon_name = PIDGIN_STOCK_TRAY_BUSY; - break; - case PURPLE_STATUS_EXTENDED_AWAY: - icon_name = PIDGIN_STOCK_TRAY_XA; - break; - case PURPLE_STATUS_INVISIBLE: - icon_name = PIDGIN_STOCK_TRAY_INVISIBLE; - break; - default: - icon_name = PIDGIN_STOCK_TRAY_AVAILABLE; - break; - } - - if (pending) - icon_name = PIDGIN_STOCK_TRAY_PENDING; - if (connecting) - icon_name = PIDGIN_STOCK_TRAY_CONNECT; - - if(icon_name) { - int icon_size; - if (docklet_height < 22) - icon_size = gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL); - else if (docklet_height < 32) - icon_size = gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_SMALL); - else if (docklet_height < 48) - icon_size = gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_MEDIUM); - else - icon_size = gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_LARGE); - - gtk_image_set_from_stock(GTK_IMAGE(image), icon_name, icon_size); - } -} - -static void -docklet_x11_resize_icon(GtkWidget *widget) -{ - if (docklet_height == MIN(widget->allocation.height, widget->allocation.width)) - return; - docklet_height = MIN(widget->allocation.height, widget->allocation.width); - pidgin_docklet_update_icon(); -} - -static void -docklet_x11_blank_icon(void) -{ - if (!blank_icon) { - GtkIconSize size = GTK_ICON_SIZE_LARGE_TOOLBAR; - gint width, height; - g_object_get(G_OBJECT(image), "icon-size", &size, NULL); - gtk_icon_size_lookup(size, &width, &height); - blank_icon = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, width, height); - gdk_pixbuf_fill(blank_icon, 0); - } - - gtk_image_set_from_pixbuf(GTK_IMAGE(image), blank_icon); -} - -static void -docklet_x11_set_tooltip(gchar *tooltip) -{ - if (!tooltips) - tooltips = gtk_tooltips_new(); - - /* image->parent is a GtkEventBox */ - if (tooltip) { - gtk_tooltips_enable(tooltips); - gtk_tooltips_set_tip(tooltips, image->parent, tooltip, NULL); - } else { - gtk_tooltips_set_tip(tooltips, image->parent, "", NULL); - gtk_tooltips_disable(tooltips); - } -} - -static void -docklet_x11_position_menu(GtkMenu *menu, int *x, int *y, gboolean *push_in, - gpointer user_data) -{ - GtkWidget *widget = GTK_WIDGET(docklet); - GtkRequisition req; - gint menu_xpos, menu_ypos; - - gtk_widget_size_request(GTK_WIDGET(menu), &req); - gdk_window_get_origin(widget->window, &menu_xpos, &menu_ypos); - - menu_xpos += widget->allocation.x; - menu_ypos += widget->allocation.y; - - if (menu_ypos > gdk_screen_get_height(gtk_widget_get_screen(widget)) / 2) - menu_ypos -= req.height; - else - menu_ypos += widget->allocation.height; - - *x = menu_xpos; - *y = menu_ypos; - - *push_in = TRUE; -} - -static void -docklet_x11_destroy(void) -{ - g_return_if_fail(docklet != NULL); - - if (embed_timeout) - g_source_remove(embed_timeout); - - pidgin_docklet_remove(); - - g_signal_handlers_disconnect_by_func(G_OBJECT(docklet), G_CALLBACK(docklet_x11_destroyed_cb), NULL); - gtk_widget_destroy(GTK_WIDGET(docklet)); - - g_object_unref(G_OBJECT(docklet)); - docklet = NULL; - - if (blank_icon) - g_object_unref(G_OBJECT(blank_icon)); - blank_icon = NULL; - - image = NULL; - - purple_debug(PURPLE_DEBUG_INFO, "docklet", "X11 destroyed\n"); -} - -static gboolean -docklet_x11_embed_timeout_cb(gpointer data) -{ - /* The docklet was not embedded within the timeout. - * Remove it as a visibility manager, but leave the plugin - * loaded so that it can embed automatically if/when a notification - * area becomes available. - */ - purple_debug_info("docklet", "X11 failed to embed within timeout\n"); - pidgin_docklet_remove(); - - return FALSE; -} - -static void -docklet_x11_create(gboolean recreate) -{ - GtkWidget *box; - - if (docklet) { - /* if this is being called when a tray icon exists, it's because - something messed up. try destroying it before we proceed, - although docklet_refcount may be all hosed. hopefully won't happen. */ - purple_debug(PURPLE_DEBUG_WARNING, "docklet", "trying to create icon but it already exists?\n"); - docklet_x11_destroy(); - } - - docklet = egg_tray_icon_new(PIDGIN_NAME); - box = gtk_event_box_new(); - image = gtk_image_new(); - GTK_WIDGET_SET_FLAGS (image, GTK_CAN_FOCUS); - - g_signal_connect(G_OBJECT(docklet), "embedded", G_CALLBACK(docklet_x11_embedded_cb), NULL); - g_signal_connect(G_OBJECT(docklet), "destroy", G_CALLBACK(docklet_x11_destroyed_cb), NULL); - g_signal_connect(G_OBJECT(docklet), "size-allocate", G_CALLBACK(docklet_x11_resize_icon), NULL); - g_signal_connect(G_OBJECT(box), "button-press-event", G_CALLBACK(docklet_x11_clicked_cb), NULL); - g_signal_connect(G_OBJECT(box), "key-press-event", G_CALLBACK(docklet_x11_pressed_cb), NULL); - g_signal_connect(G_OBJECT(box), "popup-menu", G_CALLBACK(docklet_x11_popup_cb), NULL); - gtk_container_add(GTK_CONTAINER(box), image); - gtk_container_add(GTK_CONTAINER(docklet), box); - - if (!gtk_check_version(2,4,0)) - g_object_set(G_OBJECT(box), "visible-window", FALSE, NULL); - - gtk_widget_show_all(GTK_WIDGET(docklet)); - - /* ref the docklet before we bandy it about the place */ - g_object_ref(G_OBJECT(docklet)); - - /* This is a hack to avoid a race condition between the docklet getting - * embedded in the notification area and the gtkblist restoring its - * previous visibility state. If the docklet does not get embedded within - * the timeout, it will be removed as a visibility manager until it does - * get embedded. Ideally, we would only call docklet_embedded() when the - * icon was actually embedded. This only happens when the docklet is first - * created, not when being recreated. - * - * The x11 docklet tracks whether it successfully embedded in a pref and - * allows for a longer timeout period if it successfully embedded the last - * time it was run. This should hopefully solve problems with the buddy - * list not properly starting hidden when Pidgin is started on login. - */ - if(!recreate) { - pidgin_docklet_embedded(); - if(purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/docklet/x11/embedded")) { - embed_timeout = g_timeout_add(LONG_EMBED_TIMEOUT, docklet_x11_embed_timeout_cb, NULL); - } else { - embed_timeout = g_timeout_add(SHORT_EMBED_TIMEOUT, docklet_x11_embed_timeout_cb, NULL); - } - } - - purple_debug(PURPLE_DEBUG_INFO, "docklet", "X11 created\n"); -} - -static void -docklet_x11_create_ui_op(void) -{ - docklet_x11_create(FALSE); -} - -static struct docklet_ui_ops ui_ops = -{ - docklet_x11_create_ui_op, - docklet_x11_destroy, - docklet_x11_update_icon, - docklet_x11_blank_icon, - docklet_x11_set_tooltip, - docklet_x11_position_menu -}; - -void -docklet_ui_init() -{ - pidgin_docklet_set_ui_ops(&ui_ops); - purple_prefs_add_none(PIDGIN_PREFS_ROOT "/docklet/x11"); - purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/docklet/x11/embedded", FALSE); -} - -#endif /* !GTK_CHECK_VERSION(2,10,0) */ -
--- a/pidgin/gtkprefs.c Thu Feb 18 21:38:43 2010 +0000 +++ b/pidgin/gtkprefs.c Sun Feb 21 00:11:56 2010 +0000 @@ -902,9 +902,7 @@ cell_rend = gtk_cell_renderer_text_new(); gtk_cell_layout_pack_start(GTK_CELL_LAYOUT (combo_box), cell_rend, TRUE); gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo_box), cell_rend, "markup", 1, NULL); -#if GTK_CHECK_VERSION(2,6,0) g_object_set(cell_rend, "ellipsize", PANGO_ELLIPSIZE_END, NULL); -#endif gtk_drag_dest_set(combo_box, GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_DROP, te, sizeof(te) / sizeof(GtkTargetEntry) , GDK_ACTION_COPY | GDK_ACTION_MOVE);
--- a/pidgin/gtkprivacy.c Thu Feb 18 21:38:43 2010 +0000 +++ b/pidgin/gtkprivacy.c Sun Feb 21 00:11:56 2010 +0000 @@ -220,7 +220,7 @@ for (i = 0; i < menu_entry_count; i++) { if (menu_entries[i].num == account->perm_deny) { - gtk_option_menu_set_history(GTK_OPTION_MENU(dialog->type_menu), i); + gtk_combo_box_set_active(GTK_COMBO_BOX(dialog->type_menu), i); break; } } @@ -234,9 +234,9 @@ * Even better: the privacy API needs to not suck. */ static void -type_changed_cb(GtkOptionMenu *optmenu, PidginPrivacyDialog *dialog) +type_changed_cb(GtkComboBox *combo, PidginPrivacyDialog *dialog) { - int new_type = menu_entries[gtk_option_menu_get_history(optmenu)].num; + int new_type = menu_entries[gtk_combo_box_get_active(combo)].num; dialog->account->perm_deny = new_type; serv_set_permit_deny(purple_account_get_connection(dialog->account)); @@ -343,8 +343,7 @@ GtkWidget *button; GtkWidget *dropdown; GtkWidget *label; - GtkWidget *menu; - int selected = 0; + int selected = -1; int i; dialog = g_new0(PidginPrivacyDialog, 1); @@ -372,22 +371,19 @@ dialog->account = pidgin_account_option_menu_get_selected(dropdown); /* Add the drop-down list with the allow/block types. */ - dialog->type_menu = gtk_option_menu_new(); + dialog->type_menu = gtk_combo_box_new_text(); gtk_box_pack_start(GTK_BOX(vbox), dialog->type_menu, FALSE, FALSE, 0); gtk_widget_show(dialog->type_menu); - /* Build the menu for that. */ - menu = gtk_menu_new(); - for (i = 0; i < menu_entry_count; i++) { - pidgin_new_item(menu, _(menu_entries[i].text)); + gtk_combo_box_append_text(GTK_COMBO_BOX(dialog->type_menu), + _(menu_entries[i].text)); if (menu_entries[i].num == dialog->account->perm_deny) selected = i; } - gtk_option_menu_set_menu(GTK_OPTION_MENU(dialog->type_menu), menu); - gtk_option_menu_set_history(GTK_OPTION_MENU(dialog->type_menu), selected); + gtk_combo_box_set_active(GTK_COMBO_BOX(dialog->type_menu), selected); g_signal_connect(G_OBJECT(dialog->type_menu), "changed", G_CALLBACK(type_changed_cb), dialog); @@ -421,7 +417,7 @@ button = pidgin_dialog_add_button(GTK_DIALOG(dialog->win), GTK_STOCK_CLOSE, G_CALLBACK(close_cb), dialog); dialog->close_button = button; - type_changed_cb(GTK_OPTION_MENU(dialog->type_menu), dialog); + type_changed_cb(GTK_COMBO_BOX(dialog->type_menu), dialog); #if 0 if (dialog->account->perm_deny == PURPLE_PRIVACY_ALLOW_USERS) { gtk_widget_show(dialog->allow_widget);
--- a/pidgin/gtkrequest.c Thu Feb 18 21:38:43 2010 +0000 +++ b/pidgin/gtkrequest.c Sun Feb 21 00:11:56 2010 +0000 @@ -230,10 +230,10 @@ } static void -field_choice_menu_cb(GtkOptionMenu *menu, PurpleRequestField *field) +field_choice_menu_cb(GtkComboBox *menu, PurpleRequestField *field) { purple_request_field_choice_set_value(field, - gtk_option_menu_get_history(menu)); + gtk_combo_box_get_active(menu)); } static void @@ -928,26 +928,15 @@ if (num_labels > 5) { - GtkWidget *menu; - GtkWidget *item; - - widget = gtk_option_menu_new(); - - menu = gtk_menu_new(); + widget = gtk_combo_box_new_text(); for (l = labels; l != NULL; l = l->next) { const char *text = l->data; - - item = gtk_menu_item_new_with_label(text); - gtk_widget_show(item); - - gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); + gtk_combo_box_append_text(GTK_COMBO_BOX(widget), text); } - gtk_widget_show(menu); - gtk_option_menu_set_menu(GTK_OPTION_MENU(widget), menu); - gtk_option_menu_set_history(GTK_OPTION_MENU(widget), + gtk_combo_box_set_active(GTK_COMBO_BOX(widget), purple_request_field_choice_get_default_value(field)); g_signal_connect(G_OBJECT(widget), "changed",
--- a/pidgin/gtksavedstatuses.c Thu Feb 18 21:38:43 2010 +0000 +++ b/pidgin/gtksavedstatuses.c Sun Feb 21 00:11:56 2010 +0000 @@ -85,17 +85,16 @@ }; /** - * These are used in the GtkComboBox to select the specific - * PurpleStatusType when setting a substatus for a particular saved - * status. + * These are used in the GtkComboBox to select the specific PurpleStatusType + * when setting a (sub)status for a particular saved status. */ enum { - SUBSTATUS_COLUMN_ICON, + STATUS_COLUMN_ICON, /** A hidden column containing the ID of this PurpleStatusType. */ - SUBSTATUS_COLUMN_STATUS_ID, - SUBSTATUS_COLUMN_STATUS_NAME, - SUBSTATUS_NUM_COLUMNS + STATUS_COLUMN_STATUS_ID, + STATUS_COLUMN_STATUS_NAME, + STATUS_NUM_COLUMNS }; typedef struct @@ -118,7 +117,7 @@ gchar *original_title; GtkEntry *title; - GtkOptionMenu *type; + GtkComboBox *type; GtkIMHtml *message; } StatusEditor; @@ -742,7 +741,7 @@ return; } - type = gtk_option_menu_get_history(dialog->type) + (PURPLE_STATUS_UNSET + 1); + type = gtk_combo_box_get_active(dialog->type) + (PURPLE_STATUS_UNSET + 1); message = gtk_imhtml_get_markup(dialog->message); unformatted = purple_markup_strip_html(message); @@ -837,35 +836,15 @@ } static GtkWidget * -create_stock_item(const gchar *str, const gchar *icon) -{ - GtkWidget *menuitem = gtk_menu_item_new(); - GtkWidget *label = gtk_label_new_with_mnemonic(str); - GtkWidget *hbox = gtk_hbox_new(FALSE, 4); - GtkIconSize icon_size = gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL); - GtkWidget *image = gtk_image_new_from_stock(icon, icon_size);; - - gtk_widget_show(label); - gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); - gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); - gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, 0); - gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 0); - - gtk_container_add(GTK_CONTAINER(menuitem), hbox); - - return menuitem; -} - -static GtkWidget * create_status_type_menu(PurpleStatusPrimitive type) { int i; GtkWidget *dropdown; - GtkWidget *menu; - GtkWidget *item; + GtkListStore *store; + GtkTreeIter iter; + GtkCellRenderer *renderer; - dropdown = gtk_option_menu_new(); - menu = gtk_menu_new(); + store = gtk_list_store_new(STATUS_NUM_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING); for (i = PURPLE_STATUS_UNSET + 1; i < PURPLE_STATUS_NUM_PRIMITIVES; i++) { @@ -883,14 +862,30 @@ */ continue; - item = create_stock_item(purple_primitive_get_name_from_type(i), - get_stock_icon_from_primitive(i)); - gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); + gtk_list_store_append(store, &iter); + gtk_list_store_set(store, &iter, + STATUS_COLUMN_ICON, get_stock_icon_from_primitive(i), + STATUS_COLUMN_STATUS_ID, purple_primitive_get_id_from_type(i), + STATUS_COLUMN_STATUS_NAME, purple_primitive_get_name_from_type(i), + -1); } - gtk_menu_set_active(GTK_MENU(menu), type - (PURPLE_STATUS_UNSET + 1)); - gtk_option_menu_set_menu(GTK_OPTION_MENU(dropdown), menu); - gtk_widget_show_all(menu); + dropdown = gtk_combo_box_new_with_model(GTK_TREE_MODEL(store)); + + renderer = gtk_cell_renderer_pixbuf_new(); + gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(dropdown), renderer, FALSE); + gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(dropdown), renderer, + "stock-id", STATUS_COLUMN_ICON, + NULL); + + renderer = gtk_cell_renderer_text_new(); + gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(dropdown), renderer, TRUE); + gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(dropdown), renderer, + "text", STATUS_COLUMN_STATUS_NAME, + NULL); + + gtk_combo_box_set_active(GTK_COMBO_BOX(dropdown), + type - (PURPLE_STATUS_UNSET + 1)); return dropdown; } @@ -1160,7 +1155,7 @@ dropdown = create_status_type_menu(purple_savedstatus_get_type(saved_status)); else dropdown = create_status_type_menu(PURPLE_STATUS_AWAY); - dialog->type = GTK_OPTION_MENU(dropdown); + dialog->type = GTK_COMBO_BOX(dropdown); pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("_Status:"), sg, dropdown, TRUE, NULL); /* Status message */ @@ -1275,7 +1270,7 @@ if (!gtk_combo_box_get_active_iter(box, &iter)) return; gtk_tree_model_get(GTK_TREE_MODEL(select->model), &iter, - SUBSTATUS_COLUMN_STATUS_ID, &id, + STATUS_COLUMN_STATUS_ID, &id, -1); type = purple_account_get_status_type(select->account, id); g_free(id); @@ -1366,7 +1361,7 @@ } gtk_tree_model_get(GTK_TREE_MODEL(dialog->model), &iter, - SUBSTATUS_COLUMN_STATUS_ID, &id, + STATUS_COLUMN_STATUS_ID, &id, -1); type = purple_account_get_status_type(dialog->account, id); if (purple_status_type_get_attr(type, "message") != NULL) @@ -1456,7 +1451,7 @@ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); gtk_size_group_add_widget(sg, label); - dialog->model = gtk_list_store_new(SUBSTATUS_NUM_COLUMNS, + dialog->model = gtk_list_store_new(STATUS_NUM_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING); @@ -1469,12 +1464,12 @@ NULL); gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo), rend, FALSE); gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo), rend, - "stock-id", SUBSTATUS_COLUMN_ICON, NULL); + "stock-id", STATUS_COLUMN_ICON, NULL); rend = GTK_CELL_RENDERER(gtk_cell_renderer_text_new()); gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo), rend, TRUE); gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo), rend, - "text", SUBSTATUS_COLUMN_STATUS_NAME, NULL); + "text", STATUS_COLUMN_STATUS_NAME, NULL); g_signal_connect(G_OBJECT(combo), "changed", G_CALLBACK(substatus_selection_changed_cb), dialog); @@ -1550,9 +1545,9 @@ gtk_list_store_append(dialog->model, &iter); gtk_list_store_set(dialog->model, &iter, - SUBSTATUS_COLUMN_ICON, pidgin_stock_id_from_status_primitive(prim), - SUBSTATUS_COLUMN_STATUS_ID, id, - SUBSTATUS_COLUMN_STATUS_NAME, name, + STATUS_COLUMN_ICON, pidgin_stock_id_from_status_primitive(prim), + STATUS_COLUMN_STATUS_ID, id, + STATUS_COLUMN_STATUS_NAME, name, -1); if ((status_id != NULL) && !strcmp(status_id, id)) {
--- a/pidgin/gtkutils.c Thu Feb 18 21:38:43 2010 +0000 +++ b/pidgin/gtkutils.c Sun Feb 21 00:11:56 2010 +0000 @@ -406,13 +406,13 @@ gtk_container_add(GTK_CONTAINER(button), bbox); if (icon) { - gtk_box_pack_start_defaults(GTK_BOX(bbox), ibox); + gtk_box_pack_start(GTK_BOX(bbox), ibox, TRUE, TRUE, 0); image = gtk_image_new_from_stock(icon, GTK_ICON_SIZE_BUTTON); gtk_box_pack_end(GTK_BOX(ibox), image, FALSE, TRUE, 0); } if (text) { - gtk_box_pack_start_defaults(GTK_BOX(bbox), lbox); + gtk_box_pack_start(GTK_BOX(bbox), lbox, TRUE, TRUE, 0); label = gtk_label_new(NULL); gtk_label_set_text_with_mnemonic(GTK_LABEL(label), text); gtk_label_set_mnemonic_widget(GTK_LABEL(label), button);
--- a/pidgin/plugins/gestures/gestures.c Thu Feb 18 21:38:43 2010 +0000 +++ b/pidgin/plugins/gestures/gestures.c Sun Feb 21 00:11:56 2010 +0000 @@ -145,6 +145,15 @@ } #if 0 +#if GTK_CHECK_VERSION(2,4,0) +static void +mouse_button_menu_cb(GtkComboBox *opt, gpointer data) +{ + int button = gtk_combo_box_get_active(opt); + + gstroke_set_mouse_button(button + 2); +} +#else static void mouse_button_menu_cb(GtkMenuItem *item, gpointer data) { @@ -153,6 +162,7 @@ gstroke_set_mouse_button(button + 2); } #endif +#endif static void toggle_draw_cb(GtkToggleButton *toggle, gpointer data) @@ -220,8 +230,10 @@ GtkWidget *toggle; #if 0 GtkWidget *opt; +#if GTK_CHECK_VERSION(2,4,0) GtkWidget *menu, *item; #endif +#endif /* Outside container */ ret = gtk_vbox_new(FALSE, 18); @@ -231,6 +243,19 @@ vbox = pidgin_make_frame(ret, _("Mouse Gestures Configuration")); #if 0 +#if GTK_CHECK_VERSION(2,4,0) + /* Mouse button drop-down menu */ + opt = gtk_combo_box_new_text(); + + gtk_combo_box_append_text(_("Middle mouse button")); + gtk_combo_box_append_text(_("Right mouse button")); + g_signal_connect(G_OBJECT(opt), "changed", + G_CALLBACK(mouse_button_menu_cb), NULL); + + gtk_box_pack_start(GTK_BOX(vbox), opt, FALSE, FALSE, 0); + gtk_combo_box_set_active(GTK_COMBO_BOX(opt), + gstroke_get_mouse_button() - 2); +#else /* Mouse button drop-down menu */ menu = gtk_menu_new(); opt = gtk_option_menu_new(); @@ -250,6 +275,7 @@ gtk_option_menu_set_history(GTK_OPTION_MENU(opt), gstroke_get_mouse_button() - 2); #endif +#endif /* "Visual gesture display" checkbox */ toggle = gtk_check_button_new_with_mnemonic(_("_Visual gesture display"));
--- a/pidgin/plugins/gevolution/assoc-buddy.c Thu Feb 18 21:38:43 2010 +0000 +++ b/pidgin/plugins/gevolution/assoc-buddy.c Sun Feb 21 00:11:56 2010 +0000 @@ -20,7 +20,6 @@ */ #include "internal.h" #include "gtkblist.h" -#include "gtkexpander.h" #include "pidgin.h" #include "gtkutils.h" #include "gtkimhtml.h"
--- a/pidgin/plugins/win32/transparency/win2ktrans.c Thu Feb 18 21:38:43 2010 +0000 +++ b/pidgin/plugins/win32/transparency/win2ktrans.c Sun Feb 21 00:11:56 2010 +0000 @@ -72,8 +72,6 @@ static const char *OPT_WINTRANS_BL_ONTOP = "/plugins/gtk/win32/wintrans/bl_always_on_top"; static GSList *window_list = NULL; -static BOOL (*MySetLayeredWindowAttributes)(HWND hwnd, COLORREF crKey, BYTE bAlpha, DWORD dwFlags) = NULL; - /* * CODE */ @@ -81,31 +79,31 @@ /* Set window transparency level */ static void set_wintrans(GtkWidget *window, int alpha, gboolean enabled, gboolean always_on_top) { - if (MySetLayeredWindowAttributes) { - HWND hWnd = GDK_WINDOW_HWND(window->window); - LONG style = GetWindowLong(hWnd, GWL_EXSTYLE); - if (enabled) { - style |= WS_EX_LAYERED; - } else { - style &= ~WS_EX_LAYERED; - } - SetWindowLong(hWnd, GWL_EXSTYLE, style); + + HWND hWnd = GDK_WINDOW_HWND(window->window); + LONG style = GetWindowLong(hWnd, GWL_EXSTYLE); + if (enabled) { + style |= WS_EX_LAYERED; + } else { + style &= ~WS_EX_LAYERED; + } + SetWindowLong(hWnd, GWL_EXSTYLE, style); - if (enabled) { - SetWindowPos(hWnd, - always_on_top ? HWND_TOPMOST : HWND_NOTOPMOST, - 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); - MySetLayeredWindowAttributes(hWnd, 0, alpha, LWA_ALPHA); - } else { - /* Ask the window and its children to repaint */ - SetWindowPos(hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, - SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); + if (enabled) { + SetWindowPos(hWnd, + always_on_top ? HWND_TOPMOST : HWND_NOTOPMOST, + 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); + SetLayeredWindowAttributes(hWnd, 0, alpha, LWA_ALPHA); + } else { + /* Ask the window and its children to repaint */ + SetWindowPos(hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, + SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); - RedrawWindow(hWnd, NULL, NULL, - RDW_ERASE | RDW_INVALIDATE | RDW_FRAME | RDW_ALLCHILDREN); - } + RedrawWindow(hWnd, NULL, NULL, + RDW_ERASE | RDW_INVALIDATE | RDW_FRAME | RDW_ALLCHILDREN); } + } /* When a conv window is focused, if we're only transparent when unfocused, @@ -491,14 +489,6 @@ * EXPORTED FUNCTIONS */ static gboolean plugin_load(PurplePlugin *plugin) { - MySetLayeredWindowAttributes = (void*) wpurple_find_and_loadproc( - "user32.dll", "SetLayeredWindowAttributes"); - - if (!MySetLayeredWindowAttributes) { - purple_debug_error(WINTRANS_PLUGIN_ID, - "SetLayeredWindowAttributes API not found (Required W2K+)\n"); - return FALSE; - } purple_signal_connect(purple_conversations_get_handle(), "conversation-created", plugin,
--- a/pidgin/win32/gtkwin32dep.c Thu Feb 18 21:38:43 2010 +0000 +++ b/pidgin/win32/gtkwin32dep.c Sun Feb 21 00:11:56 2010 +0000 @@ -47,8 +47,6 @@ #include "zlib.h" #include "untar.h" -#include <libintl.h> - #include "gtkwin32dep.h" #include "win32dep.h" #include "gtkconv.h" @@ -64,8 +62,6 @@ HWND messagewin_hwnd; static int gtkwin32_handle; -typedef BOOL (CALLBACK* LPFNFLASHWINDOWEX)(PFLASHWINFO); -static LPFNFLASHWINDOWEX MyFlashWindowEx = NULL; static gboolean pwm_handles_connections = TRUE; @@ -308,6 +304,7 @@ void winpidgin_window_flash(GtkWindow *window, gboolean flash) { GdkWindow * gdkwin; + FLASHWINFO info; g_return_if_fail(window != NULL); @@ -319,25 +316,19 @@ if(GDK_WINDOW_DESTROYED(gdkwin)) return; - if(MyFlashWindowEx) { - FLASHWINFO info; + memset(&info, 0, sizeof(FLASHWINFO)); + info.cbSize = sizeof(FLASHWINFO); + info.hwnd = GDK_WINDOW_HWND(gdkwin); + if (flash) { + DWORD flashCount; + info.uCount = 3; + if (SystemParametersInfo(SPI_GETFOREGROUNDFLASHCOUNT, 0, &flashCount, 0)) + info.uCount = flashCount; + info.dwFlags = FLASHW_ALL | FLASHW_TIMER; + } else + info.dwFlags = FLASHW_STOP; + info.dwTimeout = 0; - memset(&info, 0, sizeof(FLASHWINFO)); - info.cbSize = sizeof(FLASHWINFO); - info.hwnd = GDK_WINDOW_HWND(gdkwin); - if (flash) { - DWORD flashCount; - info.uCount = 3; - if (SystemParametersInfo(SPI_GETFOREGROUNDFLASHCOUNT, 0, &flashCount, 0)) - info.uCount = flashCount; - info.dwFlags = FLASHW_ALL | FLASHW_TIMER; - } else - info.dwFlags = FLASHW_STOP; - info.dwTimeout = 0; - - MyFlashWindowEx(&info); - } else - FlashWindow(GDK_WINDOW_HWND(gdkwin), flash); } void @@ -399,8 +390,6 @@ messagewin_hwnd = winpidgin_message_window_init(); - MyFlashWindowEx = (LPFNFLASHWINDOWEX) wpurple_find_and_loadproc("user32.dll", "FlashWindowEx"); - purple_debug_info("winpidgin", "winpidgin_init end\n"); } @@ -436,36 +425,16 @@ return TRUE; } -typedef HMONITOR WINAPI _MonitorFromWindow(HWND, DWORD); -typedef BOOL WINAPI _GetMonitorInfo(HMONITOR, LPMONITORINFO); - static gboolean get_WorkingAreaRectForWindow(HWND hwnd, RECT *workingAreaRc) { - static _MonitorFromWindow *the_MonitorFromWindow; - static _GetMonitorInfo *the_GetMonitorInfo; - static gboolean initialized = FALSE; HMONITOR monitor; MONITORINFO info; - if(!initialized) { - the_MonitorFromWindow = (_MonitorFromWindow*) - wpurple_find_and_loadproc("user32", "MonitorFromWindow"); - the_GetMonitorInfo = (_GetMonitorInfo*) - wpurple_find_and_loadproc("user32", "GetMonitorInfoA"); - initialized = TRUE; - } - - if(!the_MonitorFromWindow) - return FALSE; - - if(!the_GetMonitorInfo) - return FALSE; - - monitor = the_MonitorFromWindow(hwnd, MONITOR_DEFAULTTOPRIMARY); + monitor = MonitorFromWindow(hwnd, MONITOR_DEFAULTTOPRIMARY); info.cbSize = sizeof(info); - if(!the_GetMonitorInfo(monitor, &info)) + if(!GetMonitorInfo(monitor, &info)) return FALSE; CopyRect(workingAreaRc, &(info.rcWork));
--- a/po/POTFILES.in Thu Feb 18 21:38:43 2010 +0000 +++ b/po/POTFILES.in Sun Feb 21 00:11:56 2010 +0000 @@ -214,14 +214,12 @@ pidgin/gtkaccount.c pidgin/gtkblist-theme.c pidgin/gtkblist.c -pidgin/gtkcellview.c pidgin/gtkcertmgr.c pidgin/gtkconn.c pidgin/gtkconv.c pidgin/gtkdebug.c pidgin/gtkdialogs.c pidgin/gtkdocklet.c -pidgin/gtkexpander.c pidgin/gtkft.c pidgin/gtkimhtml.c pidgin/gtkimhtmltoolbar.c @@ -242,7 +240,6 @@ pidgin/gtkutils.c pidgin/gtkwhiteboard.c pidgin/pidgin.h -pidgin/pidgincombobox.c pidgin/pidginstock.c pidgin/pidgintooltip.c pidgin/pixmaps/emotes/default/24/default.theme.in