mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-20 11:44:59 +00:00
code_review: PR #1183
- code style in `Clone` constructor - re-design workspace configuration dialog Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
f14a666091
commit
b7aa49403b
12 changed files with 32 additions and 24 deletions
|
@ -176,6 +176,7 @@
|
|||
<x:String x:Key="Text.Configure.User.Placeholder" xml:space="preserve">Benutzername für dieses Repository</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace" xml:space="preserve">Arbeitsplätze</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Color" xml:space="preserve">Farbe</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Name" xml:space="preserve">Name</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Restore" xml:space="preserve">Zuletzt geöffnete Tabs beim Starten wiederherstellen</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit" xml:space="preserve">Konventionelle Commit-Hilfe</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.BreakingChanges" xml:space="preserve">Breaking Change:</x:String>
|
||||
|
|
|
@ -176,6 +176,7 @@
|
|||
<x:String x:Key="Text.Configure.User.Placeholder" xml:space="preserve">User name for this repository</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace" xml:space="preserve">Workspaces</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Color" xml:space="preserve">Color</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Name" xml:space="preserve">Name</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Restore" xml:space="preserve">Restore tabs on startup</x:String>
|
||||
<x:String x:Key="Text.ConfirmEmptyCommit.Continue" xml:space="preserve">CONTINUE</x:String>
|
||||
<x:String x:Key="Text.ConfirmEmptyCommit.NoLocalChanges" xml:space="preserve">Empty commit detected! Do you want to continue (--allow-empty)?</x:String>
|
||||
|
|
|
@ -179,6 +179,7 @@
|
|||
<x:String x:Key="Text.Configure.User.Placeholder" xml:space="preserve">Nombre de usuario para este repositorio</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace" xml:space="preserve">Espacios de Trabajo</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Color" xml:space="preserve">Color</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Name" xml:space="preserve">Nombre</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Restore" xml:space="preserve">Restaurar pestañas al iniciar</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit" xml:space="preserve">Asistente de Commit Convencional</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.BreakingChanges" xml:space="preserve">Cambio Importante:</x:String>
|
||||
|
|
|
@ -180,6 +180,7 @@
|
|||
<x:String x:Key="Text.Configure.User.Placeholder" xml:space="preserve">Nom d'utilisateur pour ce dépôt</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace" xml:space="preserve">Espaces de travail</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Color" xml:space="preserve">Couleur</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Name" xml:space="preserve">Nom</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Restore" xml:space="preserve">Restaurer les onglets au démarrage</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit" xml:space="preserve">Assistant Commits Conventionnels</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.BreakingChanges" xml:space="preserve">Changement Radical :</x:String>
|
||||
|
|
|
@ -179,6 +179,7 @@
|
|||
<x:String x:Key="Text.Configure.User.Placeholder" xml:space="preserve">Nome utente per questo repository</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace" xml:space="preserve">Spazi di Lavoro</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Color" xml:space="preserve">Colore</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Name" xml:space="preserve">Nome</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Restore" xml:space="preserve">Ripristina schede all'avvio</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit" xml:space="preserve">Guida Commit Convenzionali</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.BreakingChanges" xml:space="preserve">Modifica Sostanziale:</x:String>
|
||||
|
|
|
@ -179,6 +179,7 @@
|
|||
<x:String x:Key="Text.Configure.User.Placeholder" xml:space="preserve">このリポジトリにおけるユーザー名</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace" xml:space="preserve">ワークスペース</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Color" xml:space="preserve">色</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Name" xml:space="preserve">名前</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Restore" xml:space="preserve">起動時にタブを復元</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit" xml:space="preserve">Conventional Commitヘルパー</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.BreakingChanges" xml:space="preserve">破壊的変更:</x:String>
|
||||
|
|
|
@ -161,6 +161,7 @@
|
|||
<x:String x:Key="Text.Configure.User.Placeholder" xml:space="preserve">Nome de usuário para este repositório</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace" xml:space="preserve">Workspaces</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Color" xml:space="preserve">Cor</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Name" xml:space="preserve">Nome</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Restore" xml:space="preserve">Restaurar abas ao inicializar</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit" xml:space="preserve">Assistente de Conventional Commit</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.BreakingChanges" xml:space="preserve">Breaking Change:</x:String>
|
||||
|
|
|
@ -179,6 +179,7 @@
|
|||
<x:String x:Key="Text.Configure.User.Placeholder" xml:space="preserve">இந்த களஞ்சியத்திற்கான பயனர் பெயர்</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace" xml:space="preserve">பணியிடங்கள்</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Color" xml:space="preserve">நிறம்</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Name" xml:space="preserve">பெயர்</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Restore" xml:space="preserve">தாவல்களை மீட்டமை</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit" xml:space="preserve">வழக்கமான உறுதிமொழி உதவியாளர்</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.BreakingChanges" xml:space="preserve">உடைக்கும் மாற்றம்:</x:String>
|
||||
|
|
|
@ -180,6 +180,7 @@
|
|||
<x:String x:Key="Text.Configure.User.Placeholder" xml:space="preserve">应用于本仓库的用户名</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace" xml:space="preserve">工作区</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Color" xml:space="preserve">颜色</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Name" xml:space="preserve">名称</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Restore" xml:space="preserve">启动时恢复打开的仓库</x:String>
|
||||
<x:String x:Key="Text.ConfirmEmptyCommit.Continue" xml:space="preserve">确认继续</x:String>
|
||||
<x:String x:Key="Text.ConfirmEmptyCommit.NoLocalChanges" xml:space="preserve">提交未包含变更文件!是否继续(--allow-empty)?</x:String>
|
||||
|
|
|
@ -180,6 +180,7 @@
|
|||
<x:String x:Key="Text.Configure.User.Placeholder" xml:space="preserve">用於本存放庫的使用者名稱</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace" xml:space="preserve">工作區</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Color" xml:space="preserve">顏色</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Name" xml:space="preserve">名稱</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Restore" xml:space="preserve">啟動時還原上次開啟的存放庫</x:String>
|
||||
<x:String x:Key="Text.ConfirmEmptyCommit.Continue" xml:space="preserve">确认继续</x:String>
|
||||
<x:String x:Key="Text.ConfirmEmptyCommit.NoLocalChanges" xml:space="preserve">未包含任何檔案變更! 您是否仍要提交 (--allow-empty)?</x:String>
|
||||
|
|
|
@ -62,18 +62,13 @@ namespace SourceGit.ViewModels
|
|||
public Clone(string pageId)
|
||||
{
|
||||
_pageId = pageId;
|
||||
View = new Views.Clone() { DataContext = this };
|
||||
|
||||
// Use workspace-specific DefaultCloneDir if available
|
||||
var activeWorkspace = Preferences.Instance.GetActiveWorkspace();
|
||||
if (activeWorkspace != null && !string.IsNullOrEmpty(activeWorkspace.DefaultCloneDir))
|
||||
{
|
||||
ParentFolder = activeWorkspace.DefaultCloneDir;
|
||||
}
|
||||
else
|
||||
{
|
||||
ParentFolder = Preferences.Instance.GitDefaultCloneDir;
|
||||
}
|
||||
_parentFolder = activeWorkspace?.DefaultCloneDir;
|
||||
if (string.IsNullOrEmpty(ParentFolder))
|
||||
_parentFolder = Preferences.Instance.GitDefaultCloneDir;
|
||||
|
||||
View = new Views.Clone() { DataContext = this };
|
||||
|
||||
Task.Run(async () =>
|
||||
{
|
||||
|
@ -81,9 +76,7 @@ namespace SourceGit.ViewModels
|
|||
{
|
||||
var text = await App.GetClipboardTextAsync();
|
||||
if (Models.Remote.IsValidURL(text))
|
||||
{
|
||||
Dispatcher.UIThread.Invoke(() => Remote = text);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
|
|
@ -98,20 +98,25 @@
|
|||
<ContentControl Grid.Column="2" Content="{Binding Selected}">
|
||||
<ContentControl.DataTemplates>
|
||||
<DataTemplate DataType="vm:Workspace">
|
||||
<Grid RowDefinitions="32,32,32,32,Auto,Auto">
|
||||
<TextBox Grid.Row="0" CornerRadius="3" Height="28" Text="{Binding Name, Mode=TwoWay}"/>
|
||||
<CheckBox Grid.Row="1"
|
||||
<Grid RowDefinitions="30,32,30,32,30,Auto,32">
|
||||
<TextBlock Grid.Row="0" Margin="0,0,0,4" Text="{DynamicResource Text.ConfigureWorkspace.Name}" VerticalAlignment="Bottom"/>
|
||||
<TextBox Grid.Row="1" CornerRadius="3" Height="28" Text="{Binding Name, Mode=TwoWay}"/>
|
||||
|
||||
<TextBlock Grid.Row="2" Margin="0,0,0,4" Text="{DynamicResource Text.Preferences.Git.DefaultCloneDir}" VerticalAlignment="Bottom"/>
|
||||
<TextBox Grid.Row="3" CornerRadius="3" Height="28" Text="{Binding DefaultCloneDir, Mode=TwoWay}">
|
||||
<TextBox.InnerRightContent>
|
||||
<Button Classes="icon_button" Width="30" Height="30" Click="SelectDefaultCloneDir">
|
||||
<Path Data="{StaticResource Icons.Folder.Open}" Fill="{DynamicResource Brush.FG1}"/>
|
||||
</Button>
|
||||
</TextBox.InnerRightContent>
|
||||
</TextBox>
|
||||
|
||||
<TextBlock Grid.Row="4" Margin="0,0,0,4" Text="{DynamicResource Text.ConfigureWorkspace.Color}" VerticalAlignment="Bottom"/>
|
||||
<v:ColorPicker Grid.Row="5" HorizontalAlignment="Left" Value="{Binding Color, Mode=TwoWay}"/>
|
||||
|
||||
<CheckBox Grid.Row="6"
|
||||
Content="{DynamicResource Text.ConfigureWorkspace.Restore}"
|
||||
IsChecked="{Binding RestoreOnStartup, Mode=TwoWay}"/>
|
||||
<TextBlock Grid.Row="2" Margin="0,16,0,4" Text="{DynamicResource Text.Preferences.Git.DefaultCloneDir}"/>
|
||||
<Grid Grid.Row="3" ColumnDefinitions="*,Auto">
|
||||
<TextBox Grid.Column="0" CornerRadius="3" Height="28" Text="{Binding DefaultCloneDir, Mode=TwoWay}"/>
|
||||
<Button Grid.Column="1" Classes="icon_button" Width="30" Height="30" Click="SelectDefaultCloneDir">
|
||||
<Path Data="{StaticResource Icons.Folder.Open}" Fill="{DynamicResource Brush.FG1}"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
<TextBlock Grid.Row="4" Margin="0,16,0,4" Text="{DynamicResource Text.ConfigureWorkspace.Color}"/>
|
||||
<v:ColorPicker Grid.Row="5" HorizontalAlignment="Left" Value="{Binding Color, Mode=TwoWay}"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ContentControl.DataTemplates>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue