From 6a018f3e2525c7a9b7fc07a393e43f170c39d570 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Sun, 24 Sep 2023 15:09:20 +0200 Subject: [PATCH] MainWindow: Add sponsorship mesage --- src/core/mainwindow.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/core/mainwindow.cpp b/src/core/mainwindow.cpp index 0d330aadd..350c98287 100644 --- a/src/core/mainwindow.cpp +++ b/src/core/mainwindow.cpp @@ -1054,6 +1054,21 @@ MainWindow::MainWindow(Application *app, SharedPtr tray_icon, OS } #endif + { + QSettings s; + s.beginGroup(kSettingsGroup); + const QString do_not_show_sponsor_message_key = QString("do_not_show_sponsor_message"); + const bool do_not_show_sponsor_message = s.value(do_not_show_sponsor_message_key, false).toBool(); + s.endGroup(); + if (!do_not_show_sponsor_message) { + MessageDialog *sponsor_message = new MessageDialog(this); + sponsor_message->set_settings_group(kSettingsGroup); + sponsor_message->set_do_not_show_message_again(do_not_show_sponsor_message_key); + sponsor_message->setAttribute(Qt::WA_DeleteOnClose); + sponsor_message->ShowMessage(tr("Sponsoring Strawberry"), tr("Strawberry is free and open source software. If you like Strawberry, please consider sponsoring the project. For more information about sponsorship see our website %1").arg("www.strawberrymusicplayer.org"), IconLoader::Load("dialog-information")); + } + } + qLog(Debug) << "Started" << QThread::currentThread(); initialized_ = true;