rhythmbox r5998 - in trunk: . plugins/ipod



Author: teuf
Date: Sun Oct 26 19:49:52 2008
New Revision: 5998
URL: http://svn.gnome.org/viewvc/rhythmbox?rev=5998&view=rev

Log:
Patch from John Daiker from bug #317089, add ipod properties dialog

Added:
   trunk/plugins/ipod/ipod-info.glade
Modified:
   trunk/ChangeLog
   trunk/plugins/ipod/Makefile.am
   trunk/plugins/ipod/ipod-ui.xml
   trunk/plugins/ipod/rb-ipod-db.c
   trunk/plugins/ipod/rb-ipod-db.h
   trunk/plugins/ipod/rb-ipod-plugin.c
   trunk/plugins/ipod/rb-ipod-source.c
   trunk/plugins/ipod/rb-ipod-source.h

Modified: trunk/plugins/ipod/Makefile.am
==============================================================================
--- trunk/plugins/ipod/Makefile.am	(original)
+++ trunk/plugins/ipod/Makefile.am	Sun Oct 26 19:49:52 2008
@@ -46,7 +46,10 @@
 
 plugin_DATA = $(plugin_in_files:.rb-plugin.in=.rb-plugin)
 
-EXTRA_DIST = $(uixml_DATA) $(plugin_in_files)
+gladedir = $(plugindir)
+glade_DATA = ipod-info.glade
+
+EXTRA_DIST = $(uixml_DATA) $(plugin_in_files) $(glade_DATA)
 
 CLEANFILES = $(plugin_DATA)
 DISTCLEANFILES = $(plugin_DATA)

