[rhythmbox] mtp: add audio format descriptions to the properties dialog



commit 4d1d0ee2adb5d83d8210f9ec108c89b60e423710
Author: Jonathan Matthew <jonathan d14n org>
Date:   Thu Feb 11 22:04:15 2010 +1000

    mtp: add audio format descriptions to the properties dialog

 plugins/mtpdevice/mtp-info.ui     |   28 +++++++++++++++++++++++++++-
 plugins/mtpdevice/rb-mtp-source.c |   17 +++++++++++++++++
 2 files changed, 44 insertions(+), 1 deletions(-)
---
diff --git a/plugins/mtpdevice/mtp-info.ui b/plugins/mtpdevice/mtp-info.ui
index c8a5222..6b16424 100644
--- a/plugins/mtpdevice/mtp-info.ui
+++ b/plugins/mtpdevice/mtp-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">4</property>
+        <property name="n_rows">5</property>
         <property name="n_columns">2</property>
         <property name="column_spacing">12</property>
         <property name="row_spacing">6</property>
@@ -217,6 +217,32 @@
             <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">4</property>
+            <property name="bottom_attach">5</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkLabel" id="label-audio-formats-value">
+            <property name="visible">True</property>
+            <property name="xalign">0.0099999997764825821</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">4</property>
+            <property name="bottom_attach">5</property>
+          </packing>
+        </child>
       </object>
     </child>
     <child type="label">
diff --git a/plugins/mtpdevice/rb-mtp-source.c b/plugins/mtpdevice/rb-mtp-source.c
index 8510783..4879929 100644
--- a/plugins/mtpdevice/rb-mtp-source.c
+++ b/plugins/mtpdevice/rb-mtp-source.c
@@ -1164,6 +1164,9 @@ impl_show_properties (RBMediaPlayerSource *source, GtkWidget *info_box, GtkWidge
 	char *builder_file;
 	RBPlugin *plugin;
 	char *text;
+	GList *output_formats;
+	GList *t;
+	GString *str;
 
 	g_object_get (source, "plugin", &plugin, NULL);
 	builder_file = rb_plugin_find_file (plugin, "mtp-info.ui");
@@ -1234,6 +1237,20 @@ impl_show_properties (RBMediaPlayerSource *source, GtkWidget *info_box, GtkWidge
 	widget = GTK_WIDGET (gtk_builder_get_object (builder, "label-manufacturer-value"));
 	gtk_label_set_text (GTK_LABEL (widget), priv->manufacturer);
 
+	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]