[easytag/wip/musicbrainz-support-merge: 5/51] Check before setting SearchEntryField
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [easytag/wip/musicbrainz-support-merge: 5/51] Check before setting SearchEntryField
- Date: Sun, 31 Aug 2014 21:40:29 +0000 (UTC)
commit 60d3253e201ba140a73e0c332390f0e645973a5f
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 e6eabfd..2ce532c 100644
--- a/src/musicbrainz_dialog.c
+++ b/src/musicbrainz_dialog.c
@@ -464,15 +464,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]