mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-26 21:17:20 -08:00
feature: supports open selected revision file with default editor (#674)
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
06656f625e
commit
67cf23267a
1 changed files with 11 additions and 0 deletions
|
@ -384,6 +384,16 @@ namespace SourceGit.ViewModels
|
||||||
ev.Handled = true;
|
ev.Handled = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var openWith = new MenuItem();
|
||||||
|
openWith.Header = App.Text("OpenWith");
|
||||||
|
openWith.Icon = App.CreateMenuIcon("Icons.OpenWith");
|
||||||
|
openWith.IsEnabled = File.Exists(fullPath);
|
||||||
|
openWith.Click += (_, ev) =>
|
||||||
|
{
|
||||||
|
Native.OS.OpenWithDefaultEditor(fullPath);
|
||||||
|
ev.Handled = true;
|
||||||
|
};
|
||||||
|
|
||||||
var saveAs = new MenuItem();
|
var saveAs = new MenuItem();
|
||||||
saveAs.Header = App.Text("SaveAs");
|
saveAs.Header = App.Text("SaveAs");
|
||||||
saveAs.Icon = App.CreateMenuIcon("Icons.Save");
|
saveAs.Icon = App.CreateMenuIcon("Icons.Save");
|
||||||
|
@ -413,6 +423,7 @@ namespace SourceGit.ViewModels
|
||||||
};
|
};
|
||||||
|
|
||||||
menu.Items.Add(explore);
|
menu.Items.Add(explore);
|
||||||
|
menu.Items.Add(openWith);
|
||||||
menu.Items.Add(saveAs);
|
menu.Items.Add(saveAs);
|
||||||
menu.Items.Add(new MenuItem() { Header = "-" });
|
menu.Items.Add(new MenuItem() { Header = "-" });
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue