[easytag/wip/musicbrainz-support-merge: 102/149] Set Album of selected file



commit 309daa2005e4fc573738a7ab9a8c5dfe5f724725
Author: Abhinav <abhijangda hotmail com>
Date:   Thu Jun 26 00:05:34 2014 +0530

    Set Album of selected file
    
    Added get_first_selected_file to get first selected ET_File
    Use above ET_File to set the album name to Search ComboBoxText

 src/musicbrainz_dialog.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/musicbrainz_dialog.c b/src/musicbrainz_dialog.c
index 9c4b783..d5b9073 100644
--- a/src/musicbrainz_dialog.c
+++ b/src/musicbrainz_dialog.c
@@ -776,6 +776,7 @@ et_open_musicbrainz_dialog ()
     GtkWidget *cb_manual_search_in;
     GtkWidget *cb_search;
     GError *error;
+    ET_File *et_file;
 
     builder = gtk_builder_new ();
     error = NULL;
@@ -859,6 +860,15 @@ et_open_musicbrainz_dialog ()
 
     gtk_combo_box_set_active (GTK_COMBO_BOX (cb_manual_search_in), 1);
 
+    /* Set the text of cbManualSearch to the album of selected file */
+    get_first_selected_file (&et_file);
+
+    if (et_file && ((File_Tag *)et_file->FileTag->data)->album)
+    {
+        gtk_entry_set_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (cb_search))),
+                            ((File_Tag *)et_file->FileTag->data)->album);
+    }
+
     gtk_widget_show_all (mbDialog);
     gtk_dialog_run (GTK_DIALOG (mbDialog));
     gtk_widget_destroy (mbDialog);


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