Merge pull request #1380 from BarryThePenguin/master

setup fetcher: Show download speed on windows #1361
This commit is contained in:
Hylke Bons 2013-08-26 09:06:10 -07:00
commit d5815a90b5

View file

@ -453,11 +453,21 @@ namespace SparkleShare {
Height = 15,
Value = Controller.ProgressBarPercentage
};
TextBlock progress_label = new TextBlock () {
Width = 414,
Text = "Starting...",
TextAlignment = TextAlignment.Right
};
ContentCanvas.Children.Add (progress_bar);
ContentCanvas.Children.Add (progress_label);
Canvas.SetLeft (progress_bar, 185);
Canvas.SetTop (progress_bar, 150);
Canvas.SetLeft (progress_label, 185);
Canvas.SetTop (progress_label, 165);
TaskbarItemInfo.ProgressState = TaskbarItemProgressState.Normal;
@ -465,10 +475,11 @@ namespace SparkleShare {
Buttons.Add(finish_button);
Controller.UpdateProgressBarEvent += delegate (double percentage) {
Controller.UpdateProgressBarEvent += delegate (double percentage, string speed) {
Dispatcher.BeginInvoke ((Action) delegate {
progress_bar.Value = percentage;
TaskbarItemInfo.ProgressValue = percentage / 100;
progress_label.Text = speed;
});
};