mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -08:00
OpenSubmodule Method
This commit is contained in:
parent
fec2b402e0
commit
033fbc6383
1 changed files with 22 additions and 17 deletions
|
@ -1538,16 +1538,12 @@ namespace SourceGit.ViewModels
|
||||||
return menu;
|
return menu;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ContextMenu CreateContextMenuForSubmodule(string submodule)
|
public void OpenSubmodule(string submodule)
|
||||||
{
|
|
||||||
var open = new MenuItem();
|
|
||||||
open.Header = App.Text("Submodule.Open");
|
|
||||||
open.Icon = App.CreateMenuIcon("Icons.Folder.Open");
|
|
||||||
open.Click += (o, ev) =>
|
|
||||||
{
|
{
|
||||||
var root = Path.GetFullPath(Path.Combine(_fullpath, submodule));
|
var root = Path.GetFullPath(Path.Combine(_fullpath, submodule));
|
||||||
var gitDir = new Commands.QueryGitDir(root).Result();
|
var gitDir = new Commands.QueryGitDir(root).Result();
|
||||||
var repo = Preference.AddRepository(root, gitDir);
|
var repo = Preference.AddRepository(root, gitDir);
|
||||||
|
|
||||||
var node = new RepositoryNode()
|
var node = new RepositoryNode()
|
||||||
{
|
{
|
||||||
Id = repo.FullPath,
|
Id = repo.FullPath,
|
||||||
|
@ -1561,7 +1557,16 @@ namespace SourceGit.ViewModels
|
||||||
{
|
{
|
||||||
launcher.OpenRepositoryInTab(node, null);
|
launcher.OpenRepositoryInTab(node, null);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public ContextMenu CreateContextMenuForSubmodule(string submodule)
|
||||||
|
{
|
||||||
|
var open = new MenuItem();
|
||||||
|
open.Header = App.Text("Submodule.Open");
|
||||||
|
open.Icon = App.CreateMenuIcon("Icons.Folder.Open");
|
||||||
|
open.Click += (o, ev) =>
|
||||||
|
{
|
||||||
|
OpenSubmodule(submodule);
|
||||||
ev.Handled = true;
|
ev.Handled = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue