mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-28 23:54:59 +00:00
feature<SaveAsPatch>: show notification after saving patch successfully
This commit is contained in:
parent
a1bfbfe02e
commit
0a7a0bff42
8 changed files with 28 additions and 10 deletions
|
@ -6,11 +6,10 @@
|
|||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:controls="clr-namespace:SourceGit.Views.Controls"
|
||||
xmlns:validations="clr-namespace:SourceGit.Views.Validations"
|
||||
mc:Ignorable="d"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
Width="500" SizeToContent="Height"
|
||||
ResizeMode="NoResize">
|
||||
ResizeMode="NoResize">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="28"/>
|
||||
|
@ -61,7 +60,6 @@
|
|||
<TextBlock
|
||||
Grid.Row="0" Grid.Column="0"
|
||||
x:Name="txtMessage"
|
||||
Text="{DynamicResource Text.Clone.RemoteURL}"
|
||||
Margin="8, 16"
|
||||
HorizontalAlignment="Center"
|
||||
TextWrapping="Wrap"/>
|
||||
|
@ -72,7 +70,7 @@
|
|||
Orientation="Horizontal"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<Button Click="OnSure" Width="80" Content="{DynamicResource Text.Sure}" FontWeight="Bold"/>
|
||||
<Button Click="OnQuit" Width="80" Margin="8,0,0,0" Content="{DynamicResource Text.Cancel}" FontWeight="Bold"/>
|
||||
<Button x:Name="btnCancel" Click="OnQuit" Width="80" Margin="8,0,0,0" Content="{DynamicResource Text.Cancel}" FontWeight="Bold"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
|
|
@ -10,14 +10,30 @@ namespace SourceGit.Views {
|
|||
private Action cbOK;
|
||||
private Action cbCancel;
|
||||
|
||||
public ConfirmDialog(string title, string message) {
|
||||
Owner = App.Current.MainWindow;
|
||||
|
||||
cbOK = null;
|
||||
cbCancel = null;
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
txtTitle.Text = title;
|
||||
txtMessage.Text = message;
|
||||
btnCancel.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
public ConfirmDialog(string title, string message, Action onOk, Action onCancel = null) {
|
||||
Owner = App.Current.MainWindow;
|
||||
|
||||
cbOK = onOk;
|
||||
cbCancel = onCancel;
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
txtTitle.Text = title;
|
||||
txtMessage.Text = message;
|
||||
|
||||
cbOK = onOk;
|
||||
cbCancel = onCancel;
|
||||
btnCancel.Visibility = Visibility.Visible;
|
||||
}
|
||||
|
||||
private void OnSure(object sender, RoutedEventArgs e) {
|
||||
|
|
|
@ -373,6 +373,7 @@ namespace SourceGit.Views.Widgets {
|
|||
dialog.ShowNewFolderButton = true;
|
||||
if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) {
|
||||
new Commands.FormatPatch(repo.Path, commit.SHA, dialog.SelectedPath).Exec();
|
||||
new ConfirmDialog(App.Text("Notice"), App.Text("SaveAsPatchSuccess")).ShowDialog();
|
||||
}
|
||||
};
|
||||
menu.Items.Add(saveToPatch);
|
||||
|
|
|
@ -43,8 +43,6 @@ namespace SourceGit.Views.Widgets {
|
|||
waiting.Visibility = Visibility.Collapsed;
|
||||
waiting.IsAnimating = false;
|
||||
});
|
||||
|
||||
confirmDialog.Owner = App.Current.MainWindow;
|
||||
confirmDialog.ShowDialog();
|
||||
e.Handled = true;
|
||||
}
|
||||
|
|
|
@ -107,7 +107,6 @@ namespace SourceGit.Views.Widgets {
|
|||
Models.Preference.Instance.RemoveRepository(repo.Path);
|
||||
UpdateVisibles();
|
||||
});
|
||||
confirmDialog.Owner = App.Current.MainWindow;
|
||||
confirmDialog.ShowDialog();
|
||||
e.Handled = true;
|
||||
}
|
||||
|
|
|
@ -396,6 +396,8 @@ namespace SourceGit.Views.Widgets {
|
|||
stream.Flush();
|
||||
writer.Close();
|
||||
stream.Close();
|
||||
|
||||
new ConfirmDialog(App.Text("Notice"), App.Text("SaveAsPatchSuccess")).ShowDialog();
|
||||
}
|
||||
|
||||
private void OpenUnstagedContextMenuByNodes(ContextMenu menu, List<ChangeNode> nodes, List<Models.Change> changes) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue