changeset 25496:295777a9e2a4

propagate from branch 'im.pidgin.pidgin' (head 69639ef14e4298b2e420779e1696a07a13da5910) to branch 'im.pidgin.pidgin.yaz' (head 7cdf83b950d02559415fbc9949c2d45f79b04dfc)
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Sat, 02 Jun 2007 15:41:36 +0000
parents 8e20bb5640ed (diff) b81b1732fb64 (current diff)
children 67ad619bd97f
files libpurple/conversation.c pidgin/gtkconv.c pidgin/gtkmain.c pidgin/gtkprefs.c
diffstat 23 files changed, 286 insertions(+), 162 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/conversation.c	Thu May 31 11:30:42 2007 +0000
+++ b/libpurple/conversation.c	Sat Jun 02 15:41:36 2007 +0000
@@ -1970,7 +1970,7 @@
 
 	for (l = purple_conv_chat_get_users(chat); l; l = l->next) {
 		cb = l->data;
-		if (!purple_utf8_strcasecmp(cb->name, name))
+		if (!g_utf8_collate(cb->name, name))
 			return cb;
 	}
 
--- a/libpurple/dbus-analyze-functions.py	Thu May 31 11:30:42 2007 +0000
+++ b/libpurple/dbus-analyze-functions.py	Sat Jun 02 15:41:36 2007 +0000
@@ -2,7 +2,6 @@
 import string
 import sys
 
-
 # types translated into "int"
 simpletypes = ["int", "gint", "guint", "gboolean"]
 
@@ -362,8 +361,12 @@
         self.ccode.append("\t%s;" % self.call) # just call the function
 
     def outputstring(self, type, name, const):
-        self.cdecls.append("\tconst char *%s;" % name)
-        self.ccode.append("\t%s = null_to_empty(%s);" % (name, self.call))
+        if const:
+            self.cdecls.append("\tconst char *%s;" % name)
+        else:
+            self.cdecls.append("\tchar *%s;" % name)
+        self.ccode.append("\tif ((%s = %s) == NULL)" % (name, self.call))
+        self.ccode.append("\t\t%s = \"\";" % (name))
         self.cparamsout.append(("STRING", name))
         self.addouttype("s", name)
         if not const:
--- a/libpurple/dbus-bindings.h	Thu May 31 11:30:42 2007 +0000
+++ b/libpurple/dbus-bindings.h	Sat Jun 02 15:41:36 2007 +0000
@@ -35,9 +35,9 @@
 extern "C" {
 #endif
 
-gint purple_dbus_pointer_to_id(gpointer node);
+gint purple_dbus_pointer_to_id(gconstpointer node);
 gpointer purple_dbus_id_to_pointer(gint id, PurpleDBusType *type);
-gint  purple_dbus_pointer_to_id_error(gpointer ptr, DBusError *error);
+gint  purple_dbus_pointer_to_id_error(gconstpointer ptr, DBusError *error);
 gpointer purple_dbus_id_to_pointer_error(gint id, PurpleDBusType *type,
 				       const char *typename, DBusError *error);
 
--- a/libpurple/dbus-server.c	Thu May 31 11:30:42 2007 +0000
+++ b/libpurple/dbus-server.c	Sat Jun 02 15:41:36 2007 +0000
@@ -108,7 +108,7 @@
 }
 
 gint
-purple_dbus_pointer_to_id(gpointer node)
+purple_dbus_pointer_to_id(gconstpointer node)
 {
 	gint id = GPOINTER_TO_INT(g_hash_table_lookup(map_node_id, node));
 	if ((id == 0) && (node != NULL))
@@ -138,7 +138,7 @@
 }
 
 gint
-purple_dbus_pointer_to_id_error(gpointer ptr, DBusError *error)
+purple_dbus_pointer_to_id_error(gconstpointer ptr, DBusError *error)
 {
 	gint id = purple_dbus_pointer_to_id(ptr);
 
--- a/libpurple/protocols/msn/nexus.c	Thu May 31 11:30:42 2007 +0000
+++ b/libpurple/protocols/msn/nexus.c	Sat Jun 02 15:41:36 2007 +0000
@@ -247,6 +247,8 @@
 				temp = g_strndup(error, c - error);
 				error = purple_url_decode(temp);
 				g_free(temp);
+				if ((temp = strstr(error, " Do one of the following or try again:")) != NULL)
+					*temp = '\0';
 			}
 		}
 
--- a/libpurple/protocols/msn/session.c	Thu May 31 11:30:42 2007 +0000
+++ b/libpurple/protocols/msn/session.c	Sat Jun 02 15:41:36 2007 +0000
@@ -316,6 +316,7 @@
 							 "temporarily."));
 			break;
 		case MSN_ERROR_AUTH:
+			gc->wants_to_die = TRUE;
 			msg = g_strdup_printf(_("Unable to authenticate: %s"),
 								  (info == NULL ) ?
 								  _("Unknown error") : info);
--- a/libpurple/protocols/msn/sync.c	Thu May 31 11:30:42 2007 +0000
+++ b/libpurple/protocols/msn/sync.c	Sat Jun 02 15:41:36 2007 +0000
@@ -195,6 +195,8 @@
 
 	user = sync->last_user;
 
+	g_return_if_fail(user != NULL);
+
 	type     = cmd->params[0];
 	value    = cmd->params[1];
 
--- a/libpurple/proxy.c	Thu May 31 11:30:42 2007 +0000
+++ b/libpurple/proxy.c	Sat Jun 02 15:41:36 2007 +0000
@@ -559,7 +559,7 @@
 	int len, headers_len, status = 0;
 	gboolean error;
 	PurpleProxyConnectData *connect_data = data;
-	guchar *p;
+	char *p;
 	gsize max_read;
 
 	if (connect_data->read_buffer == NULL)
@@ -569,7 +569,7 @@
 		connect_data->read_len = 0;
 	}
 
-	p = connect_data->read_buffer + connect_data->read_len;
+	p = (char *)connect_data->read_buffer + connect_data->read_len;
 	max_read = connect_data->read_buf_len - connect_data->read_len - 1;
 
 	len = read(connect_data->fd, p, max_read);
@@ -596,11 +596,11 @@
 	connect_data->read_len += len;
 	p[len] = '\0';
 
-	p = (guchar *)g_strstr_len((const gchar *)connect_data->read_buffer,
+	p = g_strstr_len((const gchar *)connect_data->read_buffer,
 			connect_data->read_len, "\r\n\r\n");
 	if (p != NULL) {
 		*p = '\0';
-		headers_len = (p - connect_data->read_buffer) + 4;
+		headers_len = (p - (char *)connect_data->read_buffer) + 4;
 	} else if(len == max_read)
 		headers_len = len;
 	else
@@ -610,34 +610,34 @@
 	if (!error)
 	{
 		int major;
-		p = connect_data->read_buffer + 5;
-		major = strtol((const char *)p, (char**)&p, 10);
+		p = (char *)connect_data->read_buffer + 5;
+		major = strtol(p, &p, 10);
 		error = (major == 0) || (*p != '.');
 		if(!error) {
 			int minor;
 			p++;
-			minor = strtol((const char *)p, (char **)&p, 10);
+			minor = strtol(p, &p, 10);
 			error = (*p != ' ');
 			if(!error) {
 				p++;
-				status = strtol((const char *)p, (char **)&p, 10);
+				status = strtol(p, &p, 10);
 				error = (*p != ' ');
 			}
 		}
 	}
 
 	/* Read the contents */
-	p = (guchar *)g_strrstr((const gchar *)connect_data->read_buffer, "Content-Length: ");
+	p = g_strrstr((const gchar *)connect_data->read_buffer, "Content-Length: ");
 	if (p != NULL)
 	{
 		gchar *tmp;
 		int len = 0;
 		char tmpc;
 		p += strlen("Content-Length: ");
-		tmp = strchr((const char *)p, '\r');
+		tmp = strchr(p, '\r');
 		if(tmp)
 			*tmp = '\0';
-		len = atoi((const char *)p);
+		len = atoi(p);
 		if(tmp)
 			*tmp = '\r';
 
--- a/libpurple/status.c	Thu May 31 11:30:42 2007 +0000
+++ b/libpurple/status.c	Sat Jun 02 15:41:36 2007 +0000
@@ -1275,6 +1275,7 @@
 purple_presence_set_idle(PurplePresence *presence, gboolean idle, time_t idle_time)
 {
 	gboolean old_idle;
+	time_t current_time;
 
 	g_return_if_fail(presence != NULL);
 
@@ -1285,14 +1286,14 @@
 	presence->idle      = idle;
 	presence->idle_time = (idle ? idle_time : 0);
 
+	current_time = time(NULL);
+
 	if (purple_presence_get_context(presence) == PURPLE_PRESENCE_CONTEXT_BUDDY)
 	{
-		time_t current_time = time(NULL);
-
 		update_buddy_idle(purple_presence_get_buddy(presence), presence, current_time,
-		old_idle, idle);
+		                  old_idle, idle);
 	}
-	else if(purple_presence_get_context(presence) == PURPLE_PRESENCE_CONTEXT_ACCOUNT)
+	else if (purple_presence_get_context(presence) == PURPLE_PRESENCE_CONTEXT_ACCOUNT)
 	{
 		PurpleAccount *account;
 		PurpleConnection *gc;
@@ -1312,9 +1313,10 @@
 					msg = g_strdup_printf(_("+++ %s became idle"), purple_account_get_username(account));
 				else
 					msg = g_strdup_printf(_("+++ %s became unidle"), purple_account_get_username(account));
+
 				purple_log_write(log, PURPLE_MESSAGE_SYSTEM,
-							   purple_account_get_username(account),
-							   idle_time, msg);
+				                 purple_account_get_username(account),
+				                 (idle ? idle_time : current_time), msg);
 				g_free(msg);
 			}
 		}
@@ -1326,7 +1328,7 @@
 			prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl);
 
 		if (prpl_info && prpl_info->set_idle)
-			prpl_info->set_idle(gc, (idle ? (time(NULL) - idle_time) : 0));
+			prpl_info->set_idle(gc, (idle ? (current_time - idle_time) : 0));
 	}
 }
 
--- a/pidgin/Makefile.mingw	Thu May 31 11:30:42 2007 +0000
+++ b/pidgin/Makefile.mingw	Sat Jun 02 15:41:36 2007 +0000
@@ -111,6 +111,7 @@
 		-lintl \
 		-lglib-2.0 \
 		-lgobject-2.0 \
+		-lgthread-2.0 \
 		-lpurple \
 		-lz \
 		-lidletrack \
--- a/pidgin/gtkaccount.c	Thu May 31 11:30:42 2007 +0000
+++ b/pidgin/gtkaccount.c	Sat Jun 02 15:41:36 2007 +0000
@@ -433,7 +433,9 @@
 
 	/* Screen name */
 	dialog->screenname_entry = gtk_entry_new();
+#if GTK_CHECK_VERSION(2,10,0)
 	g_object_set(G_OBJECT(dialog->screenname_entry), "truncate-multiline", TRUE, NULL);
+#endif
 
 	add_pref_box(dialog, vbox, _("Screen name:"), dialog->screenname_entry);
 
--- a/pidgin/gtkconv.c	Thu May 31 11:30:42 2007 +0000
+++ b/pidgin/gtkconv.c	Sat Jun 02 15:41:36 2007 +0000
@@ -239,6 +239,10 @@
 		return FALSE;
 	}
 
+	if (gdk_window_get_state(gtkconv->win->window->window) & GDK_WINDOW_STATE_MAXIMIZED) {
+		return FALSE;
+	}
+
 	/* I find that I resize the window when it has a bunch of conversations in it, mostly so that the
 	 * tab bar will fit, but then I don't want new windows taking up the entire screen.  I check to see
 	 * if there is only one conversation in the window.  This way we'll be setting new windows to the
@@ -6981,7 +6985,7 @@
 	purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/scrollback_lines", 4000);
 
 	purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/use_theme_font", TRUE);
-	purple_prefs_add_string(PIDGIN_PREFS_ROOT "/conversations/custom_font", "Sans 28");
+	purple_prefs_add_string(PIDGIN_PREFS_ROOT "/conversations/custom_font", "");
 
 	/* Conversations -> Chat */
 	purple_prefs_add_none(PIDGIN_PREFS_ROOT "/conversations/chat");
--- a/pidgin/gtkimhtmltoolbar.c	Thu May 31 11:30:42 2007 +0000
+++ b/pidgin/gtkimhtmltoolbar.c	Sat Jun 02 15:41:36 2007 +0000
@@ -852,6 +852,64 @@
 	update_buttons(toolbar);
 }
 
+
+/* This comes from gtkmenutoolbutton.c from gtk+
+ * Copyright (C) 2003 Ricardo Fernandez Pascual
+ * Copyright (C) 2004 Paolo Borelli
+ */
+static void
+menu_position_func (GtkMenu           *menu,
+                    int               *x,
+                    int               *y,
+                    gboolean          *push_in,
+                    gpointer data)
+{
+  GtkRequisition menu_req;
+  GtkTextDirection direction;
+  GdkRectangle monitor;
+  gint monitor_num;
+  GdkScreen *screen;
+  GtkWidget *widget = data;
+
+  gtk_widget_size_request (GTK_WIDGET (widget), &menu_req);
+
+  direction = gtk_widget_get_direction (widget);
+
+  screen = gtk_widget_get_screen (GTK_WIDGET (menu));
+  monitor_num = gdk_screen_get_monitor_at_window (screen, widget->window);
+  if (monitor_num < 0)
+    monitor_num = 0;
+  gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
+
+  gdk_window_get_origin (widget->window, x, y);
+  *x += widget->allocation.x;
+    *y += widget->allocation.y;
+
+      if (direction == GTK_TEXT_DIR_LTR)
+	*x += MAX (widget->allocation.width - menu_req.width, 0);
+      else if (menu_req.width > widget->allocation.width)
+        *x -= menu_req.width - widget->allocation.width;
+
+      if ((*y + widget->allocation.height + menu_req.height) <= monitor.y + monitor.height)
+	*y += widget->allocation.height;
+      else if ((*y - menu_req.height) >= monitor.y)
+	*y -= menu_req.height;
+      else if (monitor.y + monitor.height - (*y + widget->allocation.height) > *y)
+	*y += widget->allocation.height;
+      else
+	*y -= menu_req.height;
+  *push_in = FALSE;
+}
+
+static void pidgin_menu_clicked(GtkWidget *button, GtkMenu *menu) {
+	gtk_widget_show_all(GTK_WIDGET(menu));
+	gtk_menu_popup(menu, NULL, NULL, menu_position_func, button, 0, gtk_get_current_event_time());
+}
+
+static void pidgin_menu_deactivate(GtkWidget *menu, GtkToggleButton *button) {
+	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), FALSE);
+}
+
 enum {
 	LAST_SIGNAL
 };
@@ -899,12 +957,91 @@
 	gobject_class->finalize = gtk_imhtmltoolbar_finalize;
 }
 
+static void gtk_imhtmltoolbar_create_old_buttons(GtkIMHtmlToolbar *toolbar)
+{
+	GtkWidget *button;
+	/* Bold */
+	button = pidgin_pixbuf_toolbar_button_from_stock(GTK_STOCK_BOLD);
+	g_signal_connect(G_OBJECT(button), "clicked",
+			 G_CALLBACK(do_bold), toolbar);
+	toolbar->bold = button;
+
+
+	/* Italic */
+	button = pidgin_pixbuf_toolbar_button_from_stock(GTK_STOCK_ITALIC);
+	g_signal_connect(G_OBJECT(button), "clicked",
+			 G_CALLBACK(do_italic), toolbar);
+	toolbar->italic = button;
+
+	/* Underline */
+	button = pidgin_pixbuf_toolbar_button_from_stock(GTK_STOCK_UNDERLINE);
+	g_signal_connect(G_OBJECT(button), "clicked",
+			 G_CALLBACK(do_underline), toolbar);
+	toolbar->underline = button;
+
+	/* Increase font size */
+	button = pidgin_pixbuf_toolbar_button_from_stock(PIDGIN_STOCK_TOOLBAR_TEXT_LARGER);
+	g_signal_connect(G_OBJECT(button), "clicked",
+			 G_CALLBACK(do_big), toolbar);
+	toolbar->larger_size = button;
+
+	/* Decrease font size */
+	button = pidgin_pixbuf_toolbar_button_from_stock(PIDGIN_STOCK_TOOLBAR_TEXT_SMALLER);
+	g_signal_connect(G_OBJECT(button), "clicked",
+			 G_CALLBACK(do_small), toolbar);
+	toolbar->smaller_size = button;
+
+	/* Font Face */
+
+	button = pidgin_pixbuf_toolbar_button_from_stock(PIDGIN_STOCK_TOOLBAR_FONT_FACE);
+	g_signal_connect(G_OBJECT(button), "clicked",
+			 G_CALLBACK(toggle_font), toolbar);
+	toolbar->font = button;
+
+	/* Foreground Color */
+	button = pidgin_pixbuf_toolbar_button_from_stock(PIDGIN_STOCK_TOOLBAR_FGCOLOR);
+	g_signal_connect(G_OBJECT(button), "clicked",
+			 G_CALLBACK(toggle_fg_color), toolbar);
+	toolbar->fgcolor = button;
+
+	/* Background Color */
+	button = pidgin_pixbuf_toolbar_button_from_stock(PIDGIN_STOCK_TOOLBAR_BGCOLOR);
+	g_signal_connect(G_OBJECT(button), "clicked",
+			 G_CALLBACK(toggle_bg_color), toolbar);
+	toolbar->bgcolor = button;
+
+	button = pidgin_pixbuf_toolbar_button_from_stock(PIDGIN_STOCK_TOOLBAR_INSERT_LINK);
+	g_signal_connect(G_OBJECT(button), "clicked",
+				 G_CALLBACK(insert_link_cb), toolbar);
+	toolbar->link = button;
+
+	/* Insert IM Image */
+	button = pidgin_pixbuf_toolbar_button_from_stock(PIDGIN_STOCK_TOOLBAR_INSERT_IMAGE);
+	g_signal_connect(G_OBJECT(button), "clicked",
+			 G_CALLBACK(insert_image_cb), toolbar);
+	toolbar->image = button;
+
+	/* Insert Smiley */
+	button = pidgin_pixbuf_toolbar_button_from_stock(PIDGIN_STOCK_TOOLBAR_SMILEY);
+	g_signal_connect(G_OBJECT(button), "clicked",
+			 G_CALLBACK(insert_smiley_cb), toolbar);
+	toolbar->smiley = button;
+
+
+}
+
 static void gtk_imhtmltoolbar_init (GtkIMHtmlToolbar *toolbar)
 {
 	GtkWidget *hbox = GTK_WIDGET(toolbar);
+	GtkWidget *bbox;
+	GtkWidget *image;
+	GtkWidget *label;
+	GtkWidget *insert_button;
+	GtkWidget *font_button;
+	GtkWidget *font_menu;
+	GtkWidget *insert_menu;
 	GtkWidget *button;
 	GtkWidget *sep;
-	GtkSizeGroup *sg;
 
 	toolbar->imhtml = NULL;
 	toolbar->font_dialog = NULL;
@@ -917,164 +1054,116 @@
 	toolbar->tooltips = gtk_tooltips_new();
 
 	gtk_box_set_spacing(GTK_BOX(toolbar), 3);
-	sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH);
+
+	gtk_imhtmltoolbar_create_old_buttons(toolbar);
 
 	/* Bold */
-	button = pidgin_pixbuf_toolbar_button_from_stock(GTK_STOCK_BOLD);
-	gtk_size_group_add_widget(sg, button);
-	gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
-	gtk_tooltips_set_tip(toolbar->tooltips, button, _("Bold"), NULL);
-
-	g_signal_connect(G_OBJECT(button), "clicked",
-			 G_CALLBACK(do_bold), toolbar);
+	font_button = gtk_toggle_button_new();
+	gtk_button_set_relief(GTK_BUTTON(font_button), GTK_RELIEF_NONE);
+	bbox = gtk_hbox_new(FALSE, 3);
+	gtk_container_add(GTK_CONTAINER(font_button), bbox);
+	image = gtk_image_new_from_stock(GTK_STOCK_BOLD, gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL));
+	gtk_box_pack_start(GTK_BOX(bbox), image, FALSE, FALSE, 0);
+	label = gtk_label_new_with_mnemonic(_("_Font"));
+	gtk_box_pack_start(GTK_BOX(bbox), label, FALSE, FALSE, 0);
+	gtk_box_pack_start(GTK_BOX(hbox), font_button, FALSE, FALSE, 0);
+	gtk_widget_show_all(font_button);
 
-	toolbar->bold = button;
+	font_menu = gtk_menu_new();
+
+	button = gtk_check_menu_item_new_with_mnemonic(_("_Bold"));
+	g_signal_connect_swapped(G_OBJECT(button), "activate", G_CALLBACK(gtk_button_clicked), toolbar->bold);
+	gtk_menu_shell_append(GTK_MENU_SHELL(font_menu), button);
 
