5 * th9x - http://code.google.com/p/th9x
6 * er9x - http://code.google.com/p/er9x
7 * gruvin9x - http://code.google.com/p/gruvin9x
9 * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
28 #include <QMessageBox>
30 #define CPN_STR_MSG_WELCOME QCoreApplication::translate("Companion", \
31 "<p><b>Welcome to OpenTX %1.</b></p>" \
32 "<p>As the first step, please configure the initial Radio Profile by selecting your Radio Type, Menu Language, and Build Options.</p>" \
33 "<p>You may also want to take this time to review the other available options in the displayed Settings dialog.</p>" \
34 "<p>After saving your settings, we recommend you download the latest firmware for your radio by using the <i>File -> Download</i> menu option.</p>" \
35 "<p>Please visit <a href='http://www.open-tx.org'>open-tx.org</a> for latest news, updates and documentation. Thank you for choosing OpenTX!</p>" \
38 #define CPN_STR_MSG_UPGRADED QCoreApplication::translate("Companion", \
39 "<p><b>Thank you for upgrading to OpenTX %1.</b></p>" \
40 "<p>This is a major upgrade that adds and modifies a lot of things, so please make sure that you read release notes carefully" \
41 " to learn about the changes, and thoroughly check each of your models for proper function.</p>" \
42 "<p>Please visit <a href='http://www.open-tx.org'>open-tx.org</a> for release notes and other documentation.</p>" \
45 #define CPN_STR_MSG_NO_RADIO_TYPE QCoreApplication::translate("Companion", \
46 "<p>The radio type in the selected profile does not exist. Using the default type instead.</p> <p><b>Please update your profile settings!</b></p>")
50 Q_DECLARE_TR_FUNCTIONS("AppMessages")
53 // These are used for saving "[don't] show this message again" user preferences.
58 MSG_RESERVED
= 0x04, // reserved due to legacy code
59 MSG_NO_RADIO_TYPE
= 0x08,
63 static void displayMessage(int id
, QWidget
* parent
= nullptr)
66 QMessageBox::Icon icon
= QMessageBox::Information
;
67 bool transient
= false;
71 infoTxt
= CPN_STR_MSG_WELCOME
.arg(VERSION
);
75 infoTxt
= CPN_STR_MSG_UPGRADED
.arg(VERSION
);
78 case MSG_NO_RADIO_TYPE
:
79 infoTxt
= CPN_STR_MSG_NO_RADIO_TYPE
;
80 icon
= QMessageBox::Warning
;
88 QMessageBox
msgBox(parent
);
89 msgBox
.setWindowTitle(CPN_STR_APP_NAME
);
91 msgBox
.setStandardButtons(QMessageBox::Ok
);
92 msgBox
.setText(infoTxt
);
95 msgBox
.setCheckBox(new QCheckBox(tr("Show this message again at next startup?")));
99 if (transient
|| (msgBox
.checkBox() && !msgBox
.checkBox()->isChecked()))
100 g
.warningId(g
.warningId() & ~id
);
105 #endif // _WARNINGS_H_