[rhythmbox/media-player-sync] media-player: add labels showing the number of tracks to be synced



commit fc63ab3eeb4168693723a3d69e5a9ca43639cc7a
Author: Jonathan Matthew <jonathan d14n org>
Date:   Thu Feb 4 23:12:20 2010 +1000

    media-player: add labels showing the number of tracks to be synced
    
    To better illustrate what the sync process is going to do, we now
    display the number of files that will be deleted from the device, and
    the number that will be transferred.  It's not broken down by category.
    We'll probably use the segmented bar widget to show that information.

 data/ui/media-player-properties.ui |   68 +++++++++++++++++++++++++++++++++++-
 sources/rb-media-player-source.c   |   12 ++++++
 2 files changed, 79 insertions(+), 1 deletions(-)
---
diff --git a/data/ui/media-player-properties.ui b/data/ui/media-player-properties.ui
index 5962ac4..151989c 100644
--- a/data/ui/media-player-properties.ui
+++ b/data/ui/media-player-properties.ui
@@ -155,8 +155,74 @@
                         <property name="visible">True</property>
                         <property name="left_padding">12</property>
                         <child>
-                          <object class="GtkProgressBar" id="progressbar-sync-preview">
+                          <object class="GtkVBox" id="vbox5">
                             <property name="visible">True</property>
+                            <property name="orientation">vertical</property>
+                            <property name="spacing">12</property>
+                            <child>
+                              <object class="GtkProgressBar" id="progressbar-sync-preview">
+                                <property name="visible">True</property>
+                              </object>
+                              <packing>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkTable" id="table1">
+                                <property name="visible">True</property>
+                                <property name="n_rows">2</property>
+                                <property name="n_columns">2</property>
+                                <property name="column_spacing">6</property>
+                                <property name="row_spacing">12</property>
+                                <child>
+                                  <object class="GtkLabel" id="label2">
+                                    <property name="visible">True</property>
+                                    <property name="xalign">0</property>
+                                    <property name="label" translatable="yes">Added files:</property>
+                                  </object>
+                                  <packing>
+                                    <property name="x_options">GTK_FILL</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkLabel" id="label3">
+                                    <property name="visible">True</property>
+                                    <property name="xalign">0</property>
+                                    <property name="label" translatable="yes">Removed files:</property>
+                                  </object>
+                                  <packing>
+                                    <property name="top_attach">1</property>
+                                    <property name="bottom_attach">2</property>
+                                    <property name="x_options">GTK_FILL</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkLabel" id="added-tracks">
+                                    <property name="visible">True</property>
+                                    <property name="xalign">0</property>
+                                  </object>
+                                  <packing>
+                                    <property name="left_attach">1</property>
+                                    <property name="right_attach">2</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkLabel" id="removed-tracks">
+                                    <property name="visible">True</property>
+                                    <property name="xalign">0</property>
+                                  </object>
+                                  <packing>
+                                    <property name="left_attach">1</property>
+                                    <property name="right_attach">2</property>
+                                    <property name="top_attach">1</property>
+                                    <property name="bottom_attach">2</property>
+                                  </packing>
+                                </child>
+                              </object>
+                              <packing>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
                           </object>
                         </child>
                       </object>
diff --git a/sources/rb-media-player-source.c b/sources/rb-media-player-source.c
index b16f6a9..f99d1be 100644
--- a/sources/rb-media-player-source.c
+++ b/sources/rb-media-player-source.c
@@ -55,6 +55,8 @@ typedef struct {
 	GtkDialog *properties_dialog;
 	GtkTreeStore *sync_tree_store;
 	GtkWidget *preview_bar;
+	GtkWidget *added_files_count;
+	GtkWidget *removed_files_count;
 
 	/* sync state */
 	guint64 sync_space_needed;
@@ -347,6 +349,14 @@ update_sync_preview_bar (RBMediaPlayerSource *source)
 	g_free (text);
 	g_free (capacity);
 	g_free (used);
+
+	text = g_strdup_printf ("%d", g_list_length (priv->sync_to_add));
+	gtk_label_set_text (GTK_LABEL (priv->added_files_count), text);
+	g_free (text);
+
+	text = g_strdup_printf ("%d", g_list_length (priv->sync_to_remove));
+	gtk_label_set_text (GTK_LABEL (priv->removed_files_count), text);
+	g_free (text);
 }
 
 static void
@@ -558,6 +568,8 @@ rb_media_player_source_show_properties (RBMediaPlayerSource *source)
 	}
 
 	/* set up sync widgetry */
+	priv->added_files_count = GTK_WIDGET (gtk_builder_get_object (builder, "added-tracks"));
+	priv->removed_files_count = GTK_WIDGET (gtk_builder_get_object (builder, "removed-tracks"));
 	priv->preview_bar = GTK_WIDGET (gtk_builder_get_object (builder, "progressbar-sync-preview"));
 
 	/* tree_store columns are: active, inconsistent, name, display-name, is-category, category name */



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