Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Check for update on start toggle #1357

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion OpenUtau.Core/Util/Preferences.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
Expand Down Expand Up @@ -181,6 +181,7 @@ public class SerializablePreferences {
public int OtoEditor = 0;
public string VLabelerPath = string.Empty;
public string SetParamPath = string.Empty;
public bool CheckForUpdateOnStart = true;
public bool Beta = false;
public bool RememberMid = false;
public bool RememberUst = true;
Expand Down
3 changes: 2 additions & 1 deletion OpenUtau/Strings/Strings.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ Warning: this option removes custom presets.</system:String>

<system:String x:Key="prefs.advanced">Advanced</system:String>
<system:String x:Key="prefs.advanced.beta">Beta</system:String>
<system:String x:Key="prefs.advanced.checkupdateonstart">Check for update on start</system:String>
<system:String x:Key="prefs.advanced.importtempo">When importing tracks, use the tempos of the imported project</system:String>
<system:String x:Key="prefs.advanced.importtempo.always">Always</system:String>
<system:String x:Key="prefs.advanced.importtempo.ask">Ask me each time</system:String>
Expand Down Expand Up @@ -571,4 +572,4 @@ General
<system:String x:Key="warning">Warning</system:String>
<system:String x:Key="warning.asciipath">Your OpenUtau home path "{0}" contains non-ASCII character. Exe resamplers may not work.</system:String>
<system:String x:Key="warning.renderer">No settings for this renderer.</system:String>
</ResourceDictionary>
</ResourceDictionary>
1 change: 1 addition & 0 deletions OpenUtau/Strings/Strings.de-DE.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ Warnung: Diese Option entfernt alle benutzerdefinierten Einstellungen.</system:S
<system:String x:Key="pianoroll.tool.selectionv2">Auswahlwerkzeug (1)</system:String>

<system:String x:Key="prefs.advanced">Fortgeschritten</system:String>
<system:String x:Key="prefs.advanced.checkupdateonstart">Beim Start nach Update suchen</system:String>
<!--<system:String x:Key="prefs.advanced.beta">Beta</system:String>-->
<system:String x:Key="prefs.advanced.importtempo">Beim importieren von Spuren das Tempo des importierten Projekts verwenden</system:String>
<system:String x:Key="prefs.advanced.importtempo.always">Immer</system:String>
Expand Down
1 change: 1 addition & 0 deletions OpenUtau/Strings/Strings.es-ES.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ Warning: this option removes custom presets.</system:String>-->
<!--<system:String x:Key="pianoroll.tool.selectionv2">Selection Tool (1)</system:String>-->

<!--<system:String x:Key="prefs.advanced">Advanced</system:String>-->
<!--<system:String x:Key="prefs.advanced.checkupdateonstart">Check for update on start</system:String>-->
<!--<system:String x:Key="prefs.advanced.beta">Beta</system:String>-->
<!--<system:String x:Key="prefs.advanced.importtempo">When importing tracks, use the tempos of the imported project</system:String>-->
<!--<system:String x:Key="prefs.advanced.importtempo.always">Always</system:String>-->
Expand Down
1 change: 1 addition & 0 deletions OpenUtau/Strings/Strings.es-MX.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ Advertencia: Esta opción eliminará las bases personalizadas.</system:String>
<system:String x:Key="pianoroll.tool.selectionv2">Mano (1)</system:String>

<system:String x:Key="prefs.advanced">Avanzado</system:String>
<!--<system:String x:Key="prefs.advanced.checkupdateonstart">Check for update on start</system:String>-->
<!--<system:String x:Key="prefs.advanced.beta">Beta</system:String>-->
<!--<system:String x:Key="prefs.advanced.importtempo">When importing tracks, use the tempos of the imported project</system:String>-->
<!--<system:String x:Key="prefs.advanced.importtempo.always">Always</system:String>-->
Expand Down
1 change: 1 addition & 0 deletions OpenUtau/Strings/Strings.fi-FI.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ Warning: this option removes custom presets.</system:String>-->
<!--<system:String x:Key="pianoroll.tool.selectionv2">Selection Tool (1)</system:String>-->

<system:String x:Key="prefs.advanced">Lisäasetukset</system:String>
<!--<system:String x:Key="prefs.advanced.checkupdateonstart">Check for update on start</system:String>-->
<system:String x:Key="prefs.advanced.beta">Beta versio</system:String>
<!--<system:String x:Key="prefs.advanced.importtempo">When importing tracks, use the tempos of the imported project</system:String>-->
<!--<system:String x:Key="prefs.advanced.importtempo.always">Always</system:String>-->
Expand Down
1 change: 1 addition & 0 deletions OpenUtau/Strings/Strings.fr-FR.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ Attention: cela va effacer le préréglage.</system:String>
<system:String x:Key="pianoroll.tool.selectionv2">Sélectionner (1)</system:String>

<system:String x:Key="prefs.advanced">Paramètres avancés</system:String>
<!--<system:String x:Key="prefs.advanced.checkupdateonstart">Check for update on start</system:String>-->
<!--<system:String x:Key="prefs.advanced.beta">Beta</system:String>-->
<!--<system:String x:Key="prefs.advanced.importtempo">When importing tracks, use the tempos of the imported project</system:String>-->
<!--<system:String x:Key="prefs.advanced.importtempo.always">Always</system:String>-->
Expand Down
1 change: 1 addition & 0 deletions OpenUtau/Strings/Strings.id-ID.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ Peringatan: opsi ini menghapus prasetel khusus.</system:String>
<system:String x:Key="pianoroll.tool.selectionv2">Alat Seleksi (1)</system:String>

<system:String x:Key="prefs.advanced">Lanjutan</system:String>
<!--<system:String x:Key="prefs.advanced.checkupdateonstart">Check for update on start</system:String>-->
<!--<system:String x:Key="prefs.advanced.beta">Beta</system:String>-->
<!--<system:String x:Key="prefs.advanced.importtempo">When importing tracks, use the tempos of the imported project</system:String>-->
<!--<system:String x:Key="prefs.advanced.importtempo.always">Always</system:String>-->
Expand Down
1 change: 1 addition & 0 deletions OpenUtau/Strings/Strings.it-IT.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ Tieni premuto Ctrl per selezionare</system:String>
<system:String x:Key="pianoroll.tool.selectionv2">Strumento Selezione (1)</system:String>

<system:String x:Key="prefs.advanced">Avanzato</system:String>
<!--<system:String x:Key="prefs.advanced.checkupdateonstart">Check for update on start</system:String>-->
<!--<system:String x:Key="prefs.advanced.beta">Beta</system:String>-->
<!--<system:String x:Key="prefs.advanced.importtempo">When importing tracks, use the tempos of the imported project</system:String>-->
<!--<system:String x:Key="prefs.advanced.importtempo.always">Always</system:String>-->
Expand Down
1 change: 1 addition & 0 deletions OpenUtau/Strings/Strings.ja-JP.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@
<system:String x:Key="pianoroll.tool.selectionv2">選択ツール (1)</system:String>

<system:String x:Key="prefs.advanced">高度な設定</system:String>
<system:String x:Key="prefs.advanced.checkupdateonstart">起動時にアップデートをチェック</system:String>
<system:String x:Key="prefs.advanced.beta">ベータ版</system:String>
<system:String x:Key="prefs.advanced.importtempo">トラックのインポート時、テンポもインポートする</system:String>
<system:String x:Key="prefs.advanced.importtempo.always">常にインポートする</system:String>
Expand Down
1 change: 1 addition & 0 deletions OpenUtau/Strings/Strings.ko-KR.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@
<system:String x:Key="pianoroll.tool.selectionv2">선택 도구 (1)</system:String>

<system:String x:Key="prefs.advanced">고급</system:String>
<!--<system:String x:Key="prefs.advanced.checkupdateonstart">Check for update on start</system:String>-->
<system:String x:Key="prefs.advanced.beta">베타 버전 사용</system:String>
<system:String x:Key="prefs.advanced.importtempo">프로젝트를 불러올 때, 프로젝트에 포함된 템포 사용</system:String>
<system:String x:Key="prefs.advanced.importtempo.always">항상</system:String>
Expand Down
1 change: 1 addition & 0 deletions OpenUtau/Strings/Strings.nl-NL.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ Ctrl ingedrukt houden om te selecteren</system:String>
<system:String x:Key="pianoroll.tool.selectionv2">Selectiegereedschap (1)</system:String>

<system:String x:Key="prefs.advanced">Geavanceerd</system:String>
<!--<system:String x:Key="prefs.advanced.checkupdateonstart">Check for update on start</system:String>-->
<!--<system:String x:Key="prefs.advanced.beta">Beta</system:String>-->
<!--<system:String x:Key="prefs.advanced.importtempo">When importing tracks, use the tempos of the imported project</system:String>-->
<!--<system:String x:Key="prefs.advanced.importtempo.always">Always</system:String>-->
Expand Down
1 change: 1 addition & 0 deletions OpenUtau/Strings/Strings.pl-PL.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ Uwaga: ta opcja usuwa presety własne.</system:String>
<system:String x:Key="pianoroll.tool.selectionv2">Zaznaczanie (1)</system:String>

<system:String x:Key="prefs.advanced">Zaawansowane</system:String>
<!--<system:String x:Key="prefs.advanced.checkupdateonstart">Check for update on start</system:String>-->
<!--<system:String x:Key="prefs.advanced.beta">Beta</system:String>-->
<system:String x:Key="prefs.advanced.importtempo">Przy imporcie ścieżek użyj tempa importowanego projektu</system:String>
<system:String x:Key="prefs.advanced.importtempo.always">Zawsze</system:String>
Expand Down
1 change: 1 addition & 0 deletions OpenUtau/Strings/Strings.pt-BR.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ Segure Ctrl para selecionar</system:String>
<system:String x:Key="pianoroll.tool.selectionv2">Ferramenta Seleção (1)</system:String>

<system:String x:Key="prefs.advanced">Avançado</system:String>
<!--<system:String x:Key="prefs.advanced.checkupdateonstart">Check for update on start</system:String>-->
<!--<system:String x:Key="prefs.advanced.beta">Beta</system:String>-->
<!--<system:String x:Key="prefs.advanced.importtempo">When importing tracks, use the tempos of the imported project</system:String>-->
<!--<system:String x:Key="prefs.advanced.importtempo.always">Always</system:String>-->
Expand Down
1 change: 1 addition & 0 deletions OpenUtau/Strings/Strings.ru-RU.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@
<system:String x:Key="pianoroll.tool.selectionv2">Инструмент выбора (1)</system:String>

<system:String x:Key="prefs.advanced">Дополнительно</system:String>
<!--<system:String x:Key="prefs.advanced.checkupdateonstart">Check for update on start</system:String>-->
<system:String x:Key="prefs.advanced.beta">Бета</system:String>
<system:String x:Key="prefs.advanced.importtempo">Когда импортировуются треки, использовать темп импортированного проекта</system:String>
<system:String x:Key="prefs.advanced.importtempo.always">Всегда</system:String>
Expand Down
1 change: 1 addition & 0 deletions OpenUtau/Strings/Strings.th-TH.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@
<!--<system:String x:Key="pianoroll.tool.selectionv2">Selection Tool (1)</system:String>-->

<system:String x:Key="prefs.advanced">ขั้นสูง</system:String>
<!--<system:String x:Key="prefs.advanced.checkupdateonstart">Check for update on start</system:String>-->
<system:String x:Key="prefs.advanced.beta">เบต้า</system:String>
<!--<system:String x:Key="prefs.advanced.importtempo">When importing tracks, use the tempos of the imported project</system:String>-->
<!--<system:String x:Key="prefs.advanced.importtempo.always">Always</system:String>-->
Expand Down
1 change: 1 addition & 0 deletions OpenUtau/Strings/Strings.vi-VN.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ Lưu ý: tuỳ chọn này cũng sẽ xoá các tổ hợp thiết lập của b
<system:String x:Key="pianoroll.tool.selectionv2">Chọn nốt (1)</system:String>

<system:String x:Key="prefs.advanced">Nâng cao</system:String>
<!--<system:String x:Key="prefs.advanced.checkupdateonstart">Check for update on start</system:String>-->
<system:String x:Key="prefs.advanced.beta">Tính năng thử nghiệm</system:String>
<system:String x:Key="prefs.advanced.importtempo">Khi cho vào track, sử dụng nhịp độ kèm trong tệp đó</system:String>
<system:String x:Key="prefs.advanced.importtempo.always">Luôn luôn</system:String>
Expand Down
1 change: 1 addition & 0 deletions OpenUtau/Strings/Strings.zh-CN.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@
<system:String x:Key="pianoroll.tool.selectionv2">选择工具 (1)</system:String>

<system:String x:Key="prefs.advanced">高级</system:String>
<!--<system:String x:Key="prefs.advanced.checkupdateonstart">Check for update on start</system:String>-->
<system:String x:Key="prefs.advanced.beta">Beta测试版</system:String>
<system:String x:Key="prefs.advanced.importtempo">导入音轨时导入曲速</system:String>
<system:String x:Key="prefs.advanced.importtempo.always">总是</system:String>
Expand Down
1 change: 1 addition & 0 deletions OpenUtau/Strings/Strings.zh-TW.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@
<!--<system:String x:Key="pianoroll.tool.selectionv2">Selection Tool (1)</system:String>-->

<system:String x:Key="prefs.advanced">進階</system:String>
<!--<system:String x:Key="prefs.advanced.checkupdateonstart">Check for update on start</system:String>-->
<system:String x:Key="prefs.advanced.beta">測試版</system:String>
<!--<system:String x:Key="prefs.advanced.importtempo">When importing tracks, use the tempos of the imported project</system:String>-->
<!--<system:String x:Key="prefs.advanced.importtempo.always">Always</system:String>-->
Expand Down
10 changes: 9 additions & 1 deletion OpenUtau/ViewModels/PreferencesViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ public CultureInfo? SortingOrder {
set => this.RaiseAndSetIfChanged(ref sortingOrder, value);
}

[Reactive] public bool CheckForUpdateOnStart { get; set; }

[Reactive] public bool Beta { get; set; }

public class LyricsHelperOption {
Expand Down Expand Up @@ -152,6 +154,7 @@ public PreferencesViewModel() {
ShowPortrait = Preferences.Default.ShowPortrait;
ShowIcon = Preferences.Default.ShowIcon;
ShowGhostNotes = Preferences.Default.ShowGhostNotes;
CheckForUpdateOnStart = Preferences.Default.CheckForUpdateOnStart;
Beta = Preferences.Default.Beta;
LyricsHelper = LyricsHelpers.FirstOrDefault(option => option.klass.Equals(ActiveLyricsHelper.Inst.GetPreferred()));
LyricsHelperBrackets = Preferences.Default.LyricsHelperBrackets;
Expand Down Expand Up @@ -261,6 +264,11 @@ public PreferencesViewModel() {
Preferences.Save();
MessageBus.Current.SendMessage(new PianorollRefreshEvent("Part"));
});
this.WhenAnyValue(vm => vm.CheckForUpdateOnStart)
.Subscribe(checkForUpdateOnStart => {
Preferences.Default.CheckForUpdateOnStart = checkForUpdateOnStart;
Preferences.Save();
});
this.WhenAnyValue(vm => vm.Beta)
.Subscribe(beta => {
Preferences.Default.Beta = beta;
Expand Down Expand Up @@ -382,4 +390,4 @@ public void SetSetParamPath(string path) {
this.RaisePropertyChanged(nameof(SetParamPath));
}
}
}
}
12 changes: 7 additions & 5 deletions OpenUtau/Views/MainWindow.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,13 @@ public MainWindow() {

DocManager.Inst.AddSubscriber(this);

Log.Information("Main window checking Update.");
UpdaterDialog.CheckForUpdate(
dialog => dialog.Show(this),
() => (Application.Current?.ApplicationLifetime as IControlledApplicationLifetime)?.Shutdown(),
TaskScheduler.FromCurrentSynchronizationContext());
if (Preferences.Default.CheckForUpdateOnStart) {
Log.Information("Main window checking Update.");
UpdaterDialog.CheckForUpdate(
dialog => dialog.Show(this),
() => (Application.Current?.ApplicationLifetime as IControlledApplicationLifetime)?.Shutdown(),
TaskScheduler.FromCurrentSynchronizationContext());
}
Log.Information("Created main window.");
}

Expand Down
6 changes: 5 additions & 1 deletion OpenUtau/Views/PreferencesDialog.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,10 @@

<!-- Advanced -->
<StackPanel>
<Grid Margin="0,5,0,0">
<TextBlock Text="{DynamicResource prefs.advanced.checkupdateonstart}" HorizontalAlignment="Left"/>
<ToggleSwitch IsChecked="{Binding CheckForUpdateOnStart}"/>
</Grid>
<Grid Margin="0,5,0,0">
<TextBlock Text="{DynamicResource prefs.advanced.beta}" HorizontalAlignment="Left"/>
<ToggleSwitch IsChecked="{Binding Beta}"/>
Expand All @@ -293,4 +297,4 @@
</Carousel>
</ScrollViewer>
</Grid>
</Window>
</Window>
Loading