Make it possible to not show Rosetta warning

Fixes #1180
This commit is contained in:
Jonas Kvinge
2023-04-18 18:03:39 +02:00
parent b273a449e3
commit cd03e1fc74
3 changed files with 43 additions and 10 deletions

View File

@@ -1042,15 +1042,15 @@ MainWindow::MainWindow(Application *app, std::shared_ptr<SystemTrayIcon> tray_ic
#if defined(Q_OS_MACOS)
if (Utilities::ProcessTranslated()) {
QErrorMessage *error_message = new QErrorMessage;
error_message->setAttribute(Qt::WA_DeleteOnClose);
error_message->resize(600, 220);
Utilities::CenterWidgetOnScreen(Utilities::GetScreen(this), error_message);
error_message->showMessage(tr("It is detected that Strawberry is running under Rosetta. Strawberry currently have limited macOS support, and running Strawberry under Rosetta is unsupported and known to have issues. If you want to use Strawberry on the current CPU, you should build Strawberry from source. For instructions see.: https://wiki.strawberrymusicplayer.org/wiki/Compile"));
for (QObject *obj : error_message->children()) {
if (QCheckBox *checkbox = qobject_cast<QCheckBox*>(obj)) {
checkbox->hide();
}
s.beginGroup(kSettingsGroup);
const bool ignore_rosetta = s.value("ignore_rosetta", false).toBool();
s.endGroup();
if (!ignore_rosetta) {
MessageDialog *rosetta_message = new MessageDialog(this);
rosetta_message->set_settings_group(kSettingsGroup);
rosetta_message->set_do_not_show_message_again("ignore_rosetta");
rosetta_message->setAttribute(Qt::WA_DeleteOnClose);
rosetta_message->ShowMessage(tr("Strawberry running under Rosetta"), tr("It is detected that Strawberry is running under Rosetta. Strawberry currently have limited macOS support, and running Strawberry under Rosetta is unsupported and known to have issues. If you want to use Strawberry on the current CPU, you should build Strawberry from source. For instructions see.: https://wiki.strawberrymusicplayer.org/wiki/Compile"), IconLoader::Load("dialog-warning"));
}
}
#endif