changeset 29310:45fce067c690

merge of 'dc8e146830c1b3fa49695fd76eba4bc811e7ec53' and 'e25f1563b3f1c8aebda882c2a86d2e32bac91732'
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Fri, 29 Jan 2010 01:41:16 +0000
parents 5ffedd1578f0 (current diff) 2930170ca3c0 (diff)
children 06740353bfc7 fff8cf8459c4
files
diffstat 3 files changed, 32 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkblist.c	Fri Jan 29 01:30:38 2010 +0000
+++ b/pidgin/gtkblist.c	Fri Jan 29 01:41:16 2010 +0000
@@ -470,6 +470,9 @@
 	case PURPLE_BLIST_GROUP_NODE:
 		text = purple_group_get_name(PURPLE_GROUP(node));
 		break;
+	case PURPLE_BLIST_CHAT_NODE:
+		text = purple_chat_get_name(PURPLE_CHAT(node));
+		break;
 	default:
 		g_return_if_reached();
 	}
--- a/pidgin/gtkconv.c	Fri Jan 29 01:30:38 2010 +0000
+++ b/pidgin/gtkconv.c	Fri Jan 29 01:41:16 2010 +0000
@@ -9508,6 +9508,24 @@
 	return FALSE;
 }
 
+static gboolean
+gtkconv_tab_set_tip(GtkWidget *widget, GdkEventCrossing *event, PidginConversation *gtkconv)
+{
+#if GTK_CHECK_VERSION(2, 12, 0)
+#define gtk_tooltips_set_tip(tips, w, l, p)  gtk_widget_set_tooltip_text(w, l)
+#endif
+	PangoLayout *layout;
+
+	layout = gtk_label_get_layout(GTK_LABEL(gtkconv->tab_label));
+	gtk_tooltips_set_tip(gtkconv->tooltips, widget,
+			pango_layout_is_ellipsized(layout) ? gtk_label_get_text(GTK_LABEL(gtkconv->tab_label)) : NULL,
+			NULL);
+	return FALSE;
+#if GTK_CHECK_VERSION(2, 12, 0)
+#undef gtk_tooltips_set_tip
+#endif
+}
+
 void
 pidgin_conv_window_add_gtkconv(PidginWindow *win, PidginConversation *gtkconv)
 {
@@ -9666,6 +9684,8 @@
 	gtk_event_box_set_visible_window(GTK_EVENT_BOX(ebox), FALSE);
 #endif
 	gtk_container_add(GTK_CONTAINER(ebox), gtkconv->tabby);
+	g_signal_connect(G_OBJECT(ebox), "enter-notify-event",
+			G_CALLBACK(gtkconv_tab_set_tip), gtkconv);
 
 	if (gtkconv->tab_label->parent == NULL) {
 		/* Pack if it's a new widget */
--- a/pidgin/gtkthemes.c	Fri Jan 29 01:30:38 2010 +0000
+++ b/pidgin/gtkthemes.c	Fri Jan 29 01:41:16 2010 +0000
@@ -263,7 +263,14 @@
 
 		if (buf[0] == '#' || buf[0] == '\0')
 			continue;
-
+		else {
+			int len = strlen(buf);
+			while (len && (buf[len - 1] == '\r' || buf[len - 1] == '\n'))
+				buf[--len] = '\0';
+			if (len == 0)
+				continue;
+		}
+		
 		i = buf;
 		while (isspace(*i))
 			i++;
@@ -280,25 +287,17 @@
 				list->smileys = g_slist_reverse(list->smileys);
 			list = child;
 		} else if (!g_ascii_strncasecmp(i, "Name=", strlen("Name="))) {
-			int len;
 			g_free(theme->name);
 			theme->name = g_strdup(i + strlen("Name="));
-			len = strlen(theme->name);
-			theme->name[len-1] = 0;
-			if(len > 2 && theme->name[len-2] == '\r')
-				theme->name[len-2] = 0;
 		} else if (!g_ascii_strncasecmp(i, "Description=", strlen("Description="))) {
 			g_free(theme->desc);
 			theme->desc = g_strdup(i + strlen("Description="));
-			theme->desc[strlen(theme->desc)-1] = 0;
 		} else if (!g_ascii_strncasecmp(i, "Icon=", strlen("Icon="))) {
 			g_free(theme->icon);
 			theme->icon = g_build_filename(dirname, i + strlen("Icon="), NULL);
-			theme->icon[strlen(theme->icon)-1] = 0;
 		} else if (!g_ascii_strncasecmp(i, "Author=", strlen("Author="))) {
 			g_free(theme->author);
 			theme->author = g_strdup(i + strlen("Author="));
-			theme->author[strlen(theme->author)-1] = 0;
 		} else if (load && list) {
 			gboolean hidden = FALSE;
 			char *sfile = NULL;
@@ -311,7 +310,7 @@
 				char l[64];
 				int li = 0;
 				while (!isspace(*i) && li < sizeof(l) - 1) {
-					if (*i == '\\' && *(i+1) != '\0' && *(i+1) != '\n' && *(i+1) != '\r')
+					if (*i == '\\' && *(i+1) != '\0')
 						i++;
 					l[li++] = *(i++);
 				}