cpw.rekkanoryo.icqxstatus: 36c3c944: Now that the "Set Mood" UI is in Pidgin, ...

rlaager at pidgin.im rlaager at pidgin.im
Wed Nov 26 17:50:36 EST 2008


-----------------------------------------------------------------
Revision: 36c3c9445eb73f1ba7d29f170f464309d76818eb
Ancestor: fb407a4321a42676012ee8efe5c7bba6edd06760
Author: rlaager at pidgin.im
Date: 2008-11-26T22:44:08
Branch: im.pidgin.cpw.rekkanoryo.icqxstatus
URL: http://d.pidgin.im/viewmtn/revision/info/36c3c9445eb73f1ba7d29f170f464309d76818eb

Renamed entries:
        pidgin/pixmaps/emblems/16/bathing.png to pidgin/pixmaps/emotes/small/16/bathing.png
        pidgin/pixmaps/emblems/16/cinema.png to pidgin/pixmaps/emotes/small/16/cinema.png
        pidgin/pixmaps/emblems/16/internet.png to pidgin/pixmaps/emotes/small/16/internet.png
        pidgin/pixmaps/emblems/16/music.png to pidgin/pixmaps/emotes/small/16/music.png
        pidgin/pixmaps/emblems/16/restroom.png to pidgin/pixmaps/emotes/small/16/restroom.png
        pidgin/pixmaps/emblems/16/scalable/mobile.svg to pidgin/pixmaps/emotes/small/16/scalable/mobile.svg
        pidgin/pixmaps/emblems/16/scalable/music.svg to pidgin/pixmaps/emotes/small/16/scalable/music.svg
        pidgin/pixmaps/emblems/16/shopping.png to pidgin/pixmaps/emotes/small/16/shopping.png
        pidgin/pixmaps/emblems/16/studying.png to pidgin/pixmaps/emotes/small/16/studying.png
        pidgin/pixmaps/emblems/16/suit.png to pidgin/pixmaps/emotes/small/16/suit.png
        pidgin/pixmaps/emblems/16/surfing.png to pidgin/pixmaps/emotes/small/16/surfing.png
        pidgin/pixmaps/emblems/16/typing.png to pidgin/pixmaps/emotes/small/16/typing.png
        pidgin/pixmaps/emblems/16/working.png to pidgin/pixmaps/emotes/small/16/working.png
        pidgin/pixmaps/emblems/16/writing.png to pidgin/pixmaps/emotes/small/16/writing.png
Modified files:
        .mtn-ignore pidgin/gtkblist.c pidgin/gtkrequest.c
        pidgin/pixmaps/Makefile.am
        pidgin/pixmaps/emotes/small/16/Makefile.am

ChangeLog: 

Now that the "Set Mood" UI is in Pidgin, it can do whatever it likes to
find the right icons.  Thus, with a small function and a couple other
small changes, I can shuffle all the icons around to eliminate the magic
Makefile rules and all the duplicated icons at install-time.

-------------- next part --------------
============================================================
--- .mtn-ignore	ddb519533eb14bef18140faeec292d4edc949b9d
+++ .mtn-ignore	f437f06f6284b73badc7a2834bf180923f906c2d
@@ -37,41 +37,6 @@ pidgin/pidgin$
 pidgin-.*.tar.bz2
 pidgin-*.*.*-win32bin$
 pidgin/pidgin$
