GUI: use WAV variants of the default GUI job sounds

It seems that WAV is the only format supported across most versions of
Qt (5 & 6) and most operating systems.

Existing "run program" configurations will be adjusted if they still
contain Ogg files with the installation directory placeholder.
This commit is contained in:
Moritz Bunkus 2022-04-09 11:24:31 +02:00
parent 4a4e8dc035
commit ac9951eaed
No known key found for this signature in database
GPG Key ID: 74AF00ADF2E32C85
7 changed files with 24 additions and 0 deletions

Binary file not shown.

BIN
share/sounds/finished-1.wav Normal file

Binary file not shown.

Binary file not shown.

BIN
share/sounds/finished-2.wav Normal file

Binary file not shown.

Binary file not shown.

BIN
share/sounds/finished-3.wav Normal file

Binary file not shown.

View File

@ -264,6 +264,29 @@ convert67_0_0UseISO639_3Languages(version_number_t const &writtenByVersion) {
reg->endGroup();
}
void
convert67_0_0DefaultAudioFileNames(version_number_t const &writtenByVersion) {
if (writtenByVersion >= version_number_t{"67.0.0.0"})
return;
auto reg = Settings::registry();
auto oggRe = QRegularExpression{Q("<MTX_INSTALLATION_DIRECTORY>.*ogg$")};
reg->beginGroup(s_grpRunProgramConfigurations);
for (auto const &group : reg->childGroups()) {
reg->beginGroup(group);
auto audioFile = reg->value(s_valAudioFile).toString();
if (audioFile.contains(oggRe))
reg->setValue(s_valAudioFile, audioFile.left(audioFile.length() - 3) + Q("wav"));
reg->endGroup();
}
reg->endGroup(); // runProgramConfigurations
}
} // anonymous namespace
QString
@ -449,6 +472,7 @@ Settings::convertOldSettings() {
convert66_0_0LanguageShortcuts();
convert67_0_0AttachmentsAlwaysSkipForExistingName(writtenByVersion);
convert67_0_0UseISO639_3Languages(writtenByVersion);
convert67_0_0DefaultAudioFileNames(writtenByVersion);
}
void