-	/* Italic */
-	button = pidgin_pixbuf_toolbar_button_from_stock(GTK_STOCK_ITALIC);
-	gtk_size_group_add_widget(sg, button);
-	gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
-	gtk_tooltips_set_tip(toolbar->tooltips, button, _("Italic"), NULL);
+	button = gtk_check_menu_item_new_with_mnemonic(_("_Italic"));
+	g_signal_connect_swapped(G_OBJECT(button), "activate", G_CALLBACK(gtk_button_clicked), toolbar->italic);
+	gtk_menu_shell_append(GTK_MENU_SHELL(font_menu), button);
+
+	button = gtk_check_menu_item_new_with_mnemonic(_("_Underline"));
+	g_signal_connect_swapped(G_OBJECT(button), "activate", G_CALLBACK(gtk_button_clicked), toolbar->underline);
+	gtk_menu_shell_append(GTK_MENU_SHELL(font_menu), button);
 
-	g_signal_connect(G_OBJECT(button), "clicked",
-			 G_CALLBACK(do_italic), toolbar);
+	button = gtk_menu_item_new_with_mnemonic(_("_Larger"));
+	g_signal_connect_swapped(G_OBJECT(button), "activate", G_CALLBACK(gtk_button_clicked), toolbar->larger_size);
+	gtk_menu_shell_append(GTK_MENU_SHELL(font_menu), button);
 
-	toolbar->italic = button;
+	button = gtk_menu_item_new_with_mnemonic(_("_Normal"));
+	g_signal_connect_swapped(G_OBJECT(button), "activate", G_CALLBACK(gtk_button_clicked), toolbar->normal_size);
+	gtk_menu_shell_append(GTK_MENU_SHELL(font_menu), button);
+
+	button = gtk_menu_item_new_with_mnemonic(_("_Smaller"));
+	g_signal_connect_swapped(G_OBJECT(button), "activate", G_CALLBACK(gtk_button_clicked), toolbar->smaller_size);
+	gtk_menu_shell_append(GTK_MENU_SHELL(font_menu), button);
 
-	/* Underline */
-	button = pidgin_pixbuf_toolbar_button_from_stock(GTK_STOCK_UNDERLINE);
-	gtk_size_group_add_widget(sg, button);
-	gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
-	gtk_tooltips_set_tip(toolbar->tooltips, button, _("Underline"), NULL);
+	button = gtk_menu_item_new_with_mnemonic(_("_Font face"));
+	g_signal_connect_swapped(G_OBJECT(button), "activate", G_CALLBACK(gtk_button_clicked), toolbar->font);
+	gtk_menu_shell_append(GTK_MENU_SHELL(font_menu), button);
 
-	g_signal_connect(G_OBJECT(button), "clicked",
-			 G_CALLBACK(do_underline), toolbar);
+	button = gtk_menu_item_new_with_mnemonic(_("_Foreground color"));
+	g_signal_connect_swapped(G_OBJECT(button), "activate", G_CALLBACK(gtk_button_clicked), toolbar->fgcolor);
+	gtk_menu_shell_append(GTK_MENU_SHELL(font_menu), button);
 
-	toolbar->underline = button;
+	button = gtk_menu_item_new_with_mnemonic(_("_Background color"));
+	g_signal_connect_swapped(G_OBJECT(button), "activate", G_CALLBACK(gtk_button_clicked), toolbar->bgcolor);
+	gtk_menu_shell_append(GTK_MENU_SHELL(font_menu), button);
+
+	g_signal_connect(G_OBJECT(font_button), "clicked", G_CALLBACK(pidgin_menu_clicked), font_menu);
+	g_signal_connect(G_OBJECT(font_menu), "deactivate", G_CALLBACK(pidgin_menu_deactivate), font_button);	
 
 	/* Sep */
 	sep = gtk_vseparator_new();
 	gtk_box_pack_start(GTK_BOX(hbox), sep, FALSE, FALSE, 0);
-
-	/* Increase font size */
-	button = pidgin_pixbuf_toolbar_button_from_stock(PIDGIN_STOCK_TOOLBAR_TEXT_LARGER);
-	gtk_size_group_add_widget(sg, button);
-	gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
-	gtk_tooltips_set_tip(toolbar->tooltips, button,
-			     _("Larger font size"), NULL);
-
-	g_signal_connect(G_OBJECT(button), "clicked",
-			 G_CALLBACK(do_big), toolbar);
-
-	toolbar->larger_size = button;
-
-	/* Decrease font size */
-	button = pidgin_pixbuf_toolbar_button_from_stock(PIDGIN_STOCK_TOOLBAR_TEXT_SMALLER);
-	gtk_size_group_add_widget(sg, button);
-	gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
-	gtk_tooltips_set_tip(toolbar->tooltips, button,
-			     _("Smaller font size"), NULL);
-
-	g_signal_connect(G_OBJECT(button), "clicked",
-			 G_CALLBACK(do_small), toolbar);
-
-	toolbar->smaller_size = button;
-
-	/* Sep */
-	sep = gtk_vseparator_new();
-	gtk_box_pack_start(GTK_BOX(hbox), sep, FALSE, FALSE, 0);
-
-	/* Font Face */
-
-	button = pidgin_pixbuf_toolbar_button_from_stock(PIDGIN_STOCK_TOOLBAR_FONT_FACE);
-	gtk_size_group_add_widget(sg, button);
-	gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
-	gtk_tooltips_set_tip(toolbar->tooltips, button,
-			_("Font face"), NULL);
-
-	g_signal_connect(G_OBJECT(button), "clicked",
-			 G_CALLBACK(toggle_font), toolbar);
-
-	toolbar->font = button;
-
-	/* Foreground Color */
-	button = pidgin_pixbuf_toolbar_button_from_stock(PIDGIN_STOCK_TOOLBAR_FGCOLOR);
-	gtk_size_group_add_widget(sg, button);
-	gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
-	gtk_tooltips_set_tip(toolbar->tooltips, button,
-			     _("Foreground font color"), NULL);
-
-	g_signal_connect(G_OBJECT(button), "clicked",
-			 G_CALLBACK(toggle_fg_color), toolbar);
-
-	toolbar->fgcolor = button;
-
-	/* Background Color */
-	button = pidgin_pixbuf_toolbar_button_from_stock(PIDGIN_STOCK_TOOLBAR_BGCOLOR);
-	gtk_size_group_add_widget(sg, button);
-	gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
-	gtk_tooltips_set_tip(toolbar->tooltips, button,
-			     _("Background color"), NULL);
-
-	g_signal_connect(G_OBJECT(button), "clicked",
-			 G_CALLBACK(toggle_bg_color), toolbar);
-
-	toolbar->bgcolor = button;
-
-	/* Sep */
-	sep = gtk_vseparator_new();
-	gtk_box_pack_start(GTK_BOX(hbox), sep, FALSE, FALSE, 0);
+	gtk_widget_show_all(sep);
 
 	/* Reset Formatting */
-	button = pidgin_pixbuf_toolbar_button_from_stock(PIDGIN_STOCK_CLEAR);
-	gtk_size_group_add_widget(sg, button);
+	button = gtk_toggle_button_new();
+	gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
+	bbox = gtk_hbox_new(FALSE, 3);
+	gtk_container_add(GTK_CONTAINER(button), bbox);
+	image = gtk_image_new_from_stock(PIDGIN_STOCK_CLEAR, gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL));
+	gtk_box_pack_start(GTK_BOX(bbox), image, FALSE, FALSE, 0);
+	label = gtk_label_new_with_mnemonic(_("_Reset font"));
+	gtk_box_pack_start(GTK_BOX(bbox), label, FALSE, FALSE, 0);
 	gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
-	gtk_tooltips_set_tip(toolbar->tooltips, button,
-			     _("Reset formatting"), NULL);
-
+	gtk_widget_show_all(button);
 	g_signal_connect(G_OBJECT(button), "clicked",
 			 G_CALLBACK(clear_formatting_cb), toolbar);
-
 	toolbar->clear = button;
 
 	/* Sep */
 	sep = gtk_vseparator_new();
 	gtk_box_pack_start(GTK_BOX(hbox), sep, FALSE, FALSE, 0);
+	gtk_widget_show_all(sep);
 
 	/* Insert Link */
-	button = pidgin_pixbuf_toolbar_button_from_stock(PIDGIN_STOCK_TOOLBAR_INSERT_LINK);
-	gtk_size_group_add_widget(sg, button);
-	gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
-	gtk_tooltips_set_tip(toolbar->tooltips, button, _("Insert link"), NULL);
-	g_signal_connect(G_OBJECT(button), "clicked",
-				 G_CALLBACK(insert_link_cb), toolbar);
+	insert_button = gtk_toggle_button_new();
+	gtk_button_set_relief(GTK_BUTTON(insert_button), GTK_RELIEF_NONE);
+	bbox = gtk_hbox_new(FALSE, 3);
+	gtk_container_add(GTK_CONTAINER(insert_button), bbox);
+	image = gtk_image_new_from_stock(PIDGIN_STOCK_TOOLBAR_INSERT, gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL));
+	gtk_box_pack_start(GTK_BOX(bbox), image, FALSE, FALSE, 0);
+	label = gtk_label_new_with_mnemonic(_("_Insert"));
+	gtk_box_pack_start(GTK_BOX(bbox), label, FALSE, FALSE, 0);
+	gtk_box_pack_start(GTK_BOX(hbox), insert_button, FALSE, FALSE, 0);
+	gtk_widget_show_all(insert_button);
 
-	toolbar->link = button;
-
-	/* Insert IM Image */
-	button = pidgin_pixbuf_toolbar_button_from_stock(PIDGIN_STOCK_TOOLBAR_INSERT_IMAGE);
-	gtk_size_group_add_widget(sg, button);
-	gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
-	gtk_tooltips_set_tip(toolbar->tooltips, button, _("Insert image"), NULL);
+	insert_menu = gtk_menu_new();
 
-	g_signal_connect(G_OBJECT(button), "clicked",
-			 G_CALLBACK(insert_image_cb), toolbar);
+	button = gtk_menu_item_new_with_mnemonic(_("_Smiley"));
+	g_signal_connect_swapped(G_OBJECT(button), "activate", G_CALLBACK(gtk_button_clicked), toolbar->smiley);
+	gtk_menu_shell_append(GTK_MENU_SHELL(insert_menu), button);
 
-	toolbar->image = button;
+	button = gtk_menu_item_new_with_mnemonic(_("_Image"));
+	g_signal_connect_swapped(G_OBJECT(button), "activate", G_CALLBACK(gtk_button_clicked), toolbar->image);
+	gtk_menu_shell_append(GTK_MENU_SHELL(insert_menu), button);
 
-	/* Insert Smiley */
-	button = pidgin_pixbuf_toolbar_button_from_stock(PIDGIN_STOCK_TOOLBAR_SMILEY);
-	gtk_size_group_add_widget(sg, button);
-	gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
-	gtk_tooltips_set_tip(toolbar->tooltips, button, _("Insert smiley"), NULL);
+	button = gtk_menu_item_new_with_mnemonic(_("_Link"));
+	g_signal_connect_swapped(G_OBJECT(button), "activate", G_CALLBACK(gtk_button_clicked), toolbar->link);
+	gtk_menu_shell_append(GTK_MENU_SHELL(insert_menu), button);
 
-	g_signal_connect(G_OBJECT(button), "clicked",
-			 G_CALLBACK(insert_smiley_cb), toolbar);
-
-	toolbar->smiley = button;
-
+	g_signal_connect(G_OBJECT(insert_button), "clicked", G_CALLBACK(pidgin_menu_clicked), insert_menu);
+	g_signal_connect(G_OBJECT(insert_menu), "deactivate", G_CALLBACK(pidgin_menu_deactivate), insert_button);
 	toolbar->sml = NULL;
-	gtk_widget_show_all(hbox);
 }
 
 GtkWidget *gtk_imhtmltoolbar_new()
--- a/pidgin/gtkmain.c	Thu May 31 11:30:42 2007 +0000
+++ b/pidgin/gtkmain.c	Sat Jun 02 15:41:36 2007 +0000
@@ -475,6 +475,9 @@
 #else
 	debug_enabled = FALSE;
 #endif
+
+	/* This is the first Glib function call. Make sure to initialize GThread bfeore then */
+	g_thread_init(NULL);
 	
 #ifdef ENABLE_NLS
 	bindtextdomain(PACKAGE, LOCALEDIR);
--- a/pidgin/gtkprefs.c	Thu May 31 11:30:42 2007 +0000
+++ b/pidgin/gtkprefs.c	Sat Jun 02 15:41:36 2007 +0000
@@ -906,6 +906,7 @@
 	GtkWidget *hbox;
 	GtkWidget *label;
 	GtkWidget *font_button;
+	const char *font_name;
 #endif
 
 	ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
@@ -947,7 +948,8 @@
 	hbox = gtk_hbox_new(FALSE, 3);
 	label = gtk_label_new_with_mnemonic(_("Conversation _font:"));
 	gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
-	font_button = gtk_font_button_new_with_font(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/custom_font"));
+	font_name = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/custom_font");
+	font_button = gtk_font_button_new_with_font(purple_prefs_get_string(font_name ? font_name : NULL));
 	gtk_font_button_set_show_style(GTK_FONT_BUTTON(font_button), TRUE);
 	gtk_box_pack_start(GTK_BOX(hbox), font_button, FALSE, FALSE, 0);
 	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
--- a/pidgin/gtkstatusbox.c	Thu May 31 11:30:42 2007 +0000
+++ b/pidgin/gtkstatusbox.c	Sat Jun 02 15:41:36 2007 +0000
@@ -2029,6 +2029,10 @@
 	int w, h;
 	GtkIconSize icon_size = gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_MEDIUM);
 	gtk_icon_size_lookup(icon_size, &w, &h);
+	if (height > width)
+		w = width * h  / height;
+	else if (width > height)
+		h = height * w / width;
 	gdk_pixbuf_loader_set_size(loader, w, h);
 #endif
 }
--- a/pidgin/gtkutils.c	Thu May 31 11:30:42 2007 +0000
+++ b/pidgin/gtkutils.c	Sat Jun 02 15:41:36 2007 +0000
@@ -612,6 +612,7 @@
 				g_object_unref(pixbuf);
 
 			gtalk_name = NULL;
+			i++;
 		}
 
 		pixbuf = get_prpl_pixbuf(prpl_info);
