[gnome-music/wip/jfelder/songeditor-gtk4: 73/76] songeditordialog: Add an album artist entry




commit 804e307f84bc157544a809d7c103b805733e2645
Author: Jean Felder <jfelder src gnome org>
Date:   Mon May 18 18:26:43 2020 +0200

    songeditordialog: Add an album artist entry
    
    This allows to edit the album artist tag.

 data/ui/SongEditorDialog.ui            | 41 +++++++++++++++++++++++++++++++++-
 gnomemusic/widgets/songeditordialog.py |  6 +++--
 2 files changed, 44 insertions(+), 3 deletions(-)
---
diff --git a/data/ui/SongEditorDialog.ui b/data/ui/SongEditorDialog.ui
index 919ae5dbb..8fa59d14b 100644
--- a/data/ui/SongEditorDialog.ui
+++ b/data/ui/SongEditorDialog.ui
@@ -177,7 +177,7 @@
                             <child>
                               <object class="GtkLabel" id="artist">
                                 <property name="margin-end">36</property>
-                                <property name="label" translatable="yes">Artist</property>
+                                <property name="label" translatable="yes">Song Artist</property>
                                 <property name="xalign">1</property>
                                 <attributes>
                                   <attribute name="weight" value="bold"/>
@@ -207,6 +207,45 @@
                         </child>
                       </object>
                     </child>
+                    <child>
+                      <object class="GtkBox">
+                        <property name="orientation">vertical</property>
+                        <property name="spacing">6</property>
+                        <child>
+                          <object class="GtkBox">
+                            <child>
+                              <object class="GtkLabel" id="album_artist">
+                                <property name="margin-end">36</property>
+                                <property name="label" translatable="yes">Album Artist</property>
+                                <property name="xalign">1</property>
+                                <attributes>
+                                  <attribute name="weight" value="bold"/>
+                                </attributes>
+                                <style>
+                                  <class name="dim-label"/>
+                                </style>
+                              </object>
+                            </child>
+                            <child>
+                              <object class="GtkLabel" id="_album_artist_suggestion">
+                                <property name="visible">False</property>
+                                <property name="halign">start</property>
+                                <property name="ellipsize">end</property>
+                                <property name="max_width_chars">30</property>
+                                <style>
+                                  <class name="suggestion-label"/>
+                                </style>
+                              </object>
+                            </child>
+                          </object>
+                        </child>
+                        <child>
+                          <object class="GtkEntry" id="_album_artist_entry">
+                            <property name="width_chars">45</property>
+                          </object>
+                        </child>
+                      </object>
+                    </child>
                     <child>
                       <object class="GtkBox">
                         <property name="hexpand">True</property>
diff --git a/gnomemusic/widgets/songeditordialog.py b/gnomemusic/widgets/songeditordialog.py
index c52da0515..29c7a787f 100644
--- a/gnomemusic/widgets/songeditordialog.py
+++ b/gnomemusic/widgets/songeditordialog.py
@@ -62,6 +62,8 @@ class SongEditorDialog(Gtk.Dialog):
     _use_suggestion_button = Gtk.Template.Child()
 
     # tags entries and labels
+    _album_artist_entry = Gtk.Template.Child()
+    _album_artist_suggestion = Gtk.Template.Child()
     _album_entry = Gtk.Template.Child()
     _album_suggestion = Gtk.Template.Child()
     _artist_entry = Gtk.Template.Child()
@@ -88,6 +90,8 @@ class SongEditorDialog(Gtk.Dialog):
     _tags: List[Tag] = [
         Tag("album", utils.get_album_title, Grl.Media.set_album,
             Grl.METADATA_KEY_ALBUM),
+        Tag("album_artist", utils.get_album_artist,
+            Grl.Media.set_album_artist, Grl.METADATA_KEY_ALBUM_ARTIST),
         Tag("artist", utils.get_song_artist, Grl.Media.set_artist,
             Grl.METADATA_KEY_ARTIST),
         Tag("disc", utils.get_album_disc_nr, utils.set_album_disc_nr,
@@ -101,8 +105,6 @@ class SongEditorDialog(Gtk.Dialog):
     ]
 
     _internal_tags: List[Tag] = [
-        Tag("album-artist", Grl.Media.get_album_artist,
-            Grl.Media.set_album_artist, Grl.METADATA_KEY_ALBUM_ARTIST),
         Tag("mb-recording-id", Grl.Media.get_mb_recording_id,
             Grl.Media.set_mb_recording_id, Grl.METADATA_KEY_MB_RECORDING_ID),
         Tag("mb-track-id", Grl.Media.get_mb_track_id,


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