Skip to content

Commit

Permalink
Mac: Finished adding UI for SyncDownload; the screen is pretty much f…
Browse files Browse the repository at this point in the history
…inished. In fact, the whole Sync process is pretty much done except for a few minor bugs!

Related to issue #381.
  • Loading branch information
ycastonguay committed Aug 16, 2013
1 parent b401ae7 commit 17880a0
Show file tree
Hide file tree
Showing 6 changed files with 390 additions and 81 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public class SyncClientDownloadAudioFileProgressEntity
public SyncClientDownloadAudioFileProgressEntity()
{
DownloadSpeed = "0kb/sec";
DownloadFileName = string.Empty;
}
}
}
4 changes: 2 additions & 2 deletions MPfm/MPfm.Mac/Classes/MacSyncDeviceSpecifications.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ public string GetDeviceName()
public long GetFreeSpace()
{
string root = Path.GetPathRoot(Environment.GetFolderPath(Environment.SpecialFolder.MyMusic));
Console.WriteLine("MacSyncDeviceSpecifications - GetFreeSpace - My music folder: {0} - Root: {1}", Environment.GetFolderPath(Environment.SpecialFolder.MyMusic), root);
//Console.WriteLine("MacSyncDeviceSpecifications - GetFreeSpace - My music folder: {0} - Root: {1}", Environment.GetFolderPath(Environment.SpecialFolder.MyMusic), root);
foreach (DriveInfo drive in DriveInfo.GetDrives())
{
Console.WriteLine("MacSyncDeviceSpecifications - GetFreeSpace - DriveInfo name: {0} driveType: {1} driveFormat: {2} totalFreeSpace: {3} availableFreeSpace: {4} isReady: {5} rootDirectory: {6}", drive.Name, drive.DriveType.ToString(), drive.DriveFormat.ToString(), drive.TotalFreeSpace, drive.AvailableFreeSpace, drive.IsReady, drive.RootDirectory);
//Console.WriteLine("MacSyncDeviceSpecifications - GetFreeSpace - DriveInfo name: {0} driveType: {1} driveFormat: {2} totalFreeSpace: {3} availableFreeSpace: {4} isReady: {5} rootDirectory: {6}", drive.Name, drive.DriveType.ToString(), drive.DriveFormat.ToString(), drive.TotalFreeSpace, drive.AvailableFreeSpace, drive.IsReady, drive.RootDirectory);
if (drive.RootDirectory.Name == root)
return drive.AvailableFreeSpace;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,15 @@ public override void WindowDidLoad()
private void LoadFontsAndImages()
{
lblTitle.Font = NSFont.FromFontName("TitilliumText25L-800wt", 18);
lblSubtitle.Font = NSFont.FromFontName("Junction", 12);
lblStatus.Font = NSFont.FromFontName("Junction", 12);
lblCurrentFile.Font = NSFont.FromFontName("Junction", 12);
lblCurrentFileValue.Font = NSFont.FromFontName("Junction", 12);
lblDownloadSpeed.Font = NSFont.FromFontName("Junction", 12);
lblDownloadSpeedValue.Font = NSFont.FromFontName("Junction", 16);
lblErrors.Font = NSFont.FromFontName("Junction", 12);
lblErrorsValue.Font = NSFont.FromFontName("Junction", 16);
lblFilesDownloaded.Font = NSFont.FromFontName("Junction", 12);
lblFilesDownloadedValue.Font = NSFont.FromFontName("Junction", 16);

btnCancel.Image = ImageResources.Icons.FirstOrDefault(x => x.Name == "icon_button_cancel");
}
Expand Down Expand Up @@ -95,7 +100,11 @@ public void RefreshStatus(SyncClientDownloadAudioFileProgressEntity entity)
InvokeOnMainThread(delegate {
lblStatus.StringValue = entity.Status;
lblDownloadSpeedValue.StringValue = entity.DownloadSpeed;
lblErrorsValue.StringValue = entity.Errors.ToString();
lblFilesDownloadedValue.StringValue = string.Format("{0}/{1}", entity.FilesDownloaded, entity.TotalFiles);
lblCurrentFileValue.StringValue = entity.DownloadFileName;
progressIndicator.DoubleValue = entity.PercentageDone;
progressIndicatorCurrentFile.DoubleValue = entity.DownloadPercentageDone;
});
}

Expand Down
56 changes: 56 additions & 0 deletions MPfm/MPfm.Mac/Windows/SyncDownloadWindow.designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 17880a0

Please sign in to comment.