-pidgin/pixmaps/emblems/16/afraid.png
-pidgin/pixmaps/emblems/16/amorous.png
-pidgin/pixmaps/emblems/16/angry.png
-pidgin/pixmaps/emblems/16/beer.png
-pidgin/pixmaps/emblems/16/busy.png
-pidgin/pixmaps/emblems/16/cigarette.png
-pidgin/pixmaps/emblems/16/coffee.png
-pidgin/pixmaps/emblems/16/confused.png
-pidgin/pixmaps/emblems/16/console.png
-pidgin/pixmaps/emblems/16/disappointed.png
-pidgin/pixmaps/emblems/16/embarrassed.png
-pidgin/pixmaps/emblems/16/excited.png
-pidgin/pixmaps/emblems/16/happy.png
-pidgin/pixmaps/emblems/16/hot.png
-pidgin/pixmaps/emblems/16/hungry.png
-pidgin/pixmaps/emblems/16/in_love.png
-pidgin/pixmaps/emblems/16/mean.png
-pidgin/pixmaps/emblems/16/meeting.png
-pidgin/pixmaps/emblems/16/mobile.png
-pidgin/pixmaps/emblems/16/musical-note.png
-pidgin/pixmaps/emblems/16/nervous.png
-pidgin/pixmaps/emblems/16/neutral.png
-pidgin/pixmaps/emblems/16/party.png
-pidgin/pixmaps/emblems/16/phone.png
-pidgin/pixmaps/emblems/16/plate.png
-pidgin/pixmaps/emblems/16/question.png
-pidgin/pixmaps/emblems/16/sad.png
-pidgin/pixmaps/emblems/16/sarcastic.png
-pidgin/pixmaps/emblems/16/search.png
-pidgin/pixmaps/emblems/16/shocked.png
-pidgin/pixmaps/emblems/16/sick.png
-pidgin/pixmaps/emblems/16/sleeping.png
-pidgin/pixmaps/emblems/16/sleepy.png
-pidgin/pixmaps/emblems/16/thinking.png
-pidgin/pixmaps/emblems/16/tv.png
 pidgin/pixmaps/emotes/default/24/theme
 pidgin/pixmaps/emotes/none/theme
 pidgin/pixmaps/emotes/small/16/theme
============================================================
--- pidgin/gtkblist.c	e5874d0f77a6136dade28ed46edcd3f1f886ad6c
+++ pidgin/gtkblist.c	3b69905e8282fe1794da894ffba614ccc1601e6c
@@ -3519,7 +3519,8 @@ static char *pidgin_get_tooltip_text(Pur
 
 
 		/* Offline? */
-		/* FIXME: Why is this status special-cased by the core? -- rlaager */
+		/* FIXME: Why is this status special-cased by the core? --rlaager
+		 * FIXME: Alternatively, why not have the core do all of them? --rlaager */
 		if (!PURPLE_BUDDY_IS_ONLINE(b)) {
 			purple_notify_user_info_add_pair(user_info, _("Status"), _("Offline"));
 		}
@@ -3614,7 +3615,25 @@ static GdkPixbuf * _pidgin_blist_get_cac
 	return pb;
 }
 
+static char *get_mood_icon_path(const char *mood)
+{
+	char *path;
 
+	if (!strcmp(mood, "busy")) {
+		path = g_build_filename(DATADIR, "pixmaps", "pidgin",
+		                        "status", "16", "busy.png", NULL);
+	} else if (!strcmp(mood, "hiptop")) {
+		path = g_build_filename(DATADIR, "pixmaps", "pidgin",
+		                        "emblems", "16", "hiptop.png", NULL);
+	} else {
+		char *filename = g_strdup_printf("%s.png", mood);
+		path = g_build_filename(DATADIR, "pixmaps", "pidgin",
+		                        "emotes", "small", filename, NULL);
+		g_free(filename);
+	}
+	return path;
+}
+
 GdkPixbuf *
 pidgin_blist_get_emblem(PurpleBlistNode *node)
 {
@@ -3637,8 +3656,10 @@ pidgin_blist_get_emblem(PurpleBlistNode 
 		gtkbuddynode = node->ui_data;
 		presence = purple_buddy_get_presence(buddy);
 		if (purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_MOBILE)) {
-			path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emblems",
-						"16", "mobile.png", NULL);
+			/* This emblem comes from the small emoticon set now,
+			 * to reduce duplication. */
+			path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emotes",
+						"small", "mobile.png", NULL);
 			return _pidgin_blist_get_cached_emblem(path);
 		}
 
@@ -3664,12 +3685,14 @@ pidgin_blist_get_emblem(PurpleBlistNode 
 		presence = purple_buddy_get_presence(buddy);
 
 	if (purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_MOBILE)) {
-		path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emblems", "16", "mobile.png", NULL);
+		/* This emblem comes from the small emoticon set now, to reduce duplication. */
+		path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emotes", "small", "mobile.png", NULL);
 		return _pidgin_blist_get_cached_emblem(path);
 	}
 
 	if (purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_TUNE)) {
-		path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emblems", "16", "music.png", NULL);
+		/* This emblem comes from the small emoticon set now, to reduce duplication. */
+		path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emotes", "small", "music.png", NULL);
 		return _pidgin_blist_get_cached_emblem(path);
 	}
 
@@ -3692,13 +3715,14 @@ pidgin_blist_get_emblem(PurpleBlistNode 
 		
 		if (!(name && *name))
 			return NULL;
-	}
 
-	filename = g_strdup_printf("%s.png", name);
+		path = get_mood_icon_path(name);
+	} else {
+		filename = g_strdup_printf("%s.png", name);
+		path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emblems", "16", filename, NULL);
+		g_free(filename);
+	}
 
-	path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emblems", "16", filename, NULL);
-	g_free(filename);
-
 	/* _pidgin_blist_get_cached_emblem() assumes ownership of path */
 	return _pidgin_blist_get_cached_emblem(path);
 }
@@ -7699,23 +7723,16 @@ set_mood_cb(GtkWidget *widget, PurpleAcc
 
 	/* TODO: rlaager wants this sorted. */
 	for (mood = prpl_info->get_moods(account);
-	     mood->mood != NULL ; mood++)
-	{
-		char *icon_path;
-		char *filename;
+	     mood->mood != NULL ; mood++) {
+		char *path;
 
 		if (mood->mood == NULL || mood->description == NULL)
 			continue;
 
-		icon_path = g_strdup_printf("%s.png", mood->mood);
-		filename = g_build_filename("pixmaps", "pidgin",
-		                            "emblems", "16",
-		                             icon_path, NULL);
-		g_free(icon_path);
-
+		path = get_mood_icon_path(mood->mood);
 		purple_request_field_list_add_icon(f, _(mood->description),
-				filename, mood->mood);
-		g_free(filename);
+				path, (gpointer)mood->mood);
+		g_free(path);
 
 		if (current_mood && !strcmp(current_mood, mood->mood))
 			purple_request_field_list_add_selected(f, _(mood->description));
============================================================
--- pidgin/gtkrequest.c	1827df3b5af7e2b6ccddd9b4f039a081c4fbfcbf
+++ pidgin/gtkrequest.c	f00ee50621683c7b4155faecfe7d3d726ea2e798
@@ -1050,15 +1050,10 @@ create_list_field(PurpleRequestField *fi
 		if (icons)
 		{
 			const char *icon_path = (const char *)icons->data;
-			char* filename;
 			GdkPixbuf* pixbuf = NULL;
 
 			if (icon_path)
-			{
-				filename = g_build_filename(DATADIR, icon_path, NULL);
-				pixbuf = gdk_pixbuf_new_from_file(filename, NULL);
-				g_free(filename);
-			}
+				pixbuf = gdk_pixbuf_new_from_file(icon_path, NULL);
 
 			gtk_list_store_set(store, &iter,
 						   0, purple_request_field_list_get_data(field, text),
============================================================
--- pidgin/pixmaps/Makefile.am	ed2e3a3da77204bbbfbde8b67c5e1b6c62b4e855
+++ pidgin/pixmaps/Makefile.am	cde0161e840cf9e84a2e75ace6d1899ad18c80c5
@@ -97,8 +97,6 @@ EMBLEMS_16_SCALABLE = \
 		emblems/16/scalable/free-for-chat.svg \
 		emblems/16/scalable/game.svg \
 		emblems/16/scalable/male.svg \
-		emblems/16/scalable/mobile.svg \
-		emblems/16/scalable/music.svg \
 		emblems/16/scalable/not-authorized.svg \
 		emblems/16/scalable/qq-member.svg \
 		emblems/16/scalable/secure.svg \
@@ -106,58 +104,7 @@ EMBLEMS_16_SCALABLE = \
 		emblems/16/scalable/video.svg \
 		emblems/16/scalable/voice.svg
 
-
-# Magic to copy files from emotes/small/16 to emblems/16.
-# This is necessary because UIs expect emblems in one place and
-# smiley themes in another, but we don't want to duplicate these
-# images in the source.
-emblems/16/%.png: emotes/small/16/%.png
-	rm -f $@
-	cp -f $< $@
-
-emblems/16/busy.png: status/16/busy.png
-	rm -f $@
-	cp -f $< $@
-
-# The copied emblems.
-# Ensure these are in .mtn-ignore.
-EMBLEMS_16_COPIED = \
-		emblems/16/amorous.png \
-		emblems/16/angry.png \
-		emblems/16/busy.png \
-		emblems/16/beer.png \
-		emblems/16/cigarette.png \
-		emblems/16/coffee.png \
-		emblems/16/confused.png \
-		emblems/16/console.png \
-		emblems/16/disappointed.png \
-		emblems/16/embarrassed.png \
-		emblems/16/excited.png \
-		emblems/16/in_love.png \
-		emblems/16/mean.png \
-		emblems/16/meeting.png \
-		emblems/16/mobile.png \
-		emblems/16/musical-note.png \
-		emblems/16/neutral.png \
-		emblems/16/party.png \
-		emblems/16/phone.png \
-		emblems/16/plate.png \
-		emblems/16/question.png \
-		emblems/16/sad.png \
-		emblems/16/sarcastic.png \
-		emblems/16/search.png \
-		emblems/16/sick.png \
-		emblems/16/sleeping.png \
-		emblems/16/sleepy.png \
-		emblems/16/thinking.png \
-		emblems/16/tv.png
-
-
-# Non-copied emblems.
-# Ensure these filenames don't clash with files in emotes/small/16 or
-# bad things will happen!
 EMBLEMS_16 = \
-		$(EMBLEMS_16_COPIED) \
 		emblems/16/aol-client.png \
 		emblems/16/birthday.png \
 		emblems/16/blocked.png \
@@ -170,28 +117,14 @@ EMBLEMS_16 = \
 		emblems/16/half-operator.png \
 		emblems/16/hiptop.png \
 		emblems/16/male.png \
-		emblems/16/mobile.png \
-		emblems/16/music.png \
 		emblems/16/not-authorized.png \
 		emblems/16/operator.png \
 		emblems/16/qq-member.png \
 		emblems/16/secure.png \
 		emblems/16/unavailable.png \
 		emblems/16/video.png \
-		emblems/16/voice.png \
-		emblems/16/bathing.png \
-		emblems/16/cinema.png \
-		emblems/16/internet.png \
-		emblems/16/restroom.png \
-		emblems/16/shopping.png \
-		emblems/16/studying.png \
-		emblems/16/suit.png \
-		emblems/16/surfing.png \
-		emblems/16/typing.png \
-		emblems/16/working.png \
-		emblems/16/writing.png
+		emblems/16/voice.png
 
-
 EMOTES_DEFAULT_24_SCALABLE = \
 		emotes/default/24/scalable/airplane.svg \
 		emotes/default/24/scalable/bad.svg \
@@ -270,6 +203,7 @@ EMOTES_SMALL_16_SCALABLE = \
 		emotes/default/24/scalable/yin-yang.svg
 
 EMOTES_SMALL_16_SCALABLE = \
+		emotes/small/16/scalable/mobile.svg
 		emotes/small/16/scalable/pidgin-emotes.svg
 
 PROTOCOLS_16_SCALABLE = \
============================================================
--- pidgin/pixmaps/emotes/small/16/Makefile.am	36ac99bdcb325cfca18db46fac7d42e3a784e4e3
+++ pidgin/pixmaps/emotes/small/16/Makefile.am	131beb48450636d3565ef3929a511dc7bb18b022
@@ -1,3 +1,19 @@
+# These are mood images that are NOT also used in the smiley theme.
+MOODS = \
+    bathing.png \
+    cinema.png \
+    internet.png \
+    music.png \
+    restroom.png \
+    search.png \
+    shopping.png \
+    studying.png \
+    suit.png \
+    surfing.png \
+    typing.png \
+    working.png \
+    writing.png
+
 SMILEYS = \
     amorous.png \
     angel.png \
@@ -48,6 +64,7 @@ pidginsmileypix_DATA = \
 if INSTALL_PIXMAPS
 pidginsmileypixdir = $(datadir)/pixmaps/pidgin/emotes/small
 pidginsmileypix_DATA = \
+        $(MOODS) \
         $(SMILEYS) \
         theme
 
@@ -58,4 +75,4 @@ endif
 	$< > $@
 endif
 
-EXTRA_DIST = $(SMILEYS) $(pidginsmileypix_in_files) theme
+EXTRA_DIST = $(MOODS) $(SMILEYS) $(pidginsmileypix_in_files) theme


More information about the Commits mailing list