[sound-juicer] Improve wording of submit infobar label



commit 18ab6e07389d7fbe286e29fc58369963b7c96a3f
Author: Phillip Wood <phillip wood dunelm org uk>
Date:   Mon Aug 10 13:25:44 2015 +0100

    Improve wording of submit infobar label
    
    Try to make it clearer that the user should edit the track names in
    MusicBrainz if they want to submit a new album. Currently users are
    confused when they edit the track names in Sound Juicer and it does not
    submit their edits.
    
    Change the wording of the menu item for submitting track names to make
    it clearer as well.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=753330

 data/sound-juicer-menu.ui |    2 +-
 data/sound-juicer.ui      |   47 ++++++++++++++++++++------------------------
 src/sj-main.c             |   30 +++++++++++++++++++++++----
 3 files changed, 47 insertions(+), 32 deletions(-)
---
diff --git a/data/sound-juicer-menu.ui b/data/sound-juicer-menu.ui
index ddc6c71..477c146 100644
--- a/data/sound-juicer-menu.ui
+++ b/data/sound-juicer-menu.ui
@@ -23,7 +23,7 @@
     </section>
     <section>
       <item>
-        <attribute name="label" translatable="yes">Submit Track Names</attribute>
+        <attribute name="label" translatable="yes">Open MusicBrainz</attribute>
         <attribute name="action">app.submit-tracks</attribute>
         <attribute name="accel">&lt;Primary&gt;s</attribute>
       </item>
diff --git a/data/sound-juicer.ui b/data/sound-juicer.ui
index 3e99ed7..c304531 100644
--- a/data/sound-juicer.ui
+++ b/data/sound-juicer.ui
@@ -25,8 +25,8 @@
                     <property name="halign">center</property>
                     <property name="spacing">6</property>
                     <child>
-                      <object class="GtkButton" id="submit_button">
-                        <property name="label" translatable="yes">S_ubmit Album</property>
+                      <object class="GtkButton" id="submit_bar_submit_button">
+                        <property name="label" translatable="yes">_Edit Album</property>
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="receives_default">True</property>
@@ -34,7 +34,6 @@
                         <property name="use_underline">True</property>
                         <accessibility>
                           <relation type="labelled-by" target="submit_label"/>
-                          <relation type="labelled-by" target="submit_label_secondary"/>
                         </accessibility>
                       </object>
                       <packing>
@@ -44,6 +43,24 @@
                       </packing>
                     </child>
                     <child>
+                      <object class="GtkButton" id="submit_bar_reload_button">
+                        <property name="label" translatable="yes">_Reload Album</property>
+                        <property name="visible">False</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">True</property>
+                        <property name="action_name">app.re-read</property>
+                        <property name="use_underline">True</property>
+                        <accessibility>
+                          <relation type="labelled-by" target="submit_label"/>
+                        </accessibility>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">1</property>
+                      </packing>
+                     </child>
+                     <child>
                       <object class="GtkButton" id="submit_bar_close_button">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
@@ -59,7 +76,7 @@
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">False</property>
-                        <property name="position">1</property>
+                        <property name="position">2</property>
                       </packing>
                     </child>
                   </object>
@@ -92,9 +109,6 @@
                     <property name="hexpand">True</property>
                     <property name="xalign">0</property>
                     <property name="wrap">True</property>
-                    <attributes>
-                      <attribute name="weight" value="bold"/>
-                    </attributes>
                   </object>
                   <packing>
                     <property name="expand">False</property>
@@ -102,25 +116,6 @@
                     <property name="position">0</property>
                   </packing>
                 </child>
-                <child>
-                  <object class="GtkLabel" id="submit_label_secondary">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="valign">center</property>
-                    <property name="hexpand">True</property>
-                    <property name="xalign">0</property>
-                    <property name="label" translatable="yes">You can improve the MusicBrainz database by 
adding this album.</property>
-                    <property name="wrap">True</property>
-                    <attributes>
-                      <attribute name="scale" value="0.833333333333"/>
-                    </attributes>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="position">1</property>
-                  </packing>
-                </child>
               </object>
               <packing>
                 <property name="expand">False</property>
diff --git a/src/sj-main.c b/src/sj-main.c
index 5fa6a94..eb35ba7 100644
--- a/src/sj-main.c
+++ b/src/sj-main.c
@@ -82,7 +82,7 @@ static GtkWidget *title_entry, *artist_entry, *composer_label, *composer_entry,
 static GtkWidget *entry_table; /* GtkTable containing composer_entry */
 static GtkTreeViewColumn *composer_column; /* Treeview column containing composers */
 static GtkWidget *track_listview, *extract_button, *play_button, *select_button;
-static GtkWidget *status_bar;
+static GtkWidget *status_bar, *submit_button, *reload_button;
 GtkListStore *track_store;
 GtkCellRenderer *toggle_renderer, *title_renderer, *artist_renderer, *composer_renderer;
 
@@ -336,13 +336,15 @@ set_submit_text (const AlbumDetails *album)
   gchar *text;
 
   if (g_str_equal (album->title, _("Unknown Title"))) {
-    text = g_strdup (_("This album is not in the MusicBrainz database."));
+    text = g_strdup (_("This album is not in the MusicBrainz database, please click ‘Edit Album’ to open 
your brower and edit it in MusicBrainz."));
   } else {
-    text = g_strdup_printf (_("Could not find %s by %s on MusicBrainz."),
+    text = g_strdup_printf (_("Could not find %s by %s on MusicBrainz, please click ‘Edit Album’ to open 
your brower and edit it in MusicBrainz."),
                                     album->title, album->artist);
   }
   gtk_label_set_text (GTK_LABEL (submit_label), text);
   g_free (text);
+  gtk_widget_show (submit_button);
+  gtk_widget_hide (reload_button);
 }
 
 static void
@@ -355,12 +357,27 @@ submit_tracks_enabled_changed_cb (GActionGroup *action_group,
     gtk_widget_hide (submit_bar);
 }
 
+enum {
+  SJ_RESPONSE_SUBMIT = 1,
+  SJ_RESPONSE_REREAD
+};
+
 G_MODULE_EXPORT void
 submit_bar_response_cb (GtkInfoBar *infobar,
                         int         response_id,
                         gpointer    user_data)
 {
-  gtk_widget_hide (GTK_WIDGET (infobar));
+  if (!gtk_widget_get_visible (submit_bar))
+    return;
+
+  if (response_id == SJ_RESPONSE_SUBMIT) {
+    gtk_widget_hide (submit_button);
+    gtk_widget_show (reload_button);
+    gtk_label_set_text (GTK_LABEL (submit_label),
+                        _("Click ‘Reload’ to load the edited album details from MusicBrainz"));
+  } else {
+    gtk_widget_hide (GTK_WIDGET (infobar));
+  }
 }
 
 /**
@@ -388,7 +405,7 @@ static void on_submit_activate (GSimpleAction *action, GVariant *parameter, gpoi
       g_error_free (error);
     }
   }
-  gtk_widget_hide (GTK_WIDGET (submit_bar));
+  gtk_info_bar_response (GTK_INFO_BAR (submit_bar), SJ_RESPONSE_SUBMIT);
 }
 
 static void on_preferences_activate (GSimpleAction *action, GVariant *parameter, gpointer data)
@@ -1486,6 +1503,7 @@ static void profile_changed_cb (GSettings *settings, gchar *key, gpointer user_d
  */
 static void on_reread_activate (GSimpleAction *action, GVariant *parameter, gpointer data)
 {
+  gtk_info_bar_response (GTK_INFO_BAR (submit_bar), SJ_RESPONSE_REREAD);
   reread_cd (FALSE);
 }
 
@@ -2145,6 +2163,8 @@ startup_cb (GApplication *app, gpointer user_data)
   main_window           = GET_WIDGET ("main_window");
   submit_bar            = GET_WIDGET ("submit_bar");
   submit_label          = GET_WIDGET ("submit_label");
+  reload_button         = GET_WIDGET ("submit_bar_reload_button");
+  submit_button         = GET_WIDGET ("submit_bar_submit_button");
   title_entry           = GET_WIDGET ("title_entry");
   artist_entry          = GET_WIDGET ("artist_entry");
   composer_label        = GET_WIDGET ("composer_label");


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