# HG changeset patch # User Richard Laager # Date 1227739448 0 # Node ID 93cb9f54df452934f934578c86ce647b1e6bc4d2 # Parent f3b62076fa3235763d42097022e5a8de5791e224 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. diff -r f3b62076fa32 -r 93cb9f54df45 .mtn-ignore --- a/.mtn-ignore Wed Nov 26 22:18:16 2008 +0000 +++ b/.mtn-ignore Wed Nov 26 22:44:08 2008 +0000 @@ -37,41 +37,6 @@ 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 diff -r f3b62076fa32 -r 93cb9f54df45 pidgin/gtkblist.c --- a/pidgin/gtkblist.c Wed Nov 26 22:18:16 2008 +0000 +++ b/pidgin/gtkblist.c Wed Nov 26 22:44:08 2008 +0000 @@ -3519,7 +3519,8 @@ /* 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,6 +3615,24 @@ 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 @@ 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 @@ 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,12 +3715,13 @@ if (!(name && *name)) return NULL; - } - - filename = g_strdup_printf("%s.png", name); - - path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emblems", "16", filename, NULL); - g_free(filename); + + 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); + } /* _pidgin_blist_get_cached_emblem() assumes ownership of path */ return _pidgin_blist_get_cached_emblem(path); @@ -7699,23 +7723,16 @@ /* 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)); diff -r f3b62076fa32 -r 93cb9f54df45 pidgin/gtkrequest.c --- a/pidgin/gtkrequest.c Wed Nov 26 22:18:16 2008 +0000 +++ b/pidgin/gtkrequest.c Wed Nov 26 22:44:08 2008 +0000 @@ -1050,15 +1050,10 @@ 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), diff -r f3b62076fa32 -r 93cb9f54df45 pidgin/pixmaps/Makefile.am --- a/pidgin/pixmaps/Makefile.am Wed Nov 26 22:18:16 2008 +0000 +++ b/pidgin/pixmaps/Makefile.am Wed Nov 26 22:44:08 2008 +0000 @@ -97,8 +97,6 @@ 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/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,27 +117,13 @@ 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 \ @@ -270,6 +203,7 @@ 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 = \ diff -r f3b62076fa32 -r 93cb9f54df45 pidgin/pixmaps/emblems/16/bathing.png Binary file pidgin/pixmaps/emblems/16/bathing.png has changed diff -r f3b62076fa32 -r 93cb9f54df45 pidgin/pixmaps/emblems/16/cinema.png Binary file pidgin/pixmaps/emblems/16/cinema.png has changed diff -r f3b62076fa32 -r 93cb9f54df45 pidgin/pixmaps/emblems/16/internet.png Binary file pidgin/pixmaps/emblems/16/internet.png has changed diff -r f3b62076fa32 -r 93cb9f54df45 pidgin/pixmaps/emblems/16/music.png Binary file pidgin/pixmaps/emblems/16/music.png has changed diff -r f3b62076fa32 -r 93cb9f54df45 pidgin/pixmaps/emblems/16/restroom.png Binary file pidgin/pixmaps/emblems/16/restroom.png has changed diff -r f3b62076fa32 -r 93cb9f54df45 pidgin/pixmaps/emblems/16/scalable/mobile.svg --- a/pidgin/pixmaps/emblems/16/scalable/mobile.svg Wed Nov 26 22:18:16 2008 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,264 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r f3b62076fa32 -r 93cb9f54df45 pidgin/pixmaps/emblems/16/scalable/music.svg --- a/pidgin/pixmaps/emblems/16/scalable/music.svg Wed Nov 26 22:18:16 2008 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,189 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - diff -r f3b62076fa32 -r 93cb9f54df45 pidgin/pixmaps/emblems/16/shopping.png Binary file pidgin/pixmaps/emblems/16/shopping.png has changed diff -r f3b62076fa32 -r 93cb9f54df45 pidgin/pixmaps/emblems/16/studying.png Binary file pidgin/pixmaps/emblems/16/studying.png has changed diff -r f3b62076fa32 -r 93cb9f54df45 pidgin/pixmaps/emblems/16/suit.png Binary file pidgin/pixmaps/emblems/16/suit.png has changed diff -r f3b62076fa32 -r 93cb9f54df45 pidgin/pixmaps/emblems/16/surfing.png Binary file pidgin/pixmaps/emblems/16/surfing.png has changed diff -r f3b62076fa32 -r 93cb9f54df45 pidgin/pixmaps/emblems/16/typing.png Binary file pidgin/pixmaps/emblems/16/typing.png has changed diff -r f3b62076fa32 -r 93cb9f54df45 pidgin/pixmaps/emblems/16/working.png Binary file pidgin/pixmaps/emblems/16/working.png has changed diff -r f3b62076fa32 -r 93cb9f54df45 pidgin/pixmaps/emblems/16/writing.png Binary file pidgin/pixmaps/emblems/16/writing.png has changed diff -r f3b62076fa32 -r 93cb9f54df45 pidgin/pixmaps/emotes/small/16/Makefile.am --- a/pidgin/pixmaps/emotes/small/16/Makefile.am Wed Nov 26 22:18:16 2008 +0000 +++ b/pidgin/pixmaps/emotes/small/16/Makefile.am Wed Nov 26 22:44:08 2008 +0000 @@ -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 @@ if INSTALL_PIXMAPS pidginsmileypixdir = $(datadir)/pixmaps/pidgin/emotes/small pidginsmileypix_DATA = \ + $(MOODS) \ $(SMILEYS) \ theme @@ -58,4 +75,4 @@ $< > $@ endif -EXTRA_DIST = $(SMILEYS) $(pidginsmileypix_in_files) theme +EXTRA_DIST = $(MOODS) $(SMILEYS) $(pidginsmileypix_in_files) theme diff -r f3b62076fa32 -r 93cb9f54df45 pidgin/pixmaps/emotes/small/16/bathing.png Binary file pidgin/pixmaps/emotes/small/16/bathing.png has changed diff -r f3b62076fa32 -r 93cb9f54df45 pidgin/pixmaps/emotes/small/16/cinema.png Binary file pidgin/pixmaps/emotes/small/16/cinema.png has changed diff -r f3b62076fa32 -r 93cb9f54df45 pidgin/pixmaps/emotes/small/16/internet.png Binary file pidgin/pixmaps/emotes/small/16/internet.png has changed diff -r f3b62076fa32 -r 93cb9f54df45 pidgin/pixmaps/emotes/small/16/music.png Binary file pidgin/pixmaps/emotes/small/16/music.png has changed diff -r f3b62076fa32 -r 93cb9f54df45 pidgin/pixmaps/emotes/small/16/restroom.png Binary file pidgin/pixmaps/emotes/small/16/restroom.png has changed diff -r f3b62076fa32 -r 93cb9f54df45 pidgin/pixmaps/emotes/small/16/scalable/mobile.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pidgin/pixmaps/emotes/small/16/scalable/mobile.svg Wed Nov 26 22:44:08 2008 +0000 @@ -0,0 +1,264 @@ + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r f3b62076fa32 -r 93cb9f54df45 pidgin/pixmaps/emotes/small/16/scalable/music.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pidgin/pixmaps/emotes/small/16/scalable/music.svg Wed Nov 26 22:44:08 2008 +0000 @@ -0,0 +1,189 @@ + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff -r f3b62076fa32 -r 93cb9f54df45 pidgin/pixmaps/emotes/small/16/shopping.png Binary file pidgin/pixmaps/emotes/small/16/shopping.png has changed diff -r f3b62076fa32 -r 93cb9f54df45 pidgin/pixmaps/emotes/small/16/studying.png Binary file pidgin/pixmaps/emotes/small/16/studying.png has changed diff -r f3b62076fa32 -r 93cb9f54df45 pidgin/pixmaps/emotes/small/16/suit.png Binary file pidgin/pixmaps/emotes/small/16/suit.png has changed diff -r f3b62076fa32 -r 93cb9f54df45 pidgin/pixmaps/emotes/small/16/surfing.png Binary file pidgin/pixmaps/emotes/small/16/surfing.png has changed diff -r f3b62076fa32 -r 93cb9f54df45 pidgin/pixmaps/emotes/small/16/typing.png Binary file pidgin/pixmaps/emotes/small/16/typing.png has changed diff -r f3b62076fa32 -r 93cb9f54df45 pidgin/pixmaps/emotes/small/16/working.png Binary file pidgin/pixmaps/emotes/small/16/working.png has changed diff -r f3b62076fa32 -r 93cb9f54df45 pidgin/pixmaps/emotes/small/16/writing.png Binary file pidgin/pixmaps/emotes/small/16/writing.png has changed