mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2025-01-23 01:36:57 -08:00
optimize<FileHistories>: remove use this version button from file histories.
This commit is contained in:
parent
559829c054
commit
fcad602144
2 changed files with 1 additions and 37 deletions
|
@ -131,24 +131,7 @@
|
|||
<GridSplitter Grid.Column="1" Width="1" HorizontalAlignment="Center" VerticalAlignment="Stretch" Background="Transparent"/>
|
||||
|
||||
<!-- Diff Viewer -->
|
||||
<Grid Grid.Column="2" Margin="4,4,4,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="36"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<widgets:DiffViewer Grid.Row="0" x:Name="diffViewer" />
|
||||
|
||||
<Button
|
||||
Grid.Row="1"
|
||||
Height="30"
|
||||
Padding="8,0"
|
||||
FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Background="{DynamicResource Brush.Accent1}"
|
||||
Content="{DynamicResource Text.FileHistory.UseThisVersion}"
|
||||
Click="UseSelectedVersion"/>
|
||||
</Grid>
|
||||
<widgets:DiffViewer Grid.Column="2" x:Name="diffViewer" Margin="4" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</controls:Window>
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
@ -61,24 +60,6 @@ namespace SourceGit.Views {
|
|||
Models.Watcher.Get(repo).NavigateTo(e.Uri.OriginalString);
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
private async void UseSelectedVersion(object sender, RoutedEventArgs e) {
|
||||
var commit = commitList.SelectedItem as Models.Commit;
|
||||
if (commit == null) return;
|
||||
|
||||
loading.IsAnimating = true;
|
||||
loading.Visibility = Visibility.Visible;
|
||||
|
||||
await Task.Run(() => {
|
||||
Models.Watcher.SetEnabled(repo, false);
|
||||
new Commands.Checkout(repo).FileWithRevision(file, commit.SHA);
|
||||
Models.Watcher.SetEnabled(repo, true);
|
||||
});
|
||||
|
||||
loading.IsAnimating = false;
|
||||
loading.Visibility = Visibility.Collapsed;
|
||||
e.Handled = true;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue