[rhythmbox] audioscrobbler: display user info area even without user info data response
- From: Jonathan Matthew <jmatthew src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rhythmbox] audioscrobbler: display user info area even without user info data response
- Date: Tue, 21 Sep 2010 10:54:43 +0000 (UTC)
commit 8db376c6652403128e57997b8267822b9a11249b
Author: Jamie Nicol <jamie thenicols net>
Date: Wed Aug 11 14:49:00 2010 +0100
audioscrobbler: display user info area even without user info data response
We can still display the username, and need to display UI such as the
logout button. When the response arrives later diplay extras such as
view profile link and image.
.../rb-audioscrobbler-profile-source.c | 23 ++++++++++++++-----
1 files changed, 17 insertions(+), 6 deletions(-)
---
diff --git a/plugins/audioscrobbler/rb-audioscrobbler-profile-source.c b/plugins/audioscrobbler/rb-audioscrobbler-profile-source.c
index d9900fb..31b3317 100644
--- a/plugins/audioscrobbler/rb-audioscrobbler-profile-source.c
+++ b/plugins/audioscrobbler/rb-audioscrobbler-profile-source.c
@@ -767,6 +767,9 @@ login_status_change_cb (RBAudioscrobblerAccount *account,
gtk_widget_hide_all (source->priv->login_bar);
}
if (show_profile == TRUE) {
+ gtk_label_set_label (GTK_LABEL (source->priv->username_label),
+ username);
+ gtk_widget_show (source->priv->username_label);
gtk_widget_show (source->priv->profile_window);
} else {
gtk_widget_hide (source->priv->profile_window);
@@ -1335,21 +1338,29 @@ user_info_updated_cb (RBAudioscrobblerUser *user,
gtk_label_set_label (GTK_LABEL (source->priv->username_label),
data->user_info.username);
+ gtk_widget_show (source->priv->username_label);
playcount_text = g_strdup_printf (_("%s plays"), data->user_info.playcount);
gtk_label_set_label (GTK_LABEL (source->priv->playcount_label),
playcount_text);
+ g_free (playcount_text);
+ gtk_widget_show (source->priv->playcount_label);
gtk_link_button_set_uri (GTK_LINK_BUTTON (source->priv->view_profile_link),
data->url);
+ gtk_widget_show (source->priv->view_profile_link);
- gtk_image_set_from_pixbuf (GTK_IMAGE (source->priv->profile_image), data->image);
-
- gtk_widget_show_all (source->priv->user_info_area);
-
- g_free (playcount_text);
+ if (data->image != NULL) {
+ gtk_image_set_from_pixbuf (GTK_IMAGE (source->priv->profile_image), data->image);
+ /* show the parent because the image is packed in a viewport so it has a shadow */
+ gtk_widget_show (gtk_widget_get_parent (source->priv->profile_image));
+ } else {
+ gtk_widget_hide (gtk_widget_get_parent (source->priv->profile_image));
+ }
} else {
- gtk_widget_hide_all (source->priv->user_info_area);
+ gtk_widget_hide (source->priv->playcount_label);
+ gtk_widget_hide (source->priv->view_profile_link);
+ gtk_widget_hide (gtk_widget_get_parent (source->priv->profile_image));
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]