18 #include <QDesktopServices>
19 #include <QHBoxLayout>
26 const QString yes =
"yes";
27 const QString no =
"no";
29 QString update_question()
31 QString result = QString(
"Should BornAgain check for updates automatically? - "
32 " <a href=\"%1\">yes</a> /"
33 " <a href=\"%2\">no</a>")
41 , m_updateNotifier(updateNotifier)
42 , m_updateLabel(new QLabel)
43 , m_check_for_updates(true)
45 auto layout =
new QHBoxLayout();
51 m_updateLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
63 m_updateLabel->setToolTip(
"This setting can be changed later in the main window "
72 QWidget::showEvent(event);
93 }
else if (text == no) {
95 QTimer::singleShot(200,
this, [&]() {
m_updateLabel->setText(
""); });
97 QDesktopServices::openUrl(QUrl(text));
Implements class UpdateNotifier.
void setCheckUpdatesFlag(bool flag)
bool hasDefinedUpdatesFlag() const
Returns true if settings contain record about user choice for updates.
void onUpdateNotification(const QString &text)