[rhythmbox] ipod: add supported audio formats to the properties dialog



commit 226022bd187560a7c267bfe7d5152cac21f00309
Author: Jonathan Matthew <jonathan d14n org>
Date:   Thu Feb 11 22:03:50 2010 +1000

    ipod: add supported audio formats to the properties dialog

 plugins/ipod/ipod-info.ui     |   29 ++++++++++++++++++++++++++++-
 plugins/ipod/rb-ipod-source.c |   17 +++++++++++++++++
 2 files changed, 45 insertions(+), 1 deletions(-)
---
diff --git a/plugins/ipod/ipod-info.ui b/plugins/ipod/ipod-info.ui
index 450a9ca..9f7c6e8 100644
--- a/plugins/ipod/ipod-info.ui
+++ b/plugins/ipod/ipod-info.ui
@@ -113,7 +113,7 @@
       <object class="GtkTable" id="table2">
         <property name="visible">True</property>
         <property name="border_width">12</property>
-        <property name="n_rows">6</property>
+        <property name="n_rows">7</property>
         <property name="n_columns">2</property>
         <property name="column_spacing">12</property>
         <property name="row_spacing">6</property>
@@ -269,6 +269,33 @@
             <property name="y_options"></property>
           </packing>
         </child>
+        <child>
+          <object class="GtkLabel" id="label-audio-formats">
+            <property name="visible">True</property>
+            <property name="xalign">0</property>
+            <property name="yalign">0</property>
+            <property name="label" translatable="yes">Audio formats:</property>
+          </object>
+          <packing>
+            <property name="top_attach">6</property>
+            <property name="bottom_attach">7</property>
+            <property name="x_options">GTK_FILL</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkLabel" id="label-audio-formats-value">
+            <property name="visible">True</property>
+            <property name="xalign">0</property>
+            <property name="yalign">0</property>
+            <property name="wrap">True</property>
+          </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="right_attach">2</property>
+            <property name="top_attach">6</property>
+            <property name="bottom_attach">7</property>
+          </packing>
+        </child>
       </object>
     </child>
     <child type="label">
diff --git a/plugins/ipod/rb-ipod-source.c b/plugins/ipod/rb-ipod-source.c
index cdc1da7..9110310 100644
--- a/plugins/ipod/rb-ipod-source.c
+++ b/plugins/ipod/rb-ipod-source.c
@@ -1706,6 +1706,9 @@ impl_show_properties (RBMediaPlayerSource *source, GtkWidget *info_box, GtkWidge
 	char *builder_file;
 	Itdb_Device *ipod_dev;
 	RBPlugin *plugin;
+	GList *output_formats;
+	GList *t;
+	GString *str;
 
 	/* probably should display an error on the basic page in most of these error cases.. */
 
@@ -1797,6 +1800,20 @@ impl_show_properties (RBMediaPlayerSource *source, GtkWidget *info_box, GtkWidge
 	widget = GTK_WIDGET (gtk_builder_get_object (builder, "label-firmware-version-value"));
 	gtk_label_set_text (GTK_LABEL (widget), itdb_device_get_sysinfo (ipod_dev, "VisibleBuildID"));
 
+	str = g_string_new ("");
+	output_formats = rb_removable_media_source_get_format_descriptions (RB_REMOVABLE_MEDIA_SOURCE (source));
+	for (t = output_formats; t != NULL; t = t->next) {
+		if (t != output_formats) {
+			g_string_append (str, "\n");
+		}
+		g_string_append (str, t->data);
+	}
+	rb_list_deep_free (output_formats);
+
+	widget = GTK_WIDGET (gtk_builder_get_object (builder, "label-audio-formats-value"));
+	gtk_label_set_text (GTK_LABEL (widget), str->str);
+	g_string_free (str, TRUE);
+
 	g_object_unref (builder);
 }
 



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