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  link_opened = true;
24  });
25 
26  connect(ui->buttonBox, &QDialogButtonBox::rejected, this, [=] {
27  if (ui->dontShowAgain->isChecked())
28  {
29  QSettings settings;
30  settings.setValue("NewRelease/dontShowThisVersion", release);
31  }
32  });
33 
34  ui->labelTitle->setText(title);
35 }
36 
38 {
39  delete ui;
40 }
NewReleaseDialog::~NewReleaseDialog
~NewReleaseDialog()
Definition: new_release_dialog.cpp:37
NewReleaseDialog::ui
Ui::NewReleaseDialog * ui
Definition: new_release_dialog.h:28
Ui
Definition: cheatsheet_dialog.h:6
new_release_dialog.h
NewReleaseDialog
Definition: new_release_dialog.h:17
NewReleaseDialog::NewReleaseDialog
NewReleaseDialog(QWidget *parent, QString release, QString title, QString url)
Definition: new_release_dialog.cpp:14


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:45