diff --git a/SourceGit/UI/Apply.xaml b/SourceGit/UI/Apply.xaml
index 1533930f..37cad8c7 100644
--- a/SourceGit/UI/Apply.xaml
+++ b/SourceGit/UI/Apply.xaml
@@ -73,13 +73,5 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/SourceGit/UI/Apply.xaml.cs b/SourceGit/UI/Apply.xaml.cs
index 67a6e0ca..1ce51199 100644
--- a/SourceGit/UI/Apply.xaml.cs
+++ b/SourceGit/UI/Apply.xaml.cs
@@ -1,10 +1,7 @@
using Microsoft.Win32;
-using System;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
-using System.Windows.Media;
-using System.Windows.Media.Animation;
namespace SourceGit.UI {
@@ -87,16 +84,9 @@ namespace SourceGit.UI {
PopupManager.Lock();
- status.Visibility = Visibility.Visible;
- DoubleAnimation anim = new DoubleAnimation(0, 360, TimeSpan.FromSeconds(1));
- anim.RepeatBehavior = RepeatBehavior.Forever;
- statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, anim);
-
var mode = combWhitespaceOptions.SelectedItem as WhitespaceOption;
await Task.Run(() => repo.Apply(PatchFile, mode.Arg));
- status.Visibility = Visibility.Collapsed;
- statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, null);
PopupManager.Close(true);
}
diff --git a/SourceGit/UI/Clone.xaml b/SourceGit/UI/Clone.xaml
index 28194cd5..119246eb 100644
--- a/SourceGit/UI/Clone.xaml
+++ b/SourceGit/UI/Clone.xaml
@@ -1,4 +1,4 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/SourceGit/UI/Clone.xaml.cs b/SourceGit/UI/Clone.xaml.cs
index a56b969e..a5c8b50c 100644
--- a/SourceGit/UI/Clone.xaml.cs
+++ b/SourceGit/UI/Clone.xaml.cs
@@ -1,9 +1,7 @@
-using System;
+using System;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
-using System.Windows.Media;
-using System.Windows.Media.Animation;
namespace SourceGit.UI {
@@ -63,7 +61,7 @@ namespace SourceGit.UI {
///
///
///
- private void Start(object sender, RoutedEventArgs e) {
+ private async void Start(object sender, RoutedEventArgs e) {
txtUrl.GetBindingExpression(TextBox.TextProperty).UpdateSource();
if (Validation.GetHasError(txtUrl)) return;
@@ -83,24 +81,16 @@ namespace SourceGit.UI {
PopupManager.Lock();
- status.Visibility = Visibility.Visible;
- DoubleAnimation anim = new DoubleAnimation(0, 360, TimeSpan.FromSeconds(1));
- anim.RepeatBehavior = RepeatBehavior.Forever;
- statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, anim);
-
- Task.Run(() => {
- var repo = Git.Repository.Clone(RemoteUri, ParentFolder, repoName, msg => Dispatcher.Invoke(() => statusMsg.Content = msg));
- if (repo == null) {
- PopupManager.Unlock();
- Dispatcher.Invoke(() => {
- status.Visibility = Visibility.Collapsed;
- statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, null);
- });
- } else {
- Dispatcher.Invoke(() => PopupManager.Close(true));
- repo.Open();
- }
+ var repo = await Task.Run(() => {
+ return Git.Repository.Clone(RemoteUri, ParentFolder, repoName, PopupManager.UpdateStatus);
});
+
+ if (repo == null) {
+ PopupManager.Unlock();
+ } else {
+ PopupManager.Close(true);
+ repo.Open();
+ }
}
///
diff --git a/SourceGit/UI/CreateBranch.xaml b/SourceGit/UI/CreateBranch.xaml
index c5d18666..7f71f6ff 100644
--- a/SourceGit/UI/CreateBranch.xaml
+++ b/SourceGit/UI/CreateBranch.xaml
@@ -1,4 +1,4 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/SourceGit/UI/CreateBranch.xaml.cs b/SourceGit/UI/CreateBranch.xaml.cs
index 162899d1..4edd8d41 100644
--- a/SourceGit/UI/CreateBranch.xaml.cs
+++ b/SourceGit/UI/CreateBranch.xaml.cs
@@ -1,10 +1,8 @@
-using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
-using System.Windows.Media.Animation;
namespace SourceGit.UI {
@@ -100,11 +98,6 @@ namespace SourceGit.UI {
PopupManager.Lock();
- status.Visibility = Visibility.Visible;
- DoubleAnimation anim = new DoubleAnimation(0, 360, TimeSpan.FromSeconds(1));
- anim.RepeatBehavior = RepeatBehavior.Forever;
- statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, anim);
-
bool checkout = chkCheckout.IsChecked == true;
await Task.Run(() => {
if (checkout) {
@@ -126,8 +119,6 @@ namespace SourceGit.UI {
}
});
- status.Visibility = Visibility.Collapsed;
- statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, null);
PopupManager.Close(true);
}
diff --git a/SourceGit/UI/DeleteBranch.xaml b/SourceGit/UI/DeleteBranch.xaml
index dee146ac..79080a55 100644
--- a/SourceGit/UI/DeleteBranch.xaml
+++ b/SourceGit/UI/DeleteBranch.xaml
@@ -1,4 +1,4 @@
-
-
-
-
-
-
-
-
-
diff --git a/SourceGit/UI/DeleteBranch.xaml.cs b/SourceGit/UI/DeleteBranch.xaml.cs
index c40c2e1d..65fa02e5 100644
--- a/SourceGit/UI/DeleteBranch.xaml.cs
+++ b/SourceGit/UI/DeleteBranch.xaml.cs
@@ -1,9 +1,6 @@
-using System;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
-using System.Windows.Media;
-using System.Windows.Media.Animation;
namespace SourceGit.UI {
///
@@ -41,16 +38,7 @@ namespace SourceGit.UI {
///
private async void Sure(object sender, RoutedEventArgs e) {
PopupManager.Lock();
-
- DoubleAnimation anim = new DoubleAnimation(0, 360, TimeSpan.FromSeconds(1));
- anim.RepeatBehavior = RepeatBehavior.Forever;
- statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, anim);
- status.Visibility = Visibility.Visible;
-
await Task.Run(() => branch.Delete(repo));
-
- status.Visibility = Visibility.Collapsed;
- statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, null);
PopupManager.Close(true);
}
diff --git a/SourceGit/UI/DeleteRemote.xaml b/SourceGit/UI/DeleteRemote.xaml
index 73f64458..69c06d5b 100644
--- a/SourceGit/UI/DeleteRemote.xaml
+++ b/SourceGit/UI/DeleteRemote.xaml
@@ -1,4 +1,4 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/SourceGit/UI/DeleteRemote.xaml.cs b/SourceGit/UI/DeleteRemote.xaml.cs
index d92bdf52..04e091f8 100644
--- a/SourceGit/UI/DeleteRemote.xaml.cs
+++ b/SourceGit/UI/DeleteRemote.xaml.cs
@@ -1,9 +1,6 @@
-using System;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
-using System.Windows.Media;
-using System.Windows.Media.Animation;
namespace SourceGit.UI {
@@ -42,16 +39,7 @@ namespace SourceGit.UI {
///
private async void Sure(object sender, RoutedEventArgs e) {
PopupManager.Lock();
-
- DoubleAnimation anim = new DoubleAnimation(0, 360, TimeSpan.FromSeconds(1));
- anim.RepeatBehavior = RepeatBehavior.Forever;
- statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, anim);
- status.Visibility = Visibility.Visible;
-
await Task.Run(() => Git.Remote.Delete(repo, remote));
-
- status.Visibility = Visibility.Collapsed;
- statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, null);
PopupManager.Close(true);
}
diff --git a/SourceGit/UI/DeleteTag.xaml b/SourceGit/UI/DeleteTag.xaml
index bfebbabc..e4b73198 100644
--- a/SourceGit/UI/DeleteTag.xaml
+++ b/SourceGit/UI/DeleteTag.xaml
@@ -1,4 +1,4 @@
-
-
-
-
-
-
-
-
-
diff --git a/SourceGit/UI/DeleteTag.xaml.cs b/SourceGit/UI/DeleteTag.xaml.cs
index 42527b50..aeb22c54 100644
--- a/SourceGit/UI/DeleteTag.xaml.cs
+++ b/SourceGit/UI/DeleteTag.xaml.cs
@@ -1,9 +1,6 @@
-using System;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
-using System.Windows.Media;
-using System.Windows.Media.Animation;
namespace SourceGit.UI {
@@ -44,16 +41,9 @@ namespace SourceGit.UI {
private async void Start(object sender, RoutedEventArgs e) {
PopupManager.Lock();
- DoubleAnimation anim = new DoubleAnimation(0, 360, TimeSpan.FromSeconds(1));
- anim.RepeatBehavior = RepeatBehavior.Forever;
- statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, anim);
- status.Visibility = Visibility.Visible;
-
var push = chkWithRemote.IsChecked == true;
await Task.Run(() => Git.Tag.Delete(repo, tag.Name, push));
- status.Visibility = Visibility.Collapsed;
- statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, null);
PopupManager.Close(true);
}
diff --git a/SourceGit/UI/Discard.xaml b/SourceGit/UI/Discard.xaml
index 9a384e6b..b725e4c4 100644
--- a/SourceGit/UI/Discard.xaml
+++ b/SourceGit/UI/Discard.xaml
@@ -1,4 +1,4 @@
-
-
-
-
-
-
-
-
-
diff --git a/SourceGit/UI/Discard.xaml.cs b/SourceGit/UI/Discard.xaml.cs
index 6a0e6cea..7d9372d6 100644
--- a/SourceGit/UI/Discard.xaml.cs
+++ b/SourceGit/UI/Discard.xaml.cs
@@ -1,10 +1,8 @@
-using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
-using System.Windows.Media.Animation;
namespace SourceGit.UI {
@@ -47,16 +45,7 @@ namespace SourceGit.UI {
private async void Sure(object sender, RoutedEventArgs e) {
PopupManager.Lock();
-
- DoubleAnimation anim = new DoubleAnimation(0, 360, TimeSpan.FromSeconds(1));
- anim.RepeatBehavior = RepeatBehavior.Forever;
- statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, anim);
- status.Visibility = Visibility.Visible;
-
await Task.Run(() => repo.Discard(changes));
-
- status.Visibility = Visibility.Collapsed;
- statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, null);
PopupManager.Close(true);
}
diff --git a/SourceGit/UI/Fetch.xaml b/SourceGit/UI/Fetch.xaml
index f8373778..550ed554 100644
--- a/SourceGit/UI/Fetch.xaml
+++ b/SourceGit/UI/Fetch.xaml
@@ -62,17 +62,5 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/SourceGit/UI/Fetch.xaml.cs b/SourceGit/UI/Fetch.xaml.cs
index 1489de1f..1068c518 100644
--- a/SourceGit/UI/Fetch.xaml.cs
+++ b/SourceGit/UI/Fetch.xaml.cs
@@ -1,9 +1,6 @@
-using System;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
-using System.Windows.Media;
-using System.Windows.Media.Animation;
namespace SourceGit.UI {
@@ -56,20 +53,13 @@ namespace SourceGit.UI {
PopupManager.Lock();
- status.Visibility = Visibility.Visible;
- DoubleAnimation anim = new DoubleAnimation(0, 360, TimeSpan.FromSeconds(1));
- anim.RepeatBehavior = RepeatBehavior.Forever;
- statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, anim);
-
if (chkFetchAll.IsChecked == true) {
- await Task.Run(() => repo.Fetch(null, prune, msg => Dispatcher.Invoke(() => statusMsg.Content = msg)));
+ await Task.Run(() => repo.Fetch(null, prune, PopupManager.UpdateStatus));
} else {
var remote = combRemotes.SelectedItem as Git.Remote;
- await Task.Run(() => repo.Fetch(remote, prune, msg => Dispatcher.Invoke(() => statusMsg.Content = msg)));
+ await Task.Run(() => repo.Fetch(remote, prune, PopupManager.UpdateStatus));
}
- status.Visibility = Visibility.Collapsed;
- statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, null);
PopupManager.Close(true);
}
diff --git a/SourceGit/UI/GitFlowFinishBranch.xaml b/SourceGit/UI/GitFlowFinishBranch.xaml
index 3972d60d..07f7db6c 100644
--- a/SourceGit/UI/GitFlowFinishBranch.xaml
+++ b/SourceGit/UI/GitFlowFinishBranch.xaml
@@ -38,13 +38,5 @@
-
-
-
-
-
-
-
-
diff --git a/SourceGit/UI/GitFlowFinishBranch.xaml.cs b/SourceGit/UI/GitFlowFinishBranch.xaml.cs
index 7b8b448d..b5acd375 100644
--- a/SourceGit/UI/GitFlowFinishBranch.xaml.cs
+++ b/SourceGit/UI/GitFlowFinishBranch.xaml.cs
@@ -1,9 +1,6 @@
-using System;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
-using System.Windows.Media;
-using System.Windows.Media.Animation;
namespace SourceGit.UI {
@@ -62,16 +59,7 @@ namespace SourceGit.UI {
///
private async void Sure(object sender, RoutedEventArgs e) {
PopupManager.Lock();
-
- DoubleAnimation anim = new DoubleAnimation(0, 360, TimeSpan.FromSeconds(1));
- anim.RepeatBehavior = RepeatBehavior.Forever;
- statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, anim);
- status.Visibility = Visibility.Visible;
-
await Task.Run(() => repo.FinishGitFlowBranch(branch));
-
- status.Visibility = Visibility.Collapsed;
- statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, null);
PopupManager.Close(true);
}
diff --git a/SourceGit/UI/GitFlowSetup.xaml b/SourceGit/UI/GitFlowSetup.xaml
index 18354101..616eab54 100644
--- a/SourceGit/UI/GitFlowSetup.xaml
+++ b/SourceGit/UI/GitFlowSetup.xaml
@@ -55,14 +55,6 @@
-
-
-
-
-
-
-
-
diff --git a/SourceGit/UI/GitFlowSetup.xaml.cs b/SourceGit/UI/GitFlowSetup.xaml.cs
index 622d6e4f..dfbafde7 100644
--- a/SourceGit/UI/GitFlowSetup.xaml.cs
+++ b/SourceGit/UI/GitFlowSetup.xaml.cs
@@ -1,10 +1,7 @@
-using System;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
-using System.Windows.Media;
-using System.Windows.Media.Animation;
namespace SourceGit.UI {
@@ -40,11 +37,6 @@ namespace SourceGit.UI {
private async void Sure(object sender, RoutedEventArgs e) {
PopupManager.Lock();
- DoubleAnimation anim = new DoubleAnimation(0, 360, TimeSpan.FromSeconds(1));
- anim.RepeatBehavior = RepeatBehavior.Forever;
- statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, anim);
- status.Visibility = Visibility.Visible;
-
var master = txtMaster.Text;
var dev = txtDevelop.Text;
var feature = txtFeature.Text;
@@ -53,9 +45,6 @@ namespace SourceGit.UI {
var version = txtVersion.Text;
await Task.Run(() => repo.EnableGitFlow(master, dev, feature, release, hotfix, version));
-
- status.Visibility = Visibility.Collapsed;
- statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, null);
PopupManager.Close(true);
}
diff --git a/SourceGit/UI/GitFlowStartBranch.xaml b/SourceGit/UI/GitFlowStartBranch.xaml
index 37441729..472b56d2 100644
--- a/SourceGit/UI/GitFlowStartBranch.xaml
+++ b/SourceGit/UI/GitFlowStartBranch.xaml
@@ -45,13 +45,5 @@
-
-
-
-
-
-
-
-
diff --git a/SourceGit/UI/GitFlowStartBranch.xaml.cs b/SourceGit/UI/GitFlowStartBranch.xaml.cs
index e6e688e9..242fa716 100644
--- a/SourceGit/UI/GitFlowStartBranch.xaml.cs
+++ b/SourceGit/UI/GitFlowStartBranch.xaml.cs
@@ -1,9 +1,6 @@
-using System;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
-using System.Windows.Media;
-using System.Windows.Media.Animation;
namespace SourceGit.UI {
@@ -78,16 +75,7 @@ namespace SourceGit.UI {
if (Validation.GetHasError(txtName)) return;
PopupManager.Lock();
-
- DoubleAnimation anim = new DoubleAnimation(0, 360, TimeSpan.FromSeconds(1));
- anim.RepeatBehavior = RepeatBehavior.Forever;
- statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, anim);
- status.Visibility = Visibility.Visible;
-
await Task.Run(() => repo.StartGitFlowBranch(type, SubName));
-
- status.Visibility = Visibility.Collapsed;
- statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, null);
PopupManager.Close(true);
}
diff --git a/SourceGit/UI/Init.xaml b/SourceGit/UI/Init.xaml
index f2ea32b0..fd644564 100644
--- a/SourceGit/UI/Init.xaml
+++ b/SourceGit/UI/Init.xaml
@@ -1,4 +1,4 @@
-
-
-
-
-
-
-
-
-
diff --git a/SourceGit/UI/Init.xaml.cs b/SourceGit/UI/Init.xaml.cs
index 2dd45cb1..03bb9aa9 100644
--- a/SourceGit/UI/Init.xaml.cs
+++ b/SourceGit/UI/Init.xaml.cs
@@ -1,9 +1,6 @@
-using System;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
-using System.Windows.Media;
-using System.Windows.Media.Animation;
namespace SourceGit.UI {
@@ -39,11 +36,6 @@ namespace SourceGit.UI {
private async void Sure(object sender, RoutedEventArgs e) {
PopupManager.Lock();
- DoubleAnimation anim = new DoubleAnimation(0, 360, TimeSpan.FromSeconds(1));
- anim.RepeatBehavior = RepeatBehavior.Forever;
- statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, anim);
- status.Visibility = Visibility.Visible;
-
await Task.Run(() => {
var errs = Git.Repository.RunCommand(workingDir, "init -q", null);
if (errs != null) {
@@ -53,8 +45,6 @@ namespace SourceGit.UI {
}
});
- status.Visibility = Visibility.Collapsed;
- statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, null);
PopupManager.Close(true);
var repo = App.Preference.FindRepository(workingDir);
diff --git a/SourceGit/UI/InteractiveRebase.xaml b/SourceGit/UI/InteractiveRebase.xaml
index d4df0693..8af9c162 100644
--- a/SourceGit/UI/InteractiveRebase.xaml
+++ b/SourceGit/UI/InteractiveRebase.xaml
@@ -49,11 +49,11 @@
-
diff --git a/SourceGit/UI/Merge.xaml b/SourceGit/UI/Merge.xaml
index 1b7d27a9..5caa8b09 100644
--- a/SourceGit/UI/Merge.xaml
+++ b/SourceGit/UI/Merge.xaml
@@ -1,4 +1,4 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/SourceGit/UI/Merge.xaml.cs b/SourceGit/UI/Merge.xaml.cs
index 3c1b8107..1eb132b3 100644
--- a/SourceGit/UI/Merge.xaml.cs
+++ b/SourceGit/UI/Merge.xaml.cs
@@ -1,9 +1,6 @@
-using System;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
-using System.Windows.Media;
-using System.Windows.Media.Animation;
namespace SourceGit.UI {
@@ -70,17 +67,9 @@ namespace SourceGit.UI {
PopupManager.Show(merge);
PopupManager.Lock();
- DoubleAnimation anim = new DoubleAnimation(0, 360, TimeSpan.FromSeconds(1));
- anim.RepeatBehavior = RepeatBehavior.Forever;
- merge.statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, anim);
- merge.status.Visibility = Visibility.Visible;
-
Task.Run(() => {
opened.Merge(source, "");
-
merge.Dispatcher.Invoke(() => {
- merge.status.Visibility = Visibility.Collapsed;
- merge.statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, null);
PopupManager.Close(true);
});
});
@@ -94,17 +83,10 @@ namespace SourceGit.UI {
private async void Start(object sender, RoutedEventArgs e) {
PopupManager.Lock();
- DoubleAnimation anim = new DoubleAnimation(0, 360, TimeSpan.FromSeconds(1));
- anim.RepeatBehavior = RepeatBehavior.Forever;
- statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, anim);
- status.Visibility = Visibility.Visible;
-
var branch = sourceBranch.Content as string;
var opt = combOptions.SelectedItem as Option;
await Task.Run(() => repo.Merge(branch, opt.Arg));
- status.Visibility = Visibility.Collapsed;
- statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, null);
PopupManager.Close(true);
}
diff --git a/SourceGit/UI/PopupManager.xaml b/SourceGit/UI/PopupManager.xaml
index ea2d144e..8ddb084c 100644
--- a/SourceGit/UI/PopupManager.xaml
+++ b/SourceGit/UI/PopupManager.xaml
@@ -1,4 +1,4 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SourceGit/UI/PopupManager.xaml.cs b/SourceGit/UI/PopupManager.xaml.cs
index e0e67cee..7a856756 100644
--- a/SourceGit/UI/PopupManager.xaml.cs
+++ b/SourceGit/UI/PopupManager.xaml.cs
@@ -1,6 +1,7 @@
-using System;
+using System;
using System.Windows;
using System.Windows.Controls;
+using System.Windows.Media;
using System.Windows.Media.Animation;
namespace SourceGit.UI {
@@ -34,6 +35,7 @@ namespace SourceGit.UI {
anim.From = gone;
anim.To = new Thickness(0);
+ instance.statusMsg.Content = "";
instance.popupContent.Child = elem;
instance.popupContent.Margin = gone;
instance.Visibility = Visibility.Visible;
@@ -52,14 +54,35 @@ namespace SourceGit.UI {
/// Lock
///
public static void Lock() {
+ if (instance == null) return;
locked = true;
+
+ instance.status.Visibility = Visibility.Visible;
+ DoubleAnimation anim = new DoubleAnimation(0, 360, TimeSpan.FromSeconds(1));
+ anim.RepeatBehavior = RepeatBehavior.Forever;
+ instance.statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, anim);
}
///
/// Unlock
///
public static void Unlock() {
+ if (instance == null) return;
locked = false;
+ instance.statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, null);
+ instance.status.Visibility = Visibility.Collapsed;
+ }
+
+ ///
+ /// Update status description
+ ///
+ ///
+ public static void UpdateStatus(string desc) {
+ if (instance == null) return;
+
+ instance.Dispatcher.Invoke(() => {
+ instance.statusMsg.Content = desc;
+ });
}
///
@@ -81,6 +104,8 @@ namespace SourceGit.UI {
instance.popupContent.Child = null;
};
instance.popupContent.BeginAnimation(MarginProperty, anim);
+ instance.statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, null);
+ instance.status.Visibility = Visibility.Collapsed;
}
///
diff --git a/SourceGit/UI/Pull.xaml b/SourceGit/UI/Pull.xaml
index 7ab420f8..57c0e072 100644
--- a/SourceGit/UI/Pull.xaml
+++ b/SourceGit/UI/Pull.xaml
@@ -83,18 +83,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/SourceGit/UI/Pull.xaml.cs b/SourceGit/UI/Pull.xaml.cs
index 1251f66d..e88fea7d 100644
--- a/SourceGit/UI/Pull.xaml.cs
+++ b/SourceGit/UI/Pull.xaml.cs
@@ -1,10 +1,7 @@
-using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
-using System.Windows.Media;
-using System.Windows.Media.Animation;
namespace SourceGit.UI {
@@ -80,16 +77,7 @@ namespace SourceGit.UI {
if (remote == null || branch == null) return;
PopupManager.Lock();
-
- status.Visibility = Visibility.Visible;
- DoubleAnimation anim = new DoubleAnimation(0, 360, TimeSpan.FromSeconds(1));
- anim.RepeatBehavior = RepeatBehavior.Forever;
- statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, anim);
-
- await Task.Run(() => repo.Pull(remote, branch.Substring(branch.IndexOf('/')+1), msg => Dispatcher.Invoke(() => statusMsg.Content = msg), rebase, autoStash));
-
- status.Visibility = Visibility.Collapsed;
- statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, null);
+ await Task.Run(() => repo.Pull(remote, branch.Substring(branch.IndexOf('/')+1), PopupManager.UpdateStatus, rebase, autoStash));
PopupManager.Close(true);
}
diff --git a/SourceGit/UI/Push.xaml b/SourceGit/UI/Push.xaml
index eadd4a03..b5ed0148 100644
--- a/SourceGit/UI/Push.xaml
+++ b/SourceGit/UI/Push.xaml
@@ -1,4 +1,4 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/SourceGit/UI/Push.xaml.cs b/SourceGit/UI/Push.xaml.cs
index f6d32e61..5b9e4a81 100644
--- a/SourceGit/UI/Push.xaml.cs
+++ b/SourceGit/UI/Push.xaml.cs
@@ -1,11 +1,8 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
-using System.Windows.Media;
-using System.Windows.Media.Animation;
-using System.Windows.Threading;
namespace SourceGit.UI {
@@ -55,17 +52,9 @@ namespace SourceGit.UI {
var remote = upstream.Substring(0, remoteIdx);
var remoteBranch = upstream.Substring(remoteIdx + 1);
- push.status.Visibility = Visibility.Visible;
- DoubleAnimation anim = new DoubleAnimation(0, 360, TimeSpan.FromSeconds(1));
- anim.RepeatBehavior = RepeatBehavior.Forever;
- push.statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, anim);
-
Task.Run(() => {
- repo.Push(remote, current.Name, remoteBranch, msg => push.Dispatcher.Invoke(() => push.statusMsg.Content = msg));
-
+ repo.Push(remote, current.Name, remoteBranch, PopupManager.UpdateStatus);
push.Dispatcher.Invoke(() => {
- push.status.Visibility = Visibility.Collapsed;
- push.statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, null);
PopupManager.Close(true);
});
});
@@ -108,16 +97,7 @@ namespace SourceGit.UI {
}
PopupManager.Lock();
-
- status.Visibility = Visibility.Visible;
- DoubleAnimation anim = new DoubleAnimation(0, 360, TimeSpan.FromSeconds(1));
- anim.RepeatBehavior = RepeatBehavior.Forever;
- statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, anim);
-
- await Task.Run(() => repo.Push(remote, localBranch.Name, remoteBranch, msg => Dispatcher.Invoke(() => statusMsg.Content = msg), tags, track, force));
-
- status.Visibility = Visibility.Collapsed;
- statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, null);
+ await Task.Run(() => repo.Push(remote, localBranch.Name, remoteBranch, PopupManager.UpdateStatus, tags, track, force));
PopupManager.Close(true);
}
diff --git a/SourceGit/UI/PushTag.xaml b/SourceGit/UI/PushTag.xaml
index f2738f48..a78183c6 100644
--- a/SourceGit/UI/PushTag.xaml
+++ b/SourceGit/UI/PushTag.xaml
@@ -1,4 +1,4 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/SourceGit/UI/PushTag.xaml.cs b/SourceGit/UI/PushTag.xaml.cs
index fcfc177d..b2b49d50 100644
--- a/SourceGit/UI/PushTag.xaml.cs
+++ b/SourceGit/UI/PushTag.xaml.cs
@@ -1,9 +1,6 @@
-using System;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
-using System.Windows.Media;
-using System.Windows.Media.Animation;
namespace SourceGit.UI {
@@ -48,16 +45,7 @@ namespace SourceGit.UI {
if (remote == null) return;
PopupManager.Lock();
-
- DoubleAnimation anim = new DoubleAnimation(0, 360, TimeSpan.FromSeconds(1));
- anim.RepeatBehavior = RepeatBehavior.Forever;
- statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, anim);
- status.Visibility = Visibility.Visible;
-
await Task.Run(() => Git.Tag.Push(repo, tag.Name, remote.Name));
-
- status.Visibility = Visibility.Collapsed;
- statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, null);
PopupManager.Close(true);
}
diff --git a/SourceGit/UI/Rebase.xaml b/SourceGit/UI/Rebase.xaml
index 7126459e..f46f1193 100644
--- a/SourceGit/UI/Rebase.xaml
+++ b/SourceGit/UI/Rebase.xaml
@@ -1,4 +1,4 @@
-
-
-
-
-
-
-
-
-
diff --git a/SourceGit/UI/Rebase.xaml.cs b/SourceGit/UI/Rebase.xaml.cs
index 57f8c0b8..d1eaeaf4 100644
--- a/SourceGit/UI/Rebase.xaml.cs
+++ b/SourceGit/UI/Rebase.xaml.cs
@@ -1,9 +1,7 @@
-using System;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
-using System.Windows.Media.Animation;
namespace SourceGit.UI {
@@ -67,16 +65,9 @@ namespace SourceGit.UI {
private async void Start(object sender, RoutedEventArgs e) {
PopupManager.Lock();
- DoubleAnimation anim = new DoubleAnimation(0, 360, TimeSpan.FromSeconds(1));
- anim.RepeatBehavior = RepeatBehavior.Forever;
- statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, anim);
- status.Visibility = Visibility.Visible;
-
var autoStash = chkAutoStash.IsChecked == true;
await Task.Run(() => repo.Rebase(based, autoStash));
- status.Visibility = Visibility.Collapsed;
- statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, null);
PopupManager.Close(true);
}
diff --git a/SourceGit/UI/Remote.xaml b/SourceGit/UI/Remote.xaml
index 4d87086e..c044c157 100644
--- a/SourceGit/UI/Remote.xaml
+++ b/SourceGit/UI/Remote.xaml
@@ -1,4 +1,4 @@
-
-
-
-
-
-
-
-
-
diff --git a/SourceGit/UI/Remote.xaml.cs b/SourceGit/UI/Remote.xaml.cs
index 39e40739..f20c4bc5 100644
--- a/SourceGit/UI/Remote.xaml.cs
+++ b/SourceGit/UI/Remote.xaml.cs
@@ -1,9 +1,6 @@
-using System;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
-using System.Windows.Media;
-using System.Windows.Media.Animation;
namespace SourceGit.UI {
@@ -64,11 +61,6 @@ namespace SourceGit.UI {
PopupManager.Lock();
- DoubleAnimation anim = new DoubleAnimation(0, 360, TimeSpan.FromSeconds(1));
- anim.RepeatBehavior = RepeatBehavior.Forever;
- statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, anim);
- status.Visibility = Visibility.Visible;
-
await Task.Run(() => {
if (remote != null) {
remote.Edit(repo, RemoteName, RemoteUri);
@@ -77,8 +69,6 @@ namespace SourceGit.UI {
}
});
- status.Visibility = Visibility.Collapsed;
- statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, null);
PopupManager.Close(true);
}
diff --git a/SourceGit/UI/RenameBranch.xaml b/SourceGit/UI/RenameBranch.xaml
index feb61f86..21aaf9ed 100644
--- a/SourceGit/UI/RenameBranch.xaml
+++ b/SourceGit/UI/RenameBranch.xaml
@@ -1,4 +1,4 @@
-
-
-
-
-
-
-
-
-
diff --git a/SourceGit/UI/RenameBranch.xaml.cs b/SourceGit/UI/RenameBranch.xaml.cs
index 9103ff7d..fb535fa3 100644
--- a/SourceGit/UI/RenameBranch.xaml.cs
+++ b/SourceGit/UI/RenameBranch.xaml.cs
@@ -1,9 +1,6 @@
-using System;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
-using System.Windows.Media;
-using System.Windows.Media.Animation;
namespace SourceGit.UI {
@@ -54,16 +51,7 @@ namespace SourceGit.UI {
if (Validation.GetHasError(txtNewName)) return;
PopupManager.Lock();
-
- DoubleAnimation anim = new DoubleAnimation(0, 360, TimeSpan.FromSeconds(1));
- anim.RepeatBehavior = RepeatBehavior.Forever;
- statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, anim);
- status.Visibility = Visibility.Visible;
-
await Task.Run(() => branch.Rename(repo, NewName));
-
- status.Visibility = Visibility.Collapsed;
- statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, null);
PopupManager.Close(true);
}
diff --git a/SourceGit/UI/Reset.xaml b/SourceGit/UI/Reset.xaml
index d84d0b64..6ae66237 100644
--- a/SourceGit/UI/Reset.xaml
+++ b/SourceGit/UI/Reset.xaml
@@ -1,4 +1,4 @@
-
-
-
-
-
-
-
-
-
diff --git a/SourceGit/UI/Reset.xaml.cs b/SourceGit/UI/Reset.xaml.cs
index 8e163060..c48c302d 100644
--- a/SourceGit/UI/Reset.xaml.cs
+++ b/SourceGit/UI/Reset.xaml.cs
@@ -1,9 +1,7 @@
-using System;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
-using System.Windows.Media.Animation;
namespace SourceGit.UI {
@@ -74,16 +72,7 @@ namespace SourceGit.UI {
if (mode == null) return;
PopupManager.Lock();
-
- DoubleAnimation anim = new DoubleAnimation(0, 360, TimeSpan.FromSeconds(1));
- anim.RepeatBehavior = RepeatBehavior.Forever;
- statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, anim);
- status.Visibility = Visibility.Visible;
-
await Task.Run(() => repo.Reset(revision, mode.Arg));
-
- status.Visibility = Visibility.Collapsed;
- statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, null);
PopupManager.Close(true);
}
diff --git a/SourceGit/UI/Revert.xaml b/SourceGit/UI/Revert.xaml
index 0a5e5a70..5eb0a24a 100644
--- a/SourceGit/UI/Revert.xaml
+++ b/SourceGit/UI/Revert.xaml
@@ -1,4 +1,4 @@
-
-
-
-
-
-
-
-
-
diff --git a/SourceGit/UI/Revert.xaml.cs b/SourceGit/UI/Revert.xaml.cs
index a2b86840..960a129d 100644
--- a/SourceGit/UI/Revert.xaml.cs
+++ b/SourceGit/UI/Revert.xaml.cs
@@ -1,18 +1,6 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Animation;
-using System.Windows.Media.Imaging;
-using System.Windows.Navigation;
-using System.Windows.Shapes;
namespace SourceGit.UI {
@@ -54,16 +42,7 @@ namespace SourceGit.UI {
bool autoCommit = chkCommit.IsChecked == true;
PopupManager.Lock();
-
- status.Visibility = Visibility.Visible;
- DoubleAnimation anim = new DoubleAnimation(0, 360, TimeSpan.FromSeconds(1));
- anim.RepeatBehavior = RepeatBehavior.Forever;
- statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, anim);
-
await Task.Run(() => repo.Revert(sha, autoCommit));
-
- status.Visibility = Visibility.Collapsed;
- statusIcon.RenderTransform.BeginAnimation(RotateTransform.AngleProperty, null);
PopupManager.Close(true);
}