changeset 27736:4e6e39be7fef

propagate from branch 'im.pidgin.pidgin' (head 2cbd8db1d77e345ea55b3b765ca79726273ca727) to branch 'im.pidgin.pidgin.yaz' (head c4e983e0c4199ea67cd68f54b90486d33a2e923b)
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Fri, 23 Nov 2007 11:54:29 +0000
parents 512785bd7fcb (diff) 98604b4bfa3b (current diff)
children a9cb48039d3b
files configure.ac libpurple/util.c po/de.po
diffstat 8 files changed, 80 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/configure.ac	Thu Nov 22 07:44:59 2007 +0000
+++ b/configure.ac	Fri Nov 23 11:54:29 2007 +0000
@@ -52,10 +52,10 @@
           [purple_major_version.purple_minor_version.purple_micro_version])
 m4_define([purple_display_version], purple_version[]m4_ifdef([purple_version_suffix],[purple_version_suffix]))
 
-m4_define([gnt_lt_current], [2])
+m4_define([gnt_lt_current], [3])
 m4_define([gnt_major_version], [2])
-m4_define([gnt_minor_version], [2])
-m4_define([gnt_micro_version], [3])
+m4_define([gnt_minor_version], [3])
+m4_define([gnt_micro_version], [0])
 m4_define([gnt_version_suffix], [])
 m4_define([gnt_version],
           [gnt_major_version.gnt_minor_version.gnt_micro_version])
@@ -303,6 +303,9 @@
 	AC_MSG_ERROR([
 
 You must have the GLib 2.0 development headers installed to build.
+
+If you have these installed already you may need to install pkg-config so
+I can find them.
 ])])
 AC_SUBST(GLIB_CFLAGS)
 AC_SUBST(GLIB_LIBS)
@@ -387,7 +390,7 @@
 	AC_SUBST(GTK_LIBS)
 
 	dnl We only really need Pango >= 1.4 for decent RTL support
-	PKG_CHECK_MODULES(pango, [pango >= 1.4.0],
+	PKG_CHECK_MODULES(PANGO, [pango >= 1.4.0],
 			AC_DEFINE(HAVE_PANGO14, 1, [Define if we have Pango 1.4 or newer.]),:)
 
 	dnl #######################################################################
--- a/finch/libgnt/configure.ac	Thu Nov 22 07:44:59 2007 +0000
+++ b/finch/libgnt/configure.ac	Fri Nov 23 11:54:29 2007 +0000
@@ -24,11 +24,11 @@
 # Make sure to update ../../configure.ac with libgnt version changes.
 #
 
-m4_define([gnt_lt_current], [2])
+m4_define([gnt_lt_current], [3])
 m4_define([gnt_major_version], [2])
-m4_define([gnt_minor_version], [2])
+m4_define([gnt_minor_version], [3])
 m4_define([gnt_micro_version], [0])
-m4_define([gnt_version_suffix], [devel])
+m4_define([gnt_version_suffix], [])
 m4_define([gnt_version],
           [gnt_major_version.gnt_minor_version.gnt_micro_version])
 m4_define([gnt_display_version], gnt_version[]m4_ifdef([gnt_version_suffix],[gnt_version_suffix]))
--- a/finch/libgnt/gntwm.c	Thu Nov 22 07:44:59 2007 +0000
+++ b/finch/libgnt/gntwm.c	Fri Nov 23 11:54:29 2007 +0000
@@ -81,6 +81,7 @@
 static int widestringwidth(wchar_t *wide);
 #endif
 
+static void ensure_normal_mode(GntWM *wm);
 static gboolean write_already(gpointer data);
 static int write_timeout;
 static time_t last_active_time;
@@ -392,6 +393,10 @@
 	if (!wm->cws->ordered || !wm->cws->ordered->next)
 		return;
 
+	if (wm->mode != GNT_KP_MODE_NORMAL) {
+		ensure_normal_mode(wm);
+	}
+
 	w = wm->cws->ordered->data;
 	pos = g_list_index(wm->cws->list, w);
 	pos += direction;
@@ -503,6 +508,7 @@
 
 	if (wm->cws->ordered) {
 		gnt_widget_destroy(wm->cws->ordered->data);
+		ensure_normal_mode(wm);
 	}
 
 	return TRUE;
@@ -522,6 +528,7 @@
 setup__list(GntWM *wm)
 {
 	GntWidget *tree, *win;
+	ensure_normal_mode(wm);
 	win = wm->_list.window = gnt_box_new(FALSE, FALSE);
 	gnt_box_set_toplevel(GNT_BOX(win), TRUE);
 	gnt_box_set_pad(GNT_BOX(win), 0);
@@ -972,6 +979,16 @@
 	update_screen(wm);
 }
 
+static void
+ensure_normal_mode(GntWM *wm)
+{
+	if (wm->mode != GNT_KP_MODE_NORMAL) {
+		if (wm->cws->ordered)
+			window_reverse(wm->cws->ordered->data, FALSE, wm);
+		wm->mode = GNT_KP_MODE_NORMAL;
+	}
+}
+
 static gboolean
 start_move(GntBindable *bindable, GList *null)
 {
@@ -1453,6 +1470,7 @@
 	if (wm->_list.window) {
 		gnt_widget_destroy(wm->_list.window);
 	}
+	ensure_normal_mode(wm);
 	gnt_ws_hide(wm->cws, wm->nodes);
 	wm->cws = s;
 	gnt_ws_show(wm->cws, wm->nodes);
--- a/libpurple/tests/Makefile.am	Thu Nov 22 07:44:59 2007 +0000
+++ b/libpurple/tests/Makefile.am	Fri Nov 23 11:54:29 2007 +0000
@@ -1,6 +1,9 @@
 if HAVE_CHECK
 TESTS=check_libpurple
 
+clean-local:
+	-rm -rf libpurple..
+
 check_PROGRAMS=check_libpurple
 
 check_libpurple_SOURCES=\
--- a/libpurple/tests/test_util.c	Thu Nov 22 07:44:59 2007 +0000
+++ b/libpurple/tests/test_util.c	Fri Nov 23 11:54:29 2007 +0000
@@ -76,7 +76,7 @@
 
 START_TEST(test_util_str_to_time)
 {
-	fail_unless(377185800 == purple_str_to_time("19811214T12:50:00", TRUE, NULL, NULL, NULL));
+	fail_unless(377182200 == purple_str_to_time("19811214T12:50:00", TRUE, NULL, NULL, NULL));
 	fail_unless(1175919261 == purple_str_to_time("20070407T04:14:21", TRUE, NULL, NULL, NULL));
 }
 END_TEST
--- a/libpurple/util.c	Thu Nov 22 07:44:59 2007 +0000
+++ b/libpurple/util.c	Fri Nov 23 11:54:29 2007 +0000
@@ -753,13 +753,13 @@
                  struct tm *tm, long *tz_off, const char **rest)
 {
 	time_t retval = 0;
-	struct tm *t;
+	static struct tm t;
 	const char *c = timestamp;
 	int year = 0;
 	long tzoff = PURPLE_NO_TZ_OFF;
 
 	time(&retval);
-	t = localtime(&retval);
+	localtime_r(&retval, &t);
 
 	/* 4 digit year */
 	if (sscanf(c, "%04d", &year) && year > 1900)
@@ -767,11 +767,11 @@
 		c += 4;
 		if (*c == '-')
 			c++;
-		t->tm_year = year - 1900;
+		t.tm_year = year - 1900;
 	}
 
 	/* 2 digit month */
-	if (!sscanf(c, "%02d", &t->tm_mon))
+	if (!sscanf(c, "%02d", &t.tm_mon))
 	{
 		if (rest != NULL && *c != '\0')
 			*rest = c;
@@ -780,10 +780,10 @@
 	c += 2;
 	if (*c == '-' || *c == '/')
 		c++;
-	t->tm_mon -= 1;
+	t.tm_mon -= 1;
 
 	/* 2 digit day */
-	if (!sscanf(c, "%02d", &t->tm_mday))
+	if (!sscanf(c, "%02d", &t.tm_mday))
 	{
 		if (rest != NULL && *c != '\0')
 			*rest = c;
@@ -794,13 +794,13 @@
 	{
 		c++;
 
-		if (!sscanf(c, "%04d", &t->tm_year))
+		if (!sscanf(c, "%04d", &t.tm_year))
 		{
 			if (rest != NULL && *c != '\0')
 				*rest = c;
 			return 0;
 		}
-		t->tm_year -= 1900;
+		t.tm_year -= 1900;
 	}
 	else if (*c == 'T' || *c == '.')
 	{
@@ -808,17 +808,20 @@
 		/* we have more than a date, keep going */
 
 		/* 2 digit hour */
-		if ((sscanf(c, "%02d:%02d:%02d", &t->tm_hour, &t->tm_min, &t->tm_sec) == 3 && (c = c + 8)) ||
-		    (sscanf(c, "%02d%02d%02d", &t->tm_hour, &t->tm_min, &t->tm_sec) == 3 && (c = c + 6)))
+		if ((sscanf(c, "%02d:%02d:%02d", &t.tm_hour, &t.tm_min, &t.tm_sec) == 3 && (c = c + 8)) ||
+		    (sscanf(c, "%02d%02d%02d", &t.tm_hour, &t.tm_min, &t.tm_sec) == 3 && (c = c + 6)))
 		{
 			gboolean offset_positive = FALSE;
 			int tzhrs;
 			int tzmins;
 
-			t->tm_isdst = -1;
-
-			if (*c == '.' && *(c+1) >= '0' && *(c+1) <= '9') /* dealing with precision we don't care about */
-				c += 4;
+			t.tm_isdst = -1;
+
+			if (*c == '.') {
+				do {
+					c++;
+				} while (*c >= '0' && *c <= '9'); /* dealing with precision we don't care about */
+			}
 			if (*c == '+')
 				offset_positive = TRUE;
 			if (((*c == '+' || *c == '-') && (c = c + 1)) &&
@@ -830,11 +833,23 @@
 					tzoff *= -1;
 				/* We don't want the C library doing DST calculations
 				 * if we know the UTC offset already. */
-				t->tm_isdst = 0;
+				t.tm_isdst = 0;
 			}
 			else if (utc)
 			{
-				t->tm_isdst = -1;
+				static struct tm tmptm;
+				time_t tmp;
+				tmp = mktime(&t);
+				/* we care about whether it *was* dst, and the offset, here on this
+				 * date, not whether we are currently observing dst locally *now*.
+				 * This isn't perfect, because we would need to know in advance the
+				 * offset we are trying to work out in advance to be sure this
+				 * works for times around dst transitions but it'll have to do. */
+				localtime_r(&tmp, &tmptm);
+				t.tm_isdst = tmptm.tm_isdst;
+#ifdef HAVE_TM_GMTOFF
+				t.tm_gmtoff = tmptm.tm_gmtoff;
+#endif
 			}
 
 			if (rest != NULL && *c != '\0')
@@ -863,7 +878,7 @@
 					tzoff += sys_tzoff;
 #else
 #ifdef HAVE_TM_GMTOFF
-				tzoff += t->tm_gmtoff;
+				tzoff += t.tm_gmtoff;
 #else
 #	ifdef HAVE_TIMEZONE
 				tzset();    /* making sure */
@@ -882,12 +897,12 @@
 
 	if (tm != NULL)
 	{
-		*tm = *t;
+		memcpy(tm, &t, sizeof(struct tm));
 		tm->tm_isdst = -1;
 		mktime(tm);
 	}
 
-	retval = mktime(t);
+	retval = mktime(&t);
 	if (tzoff != PURPLE_NO_TZ_OFF)
 		retval += tzoff;
 
--- a/pidgin/gtkblist.c	Thu Nov 22 07:44:59 2007 +0000
+++ b/pidgin/gtkblist.c	Fri Nov 23 11:54:29 2007 +0000
@@ -4441,8 +4441,12 @@
                              PurpleAccount *account)
 {
 	GList *l = NULL;
-	GList *children = gtk_container_get_children(container);
+	GList *children = NULL;
 	GtkWidget *ret = NULL;
+	/* XXX: Workaround for the currently incomplete implementation of PidginScrollBook */
+	if (PIDGIN_IS_SCROLL_BOOK(container))
+		container = GTK_CONTAINER(PIDGIN_SCROLL_BOOK(container)->notebook);
+	children = gtk_container_get_children(container);
 	l = g_list_find_custom(children, account, (GCompareFunc) find_account_widget);
 	if (l)
 		ret = GTK_WIDGET(l->data);
@@ -4456,7 +4460,6 @@
 {
 	GtkWidget *widget = find_child_widget_by_account(container, account);
 	if(widget) {
-		gtk_container_remove(container, widget);
 		gtk_widget_destroy(widget);
 	}
 }
@@ -4620,7 +4623,7 @@
 
 	if(priv->signed_on_elsewhere)
 		return;
-	
+
 	mini_dialog = priv->signed_on_elsewhere =
 		pidgin_mini_dialog_new(NULL, NULL, PIDGIN_STOCK_DISCONNECT);
 
@@ -4649,6 +4652,10 @@
 		return;
 
 	accounts = pidgin_mini_dialog_get_num_children(mini_dialog);
+	if (accounts == 0) {
+		gtk_widget_destroy(GTK_WIDGET(mini_dialog));
+		return;
+	}
 
 	title = g_strdup_printf(
 		ngettext("%d account was disabled because you signed on from another location.",
--- a/po/de.po	Thu Nov 22 07:44:59 2007 +0000
+++ b/po/de.po	Fri Nov 23 11:54:29 2007 +0000
@@ -11,7 +11,7 @@
 msgstr ""
 "Project-Id-Version: de\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2007-11-17 16:16+0100\n"
+"POT-Creation-Date: 2007-11-22 21:19+0100\n"
 "PO-Revision-Date: 2007-11-17 16:14+0100\n"
 "Last-Translator: Bjoern Voigt <bjoern@cs.tu-berlin.de>\n"
 "Language-Team: Deutsch <de@li.org>\n"
@@ -4301,6 +4301,9 @@
 msgid "Connect server"
 msgstr "Verbindungsserver"
 
+msgid "File transfer proxies"
+msgstr "Proxys für Dateiübertragungen"
+
 #, c-format
 msgid "%s has left the conversation."
 msgstr "%s hat das Gespräch verlassen."