mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 04:34: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
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue