mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -08:00
feature: use Ctrl
+ click to stash all changes automatically with default options (#351)
This commit is contained in:
parent
965a4b21ae
commit
429e037adb
4 changed files with 27 additions and 9 deletions
|
@ -616,15 +616,9 @@ namespace SourceGit.ViewModels
|
|||
Task.Run(RefreshCommits);
|
||||
}
|
||||
|
||||
public void StashAll()
|
||||
public void StashAll(bool autoStart)
|
||||
{
|
||||
if (PopupHost.CanCreatePopup())
|
||||
{
|
||||
var changes = new List<Models.Change>();
|
||||
changes.AddRange(_workingCopy.Unstaged);
|
||||
changes.AddRange(_workingCopy.Staged);
|
||||
PopupHost.ShowPopup(new StashChanges(this, changes, true));
|
||||
}
|
||||
_workingCopy?.StashAll(autoStart);
|
||||
}
|
||||
|
||||
public void GotoResolve()
|
||||
|
|
|
@ -317,6 +317,17 @@ namespace SourceGit.ViewModels
|
|||
dialog.ShowDialog(toplevel);
|
||||
}
|
||||
|
||||
public void StashAll(bool autoStart)
|
||||
{
|
||||
if (!PopupHost.CanCreatePopup())
|
||||
return;
|
||||
|
||||
if (autoStart)
|
||||
PopupHost.ShowAndStartPopup(new StashChanges(_repo, _cached, true));
|
||||
else
|
||||
PopupHost.ShowPopup(new StashChanges(_repo, _cached, true));
|
||||
}
|
||||
|
||||
public void StageSelected()
|
||||
{
|
||||
StageChanges(_selectedUnstaged);
|
||||
|
|
|
@ -64,7 +64,14 @@
|
|||
<Path Width="14" Height="14" Data="{StaticResource Icons.Push}"/>
|
||||
</Button>
|
||||
|
||||
<Button Classes="icon_button" Width="32" Margin="16,0,0,0" Command="{Binding StashAll}" ToolTip.Tip="{DynamicResource Text.Stash}">
|
||||
<Button Classes="icon_button" Width="32" Margin="16,0,0,0" Click="StashAll">
|
||||
<ToolTip.Tip>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<TextBlock Text="{DynamicResource Text.Stash}"/>
|
||||
<TextBlock Classes="small italic" Margin="0,4,0,0" Text="{DynamicResource Text.CtrlClickTip}" Foreground="{DynamicResource Brush.FG2}"/>
|
||||
</StackPanel>
|
||||
</ToolTip.Tip>
|
||||
|
||||
<Path Width="14" Height="14" Data="{StaticResource Icons.Stashes.Add}"/>
|
||||
</Button>
|
||||
|
||||
|
|
|
@ -71,6 +71,12 @@ namespace SourceGit.Views
|
|||
e.Handled = true;
|
||||
}
|
||||
|
||||
private void StashAll(object _, RoutedEventArgs e)
|
||||
{
|
||||
(DataContext as ViewModels.Repository)?.StashAll(_hasCtrl);
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
private void OpenGitFlowMenu(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (DataContext is ViewModels.Repository repo)
|
||||
|
|
Loading…
Reference in a new issue