diff options
author | Richard Laager <rlaager@pidgin.im> | 2008-11-26 22:44:08 +0000 |
---|---|---|
committer | Richard Laager <rlaager@pidgin.im> | 2008-11-26 22:44:08 +0000 |
commit | 035d456ae31c5d38258e1d125fd86d452dfe6273 (patch) | |
tree | 1634d6c27c6d8930ffda3bc84218328d53e7a990 | |
parent | e5f6b500c21486a25bf9f3ea6db03d784eec64a6 (diff) | |
download | pidgin-035d456ae31c5d38258e1d125fd86d452dfe6273.tar.gz |
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.
-rw-r--r-- | .mtn-ignore | 35 | ||||
-rw-r--r-- | pidgin/gtkblist.c | 61 | ||||
-rw-r--r-- | pidgin/gtkrequest.c | 7 | ||||
-rw-r--r-- | pidgin/pixmaps/Makefile.am | 70 | ||||
-rw-r--r-- | pidgin/pixmaps/emotes/small/16/Makefile.am | 19 | ||||
-rw-r--r-- | pidgin/pixmaps/emotes/small/16/bathing.png (renamed from pidgin/pixmaps/emblems/16/bathing.png) | bin | 816 -> 816 bytes | |||
-rw-r--r-- | pidgin/pixmaps/emotes/small/16/cinema.png (renamed from pidgin/pixmaps/emblems/16/cinema.png) | bin | 659 -> 659 bytes | |||
-rw-r--r-- | pidgin/pixmaps/emotes/small/16/internet.png (renamed from pidgin/pixmaps/emblems/16/internet.png) | bin | 999 -> 999 bytes | |||
-rw-r--r-- | pidgin/pixmaps/emotes/small/16/music.png (renamed from pidgin/pixmaps/emblems/16/music.png) | bin | 571 -> 571 bytes | |||
-rw-r--r-- | pidgin/pixmaps/emotes/small/16/restroom.png (renamed from pidgin/pixmaps/emblems/16/restroom.png) | bin | 716 -> 716 bytes | |||
-rw-r--r-- | pidgin/pixmaps/emotes/small/16/scalable/mobile.svg (renamed from pidgin/pixmaps/emblems/16/scalable/mobile.svg) | 0 | ||||
-rw-r--r-- | pidgin/pixmaps/emotes/small/16/scalable/music.svg (renamed from pidgin/pixmaps/emblems/16/scalable/music.svg) | 0 | ||||
-rw-r--r-- | pidgin/pixmaps/emotes/small/16/shopping.png (renamed from pidgin/pixmaps/emblems/16/shopping.png) | bin | 645 -> 645 bytes | |||
-rw-r--r-- | pidgin/pixmaps/emotes/small/16/studying.png (renamed from pidgin/pixmaps/emblems/16/studying.png) | bin | 718 -> 718 bytes | |||
-rw-r--r-- | pidgin/pixmaps/emotes/small/16/suit.png (renamed from pidgin/pixmaps/emblems/16/suit.png) | bin | 804 -> 804 bytes | |||
-rw-r--r-- | pidgin/pixmaps/emotes/small/16/surfing.png (renamed from pidgin/pixmaps/emblems/16/surfing.png) | bin | 919 -> 919 bytes | |||
-rw-r--r-- | pidgin/pixmaps/emotes/small/16/typing.png (renamed from pidgin/pixmaps/emblems/16/typing.png) | bin | 725 -> 725 bytes | |||
-rw-r--r-- | pidgin/pixmaps/emotes/small/16/working.png (renamed from pidgin/pixmaps/emblems/16/working.png) | bin | 924 -> 924 bytes | |||
-rw-r--r-- | pidgin/pixmaps/emotes/small/16/writing.png (renamed from pidgin/pixmaps/emblems/16/writing.png) | bin | 714 -> 714 bytes |
19 files changed, 60 insertions, 132 deletions
diff --git a/.mtn-ignore b/.mtn-ignore index 710c1aa27e..3f6c88ab7b 100644 --- a/.mtn-ignore +++ b/.mtn-ignore @@ -37,41 +37,6 @@ pidgin-.*.tar.gz 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 --git a/pidgin/gtkblist.c b/pidgin/gtkblist.c index 3818249fef..8408d04e23 100644 --- a/pidgin/gtkblist.c +++ b/pidgin/gtkblist.c @@ -3519,7 +3519,8 @@ static char *pidgin_get_tooltip_text(PurpleBlistNode *node, gboolean full) /* 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 @@ static GdkPixbuf * _pidgin_blist_get_cached_emblem(gchar *path) { 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 *node) 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 *node) 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 @@ pidgin_blist_get_emblem(PurpleBlistNode *node) 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 @@ set_mood_cb(GtkWidget *widget, PurpleAccount *account) /* 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 --git a/pidgin/gtkrequest.c b/pidgin/gtkrequest.c index 3e05eab739..8edaa00709 100644 --- a/pidgin/gtkrequest.c +++ b/pidgin/gtkrequest.c @@ -1050,15 +1050,10 @@ create_list_field(PurpleRequestField *field) 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 --git a/pidgin/pixmaps/Makefile.am b/pidgin/pixmaps/Makefile.am index 1a85c70cd4..3b3acde7bf 100644 --- a/pidgin/pixmaps/Makefile.am +++ b/pidgin/pixmaps/Makefile.am @@ -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,27 +117,13 @@ 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 \ @@ -270,6 +203,7 @@ EMOTES_DEFAULT_24_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 = \ diff --git a/pidgin/pixmaps/emotes/small/16/Makefile.am b/pidgin/pixmaps/emotes/small/16/Makefile.am index 713d6aad58..ef9d6254e9 100644 --- a/pidgin/pixmaps/emotes/small/16/Makefile.am +++ b/pidgin/pixmaps/emotes/small/16/Makefile.am @@ -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_in_files = small.theme.in if INSTALL_PIXMAPS pidginsmileypixdir = $(datadir)/pixmaps/pidgin/emotes/small pidginsmileypix_DATA = \ + $(MOODS) \ $(SMILEYS) \ theme @@ -58,4 +75,4 @@ theme: small.theme.in $< > $@ endif -EXTRA_DIST = $(SMILEYS) $(pidginsmileypix_in_files) theme +EXTRA_DIST = $(MOODS) $(SMILEYS) $(pidginsmileypix_in_files) theme diff --git a/pidgin/pixmaps/emblems/16/bathing.png b/pidgin/pixmaps/emotes/small/16/bathing.png Binary files differindex 662eb2ac97..662eb2ac97 100644 --- a/pidgin/pixmaps/emblems/16/bathing.png +++ b/pidgin/pixmaps/emotes/small/16/bathing.png diff --git a/pidgin/pixmaps/emblems/16/cinema.png b/pidgin/pixmaps/emotes/small/16/cinema.png Binary files differindex e561cb0791..e561cb0791 100644 --- a/pidgin/pixmaps/emblems/16/cinema.png +++ b/pidgin/pixmaps/emotes/small/16/cinema.png diff --git a/pidgin/pixmaps/emblems/16/internet.png b/pidgin/pixmaps/emotes/small/16/internet.png Binary files differindex 9281221f98..9281221f98 100644 --- a/pidgin/pixmaps/emblems/16/internet.png +++ b/pidgin/pixmaps/emotes/small/16/internet.png diff --git a/pidgin/pixmaps/emblems/16/music.png b/pidgin/pixmaps/emotes/small/16/music.png Binary files differindex 4b40b6eedf..4b40b6eedf 100644 --- a/pidgin/pixmaps/emblems/16/music.png +++ b/pidgin/pixmaps/emotes/small/16/music.png diff --git a/pidgin/pixmaps/emblems/16/restroom.png b/pidgin/pixmaps/emotes/small/16/restroom.png Binary files differindex a642e7d53c..a642e7d53c 100644 --- a/pidgin/pixmaps/emblems/16/restroom.png +++ b/pidgin/pixmaps/emotes/small/16/restroom.png diff --git a/pidgin/pixmaps/emblems/16/scalable/mobile.svg b/pidgin/pixmaps/emotes/small/16/scalable/mobile.svg index 239d2c38f5..239d2c38f5 100644 --- a/pidgin/pixmaps/emblems/16/scalable/mobile.svg +++ b/pidgin/pixmaps/emotes/small/16/scalable/mobile.svg diff --git a/pidgin/pixmaps/emblems/16/scalable/music.svg b/pidgin/pixmaps/emotes/small/16/scalable/music.svg index 29f0acfda6..29f0acfda6 100644 --- a/pidgin/pixmaps/emblems/16/scalable/music.svg +++ b/pidgin/pixmaps/emotes/small/16/scalable/music.svg diff --git a/pidgin/pixmaps/emblems/16/shopping.png b/pidgin/pixmaps/emotes/small/16/shopping.png Binary files differindex 291107ae64..291107ae64 100644 --- a/pidgin/pixmaps/emblems/16/shopping.png +++ b/pidgin/pixmaps/emotes/small/16/shopping.png diff --git a/pidgin/pixmaps/emblems/16/studying.png b/pidgin/pixmaps/emotes/small/16/studying.png Binary files differindex 0a6053f86c..0a6053f86c 100644 --- a/pidgin/pixmaps/emblems/16/studying.png +++ b/pidgin/pixmaps/emotes/small/16/studying.png diff --git a/pidgin/pixmaps/emblems/16/suit.png b/pidgin/pixmaps/emotes/small/16/suit.png Binary files differindex 3c0080f0dd..3c0080f0dd 100644 --- a/pidgin/pixmaps/emblems/16/suit.png +++ b/pidgin/pixmaps/emotes/small/16/suit.png diff --git a/pidgin/pixmaps/emblems/16/surfing.png b/pidgin/pixmaps/emotes/small/16/surfing.png Binary files differindex 727b352f72..727b352f72 100644 --- a/pidgin/pixmaps/emblems/16/surfing.png +++ b/pidgin/pixmaps/emotes/small/16/surfing.png diff --git a/pidgin/pixmaps/emblems/16/typing.png b/pidgin/pixmaps/emotes/small/16/typing.png Binary files differindex 7f60b0a25e..7f60b0a25e 100644 --- a/pidgin/pixmaps/emblems/16/typing.png +++ b/pidgin/pixmaps/emotes/small/16/typing.png diff --git a/pidgin/pixmaps/emblems/16/working.png b/pidgin/pixmaps/emotes/small/16/working.png Binary files differindex cc90d637df..cc90d637df 100644 --- a/pidgin/pixmaps/emblems/16/working.png +++ b/pidgin/pixmaps/emotes/small/16/working.png diff --git a/pidgin/pixmaps/emblems/16/writing.png b/pidgin/pixmaps/emotes/small/16/writing.png Binary files differindex e8b5d0d53e..e8b5d0d53e 100644 --- a/pidgin/pixmaps/emblems/16/writing.png +++ b/pidgin/pixmaps/emotes/small/16/writing.png |