Skip to content

Commit

Permalink
Merge pull request #956 from oxygen-dioxide/install-oudep
Browse files Browse the repository at this point in the history
Add a "Install Dependency (.oudep)" item in Tools menu
  • Loading branch information
stakira authored Nov 30, 2023
2 parents 3bca5b9 + 38b00fb commit f9a0441
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions OpenUtau/FilePicker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ internal class FilePicker {
public static FilePickerFileType DS { get; } = new("DS") {
Patterns = new[] { "*.ds" },
};
public static FilePickerFileType OUDEP { get; } = new("OpenUtau dependency"){
Patterns = new[] { "*.oudep" },
};

public async static Task<string?> OpenFile(
Window window, string titleKey, params FilePickerFileType[] types) {
Expand Down
1 change: 1 addition & 0 deletions OpenUtau/Strings/Strings.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@
<system:String x:Key="menu.tools">Tools</system:String>
<system:String x:Key="menu.tools.clearcache">Clear Cache</system:String>
<system:String x:Key="menu.tools.debugwindow">Debug Window</system:String>
<system:String x:Key="menu.tools.dependency.install">Install Dependency (.oudep)...</system:String>
<system:String x:Key="menu.tools.layout">Layout</system:String>
<system:String x:Key="menu.tools.layout.hsplit11">Horizontal 1:1</system:String>
<system:String x:Key="menu.tools.layout.hsplit12">Horizontal 1:2</system:String>
Expand Down
1 change: 1 addition & 0 deletions OpenUtau/Views/MainWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
<MenuItem Header="{DynamicResource menu.tools.project.expressions}" Click="OnMenuExpressionss"/>
<MenuItem Header="{DynamicResource menu.tools.singers}" Click="OnMenuSingers"/>
<MenuItem Header="{DynamicResource menu.tools.singer.install}" Click="OnMenuInstallSinger"/>
<MenuItem Header="{DynamicResource menu.tools.dependency.install}" Click="OnMenuInstallDependency"/>
<MenuItem Header="{DynamicResource menu.tools.prefs}" Click="OnMenuPreferences"/>
</MenuItem>
<MenuItem Header="{DynamicResource menu.help}">
Expand Down
12 changes: 12 additions & 0 deletions OpenUtau/Views/MainWindow.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,18 @@ async void OnMenuInstallSinger(object sender, RoutedEventArgs args) {
}
}

async void OnMenuInstallDependency(object sender, RoutedEventArgs args){
var file = await FilePicker.OpenFile(
this, "menu.tools.dependency.install", FilePicker.OUDEP);
if (file == null) {
return;
}
if (file.EndsWith(DependencyInstaller.FileExt)) {
DependencyInstaller.Install(file);
return;
}
}

void OnMenuPreferences(object sender, RoutedEventArgs args) {
PreferencesViewModel dataContext;
try {
Expand Down

0 comments on commit f9a0441

Please sign in to comment.