mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 04:34:59 +00:00
feature: add a button to scan repositories under default clone dir (#427)
This commit is contained in:
parent
aab14784fc
commit
0d676fa3fb
9 changed files with 162 additions and 3 deletions
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Avalonia.Collections;
|
||||
using Avalonia.Controls;
|
||||
|
@ -114,6 +115,17 @@ namespace SourceGit.ViewModels
|
|||
Native.OS.OpenTerminal(null);
|
||||
}
|
||||
|
||||
public void ScanDefaultCloneDir()
|
||||
{
|
||||
var defaultCloneDir = Preference.Instance.GitDefaultCloneDir;
|
||||
if (string.IsNullOrEmpty(defaultCloneDir))
|
||||
App.RaiseException(PopupHost.Active.GetId(), "The default clone dir haven't been configured!");
|
||||
else if (!Directory.Exists(defaultCloneDir))
|
||||
App.RaiseException(PopupHost.Active.GetId(), $"The default clone dir '{defaultCloneDir}' is not exists!");
|
||||
else if (PopupHost.CanCreatePopup())
|
||||
PopupHost.ShowAndStartPopup(new ScanRepositories(defaultCloneDir));
|
||||
}
|
||||
|
||||
public void ClearSearchFilter()
|
||||
{
|
||||
SearchFilter = string.Empty;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue