Permalink
Browse files

fix work item: 17798, allow ctrl + enter to commit in pending changes

  • Loading branch information...
1 parent 2754646 commit 6e439bbaed8afee24ea65aceb48866a2c26265f3 @yysun committed Oct 27, 2012
Showing with 20 additions and 6 deletions.
  1. +1 −1 GitUI/UI/PendingChanges.xaml
  2. +11 −4 GitUI/UI/PendingChanges.xaml.cs
  3. +1 −1 PendingChangesView.xaml
  4. +7 −0 PendingChangesView.xaml.cs
@@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
- d:DesignHeight="300" d:DesignWidth="800">
+ d:DesignHeight="300" d:DesignWidth="800" KeyDown="UserControl_KeyDown">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
@@ -530,23 +530,30 @@ private void btnPendingChanges_Click(object sender, RoutedEventArgs e)
var isAmend = chkAmend.IsChecked == true;
if (HasComments() && StageSelectedFiles(!isAmend))
{
-
ShowStatusMessage("Committing ...");
var id = tracker.Commit(Comments, isAmend, chkSignOff.IsChecked == true);
ShowStatusMessage("Commit successfully. Commit Hash: " + id);
ClearUI();
+
+ HistoryViewCommands.CloseCommitDetails.Execute(this, null);
+ HistoryViewCommands.RefreshGraph.Execute(this, null);
}
service.NoRefresh = false;
-
- HistoryViewCommands.CloseCommitDetails.Execute(this, null);
- HistoryViewCommands.RefreshGraph.Execute(this, null);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Exclamation);
ShowStatusMessage(ex.Message);
}
}
+
+ private void UserControl_KeyDown(object sender, KeyEventArgs e)
+ {
+ if (e.Key == Key.Enter && Keyboard.Modifiers == ModifierKeys.Control)
+ {
+ btnPendingChanges_Click(this, null);
+ }
+ }
}
public static class ExtHelper
View
@@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
- d:DesignHeight="300" d:DesignWidth="800">
+ d:DesignHeight="300" d:DesignWidth="800" KeyDown="UserControl_KeyDown">
<Grid x:Name="Main" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
@@ -636,6 +636,13 @@ private void OpenFile(string fileName)
if (!opened) dte.ItemOperations.OpenFile(fileName);
}
+ private void UserControl_KeyDown(object sender, KeyEventArgs e)
+ {
+ if (e.Key == Key.Enter && Keyboard.Modifiers == ModifierKeys.Control)
+ {
+ this.Commit();
+ }
+ }
}
public static class ExtHelper

0 comments on commit 6e439bb

Please sign in to comment.