hipo r148 - in trunk: . src



Author: bgarret
Date: Sun Feb 17 15:33:39 2008
New Revision: 148
URL: http://svn.gnome.org/viewvc/hipo?rev=148&view=rev

Log:
2008-02-17  Benoit Garret  <benoit garret_gnome gadz org>

        * configure.ac:
        * src/HipoMainWindow.cs:
        * src/Makefile.am:

        Build with the newest ipod-sharp. Dependencies now include
        ipod-sharp >= 0.8.0 and ndesk-dbus-glib >= 0.3



Modified:
   trunk/ChangeLog
   trunk/configure.ac
   trunk/src/HipoMainWindow.cs
   trunk/src/Makefile.am

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac	(original)
+++ trunk/configure.ac	Sun Feb 17 15:33:39 2008
@@ -14,14 +14,16 @@
 AC_SUBST(EXTRA_GLIB_LIBS)
 
 GTK_SHARP_REQUIRED=2.10
-IPOD_SHARP_REQUIRED=0.6.3
+IPOD_SHARP_REQUIRED=0.8.0
+NDESK_DBUS_GLIB_REQUIRED=0.3
 
 PKG_CHECK_MODULES(HIPO, 
 		gtk-sharp-2.0 >= $GTK_SHARP_REQUIRED \
 		gnome-sharp-2.0 >= $GTK_SHARP_REQUIRED \
 		glade-sharp-2.0 >= $GTK_SHARP_REQUIRED \
 		ipod-sharp >= $IPOD_SHARP_REQUIRED   \
-		ipod-sharp-ui >= $IPOD_SHARP_REQUIRED)
+		ipod-sharp-ui >= $IPOD_SHARP_REQUIRED \
+		ndesk-dbus-glib-1.0 >= $NDESK_DBUS_GLIB_REQUIRED)
 
 AC_SUBST(HIPO_LIBS)
 

Modified: trunk/src/HipoMainWindow.cs
==============================================================================
--- trunk/src/HipoMainWindow.cs	(original)
+++ trunk/src/HipoMainWindow.cs	Sun Feb 17 15:33:39 2008
@@ -30,6 +30,7 @@
 using Glade;
 using Gnome;
 using IPod;
+using NDesk.DBus;
 using Mono.Unix;
 
 namespace Hipo
@@ -206,6 +207,9 @@
 
 			SetDevice ();
 
+			// Even though we don't (currently) use dbus, ipod-sharp does.
+			// Without hooking up the glib main loop, some ipod-sharp functionality breaks.
+			BusG.Init ();
 			program.Run ();
 		}
 
@@ -1112,12 +1116,12 @@
 			deviceProperties.Title = String.Format (Catalog.GetString ("{0} Properties"), this.device.Name);
 			nameEntry.Text = this.device.Name;
 
-			serialLabel.Text = this.device.SerialNumber;
-			modelLabel.Text = this.device.ModelString;
-			generationLabel.Text = String.Format ("{0}", this.device.Generation);
-			capacityLabel.Text = FormatString ((double) this.device.VolumeSize);
-			mountLabel.Text = this.device.MountPoint;
-			spaceLabel.Text = String.Format ("{0}%", (int) ((double) device.VolumeUsed / (double) device.VolumeSize * 100));
+			serialLabel.Text = this.device.ProductionInfo.SerialNumber;
+			modelLabel.Text = this.device.ModelInfo.DeviceClass;
+			generationLabel.Text = String.Format ("{0}", this.device.ModelInfo.Generation);
+			capacityLabel.Text = FormatString ((double) this.device.VolumeInfo.Size);
+			mountLabel.Text = this.device.VolumeInfo.MountPoint;
+			spaceLabel.Text = String.Format ("{0}%", (int) ((double) device.VolumeInfo.SpaceUsed / (double) device.VolumeInfo.Size * 100));
 			firmwareLabel.Text = this.device.FirmwareVersion;
 
 
