diff --git a/src/Resources/Locales/en_US.xaml b/src/Resources/Locales/en_US.xaml
index da900303..30ea054c 100644
--- a/src/Resources/Locales/en_US.xaml
+++ b/src/Resources/Locales/en_US.xaml
@@ -542,4 +542,5 @@
Invalid path for archive file
This field is required
You are removing repository '{0}'. Are you sure to continue?
+ You are trying to clear all stashes. Are you sure to continue?
\ No newline at end of file
diff --git a/src/Resources/Locales/zh_CN.xaml b/src/Resources/Locales/zh_CN.xaml
index 9eafebf9..e7a48dfc 100644
--- a/src/Resources/Locales/zh_CN.xaml
+++ b/src/Resources/Locales/zh_CN.xaml
@@ -541,4 +541,5 @@
非法的存档文件路径!
内容未填写!
正在将 '{0}' 从列表中移除,是否要继续?
+ 您正在丢弃所有的贮藏,一经操作,无法回退,是否继续?
\ No newline at end of file
diff --git a/src/Views/Widgets/Stashes.xaml b/src/Views/Widgets/Stashes.xaml
index d83b3715..6faf5a6c 100644
--- a/src/Views/Widgets/Stashes.xaml
+++ b/src/Views/Widgets/Stashes.xaml
@@ -26,25 +26,43 @@
-
+
+
+
+
+
+
+
+
+
-
+
+
+
diff --git a/src/Views/Widgets/Stashes.xaml.cs b/src/Views/Widgets/Stashes.xaml.cs
index 118436d9..a7dac347 100644
--- a/src/Views/Widgets/Stashes.xaml.cs
+++ b/src/Views/Widgets/Stashes.xaml.cs
@@ -25,6 +25,30 @@ namespace SourceGit.Views.Widgets {
changeList.ItemsSource = null;
}
+ private void ClearAll(object sender, RoutedEventArgs e) {
+ var confirmDialog = new ConfirmDialog(
+ App.Text("Apply.Warn"),
+ App.Text("ConfirmClearStashes"),
+ async () => {
+ waiting.Visibility = Visibility.Visible;
+ waiting.IsAnimating = true;
+ Models.Watcher.SetEnabled(repo, false);
+ await Task.Run(() => {
+ new Commands.Command() {
+ Cwd = repo,
+ Args = "stash clear",
+ }.Exec();
+ });
+ Models.Watcher.SetEnabled(repo, true);
+ waiting.Visibility = Visibility.Collapsed;
+ waiting.IsAnimating = false;
+ });
+
+ confirmDialog.Owner = App.Current.MainWindow;
+ confirmDialog.ShowDialog();
+ e.Handled = true;
+ }
+
private async void OnStashSelectionChanged(object sender, SelectionChangedEventArgs e) {
changeList.ItemsSource = null;
selected = null;