@@ -1457,8 +1458,7 @@
 			else
 				purple_request_choice(NULL, NULL,
 						    _("You have dragged an image"),
-						    (ft ? _("You can send this image as a file transfer or "
-							   "embed it into this message, or use it as the buddy icon for this user.") :
+						    (ft ? _("You can send this image as a file transfer, or use it as the buddy icon for this user.") :
 						    _("You can insert this image into this message, or use it as the buddy icon for this user")),
 						    (ft ? DND_FILE_TRANSFER : DND_IM_IMAGE),
 							"OK", (GCallback)dnd_image_ok_callback,
--- a/pidgin/pidginstock.c	Thu May 31 11:30:42 2007 +0000
+++ b/pidgin/pidginstock.c	Sat Jun 02 15:41:36 2007 +0000
@@ -151,6 +151,7 @@
 	{ PIDGIN_STOCK_TOOLBAR_FONT_FACE, "toolbar", "font-face.png", TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL  },
 	{ PIDGIN_STOCK_TOOLBAR_TEXT_SMALLER, "toolbar", "font-size-down.png", TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL  },
 	{ PIDGIN_STOCK_TOOLBAR_TEXT_LARGER, "toolbar", "font-size-up.png", TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL  },
+	{ PIDGIN_STOCK_TOOLBAR_INSERT, "toolbar", "insert.png", TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL  },
 	{ PIDGIN_STOCK_TOOLBAR_INSERT_IMAGE, "toolbar", "insert-image.png", TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL  },
 	{ PIDGIN_STOCK_TOOLBAR_INSERT_LINK, "toolbar", "insert-link.png", TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL  },
 	{ PIDGIN_STOCK_TOOLBAR_MESSAGE_NEW, "toolbar", "message-new.png", TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL  },
--- a/pidgin/pidginstock.h	Thu May 31 11:30:42 2007 +0000
+++ b/pidgin/pidginstock.h	Sat Jun 02 15:41:36 2007 +0000
@@ -116,6 +116,7 @@
 #define PIDGIN_STOCK_TOOLBAR_FONT_FACE	  "pidgin-font-face"
 #define PIDGIN_STOCK_TOOLBAR_TEXT_SMALLER "pidgin-text-smaller"
 #define PIDGIN_STOCK_TOOLBAR_TEXT_LARGER  "pidgin-text-larger"
+#define PIDGIN_STOCK_TOOLBAR_INSERT       "pidgin-insert"
 #define PIDGIN_STOCK_TOOLBAR_INSERT_IMAGE "pidgin-insert-image"
 #define PIDGIN_STOCK_TOOLBAR_INSERT_LINK  "pidgin-insert-link"
 #define PIDGIN_STOCK_TOOLBAR_MESSAGE_NEW  "pidgin-message-new"
--- a/pidgin/pixmaps/toolbar/16/Makefile.am	Thu May 31 11:30:42 2007 +0000
+++ b/pidgin/pixmaps/toolbar/16/Makefile.am	Sat Jun 02 15:41:36 2007 +0000
@@ -6,6 +6,7 @@
 		font-face.png \
 		font-size-down.png \
 		font-size-up.png \
+		insert.png \
 		insert-image.png \
 		insert-link.png \
 		message-new.png \
Binary file pidgin/pixmaps/toolbar/16/insert.png has changed
--- a/pidgin/win32/nsis/translations/slovenian.nsh	Thu May 31 11:30:42 2007 +0000
+++ b/pidgin/win32/nsis/translations/slovenian.nsh	Sat Jun 02 15:41:36 2007 +0000
@@ -19,30 +19,35 @@
 
 ; Components Page
 !define PIDGIN_SECTION_TITLE			"Pidgin - odjemalec za klepet (zahtevano)"
-!define GTK_SECTION_TITLE			"GTK+ izvajalno okolje (zahtevano)"
-!define PIDGIN_SHORTCUTS_SECTION_TITLE		"Bližnjice"
+!define GTK_SECTION_TITLE			"Izvajalno okolje GTK+ (zahtevano)"
+!define PIDGIN_SHORTCUTS_SECTION_TITLE		"Tipke za bližnjice"
 !define PIDGIN_DESKTOP_SHORTCUT_SECTION_TITLE	"Namizje"
 !define PIDGIN_STARTMENU_SHORTCUT_SECTION_TITLE	"Začetni meni"
-!define PIDGIN_SECTION_DESCRIPTION		"Temeljne datoteke Pidgin"
+!define PIDGIN_SECTION_DESCRIPTION		"Temeljne datoteke in knjižnice za Pidgin"
 !define GTK_SECTION_DESCRIPTION			"Večplatformna orodjarna GUI, ki jo uporablja Pidgin"
 
 !define PIDGIN_SHORTCUTS_SECTION_DESCRIPTION	"Bližnjice za zagon Pidgina"
 !define PIDGIN_DESKTOP_SHORTCUT_DESC		"Ustvari bližnjico za Pidgin na namizju"
-!define PIDGIN_STARTMENU_SHORTCUT_DESC		"Ustvari vnos Pidgin v meniju Start"
+!define PIDGIN_STARTMENU_SHORTCUT_DESC		"Ustvari izbiro Pidgin v meniju Start"
 
 ; GTK+ Directory Page
 !define GTK_UPGRADE_PROMPT			"Nameščeno imate starejšo različico izvajalnega okolja GTK+. Jo želite nadgraditi?$\rOpomba: če je ne boste nadgradili, $(^Name) morda ne bo deloval."
+!define GTK_WINDOWS_INCOMPATIBLE		"Okolja Windows 95/98/Me z GTK+ 2.8.0 ali novejšimi niso združljiva.  GTK+ ${GTK_INSTALL_VERSION} will not be installed.$\rIf you don't have GTK+ ${GTK_MIN_VERSION} ali novejši je že nameščen, zato se bo namestitev zdaj prekinila."
 
 ; Installer Finish Page
 !define PIDGIN_FINISH_VISIT_WEB_SITE		"Obiščite spletno stran Windows Pidgin"
 
 ; Pidgin Section Prompts and Texts
 !define PIDGIN_UNINSTALL_DESC			"$(^Name) (samo odstrani)"
+!define PIDGIN_PROMPT_CONTINUE_WITHOUT_UNINSTALL	"Trenutno nameščene različice Pidgina ni mogoče odstraniti. Nova različica bo nameščena brez odstranitve trenutno nameščene različice."
 
 ; GTK+ Section Prompts
 !define GTK_INSTALL_ERROR			"Napaka pri namestitvi izvajalnega okolja GTK+."
 !define GTK_BAD_INSTALL_PATH			"Pot, ki ste jo vnesli, ni dosegljiva ali je ni mogoče ustvariti."
 
+; URL Handler section
+!define URI_HANDLERS_SECTION_TITLE		"URI Handlers"
+
 ; Uninstall Section Prompts
 !define un.PIDGIN_UNINSTALL_ERROR_1		"Vnosov za Pidgin v registru ni mogoče najti.$\rNajverjetneje je ta program namestil drug uporabnik."
 !define un.PIDGIN_UNINSTALL_ERROR_2		"Za odstranitev programa nimate ustreznih pravic."
--- a/po/ChangeLog	Thu May 31 11:30:42 2007 +0000
+++ b/po/ChangeLog	Sat Jun 02 15:41:36 2007 +0000
@@ -3,6 +3,7 @@
 version 2.0.2
 	* English (British) translation updated (Luke Ross)
 	* Slovenian translation updated (Martin Srebotnjak)
+	* Slovenian win32 installer updated (Martin Srebotnjak)
 
 version 2.0.1
 	* Chinese (Hong Kong) translation added (Ambrose C. Li, Abel Cheung)