@@ -1337,10 +1341,10 @@
 			string used = null;
 			double percent;
 
-			capacity = FormatString ((double) this.device.VolumeSize);
-			used = FormatString ((double) this.device.VolumeUsed);
+			capacity = FormatString ((double) this.device.VolumeInfo.Size);
+			used = FormatString ((double) this.device.VolumeInfo.SpaceUsed);
 
-			percent = ((double) this.device.VolumeUsed * 100) / ((double) this.device.VolumeSize);
+			percent = ((double) this.device.VolumeInfo.SpaceUsed * 100) / ((double) this.device.VolumeInfo.Size);
                         /* space used in the device, example: used 15G of 60G */ 
 			ipodCapacityBar.Text = String.Format (Catalog.GetString ("Used {0} of {1}"), used, capacity);
 			ipodCapacityBar.Fraction = percent  / 100;
@@ -1357,54 +1361,8 @@
 
 		public static Gdk.Pixbuf GetDeviceIcon (IPod.Device device)
 		{
-			string deviceId = null;
+			string deviceId = device.ModelInfo.IconName;
 			
-			switch (device.Model) {
-
-			case DeviceModel.Color:
-				deviceId = "multimedia-player-ipod-standard-color";
-				break;
-			case DeviceModel.ColorU2:
-				deviceId = "multimedia-player-ipod-U2-color";
-				break;
-			case DeviceModel.RegularU2:
-				deviceId = "multimedia-player-ipod-U2-monochrome";
-				break;
-			case DeviceModel.Mini:
-				deviceId = "multimedia-player-ipod-mini-silver";
-				break;
-			case DeviceModel.MiniBlue:
-				deviceId = "multimedia-player-ipod-mini-blue";
-				break;
-			case DeviceModel.MiniPink:
-				deviceId = "multimedia-player-ipod-mini-pink";
-				break;
-			case DeviceModel.MiniGreen:
-				deviceId = "multimedia-player-ipod-mini-green";
-				break;
-			case DeviceModel.MiniGold:
-				deviceId = "multimedia-player-ipod-mini-gold";
-				break;
-			case DeviceModel.Shuffle:
-				deviceId = "multimedia-player-ipod-shuffle";
-				break;
-			case DeviceModel.NanoWhite:
-				deviceId = "multimedia-player-ipod-nano-white";
-				break;
-			case DeviceModel.NanoBlack:
-				deviceId = "multimedia-player-ipod-nano-black";
-				break;
-			case DeviceModel.VideoWhite:
-				deviceId = "multimedia-player-ipod-video-white";
-				break;
-			case DeviceModel.VideoBlack:
-				deviceId = "multimedia-player-ipod-video-black";
-				break;
-			default:
-				deviceId = "multimedia-player-ipod-standard-monochrome";
-				break;
-			}
-
 			Gdk.Pixbuf deviceIcon = Gtk.IconTheme.Default.LoadIcon (deviceId, 16, 0);
 			
 			return (deviceIcon);

Modified: trunk/src/Makefile.am
==============================================================================
--- trunk/src/Makefile.am	(original)
+++ trunk/src/Makefile.am	Sun Feb 17 15:33:39 2008
@@ -23,7 +23,7 @@
 	$(top_srcdir)/data/hipo-logo.png \
 	$(top_srcdir)/data/ipod.gif
 
-HIPO_ASSEMBLIES = -r:Mono.Posix -pkg:gtk-sharp-2.0,gnome-sharp-2.0,glade-sharp-2.0,ipod-sharp,ipod-sharp-ui -r:$(top_builddir)/taglib-sharp/taglib-sharp.dll
+HIPO_ASSEMBLIES = -r:Mono.Posix -pkg:gtk-sharp-2.0,gnome-sharp-2.0,glade-sharp-2.0,ipod-sharp,ipod-sharp-ui,ndesk-dbus-glib-1.0 -r:$(top_builddir)/taglib-sharp/taglib-sharp.dll
 
 ASSEMBLY = hipo.exe
 



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