banshee r3896 - in trunk/banshee: . src/Dap/Banshee.Dap.Ipod/Banshee.Dap.Ipod
- From: abock svn gnome org
- To: svn-commits-list gnome org
- Subject: banshee r3896 - in trunk/banshee: . src/Dap/Banshee.Dap.Ipod/Banshee.Dap.Ipod
- Date: Tue, 6 May 2008 20:04:17 +0100 (BST)
Author: abock
Date: Tue May 6 19:04:17 2008
New Revision: 3896
URL: http://svn.gnome.org/viewvc/banshee?rev=3896&view=rev
Log:
2008-05-06 Aaron Bockover <abock gnome org>
* src/Dap/Banshee.Dap.Ipod/Banshee.Dap.Ipod/IpodSource.cs: Make the
progress notification for iPod syncing much better
Modified:
trunk/banshee/ChangeLog
trunk/banshee/src/Dap/Banshee.Dap.Ipod/Banshee.Dap.Ipod/IpodSource.cs
Modified: trunk/banshee/src/Dap/Banshee.Dap.Ipod/Banshee.Dap.Ipod/IpodSource.cs
==============================================================================
--- trunk/banshee/src/Dap/Banshee.Dap.Ipod/Banshee.Dap.Ipod/IpodSource.cs (original)
+++ trunk/banshee/src/Dap/Banshee.Dap.Ipod/Banshee.Dap.Ipod/IpodSource.cs Tue May 6 19:04:17 2008
@@ -368,7 +368,7 @@
Application.IdleTimeoutRemove (sync_timeout_id);
}
- sync_timeout_id = Application.RunTimeout (5000, PerformSync);
+ sync_timeout_id = Application.RunTimeout (1000, PerformSync);
}
}
@@ -458,25 +458,57 @@
}
try {
+ ipod_device.TrackDatabase.SaveStarted += OnIpodDatabaseSaveStarted;
+ ipod_device.TrackDatabase.SaveEnded += OnIpodDatabaseSaveEnded;
ipod_device.TrackDatabase.SaveProgressChanged += OnIpodDatabaseSaveProgressChanged;
ipod_device.Save ();
} catch (Exception e) {
Log.Exception ("Failed to save iPod database", e);
} finally {
+ ipod_device.TrackDatabase.SaveStarted -= OnIpodDatabaseSaveStarted;
+ ipod_device.TrackDatabase.SaveEnded -= OnIpodDatabaseSaveEnded;
ipod_device.TrackDatabase.SaveProgressChanged -= OnIpodDatabaseSaveProgressChanged;
}
}
+ private UserJob sync_user_job;
+
+ private void OnIpodDatabaseSaveStarted (object o, EventArgs args)
+ {
+ DisposeSyncUserJob ();
+
+ sync_user_job = new UserJob (Catalog.GetString ("Syncing iPod"),
+ Catalog.GetString ("Preparing to synchronize..."), GetIconNames ());
+ sync_user_job.Register ();
+ }
+
+ private void OnIpodDatabaseSaveEnded (object o, EventArgs args)
+ {
+ DisposeSyncUserJob ();
+ }
+
+ private void DisposeSyncUserJob ()
+ {
+ if (sync_user_job != null) {
+ sync_user_job.Finish ();
+ sync_user_job = null;
+ }
+ }
+
private void OnIpodDatabaseSaveProgressChanged (object o, IPod.TrackSaveProgressArgs args)
{
double progress = args.CurrentTrack == null ? 0.0 : args.TotalProgress;
string message = args.CurrentTrack == null
- ? Catalog.GetString ("Waiting for Media")
+ ? Catalog.GetString ("Updating...")
: String.Format ("{0} - {1}", args.CurrentTrack.Artist, args.CurrentTrack.Title);
- AddTrackJob.Title = Catalog.GetString ("Syncing iPod");
- AddTrackJob.Status = message;
- AddTrackJob.Progress = progress;
+ if (progress >= 0.99) {
+ sync_user_job.Status = Catalog.GetString ("Flushing to disk...");
+ sync_user_job.Progress = 0;
+ } else {
+ sync_user_job.Status = message;
+ sync_user_job.Progress = progress;
+ }
}
public bool SyncNeeded {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]