[easytag/wip/musicbrainz-support] Added MusicBrainz dialog



commit 012c6141b2045b49320a8817e4264e5e5fa9683b
Author: Abhinav <abhijangda hotmail com>
Date:   Fri May 9 20:55:56 2014 +0530

    Added MusicBrainz dialog

 Makefile.am                   |    2 +
 data/musicbrainz_dialog.glade |  759 +++++++++++++++++++++++++++++++++++++++++
 src/bar.c                     |    3 +-
 src/mbentityview.c            |  142 ++++++++
 src/mbentityview.h            |   76 ++++
 src/musicbrainz_dialog.c      |   77 +++++
 src/musicbrainz_dialog.h      |   31 ++
 7 files changed, 1089 insertions(+), 1 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 1f58f47..2083f2b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -62,6 +62,8 @@ easytag_SOURCES = \
        src/mpeg_header.c \
        src/mp4_tag.cc \
        src/musepack_header.c \
+       src/musicbrainz_dialog.c \
+       src/mbentityview.c \
        src/ogg_header.c \
        src/ogg_tag.c \
        src/opus_header.c \
diff --git a/data/musicbrainz_dialog.glade b/data/musicbrainz_dialog.glade
new file mode 100755
index 0000000..415f3cf
--- /dev/null
+++ b/data/musicbrainz_dialog.glade
@@ -0,0 +1,759 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkImage" id="image12">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="stock">gtk-find</property>
+  </object>
+  <object class="GtkImage" id="image13">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="stock">gtk-stop</property>
+  </object>
+  <object class="GtkImage" id="image8">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="stock">gtk-find</property>
+  </object>
+  <object class="GtkImage" id="image9">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="stock">gtk-stop</property>
+  </object>
+  <object class="GtkImage" id="findimage">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="stock">gtk-find</property>
+  </object>
+  <object class="GtkImage" id="image14">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="stock">gtk-missing-image</property>
+    <property name="icon-size">5</property>
+  </object>
+  <object class="GtkImage" id="img_invert_selection">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="stock">easytag-invert-selection</property>
+  </object>
+  <object class="GtkImage" id="img_red_lines">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="stock">easytag-red-lines</property>
+  </object>
+  <object class="GtkImage" id="img_unselect_all">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="stock">easytag-unselect-all</property>
+  </object>
+  <object class="GtkImage" id="image10">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="stock">gtk-find</property>
+  </object>
+  <object class="GtkImage" id="image11">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="stock">gtk-stop</property>
+  </object>
+  <object class="GtkDialog" id="mbDialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">5</property>
+    <property name="title" translatable="yes">Music Brainz Search</property>
+    <property name="type_hint">dialog</property>
+    <child internal-child="vbox">
+      <object class="GtkBox" id="dialog-vbox1">
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">2</property>
+        <child internal-child="action_area">
+          <object class="GtkButtonBox" id="dialog-action_area1">
+            <property name="can_focus">False</property>
+            <property name="layout_style">end</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkBox" id="box1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="orientation">vertical</property>
+            <property name="spacing">1</property>
+            <child>
+              <object class="GtkNotebook" id="notebook1">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <child>
+                  <object class="GtkVBox" id="vbox1">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <child>
+                      <object class="GtkFrame" id="frame1">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label_xalign">0</property>
+                        <property name="shadow_type">in</property>
+                        <child>
+                          <object class="GtkAlignment" id="alignment1">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="top_padding">2</property>
+                            <property name="left_padding">12</property>
+                            <child>
+                              <object class="GtkHBox" id="hbox1">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="spacing">5</property>
+                                <child>
+                                  <object class="GtkLabel" id="label4">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="label" translatable="yes">Search:</property>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">0</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkComboBoxText" id="cbAutomaticSearch">
+                                    <property name="width_request">240</property>
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="entry_text_column">0</property>
+                                    <property name="id_column">1</property>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="padding">4</property>
+                                    <property name="position">1</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkButton" id="btnAutomaticFind">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="receives_default">True</property>
+                                    <property name="image">image8</property>
+                                    <property name="image_position">top</property>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">2</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkButton" id="btnAutomaticStop">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="receives_default">True</property>
+                                    <property name="image">image9</property>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">4</property>
+                                  </packing>
+                                </child>
+                              </object>
+                            </child>
+                          </object>
+                        </child>
+                        <child type="label">
+                          <object class="GtkLabel" id="label5">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="label" translatable="yes">Automatic Search in MusicBrainz 
Database</property>
+                          </object>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                  </object>
+                </child>
+                <child type="tab">
+                  <object class="GtkLabel" id="label1">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">Automatic Search</property>
+                  </object>
+                  <packing>
+                    <property name="tab_fill">False</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkBox" id="box7">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="orientation">vertical</property>
+                    <child>
+                      <object class="GtkLabel" id="label6">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="xalign">0.0099999997764825821</property>
+                        <property name="label" translatable="yes">Manually Search MusicBrainz 
Database</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkAlignment" id="alignment3">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="top_padding">3</property>
+                        <property name="left_padding">12</property>
+                        <child>
+                          <object class="GtkHBox" id="hbox3">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="spacing">5</property>
+                            <child>
+                              <object class="GtkLabel" id="label7">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="label" translatable="yes">Search:</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkComboBoxText" id="cbManualSearch">
+                                <property name="width_request">240</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="entry_text_column">0</property>
+                                <property name="id_column">1</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="padding">4</property>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkLabel" id="label14">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="label" translatable="yes">Through:</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">True</property>
+                                <property name="position">2</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkComboBox" id="cbManualSearchIn">
+                                <property name="width_request">120</property>
+                                <property name="height_request">26</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">3</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkButton" id="btnManualFind">
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">True</property>
+                                <property name="image">findimage</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">4</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkButton" id="btnManualStop">
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">True</property>
+                                <property name="image">stopimage</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">5</property>
+                              </packing>
+                            </child>
+                          </object>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+                <child type="tab">
+                  <object class="GtkLabel" id="label13">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">Manual Search</property>
+                  </object>
+                  <packing>
+                    <property name="position">1</property>
+                    <property name="tab_fill">False</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkBox" id="box3">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="orientation">vertical</property>
+                    <child>
+                      <object class="GtkBox" id="box6">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="spacing">5</property>
+                        <child>
+                          <object class="GtkLabel" id="label2">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="xalign">0</property>
+                            <property name="label" translatable="yes"> Scan Selected Files from MusicBrainz 
Database based on their album:</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkButton" id="btnSelectedFind">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">True</property>
+                            <property name="image">image10</property>
+                            <property name="image_position">right</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="position">3</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkButton" id="btnSelectedStop">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">True</property>
+                            <property name="image">image11</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="position">4</property>
+                          </packing>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="padding">4</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="position">2</property>
+                    <property name="tab_fill">False</property>
+                  </packing>
+                </child>
+                <child type="tab">
+                  <object class="GtkLabel" id="label10">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="margin_left">1</property>
+                    <property name="label" translatable="yes">Scan Selected Files</property>
+                  </object>
+                  <packing>
+                    <property name="position">2</property>
+                    <property name="tab_fill">False</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkBox" id="box4">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="orientation">vertical</property>
+                    <property name="spacing">1</property>
+                    <child>
+                      <object class="GtkBox" id="box5">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="spacing">3</property>
+                        <child>
+                          <object class="GtkLabel" id="label12">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="xalign">0.019999999552965164</property>
+                            <property name="label" translatable="yes"> Insert Disc into Disc Drive to search 
into MusicBrainz Data Base with DiscID: </property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkButton" id="btnDiscFind">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">True</property>
+                            <property name="image">image12</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkButton" id="btnDiscStop">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">True</property>
+                            <property name="image">image13</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="position">2</property>
+                          </packing>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="padding">4</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="position">3</property>
+                    <property name="tab_fill">False</property>
+                  </packing>
+                </child>
+                <child type="tab">
+                  <object class="GtkLabel" id="label9">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">Disc Lookup</property>
+                  </object>
+                  <packing>
+                    <property name="position">3</property>
+                    <property name="tab_fill">False</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="padding">1</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkFrame" id="frame2">
+                <property name="width_request">555</property>
+                <property name="height_request">216</property>
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label_xalign">0</property>
+                <property name="shadow_type">in</property>
+                <child>
+                  <object class="GtkAlignment" id="alignment2">
+                    <property name="width_request">551</property>
+                    <property name="height_request">193</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="left_padding">12</property>
+                    <child>
+                      <object class="GtkVBox" id="centralBox">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="spacing">3</property>
+                        <child>
+                          <object class="GtkToolbar" id="toolbar1">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <child>
+                              <object class="GtkToolItem" id="toolbutton1">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <child>
+                                  <object class="GtkLabel" id="label3">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="label" translatable="yes">Search:</property>
+                                  </object>
+                                </child>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="homogeneous">True</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkToolItem" id="toolbutton2">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <child>
+                                  <object class="GtkComboBoxText" id="comboboxtext1">
+                                    <property name="width_request">131</property>
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="entry_text_column">0</property>
+                                    <property name="id_column">1</property>
+                                  </object>
+                                </child>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="homogeneous">True</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkToolButton" id="toolbtnUp">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="label" translatable="yes">toolbutton3</property>
+                                <property name="use_underline">True</property>
+                                <property name="stock_id">gtk-go-up</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="homogeneous">True</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkToolButton" id="toolbutton3">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="label" translatable="yes">toolbutton3</property>
+                                <property name="use_underline">True</property>
+                                <property name="stock_id">gtk-go-down</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="homogeneous">True</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkSeparatorToolItem" id="toolbutton4">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="homogeneous">True</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkToolButton" id="toolbutton5">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="label" translatable="yes">toolbutton5</property>
+                                <property name="use_underline">True</property>
+                                <property name="icon_widget">img_invert_selection</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="homogeneous">True</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkToolButton" id="toolbutton6">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="label" translatable="yes">toolbutton6</property>
+                                <property name="use_underline">True</property>
+                                <property name="stock_id">gtk-select-all</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="homogeneous">True</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkToolButton" id="toolbutton7">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="label" translatable="yes">toolbutton7</property>
+                                <property name="use_underline">True</property>
+                                <property name="icon_widget">img_unselect_all</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="homogeneous">True</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkToolButton" id="toolbutton8">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="label" translatable="yes">toolbutton8</property>
+                                <property name="use_underline">True</property>
+                                <property name="icon_widget">img_red_lines</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="homogeneous">True</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkToolButton" id="toolbutton9">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="label" translatable="yes">toolbutton9</property>
+                                <property name="use_underline">True</property>
+                                <property name="stock_id">gtk-refresh</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="homogeneous">True</property>
+                              </packing>
+                            </child>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+                <child type="label">
+                  <object class="GtkLabel" id="label8">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">&lt;b&gt;Results:&lt;/b&gt;</property>
+                    <property name="use_markup">True</property>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">True</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkBox" id="box2">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <child>
+                  <object class="GtkBox" id="box10">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="spacing">4</property>
+                    <child>
+                      <object class="GtkButton" id="button9">
+                        <property name="label" translatable="yes">Close</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">True</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="pack_type">end</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkButton" id="button10">
+                        <property name="label" translatable="yes">Apply Tag Changes</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">True</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="pack_type">end</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">True</property>
+                    <property name="fill">True</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkStatusbar" id="statusbar1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="spacing">2</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">3</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </object>
+  <object class="GtkImage" id="stopimage">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="stock">gtk-stop</property>
+  </object>
+  <object class="GtkTreeStore" id="treestore1">
+    <columns>
+      <!-- column-name Entities -->
+      <column type="guchar"/>
+    </columns>
+  </object>
+</interface>
diff --git a/src/bar.c b/src/bar.c
index 17a6a30..4d02e1b 100644
--- a/src/bar.c
+++ b/src/bar.c
@@ -36,6 +36,7 @@
 #include "charset.h"
 #include "ui_manager.h"
 #include "gtk2_compat.h"
