Skip to content

Commit

Permalink
remove verify button
Browse files Browse the repository at this point in the history
  • Loading branch information
yysun committed Dec 21, 2013
1 parent 2d193f9 commit 99455ee
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 14 deletions.
17 changes: 9 additions & 8 deletions UI/Settings.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,16 @@
</Style>
</UserControl.Resources>
<Grid Background="White">
<Label Content="Browse or type the path to Git for Windows (git.exe) and verify" Height="28" HorizontalAlignment="Left" Margin="7,12,0,0" Name="label1" VerticalAlignment="Top" />
<TextBox Height="23" HorizontalAlignment="Stretch" Margin="12,38,120,0" Name="txtGitExePath" VerticalAlignment="Top" />
<Button Content="Browse ..." Height="23" HorizontalAlignment="Right" Margin="0,37,25,0" Name="btnBrowse" VerticalAlignment="Top" Width="75" Click="btnBrowse_Click" />
<Label Content="." Height="28" HorizontalAlignment="Left" Margin="105,66,0,0" Name="txtMessage" VerticalAlignment="Top" />
<Label Content="Browse or type the path to Git for Windows (git.exe)" Height="28" HorizontalAlignment="Left" Margin="7,12,0,0" Name="label1" VerticalAlignment="Top" />
<TextBox Height="23" HorizontalAlignment="Left" Margin="12,38,0,0" Name="txtGitExePath" VerticalAlignment="Top" Width="368" MouseDown="txtGitExePath_MouseDown" KeyUp="txtGitExePath_KeyUp" />
<Button Content="Browse ..." Height="23" HorizontalAlignment="Left" Margin="386,38,0,0" Name="btnBrowse" VerticalAlignment="Top" Width="75" Click="btnBrowse_Click" />
<Label Content="." Height="28" HorizontalAlignment="Left" Margin="12,66,0,0" Name="txtMessage" VerticalAlignment="Top" />
<Label Content="Git User Name" Height="28" HorizontalAlignment="Left" Margin="12,100,0,0" Name="label2" VerticalAlignment="Top" />
<TextBox Height="23" HorizontalAlignment="Stretch" Margin="105,105,120,0" Name="txtUserName" VerticalAlignment="Top" />
<TextBox Height="23" HorizontalAlignment="Left" Margin="105,105,0,0" Name="txtUserName" VerticalAlignment="Top" Width="275" />
<Label Content="Git User Email" Height="28" HorizontalAlignment="Left" Margin="12,129,0,0" Name="label3" VerticalAlignment="Top" />
<TextBox Height="23" HorizontalAlignment="Stretch" Margin="105,134,120,0" Name="txtUserEmail" VerticalAlignment="Top" />
<Button Content="Verify" Height="23" HorizontalAlignment="Left" Margin="12,67,0,0" Name="btnVerify" VerticalAlignment="Top" Width="75" Click="btnVerify_Click" />
<Button Content="OK" Height="23" HorizontalAlignment="Left" Margin="12,172,0,0" Name="btnOK" VerticalAlignment="Top" Width="75" Click="btnOK_Click" />
<TextBox Height="23" HorizontalAlignment="Left" Margin="105,134,0,0" Name="txtUserEmail" VerticalAlignment="Top" Width="275" />
<Button Content="Verify" Height="23" HorizontalAlignment="Left" Margin="386,71,0,0" Name="btnVerify" VerticalAlignment="Top" Width="75" Click="btnVerify_Click" Visibility="Hidden" />
<Button Content="Cancel" Height="23" HorizontalAlignment="Left" Margin="12,172,0,0" Name="btnCancel" VerticalAlignment="Top" Width="75" Click="btnCancel_Click" />
<Button Content="OK" Height="23" HorizontalAlignment="Left" Margin="105,172,0,0" Name="btnOK" VerticalAlignment="Top" Width="75" Click="btnOK_Click"/>
</Grid>
</UserControl>
25 changes: 19 additions & 6 deletions UI/Settings.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@ private void CheckGitBash()
txtMessage.Content = ex.Message;
}

if (GitBash.Exists && txtMessage.Content.ToString().StartsWith("git version"))
{
btnOK.Visibility = Visibility.Visible;
}
btnOK.IsEnabled = GitBash.Exists && txtMessage.Content.ToString().StartsWith("git version");
}

private void btnOK_Click(object sender, RoutedEventArgs e)
Expand Down Expand Up @@ -96,9 +93,10 @@ internal void Show()
{
this.Visibility = Visibility.Visible;
txtGitExePath.Text = GitBash.GitExePath;
btnOK.Visibility = Visibility.Collapsed;
btnOK.IsEnabled = false;
txtGitExePath.Text = GitSccOptions.Current.GitBashPath;
txtMessage.Content = "";
CheckGitBash();
}

internal void Hide()
Expand All @@ -108,9 +106,24 @@ internal void Hide()

private void btnVerify_Click(object sender, RoutedEventArgs e)
{
btnOK.Visibility = Visibility.Collapsed;
btnOK.IsEnabled = false;
txtMessage.Content = "";
CheckGitBash();
}

private void btnCancel_Click(object sender, RoutedEventArgs e)
{
Hide();
}

private void txtGitExePath_KeyUp(object sender, KeyEventArgs e)
{
if (e.Key == Key.Enter)
{
CheckGitBash();
}
}


}
}

0 comments on commit 99455ee

Please sign in to comment.