Added: trunk/plugins/ipod/ipod-info.glade
==============================================================================
--- (empty file)
+++ trunk/plugins/ipod/ipod-info.glade	Sun Oct 26 19:49:52 2008
@@ -0,0 +1,869 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
+<!--*- mode: xml -*-->
+<glade-interface>
+  <widget class="GtkDialog" id="ipod-information">
+    <property name="visible">True</property>
+    <property name="title" translatable="yes">iPod Properties</property>
+    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+    <property name="has_separator">False</property>
+    <child internal-child="vbox">
+      <widget class="GtkVBox" id="dialog-vbox1">
+        <property name="visible">True</property>
+        <child>
+          <widget class="GtkNotebook" id="notebook1">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="border_width">6</property>
+            <child>
+              <widget class="GtkVBox" id="vbox1">
+                <property name="visible">True</property>
+                <property name="border_width">12</property>
+                <child>
+                  <widget class="GtkFrame" id="frame1">
+                    <property name="visible">True</property>
+                    <property name="label_xalign">0</property>
+                    <property name="shadow_type">GTK_SHADOW_NONE</property>
+                    <child>
+                      <widget class="GtkTable" id="table-information">
+                        <property name="visible">True</property>
+                        <property name="border_width">12</property>
+                        <property name="n_rows">2</property>
+                        <property name="n_columns">2</property>
+                        <property name="column_spacing">12</property>
+                        <property name="row_spacing">6</property>
+                        <child>
+                          <widget class="GtkEntry" id="entry-ipod-name">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="invisible_char">*</property>
+                          </widget>
+                          <packing>
+                            <property name="left_attach">1</property>
+                            <property name="right_attach">2</property>
+                            <property name="y_options"></property>
+                          </packing>
+                        </child>
+                        <child>
+                          <widget class="GtkLabel" id="label-ipod-name">
+                            <property name="visible">True</property>
+                            <property name="xalign">0</property>
+                            <property name="label" translatable="yes">iPod Name:</property>
+                          </widget>
+                          <packing>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options"></property>
+                          </packing>
+                        </child>
+                        <child>
+                          <widget class="GtkLabel" id="label-ipod-usage">
+                            <property name="visible">True</property>
+                            <property name="xalign">0</property>
+                            <property name="label" translatable="yes">Volume Usage:</property>
+                          </widget>
+                          <packing>
+                            <property name="top_attach">2</property>
+                            <property name="bottom_attach">3</property>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options"></property>
+                          </packing>
+                        </child>
+                        <child>
+                          <widget class="GtkProgressBar" id="progressbar-ipod-usage">
+                            <property name="visible">True</property>
+                            <property name="pulse_step">0.10000000149</property>
+                          </widget>
+                          <packing>
+                            <property name="left_attach">1</property>
+                            <property name="right_attach">2</property>
+                            <property name="top_attach">2</property>
+                            <property name="bottom_attach">3</property>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options"></property>
+                          </packing>
+                        </child>
+                      </widget>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="label-frame-information">
+                        <property name="visible">True</property>
+                        <property name="label" translatable="yes">&lt;b&gt;Information&lt;/b&gt;</property>
+                        <property name="use_markup">True</property>
+                      </widget>
+                      <packing>
+                        <property name="type">label_item</property>
+                      </packing>
+                    </child>
+                  </widget>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkFrame" id="frame3">
+                    <property name="visible">True</property>
+                    <property name="label_xalign">0</property>
+                    <property name="shadow_type">GTK_SHADOW_NONE</property>
+                    <child>
+                      <widget class="GtkTable" id="table-content">
+                        <property name="visible">True</property>
+                        <property name="border_width">12</property>
+                        <property name="n_rows">2</property>
+                        <property name="n_columns">2</property>
+                        <property name="column_spacing">12</property>
+                        <property name="row_spacing">6</property>
+                        <child>
+                          <widget class="GtkLabel" id="label-number-playlist-number">
+                            <property name="visible">True</property>
+                            <property name="xalign">0</property>
+                            <property name="justify">GTK_JUSTIFY_RIGHT</property>
+                          </widget>
+                          <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>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options"></property>
+                          </packing>
+                        </child>
+                        <child>
+                          <widget class="GtkLabel" id="label-number-track-number">
+                            <property name="visible">True</property>
+                            <property name="xalign">0</property>
+                            <property name="justify">GTK_JUSTIFY_RIGHT</property>
+                          </widget>
+                          <packing>
+                            <property name="left_attach">1</property>
+                            <property name="right_attach">2</property>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options"></property>
+                          </packing>
+                        </child>
+                        <child>
+                          <widget class="GtkLabel" id="label-number-playlist">
+                            <property name="visible">True</property>
+                            <property name="xalign">0</property>
+                            <property name="label" translatable="yes">Number of Playlists:</property>
+                          </widget>
+                          <packing>
+                            <property name="top_attach">1</property>
+                            <property name="bottom_attach">2</property>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options"></property>
+                          </packing>
+                        </child>
+                        <child>
+                          <widget class="GtkLabel" id="label-number-tracks">
+                            <property name="visible">True</property>
+                            <property name="xalign">0</property>
+                            <property name="label" translatable="yes">Number of Tracks:</property>
+                          </widget>
+                          <packing>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options"></property>
+                          </packing>
+                        </child>
+                      </widget>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="label-frame-content">
+                        <property name="visible">True</property>
+                        <property name="label" translatable="yes">&lt;b&gt;Content&lt;/b&gt;</property>
+                        <property name="use_markup">True</property>
+                      </widget>
+                      <packing>
+                        <property name="type">label_item</property>
+                      </packing>
+                    </child>
+                  </widget>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </widget>
+            </child>
+            <child>
+              <widget class="GtkLabel" id="label-notebook-basic">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">Basic</property>
+              </widget>
+              <packing>
+                <property name="type">tab</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkFrame" id="frame2">
+                <property name="visible">True</property>
+                <property name="border_width">12</property>
+                <property name="label_xalign">0</property>
+                <property name="shadow_type">GTK_SHADOW_NONE</property>
+                <child>
+                  <widget class="GtkTable" id="table2">
+                    <property name="visible">True</property>
+                    <property name="border_width">12</property>
+                    <property name="n_rows">6</property>
+                    <property name="n_columns">2</property>
+                    <property name="column_spacing">12</property>
+                    <property name="row_spacing">6</property>
+                    <child>
+                      <widget class="GtkLabel" id="label-device-node-value">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                      </widget>
+                      <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>
+                        <property name="y_options"></property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="label-mount-point-value">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                      </widget>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="right_attach">2</property>
+                        <property name="y_options"></property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="label-device-node">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Device Node:</property>
+                      </widget>
+                      <packing>
+                        <property name="top_attach">1</property>
+                        <property name="bottom_attach">2</property>
+                        <property name="x_options">GTK_FILL</property>
+                        <property name="y_options"></property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="label-mount-point">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Mount Point:</property>
+                      </widget>
+                      <packing>
+                        <property name="x_options">GTK_FILL</property>
+                        <property name="y_options"></property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="label-database-version">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Database Version:</property>
+                      </widget>
+                      <packing>
+                        <property name="top_attach">5</property>
+                        <property name="bottom_attach">6</property>
+                        <property name="x_options">GTK_FILL</property>
+                        <property name="y_options"></property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="label-database-version-value">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                      </widget>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="right_attach">2</property>
+                        <property name="top_attach">5</property>
+                        <property name="bottom_attach">6</property>
+                        <property name="y_options"></property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="label-firmware-version">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Firmware Version:</property>
+                      </widget>
+                      <packing>
+                        <property name="top_attach">4</property>
+                        <property name="bottom_attach">5</property>
+                        <property name="x_options">GTK_FILL</property>
+                        <property name="y_options"></property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="label-firmware-version-value">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                      </widget>
+                      <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>
+                        <property name="y_options"></property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="label-serial-number">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Serial Number:</property>
+                      </widget>
+                      <packing>
+                        <property name="top_attach">3</property>
+                        <property name="bottom_attach">4</property>
+                        <property name="x_options">GTK_FILL</property>
+                        <property name="y_options"></property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="label-serial-number-value">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                      </widget>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="right_attach">2</property>
+                        <property name="top_attach">3</property>
+                        <property name="bottom_attach">4</property>
+                        <property name="y_options"></property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="label-ipod-mode">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Model:</property>
+                      </widget>
+                      <packing>
+                        <property name="top_attach">2</property>
+                        <property name="bottom_attach">3</property>
+                        <property name="y_options"></property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="label-ipod-model-value">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                      </widget>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="right_attach">2</property>
+                        <property name="top_attach">2</property>
+                        <property name="bottom_attach">3</property>
+                        <property name="x_options">GTK_FILL</property>
+                        <property name="y_options"></property>
+                      </packing>
+                    </child>
+                  </widget>
+                </child>
+                <child>
+                  <widget class="GtkLabel" id="label-frame-system">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">&lt;b&gt;System&lt;/b&gt;</property>
+                    <property name="use_markup">True</property>
+                  </widget>
+                  <packing>
+                    <property name="type">label_item</property>
+                  </packing>
+                </child>
+              </widget>
+              <packing>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkLabel" id="label-notebook-advanced">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">Advanced</property>
+              </widget>
+              <packing>
+                <property name="type">tab</property>
+                <property name="position">1</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child internal-child="action_area">
+          <widget class="GtkHButtonBox" id="dialog-action_area1">
+            <property name="visible">True</property>
+            <property name="layout_style">GTK_BUTTONBOX_END</property>
+            <child>
+              <widget class="GtkButton" id="closebutton1">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="label">gtk-close</property>
+                <property name="use_stock">True</property>
+                <property name="response_id">-7</property>
+              </widget>
+            </child>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+            <property name="pack_type">GTK_PACK_END</property>
+          </packing>
+        </child>
+      </widget>
+    </child>
+  </widget>
+</glade-interface>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
+<!--*- mode: xml -*-->
+<glade-interface>
+  <widget class="GtkDialog" id="ipod-information">
+    <property name="visible">True</property>
+    <property name="title" translatable="yes">iPod Properties</property>
+    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+    <property name="has_separator">False</property>
+    <child internal-child="vbox">
+      <widget class="GtkVBox" id="dialog-vbox1">
+        <property name="visible">True</property>
+        <child>
+          <widget class="GtkNotebook" id="notebook1">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="border_width">6</property>
+            <child>
+              <widget class="GtkVBox" id="vbox1">
+                <property name="visible">True</property>
+                <property name="border_width">12</property>
+                <child>
+                  <widget class="GtkFrame" id="frame1">
+                    <property name="visible">True</property>
+                    <property name="label_xalign">0</property>
+                    <property name="shadow_type">GTK_SHADOW_NONE</property>
+                    <child>
+                      <widget class="GtkTable" id="table-information">
+                        <property name="visible">True</property>
+                        <property name="border_width">12</property>
+                        <property name="n_rows">3</property>
+                        <property name="n_columns">2</property>
+                        <property name="column_spacing">12</property>
+                        <property name="row_spacing">6</property>
+                        <child>
+                          <widget class="GtkEntry" id="entry-ipod-owner">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="invisible_char">*</property>
+                          </widget>
+                          <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>
+                            <property name="y_options"></property>
+                          </packing>
+                        </child>
+                        <child>
+                          <widget class="GtkEntry" id="entry-ipod-name">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="invisible_char">*</property>
+                          </widget>
+                          <packing>
+                            <property name="left_attach">1</property>
+                            <property name="right_attach">2</property>
+                            <property name="y_options"></property>
+                          </packing>
+                        </child>
+                        <child>
+                          <widget class="GtkLabel" id="label-ipod-owner">
+                            <property name="visible">True</property>
+                            <property name="xalign">0</property>
+                            <property name="label" translatable="yes">Your Name:</property>
+                          </widget>
+                          <packing>
+                            <property name="top_attach">1</property>
+                            <property name="bottom_attach">2</property>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options"></property>
+                          </packing>
+                        </child>
+                        <child>
+                          <widget class="GtkLabel" id="label-ipod-name">
+                            <property name="visible">True</property>
+                            <property name="xalign">0</property>
+                            <property name="label" translatable="yes">iPod Name:</property>
+                          </widget>
+                          <packing>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options"></property>
+                          </packing>
+                        </child>
+                        <child>
+                          <widget class="GtkLabel" id="label-ipod-usage">
+                            <property name="visible">True</property>
+                            <property name="xalign">0</property>
+                            <property name="label" translatable="yes">Volume Usage:</property>
+                          </widget>
+                          <packing>
+                            <property name="top_attach">2</property>
+                            <property name="bottom_attach">3</property>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options"></property>
+                          </packing>
+                        </child>
+                        <child>
+                          <widget class="GtkProgressBar" id="progressbar-ipod-usage">
+                            <property name="visible">True</property>
+                            <property name="pulse_step">0.10000000149</property>
+                          </widget>
+                          <packing>
+                            <property name="left_attach">1</property>
+                            <property name="right_attach">2</property>
+                            <property name="top_attach">2</property>
+                            <property name="bottom_attach">3</property>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options"></property>
+                          </packing>
+                        </child>
+                      </widget>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="label-frame-information">
+                        <property name="visible">True</property>
+                        <property name="label" translatable="yes">&lt;b&gt;Information&lt;/b&gt;</property>
+                        <property name="use_markup">True</property>
+                      </widget>
+                      <packing>
+                        <property name="type">label_item</property>
+                      </packing>
+                    </child>
+                  </widget>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkFrame" id="frame3">
+                    <property name="visible">True</property>
+                    <property name="label_xalign">0</property>
+                    <property name="shadow_type">GTK_SHADOW_NONE</property>
+                    <child>
+                      <widget class="GtkTable" id="table-content">
+                        <property name="visible">True</property>
+                        <property name="border_width">12</property>
+                        <property name="n_rows">2</property>
+                        <property name="n_columns">2</property>
+                        <property name="column_spacing">12</property>
+                        <property name="row_spacing">6</property>
+                        <child>
+                          <widget class="GtkLabel" id="label-number-playlist-number">
+                            <property name="visible">True</property>
+                            <property name="xalign">0</property>
+                            <property name="justify">GTK_JUSTIFY_RIGHT</property>
+                          </widget>
+                          <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>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options"></property>
+                          </packing>
+                        </child>
+                        <child>
+                          <widget class="GtkLabel" id="label-number-track-number">
+                            <property name="visible">True</property>
+                            <property name="xalign">0</property>
+                            <property name="justify">GTK_JUSTIFY_RIGHT</property>
+                          </widget>
+                          <packing>
+                            <property name="left_attach">1</property>
+                            <property name="right_attach">2</property>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options"></property>
+                          </packing>
+                        </child>
+                        <child>
+                          <widget class="GtkLabel" id="label-number-playlist">
+                            <property name="visible">True</property>
+                            <property name="xalign">0</property>
+                            <property name="label" translatable="yes">Number of Playlists:</property>
+                          </widget>
+                          <packing>
+                            <property name="top_attach">1</property>
+                            <property name="bottom_attach">2</property>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options"></property>
+                          </packing>
+                        </child>
+                        <child>
+                          <widget class="GtkLabel" id="label-number-tracks">
+                            <property name="visible">True</property>
+                            <property name="xalign">0</property>
+                            <property name="label" translatable="yes">Number of Tracks:</property>
+                          </widget>
+                          <packing>
+                            <property name="x_options">GTK_FILL</property>
+                            <property name="y_options"></property>
+                          </packing>
+                        </child>
+                      </widget>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="label-frame-content">
+                        <property name="visible">True</property>
+                        <property name="label" translatable="yes">&lt;b&gt;Content&lt;/b&gt;</property>
+                        <property name="use_markup">True</property>
+                      </widget>
+                      <packing>
+                        <property name="type">label_item</property>
+                      </packing>
+                    </child>
+                  </widget>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </widget>
+            </child>
+            <child>
+              <widget class="GtkLabel" id="label-notebook-basic">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">Basic</property>
+              </widget>
+              <packing>
+                <property name="type">tab</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkFrame" id="frame2">
+                <property name="visible">True</property>
+                <property name="border_width">12</property>
+                <property name="label_xalign">0</property>
+                <property name="shadow_type">GTK_SHADOW_NONE</property>
+                <child>
+                  <widget class="GtkTable" id="table2">
+                    <property name="visible">True</property>
+                    <property name="border_width">12</property>
+                    <property name="n_rows">6</property>
+                    <property name="n_columns">2</property>
+                    <property name="column_spacing">12</property>
+                    <property name="row_spacing">6</property>
+                    <child>
+                      <widget class="GtkLabel" id="label-device-node-value">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                      </widget>
+                      <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>
+                        <property name="y_options"></property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="label-mount-point-value">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                      </widget>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="right_attach">2</property>
+                        <property name="y_options"></property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="label-device-node">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Device Node:</property>
+                      </widget>
+                      <packing>
+                        <property name="top_attach">1</property>
+                        <property name="bottom_attach">2</property>
+                        <property name="x_options">GTK_FILL</property>
+                        <property name="y_options"></property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="label-mount-point">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Mount Point:</property>
+                      </widget>
+                      <packing>
+                        <property name="x_options">GTK_FILL</property>
+                        <property name="y_options"></property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="label-database-version">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Database Version:</property>
+                      </widget>
+                      <packing>
+                        <property name="top_attach">5</property>
+                        <property name="bottom_attach">6</property>
+                        <property name="x_options">GTK_FILL</property>
+                        <property name="y_options"></property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="label-database-version-value">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                      </widget>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="right_attach">2</property>
+                        <property name="top_attach">5</property>
+                        <property name="bottom_attach">6</property>
+                        <property name="y_options"></property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="label-firmware-version">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Firmware Version:</property>
+                      </widget>
+                      <packing>
+                        <property name="top_attach">4</property>
+                        <property name="bottom_attach">5</property>
+                        <property name="x_options">GTK_FILL</property>
+                        <property name="y_options"></property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="label-firmware-version-value">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                      </widget>
+                      <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>
+                        <property name="y_options"></property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="label-serial-number">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Serial Number:</property>
+                      </widget>
+                      <packing>
+                        <property name="top_attach">3</property>
+                        <property name="bottom_attach">4</property>
+                        <property name="x_options">GTK_FILL</property>
+                        <property name="y_options"></property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="label-serial-number-value">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                      </widget>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="right_attach">2</property>
+                        <property name="top_attach">3</property>
+                        <property name="bottom_attach">4</property>
+                        <property name="y_options"></property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="label-ipod-mode">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Model:</property>
+                      </widget>
+                      <packing>
+                        <property name="top_attach">2</property>
+                        <property name="bottom_attach">3</property>
+                        <property name="y_options"></property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="label-ipod-model-value">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                      </widget>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="right_attach">2</property>
+                        <property name="top_attach">2</property>
+                        <property name="bottom_attach">3</property>
+                        <property name="x_options">GTK_FILL</property>
+                        <property name="y_options"></property>
+                      </packing>
+                    </child>
+                  </widget>
+                </child>
+                <child>
+                  <widget class="GtkLabel" id="label-frame-system">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">&lt;b&gt;System&lt;/b&gt;</property>
+                    <property name="use_markup">True</property>
+                  </widget>
+                  <packing>
+                    <property name="type">label_item</property>
+                  </packing>
+                </child>
+              </widget>
+              <packing>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkLabel" id="label-notebook-advanced">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">Advanced</property>
+              </widget>
+              <packing>
+                <property name="type">tab</property>
+                <property name="position">1</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child internal-child="action_area">
+          <widget class="GtkHButtonBox" id="dialog-action_area1">
+            <property name="visible">True</property>
+            <property name="layout_style">GTK_BUTTONBOX_END</property>
+            <child>
+              <widget class="GtkButton" id="closebutton1">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="label">gtk-close</property>
+                <property name="use_stock">True</property>
+                <property name="response_id">-7</property>
+              </widget>
+            </child>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+            <property name="pack_type">GTK_PACK_END</property>
+          </packing>
+        </child>
+      </widget>
+    </child>
+  </widget>
+</glade-interface>

Modified: trunk/plugins/ipod/ipod-ui.xml
==============================================================================
--- trunk/plugins/ipod/ipod-ui.xml	(original)
+++ trunk/plugins/ipod/ipod-ui.xml	Sun Oct 26 19:49:52 2008
@@ -1,9 +1,11 @@
 <ui>
   <popup name="iPodSourcePopup">
-    <menuitem name="iPodSrcPopupRename" action="iPodSourceRename"/>
+    <placeholder name="iPodSrcPopupRename" action="iPodSourceRename"/>
+    <menuitem name="iPodSrcPopupPlaylistNew" action="iPodSourcePlaylistNew"/>
+    <separator />
     <menuitem name="iPodSrcPopupEject" action="RemovableSourceEject"/>
     <separator />
-    <menuitem name="iPodSrcPopupPlaylistNew" action="iPodSourcePlaylistNew"/>
+    <menuitem name="iPodSrcPopupProperties" action="iPodProperties"/>
   </popup>
   <popup name="iPodPlaylistSourcePopup">
     <menuitem name="iPodPlaylistSrcPopupRename" action="iPodPlaylistSourceRename"/>

Modified: trunk/plugins/ipod/rb-ipod-db.c
==============================================================================
--- trunk/plugins/ipod/rb-ipod-db.c	(original)
+++ trunk/plugins/ipod/rb-ipod-db.c	Sun Oct 26 19:49:52 2008
@@ -900,3 +900,10 @@
 	return priv->itdb->device;
 }
 
+guint32
+rb_ipod_db_get_database_version (RbIpodDb *ipod_db)
+{
+	RbIpodDbPrivate *priv = IPOD_DB_GET_PRIVATE (ipod_db);
+
+	return priv->itdb->version;
+}

Modified: trunk/plugins/ipod/rb-ipod-db.h
==============================================================================
--- trunk/plugins/ipod/rb-ipod-db.h	(original)
+++ trunk/plugins/ipod/rb-ipod-db.h	Sun Oct 26 19:49:52 2008
@@ -77,4 +77,5 @@
 GList *rb_ipod_db_get_tracks (RbIpodDb *ipod_db);
 const char *rb_ipod_db_get_mount_path (RbIpodDb *ipod_db);
 Itdb_Device *rb_ipod_db_get_device (RbIpodDb *ipod_db);
+guint32 rb_ipod_db_get_database_version (RbIpodDb *ipod_db);
 #endif

Modified: trunk/plugins/ipod/rb-ipod-plugin.c
==============================================================================
--- trunk/plugins/ipod/rb-ipod-plugin.c	(original)
+++ trunk/plugins/ipod/rb-ipod-plugin.c	Sun Oct 26 19:49:52 2008
@@ -46,6 +46,7 @@
 #include "rb-file-helpers.h"
 #include "rb-util.h"
 #include "rb-shell.h"
+#include "rb-stock-icons.h"
 
 
 #define RB_TYPE_IPOD_PLUGIN		(rb_ipod_plugin_get_type ())
@@ -91,6 +92,8 @@
 					RBIpodPlugin *plugin);
 static void  rb_ipod_plugin_cmd_playlist_delete (GtkAction *action,
 					RBIpodPlugin *plugin);
+static void  rb_ipod_plugin_cmd_properties (GtkAction *action,
+					    RBIpodPlugin *plugin);
 
 RB_PLUGIN_REGISTER(RBIpodPlugin, rb_ipod_plugin)
 
@@ -100,7 +103,10 @@
 	{ "iPodSourceRename", NULL, N_("_Rename"), NULL,
 	  N_("Rename iPod"),
 	  G_CALLBACK (rb_ipod_plugin_cmd_rename) },
-	{ "iPodSourcePlaylistNew", NULL, N_("_New Playlist"), NULL,
+	{ "iPodProperties", GTK_STOCK_PROPERTIES, N_("_Properties"), NULL,
+	  N_("Display iPod properties"),
+	  G_CALLBACK (rb_ipod_plugin_cmd_properties) },
+	{ "iPodSourcePlaylistNew", RB_STOCK_PLAYLIST_NEW, N_("_New Playlist"), NULL,
 	  N_("Add new playlist to iPod"),
 	  G_CALLBACK (rb_ipod_plugin_cmd_playlist_new) },
 	{ "iPodPlaylistSourceRename", NULL, N_("_Rename"), NULL,
@@ -240,6 +246,24 @@
 }
 
 static void
+rb_ipod_plugin_cmd_properties (GtkAction *action,
+			       RBIpodPlugin *plugin)
+{
+	RBSource *source = NULL;
+
+	g_object_get (G_OBJECT (plugin->shell), 
+		      "selected-source", &source,
+		      NULL);
+	if ((source == NULL) || !RB_IS_IPOD_SOURCE (source)) {
+		g_critical ("got iPodSourceProperties action for non-ipod source");
+		return;
+	}
+
+	rb_ipod_source_show_properties (RB_IPOD_SOURCE (source));
+	g_object_unref (G_OBJECT (source));
+}
+ 
+static void
 rb_ipod_plugin_cmd_rename (GtkAction *action,
 			   RBIpodPlugin *plugin)
 {

Modified: trunk/plugins/ipod/rb-ipod-source.c
==============================================================================
--- trunk/plugins/ipod/rb-ipod-source.c	(original)
+++ trunk/plugins/ipod/rb-ipod-source.c	Sun Oct 26 19:49:52 2008
@@ -46,6 +46,7 @@
 #include "rb-ipod-db.h"
 #include "rb-debug.h"
 #include "rb-file-helpers.h"
+#include "rb-glade-helpers.h"
 #include "rb-plugin.h"
 #include "rb-removable-media-manager.h"
 #include "rb-ipod-static-playlist-source.h"
@@ -69,6 +70,7 @@
 static void rb_ipod_load_songs (RBiPodSource *source);
 static void impl_delete_thyself (RBSource *source);
 static GList* impl_get_ui_actions (RBSource *source);
+
 #ifdef HAVE_HAL
 static gboolean hal_udi_is_ipod (const char *udi);
 #endif
@@ -1710,3 +1712,155 @@
 	rb_ipod_db_remove_playlist (priv->ipod_db, rb_ipod_static_playlist_source_get_itdb_playlist (playlist_source));
 }
 
+static void
+rb_ipod_info_response_cb (GtkDialog *dialog,
+ 			  int response_id,
+ 			  RBiPodSource *source)
+{
+	if (response_id == GTK_RESPONSE_CLOSE) {
+ 		
+		gtk_widget_destroy (GTK_WIDGET (dialog));
+	}
+}
+
+static gboolean
+ipod_name_changed_cb (GtkWidget     *widget,
+ 		      GdkEventFocus *event,
+ 		      gpointer       user_data) 
+{
+	g_object_set (RB_SOURCE (user_data), "name", 
+		      gtk_entry_get_text (GTK_ENTRY (widget)),
+		      NULL);
+	return FALSE;
+}
+
+static guint64 get_fs_property (const char *mountpoint, const char *attr)
+{
+        GFile *root;
+        GFileInfo *info;
+        guint64 value;
+
+        root = g_file_new_for_path (mountpoint);
+        info = g_file_query_filesystem_info (root, attr, NULL, NULL);
+        g_object_unref (G_OBJECT (root));
+        if (info == NULL) {
+                return 0;
+        }
+        if (!g_file_info_has_attribute (info, attr)) {
+                g_object_unref (G_OBJECT (info));
+                return 0;
+        }
+        value = g_file_info_get_attribute_uint64 (info, attr);
+        g_object_unref (G_OBJECT (info));
+
+        return value;
+}
+
+static guint64
+get_ipod_capacity (const char *mountpoint)
+{
+        return  get_fs_property (mountpoint, G_FILE_ATTRIBUTE_FILESYSTEM_SIZE);
+}
+
+static guint64
+get_ipod_free_space (const char *mountpoint)
+{
+	return get_fs_property (mountpoint, G_FILE_ATTRIBUTE_FILESYSTEM_FREE);
+}
+
+static char *
+get_ipod_device (RBiPodSource *source)
+{
+        GMount *mount;
+        GVolume *volume;
+        char *device;
+
+        g_object_get (RB_SOURCE (source), "mount", &mount, NULL);
+        volume = g_mount_get_volume (mount);
+        device = g_volume_get_identifier (volume,
+                                          G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE);
+        g_object_unref (G_OBJECT (volume));
+        g_object_unref (G_OBJECT (mount));
+
+        return device;
+}
+
+void
+rb_ipod_source_show_properties (RBiPodSource *source)
+{
+	GladeXML *xml;
+	GtkWidget *dialog;
+	GtkWidget *label;
+	char *text;
+	const gchar *mp;
+	char *used;
+	char *capacity;
+ 	RBiPodSourcePrivate *priv = IPOD_SOURCE_GET_PRIVATE (source);
+	Itdb_Device *ipod_dev;
+
+	ipod_dev = rb_ipod_db_get_device(priv->ipod_db);
+
+	xml = rb_glade_xml_new ("ipod-info.glade", "ipod-information", NULL);
+ 	if (xml == NULL) {
+ 		rb_debug ("Couldn't load ipod-info.glade");
+ 		return;
+ 	}
+	
+ 	dialog = glade_xml_get_widget (xml, "ipod-information");
+ 	g_signal_connect_object (G_OBJECT (dialog),
+ 				 "response",
+ 				 G_CALLBACK (rb_ipod_info_response_cb),
+ 				 source, 0);
+ 
+ 	label = glade_xml_get_widget (xml, "label-number-track-number");
+ 	text = g_strdup_printf ("%u", g_list_length ( rb_ipod_db_get_tracks(priv->ipod_db) ));
+ 	gtk_label_set_text (GTK_LABEL (label), text);
+ 	g_free (text);
+ 
+ 	label = glade_xml_get_widget (xml, "entry-ipod-name");
+ 	gtk_entry_set_text (GTK_ENTRY (label), rb_ipod_db_get_ipod_name(priv->ipod_db));
+ 	g_signal_connect (G_OBJECT (label), "focus-out-event", 
+ 			  (GCallback)ipod_name_changed_cb, source);
+ 
+ 	label = glade_xml_get_widget (xml, "label-number-playlist-number");
+ 	text = g_strdup_printf ("%u", g_list_length(rb_ipod_db_get_playlists(priv->ipod_db)));
+ 	gtk_label_set_text (GTK_LABEL (label), text);
+ 	g_free (text);
+ 
+ 	label = glade_xml_get_widget (xml, "label-mount-point-value");
+	mp = rb_ipod_db_get_mount_path (priv->ipod_db);
+ 	gtk_label_set_text (GTK_LABEL (label), mp);
+
+	label = glade_xml_get_widget (xml, "progressbar-ipod-usage");
+	used = g_format_size_for_display (get_ipod_capacity (mp) - get_ipod_free_space (mp));
+	capacity = g_format_size_for_display (get_ipod_capacity(mp));
+	gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (label), 
+				       (double)(get_ipod_capacity (mp) - get_ipod_free_space (mp))/(double)get_ipod_capacity (mp));
+	text = g_strdup_printf("%s of %s", used, capacity);
+	gtk_progress_bar_set_text (GTK_PROGRESS_BAR (label), text);
+	g_free (text);
+	g_free (capacity);
+	g_free (used);
+
+	label = glade_xml_get_widget (xml, "label-device-node-value");
+	text = get_ipod_device (source);
+	gtk_label_set_text (GTK_LABEL (label), text);
+	g_free (text);
+
+ 	label = glade_xml_get_widget (xml, "label-ipod-model-value");
+ 	gtk_label_set_text (GTK_LABEL (label), itdb_device_get_sysinfo(ipod_dev, "ModelNumStr"));
+
+ 	label = glade_xml_get_widget (xml, "label-database-version-value");
+	text = g_strdup_printf ("%u", rb_ipod_db_get_database_version(priv->ipod_db));
+ 	gtk_label_set_text (GTK_LABEL (label), text);
+	g_free(text);
+
+ 	label = glade_xml_get_widget (xml, "label-serial-number-value");
+	gtk_label_set_text (GTK_LABEL (label), itdb_device_get_sysinfo(ipod_dev, "pszSerialNumber"));
+
+ 	label = glade_xml_get_widget (xml, "label-firmware-version-value");
+	gtk_label_set_text (GTK_LABEL (label), itdb_device_get_sysinfo(ipod_dev, "VisibleBuildID"));
+
+ 	gtk_widget_show (GTK_WIDGET (dialog));
+}
+

Modified: trunk/plugins/ipod/rb-ipod-source.h
==============================================================================
--- trunk/plugins/ipod/rb-ipod-source.h	(original)
+++ trunk/plugins/ipod/rb-ipod-source.h	Sun Oct 26 19:49:52 2008
@@ -63,6 +63,8 @@
 void			rb_ipod_source_remove_playlist	(RBiPodSource *ipod_source,
 							 RBSource *source);
 
+void			rb_ipod_source_show_properties	(RBiPodSource *source);
+
 G_END_DECLS
 
 #endif /* __RB_IPOD_SOURCE_H */



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