feature<Launcher>: supports restore last opened tabs when startup

This commit is contained in:
leo 2021-07-06 09:58:36 +08:00
parent 2ddc61e162
commit f6c17e7d34
7 changed files with 90 additions and 20 deletions

View file

@ -85,6 +85,18 @@ namespace SourceGit {
}
if (repo != null) Models.Watcher.Open(repo);
} else {
var restore = Models.Preference.Instance.Restore;
var actived = null as Models.Repository;
if (restore.IsEnabled && restore.Opened.Count > 0) {
foreach (var path in restore.Opened) {
var repo = Models.Preference.Instance.FindRepository(path);
if (repo != null) Models.Watcher.Open(repo);
if (path == restore.Actived) actived = repo;
}
if (actived != null) Models.Watcher.Open(actived);
}
}
// 检测更新