new_release_dialog.cpp
Go to the documentation of this file.
1 /*
2  * This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this
4  * file, You can obtain one at https://mozilla.org/MPL/2.0/.
5  */
6 
7 #include "new_release_dialog.h"
8 #include "ui_new_release_dialog.h"
9 #include <QSettings>
10 #include <QDesktopServices>
11 #include <QUrl>
12 #include <QDialogButtonBox>
13 
14 NewReleaseDialog::NewReleaseDialog(QWidget* parent, QString release, QString title,
15  QString url)
16  : QDialog(parent), ui(new Ui::NewReleaseDialog)
17 {
18  ui->setupUi(this);
19  setWindowFlags(Qt::WindowStaysOnTopHint);
20 
21  connect(ui->pushButtonWeb, &QPushButton::clicked, this,
22  [=] { QDesktopServices::openUrl(QUrl(url)); });
23 
24  connect(ui->buttonBox, &QDialogButtonBox::rejected, this, [=] {
25  if (ui->dontShowAgain->isChecked())
26  {
27  QSettings settings;
28  settings.setValue("NewRelease/dontShowThisVersion", release);
29  }
30  });
31 
32  ui->labelRelease->setText(release);
33  ui->labelTitle->setText(title);
34 }
35 
37 {
38  delete ui;
39 }
Ui::NewReleaseDialog * ui
NewReleaseDialog(QWidget *parent, QString release, QString title, QString url)


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Jun 19 2023 03:01:38