windows setup: report initial sync progress in the taskbar item. Closes #619

This commit is contained in:
Hylke Bons 2012-03-17 17:37:43 +00:00
parent 9de116e86f
commit 7fa5bcf505
2 changed files with 20 additions and 6 deletions

View file

@ -28,6 +28,7 @@ using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shell;
using Drawing = System.Drawing;
using Imaging = System.Windows.Interop.Imaging;
@ -357,6 +358,9 @@ namespace SparkleShare {
Canvas.SetTop (path_help_label, 330);
Canvas.SetRight (path_help_label, 30);
TaskbarItemInfo.ProgressValue = 0.0;
TaskbarItemInfo.ProgressState = TaskbarItemProgressState.None;
Buttons.Add (add_button);
Buttons.Add (cancel_button);
@ -441,18 +445,21 @@ namespace SparkleShare {
Value = 1
};
ContentCanvas.Children.Add (progress_bar);
Canvas.SetLeft (progress_bar, 185);
Canvas.SetTop (progress_bar, 150);
TaskbarItemInfo.ProgressState = TaskbarItemProgressState.Normal;
Buttons.Add (finish_button);
Buttons.Add (cancel_button);
Controller.UpdateProgressBarEvent += delegate (double percentage) {
Dispatcher.Invoke ((Action) delegate {
progress_bar.Value = percentage;
progress_bar.Value = percentage;
TaskbarItemInfo.ProgressValue = percentage / 100;
});
};
@ -502,6 +509,8 @@ namespace SparkleShare {
Canvas.SetLeft (help_block, 210);
Canvas.SetTop (help_block, 100);
TaskbarItemInfo.ProgressValue = 1.0;
TaskbarItemInfo.ProgressState = TaskbarItemProgressState.Error;
Buttons.Add (try_again_button);
Buttons.Add (cancel_button);
@ -554,6 +563,9 @@ namespace SparkleShare {
Canvas.SetTop (warning_block, 100);
}
TaskbarItemInfo.ProgressValue = 0.0;
TaskbarItemInfo.ProgressState = TaskbarItemProgressState.None;
Buttons.Add (finish_button);
Buttons.Add (open_folder_button);

View file

@ -18,14 +18,12 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Forms.Integration;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Forms.Integration;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Reflection;
using System.Windows.Shell;
namespace SparkleShare {
@ -49,6 +47,10 @@ namespace SparkleShare {
Height = 440;
ResizeMode = ResizeMode.NoResize;
Background = new SolidColorBrush (Colors.WhiteSmoke);
TaskbarItemInfo = new TaskbarItemInfo () {
Description = "SparkleShare"
};
WindowStartupLocation = WindowStartupLocation.CenterScreen;
Content = ContentCanvas;