+#include "musicbrainz_dialog.h"
 
 /***************
  * Declaration *
@@ -286,7 +287,7 @@ void Create_UI (GtkWidget **ppmenubar, GtkWidget **pptoolbar)
           _("Search filenames and tags"),
           G_CALLBACK (Open_Search_File_Window) },
         { AM_CDDB_SEARCH, GTK_STOCK_CDROM, _("CDD_B Search…"), "<Primary>B",
-          _("CDDB search"), G_CALLBACK (Open_Cddb_Window) },
+          _("CDDB search"), G_CALLBACK (et_open_musicbrainz_dialog) },
         { AM_FILENAME_FROM_TXT, GTK_STOCK_OPEN,
           _("Load Filenames From a Text File…"), "<Primary>T",
           _("Load filenames from a text file"),
diff --git a/src/mbentityview.c b/src/mbentityview.c
new file mode 100644
index 0000000..f792a00
--- /dev/null
+++ b/src/mbentityview.c
@@ -0,0 +1,142 @@
+/* mbentityview.c - 2014/05/05 */
+/*
+ *  EasyTAG - Tag editor for MP3 and Ogg Vorbis files
+ *  Copyright (C) 2000-2014  Abhinav Jangda <abhijangda hotmail com>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include "mbentityview.h"
+
+#define ET_MB_ENTITY_VIEW_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \
+                                            ET_MB_ENTITY_VIEW_TYPE, \
+                                            EtMbEntityViewPrivate))
+
+/***************
+ * Declaration *
+ ***************/
+
+/*
+ * EtMbEntityViewPrivate:
+ * @breadCrumbBox: GtkToolbar which represents the BreadCrumbWidget
+ * @treeView: GtkTreeView to display the recieved music brainz data
+ * @listStore: GtkListStore for treeView
+ * @scrolledWindow: GtkScrolledWindow for treeView
+ *
+ * Private data for EtMbEntityView.
+ */
+typedef struct
+{
+    GtkWidget *breadCrumbBox;
+    GtkWidget *treeView;
+    GtkListStore *listStore;
+    GtkWidget *scrolledWindow;
+} EtMbEntityViewPrivate;
+
+/**************
+ * Prototypes *
+ **************/
+
+static void
+et_mb_entity_view_class_init (EtMbEntityViewClass *klass);
+
+static void
+et_mb_entity_view_init (EtMbEntityView *proj_notebook);
+
+/*************
+ * Functions *
+ *************/
+
+/*
+ * et_mb_entity_view_get_type
+ *
+ * Returns: A GType, type of EtMbEntityView.
+ */
+GType
+et_mb_entity_view_get_type (void)
+{
+    static GType et_mb_entity_view_type = 0;
+    
+    if (!et_mb_entity_view_type)
+    {
+        static const GTypeInfo et_mb_entity_view_type_info = 
+        {
+            sizeof (EtMbEntityViewClass),
+            NULL,
+            NULL,
+            (GClassInitFunc) et_mb_entity_view_class_init,
+            NULL,
+            NULL,
+            sizeof (EtMbEntityView),
+            0,
+            (GInstanceInitFunc) et_mb_entity_view_init,
+        };
+        et_mb_entity_view_type = g_type_register_static (GTK_TYPE_BOX, 
+                                                         "EtMbEntityView",
+                                                         &et_mb_entity_view_type_info,
+                                                         0);
+    }
+    return et_mb_entity_view_type;
+}
+
+/*
+ * et_mb_entity_view_class_init:
+ * klass: EtMbEntityViewClass to initialize.
+ *
+ * Initializes an EtMbEntityViewClass class.
+ */
+static void
+et_mb_entity_view_class_init (EtMbEntityViewClass *klass)
+{
+    g_type_class_add_private (klass, sizeof (EtMbEntityViewPrivate));
+}
+
+/*
+ * et_mb_entity_view_init:
+ * @entity_view: EtMbEntityView to initialize.
+ *
+ * Initializes an EtMbEntityView.
+ */
+static void
+et_mb_entity_view_init (EtMbEntityView *entity_view)
+{
+    EtMbEntityViewPrivate *priv = ET_MB_ENTITY_VIEW_GET_PRIVATE (entity_view);
+
+    /* Adding child widgets */
+    priv->breadCrumbBox = gtk_toolbar_new ();
+    priv->listStore = gtk_list_store_new (0);
+    priv->treeView = gtk_tree_view_new_with_model (GTK_TREE_MODEL (priv->listStore));
+    priv->scrolledWindow = gtk_scrolled_window_new (NULL, NULL);
+    gtk_container_add (GTK_CONTAINER (priv->scrolledWindow), priv->treeView);
+    gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (priv->scrolledWindow),
+                                    GTK_POLICY_ALWAYS, GTK_POLICY_ALWAYS);
+    gtk_box_pack_start (GTK_BOX (entity_view), priv->breadCrumbBox,
+                        FALSE, FALSE, 2);
+    gtk_box_pack_start (GTK_BOX (entity_view), priv->scrolledWindow,
+                        TRUE, TRUE, 2);
+}
+
+/*
+ * et_mb_entity_view_new:
+ *
+ * Creates a new EtMbEntityView.
+ *
+ * Returns: GtkWidget, a new EtMbEntityView.
+ */
+GtkWidget *
+et_mb_entity_view_new ()
+{
+    return GTK_WIDGET (g_object_new (et_mb_entity_view_get_type (), NULL));
+}
\ No newline at end of file
diff --git a/src/mbentityview.h b/src/mbentityview.h
new file mode 100644
index 0000000..7eb5f9d
--- /dev/null
+++ b/src/mbentityview.h
@@ -0,0 +1,76 @@
+/* mbentityview.h - 2014/05/05 */
+/*
+ *  EasyTAG - Tag editor for MP3 and Ogg Vorbis files
+ *  Copyright (C) 2000-2014  Abhinav Jangda <abhijangda hotmail com>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __MB_ENTITY_VIEW_H__
+#define __MB_ENTITY_VIEW_H__
+
+#include <gtk/gtk.h>
+
+#define ET_MB_ENTITY_VIEW_TYPE (et_mb_entity_view_get_type ())
+#define ET_MB_ENTITY_VIEW (obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+                                                             ET_MB_ENTITY_VIEW_TYPE, \
+                                                             EtMbEntityView))
+
+#define ET_MB_ENTITY_VIEW_CLASS (klass) (G_TYPE_CHECK_INSTANCE_CAST ((klass), \
+                                                                    ET_MB_ENTITY_VIEW_TYPE, \
+                                                                    EtMbEntityView))
+
+#define IS_ET_MB_ENTITY_VIEW (obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
+                                                               ET_MB_ENTITY_VIEW_TYPE))
+
+#define IS_ET_MB_ENTITY_VIEW_CLASS (klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \
+                                                                     ET_MB_ENTITY_VIEW_TYPE))
+
+/***************
+ * Declaration *
+ ***************/
+
+/*
+ * EtMbEntityView:
+ * @vbox: GtkBox, parent class of EtMbEntityView
+ *
+ * This widget is used to show data recieved from music brainz and helps to
+ * navigate in it using breadcrumb widget.
+ */
+typedef struct 
+{
+    GtkBox vbox;
+} EtMbEntityView;
+
+/*
+ * EtMbEntityViewClass:
+ * @parent: GtkBoxClass, parent class of EtMbEntityViewClass
+ *
+ * Class of EtMbEntityView.
+ */
+typedef struct
+{
+    GtkBoxClass parent;
+} EtMbEntityViewClass;
+
+/**************
+ * Prototypes *
+ **************/
+
+GType
+et_mb_entity_view_get_type (void) G_GNUC_CONST;
+GtkWidget *
+et_mb_entity_view_new (void);
+#endif /* __MB_ENTITY_VIEW_H__ */
\ No newline at end of file
diff --git a/src/musicbrainz_dialog.c b/src/musicbrainz_dialog.c
new file mode 100644
index 0000000..7347df9
--- /dev/null
+++ b/src/musicbrainz_dialog.c
@@ -0,0 +1,77 @@
+/* musicbrainz_dialog.c - 2014/05/05 */
+/*
+ *  EasyTAG - Tag editor for MP3 and Ogg Vorbis files
+ *  Copyright (C) 2000-2014  Abhinav Jangda <abhijangda hotmail com>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+ 
+#include "config.h"
+
+#include <gtk/gtk.h>
+#include <gdk/gdkkeysyms.h>
+#include <glib/gi18n.h>
+
+#include "gtk2_compat.h"
+#include "cddb.h"
+#include "easytag.h"
+#include "et_core.h"
+#include "browser.h"
+#include "scan_dialog.h"
+#include "log.h"
+#include "misc.h"
+#include "setting.h"
+#include "id3_tag.h"
+#include "setting.h"
+#include "charset.h"
+#include "musicbrainz_dialog.h"
+#include "mbentityview.h"
+
+/***************
+ * Declaration *
+ ***************/
+
+static GtkBuilder *builder;
+static GtkWidget *mbDialog;
+static GtkWidget *entityView;
+
+/*************
+ * Functions *
+ *************/
+
+/*
+ * et_open_musicbrainz_dialog:
+ *
+ * This function will open the musicbrainz dialog.
+ */
+void
+et_open_musicbrainz_dialog ()
+{
+    entityView = et_mb_entity_view_new ();
+    builder = gtk_builder_new ();
+    gtk_builder_add_from_file (builder, "data/musicbrainz_dialog.glade", NULL);
+
+    mbDialog = GTK_WIDGET (gtk_builder_get_object (builder, "mbDialog"));
+
+    gtk_box_pack_start (GTK_BOX (gtk_builder_get_object (builder, "centralBox")),
+                        entityView, TRUE, TRUE, 2);
+    gtk_box_reorder_child (GTK_BOX (gtk_builder_get_object (builder, "centralBox")),
+                           entityView, 0);
+
+    gtk_widget_show_all (mbDialog);
+    gtk_dialog_run (GTK_DIALOG (mbDialog));
+    gtk_widget_destroy (mbDialog);
+    g_object_unref (G_OBJECT (builder));
+}
\ No newline at end of file
diff --git a/src/musicbrainz_dialog.h b/src/musicbrainz_dialog.h
new file mode 100644
index 0000000..32e5cad
--- /dev/null
+++ b/src/musicbrainz_dialog.h
@@ -0,0 +1,31 @@
+/* musicbrainz_dialog.h - 2014/05/05 */
+/*
+ *  EasyTAG - Tag editor for MP3 and Ogg Vorbis files
+ *  Copyright (C) 2000-2014  Abhinav Jangda <abhijangda hotmail com>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+ 
+#ifndef __MUSICBRAINZ_DIALOG_H__
+#define __MUSICBRAINZ_DIALOG_H__
+
+/**************
+ * Prototypes *
+ **************/
+
+void
+et_open_musicbrainz_dialog (void);
+
+#endif /* __MUSICBRAINZ_DIALOG_H__ */


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