[rhythmbox] song-info: only try to set up comment widgetry for single track case



commit 77629bd5871bef161c981905b20064899d91a9b4
Author: Jonathan Matthew <jonathan d14n org>
Date:   Wed Jun 23 11:28:33 2010 +1000

    song-info: only try to set up comment widgetry for single track case

 widgets/rb-song-info.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/widgets/rb-song-info.c b/widgets/rb-song-info.c
index c0773d2..13cdff1 100644
--- a/widgets/rb-song-info.c
+++ b/widgets/rb-song-info.c
@@ -387,6 +387,8 @@ rb_song_info_construct_single (RBSongInfo *song_info, GtkBuilder *builder, gbool
 	song_info->priv->play_count    = GTK_WIDGET (gtk_builder_get_object (builder, "song_info_playcount"));
 	song_info->priv->last_played   = GTK_WIDGET (gtk_builder_get_object (builder, "song_info_lastplayed"));
 	song_info->priv->name = GTK_WIDGET (gtk_builder_get_object (builder, "song_info_name"));
+	song_info->priv->comment = GTK_WIDGET (gtk_builder_get_object (builder, "song_info_comment"));
+	song_info->priv->comment_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (song_info->priv->comment));
 
 	rb_builder_boldify_label (builder, "title_label");
 	rb_builder_boldify_label (builder, "trackn_label");
@@ -399,6 +401,7 @@ rb_song_info_construct_single (RBSongInfo *song_info, GtkBuilder *builder, gbool
 	rb_builder_boldify_label (builder, "duration_label");
 	rb_builder_boldify_label (builder, "bitrate_label");
 	rb_builder_boldify_label (builder, "bpm_label");
+	rb_builder_boldify_label (builder, "comment_label");
 
 	/* whenever you press a mnemonic, the associated GtkEntry's text gets highlighted */
 	g_signal_connect_object (G_OBJECT (song_info->priv->title),
@@ -409,13 +412,17 @@ rb_song_info_construct_single (RBSongInfo *song_info, GtkBuilder *builder, gbool
 				 "mnemonic-activate",
 				 G_CALLBACK (rb_song_info_mnemonic_cb),
 				 NULL, 0);
+	g_signal_connect_object (G_OBJECT (song_info->priv->comment),
+				 "mnemonic-activate",
+				 G_CALLBACK (rb_song_info_mnemonic_cb),
+				 NULL, 0);
 
 	gtk_editable_set_editable (GTK_EDITABLE (song_info->priv->title), editable);
 	gtk_editable_set_editable  (GTK_EDITABLE (song_info->priv->track_cur), editable);
+	gtk_text_view_set_editable (GTK_TEXT_VIEW (song_info->priv->comment), editable);
 
 	/* default focus */
 	gtk_widget_grab_focus (song_info->priv->title);
-
 }
 
 static void
@@ -497,8 +504,6 @@ rb_song_info_constructed (GObject *object)
 	song_info->priv->album_artist = GTK_WIDGET (gtk_builder_get_object (builder, "song_info_album_artist"));
 	song_info->priv->genre = GTK_WIDGET (gtk_builder_get_object (builder, "song_info_genre"));
 	song_info->priv->year = GTK_WIDGET (gtk_builder_get_object (builder, "song_info_year"));
-	song_info->priv->comment = GTK_WIDGET (gtk_builder_get_object (builder, "song_info_comment"));
-	song_info->priv->comment_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (song_info->priv->comment));
 	song_info->priv->playback_error_box = GTK_WIDGET (gtk_builder_get_object (builder, "song_info_error_box"));
 	song_info->priv->playback_error_label = GTK_WIDGET (gtk_builder_get_object (builder, "song_info_error_label"));
 	song_info->priv->disc_cur = GTK_WIDGET (gtk_builder_get_object (builder, "song_info_disc_cur"));
@@ -516,7 +521,6 @@ rb_song_info_constructed (GObject *object)
 	rb_builder_boldify_label (builder, "album_artist_label");
 	rb_builder_boldify_label (builder, "genre_label");
 	rb_builder_boldify_label (builder, "year_label");
-	rb_builder_boldify_label (builder, "comment_label");
 	rb_builder_boldify_label (builder, "rating_label");
 	rb_builder_boldify_label (builder, "discn_label");
 	rb_builder_boldify_label (builder, "artist_sortname_label");
@@ -543,10 +547,6 @@ rb_song_info_constructed (GObject *object)
 				 "mnemonic-activate",
 				 G_CALLBACK (rb_song_info_mnemonic_cb),
 				 NULL, 0);
-	g_signal_connect_object (G_OBJECT (song_info->priv->comment),
-				 "mnemonic-activate",
-				 G_CALLBACK (rb_song_info_mnemonic_cb),
-				 NULL, 0);
 	g_signal_connect_object (G_OBJECT (song_info->priv->disc_cur),
 				 "mnemonic-activate",
 				 G_CALLBACK (rb_song_info_mnemonic_cb),
@@ -585,11 +585,11 @@ rb_song_info_constructed (GObject *object)
 	gtk_editable_set_editable (GTK_EDITABLE (song_info->priv->album_artist), editable);
 	gtk_editable_set_editable (GTK_EDITABLE (song_info->priv->genre), editable);
 	gtk_editable_set_editable (GTK_EDITABLE (song_info->priv->year), editable);
-	gtk_text_view_set_editable (GTK_TEXT_VIEW (song_info->priv->comment), editable);
 	gtk_editable_set_editable (GTK_EDITABLE (song_info->priv->disc_cur), editable);
 
 	/* Finish construction */
 	if (song_info->priv->current_entry) {
+
 		rb_song_info_construct_single (song_info, builder, editable);
 		rb_song_info_populate_dialog (song_info);
 	} else {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]