Skip to content

Commit

Permalink
chore: 优化扩展功能
Browse files Browse the repository at this point in the history
  • Loading branch information
LiuYunPlayer committed Nov 21, 2024
1 parent f8bc3ba commit ad1e9cd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
2 changes: 1 addition & 1 deletion TuneLab/Resources/Translations/zh-CN.toml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
"Redo" = "重做"
"Settings" = "设置"

"Extensions" = "功能"
"Extensions" = "扩展"
"Install/Update" = "安装或更新"

"Project" = "工程"
Expand Down
20 changes: 1 addition & 19 deletions TuneLab/UI/MainWindow/Editor/Editor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -811,24 +811,6 @@ Menu CreateMenu()
});
menuBarItem.Items.Add(menuItem);
}
{
var menuItem = new MenuItem().SetTrName("Install Extensions").SetAction(async () =>
{
var topLevel = TopLevel.GetTopLevel(this);
if (topLevel == null)
return;
var files = await topLevel.StorageProvider.OpenFilePickerAsync(new FilePickerOpenOptions
{
Title = "Open Tlx File",
AllowMultiple = false,
FileTypeFilter = [new("Tlx Package") { Patterns = ["*.tlx"] }]
});
if (files.IsEmpty()) return;
var fileList = files.Select(f => f.TryGetLocalPath()).Where(f => f != null).ToArray();
if (fileList != null) InstallExtensions(fileList);
});
menuBarItem.Items.Add(menuItem);
}
menu.Items.Add(menuBarItem);
}

Expand Down Expand Up @@ -876,7 +858,7 @@ Menu CreateMenu()
{
Title = "Open Tlx File",
AllowMultiple = false,
FileTypeFilter = [new("Tlx Package") { Patterns = ["*.tlx"] }]
FileTypeFilter = [new("TuneLab Extension") { Patterns = ["*.tlx"] }]
});
if (files.IsEmpty()) return;
var fileList = files.Select(f => f.TryGetLocalPath()).Where(f => f != null).ToArray();
Expand Down

0 comments on commit ad1e9cd

Please sign in to comment.