[easytag/wip/musicbrainz-support-appwin-merge: 7/58] Check before	setting SearchEntryField
- From: Abhinav Jangda <abhijangda src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [easytag/wip/musicbrainz-support-appwin-merge: 7/58] Check before	setting SearchEntryField
 
- Date: Fri, 22 Aug 2014 16:33:55 +0000 (UTC)
 
commit f11bd42430d27a51826b78020642765b95b15380
Author: Abhinav <abhijangda hotmail com>
Date:   Thu Jun 26 00:18:02 2014 +0530
    Check before setting SearchEntryField
 src/musicbrainz_dialog.c |   30 +++++++++++++++++++++++++++---
 1 files changed, 27 insertions(+), 3 deletions(-)
---
diff --git a/src/musicbrainz_dialog.c b/src/musicbrainz_dialog.c
index b10509f..6da3c0a 100755
--- a/src/musicbrainz_dialog.c
+++ b/src/musicbrainz_dialog.c
@@ -465,15 +465,39 @@ bt_selected_find_clicked (GtkWidget *widget, gpointer user_data)
 
     if (type == MB_ENTITY_KIND_ARTIST)
     {
-        gtk_entry_set_text (GTK_ENTRY (entry), file_tag->artist);
+        if (file_tag->artist && *(file_tag->artist))
+        {
+            gtk_entry_set_text (GTK_ENTRY (entry), file_tag->artist);
+        }
+        else
+        {
+            gtk_statusbar_push (GTK_STATUSBAR (gtk_builder_get_object (builder, "statusbar")),
+                        0, _("Artist of current file is not set"));
+        }
     }
     else if (type == MB_ENTITY_KIND_ALBUM)
     {
-        gtk_entry_set_text (GTK_ENTRY (entry), file_tag->album);
+        if (file_tag->album && *(file_tag->album))
+        {
+            gtk_entry_set_text (GTK_ENTRY (entry), file_tag->album);
+        }
+        else
+        {
+            gtk_statusbar_push (GTK_STATUSBAR (gtk_builder_get_object (builder, "statusbar")),
+                        0, _("Album of current file is not set"));
+        }
     }
     else if (type == MB_ENTITY_KIND_TRACK)
     {
-        gtk_entry_set_text (GTK_ENTRY (entry), file_tag->title);
+        if (file_tag->title && *(file_tag->title))
+        {
+            gtk_entry_set_text (GTK_ENTRY (entry), file_tag->title);
+        }
+        else
+        {
+            gtk_statusbar_push (GTK_STATUSBAR (gtk_builder_get_object (builder, "statusbar")),
+                        0, _("Track of current file is not set"));
+        }
     }
 
     btn_manual_find_clicked (NULL, NULL);
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]