parent
37578dde7b
commit
6549ca4e1d
After Width: | Height: | Size: 30 KiB |
@ -0,0 +1,44 @@
|
|||||||
|
// SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
// Copyright (c) 2020-2021, The Monero Project.
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
#include "updatedialog.h"
|
||||||
|
#include "ui_updatedialog.h"
|
||||||
|
|
||||||
|
#include "config-wowlet.h"
|
||||||
|
|
||||||
|
UpdateDialog::UpdateDialog(AppContext *ctx, QWidget *parent) :
|
||||||
|
QDialog(parent),
|
||||||
|
ctx(ctx),
|
||||||
|
ui(new Ui::UpdateDialog) {
|
||||||
|
ui->setupUi(this);
|
||||||
|
this->setWindowIcon(QIcon("://assets/images/appicons/64x64.png"));
|
||||||
|
|
||||||
|
auto version_str = ctx->versionPending.value("version").toString();
|
||||||
|
|
||||||
|
QPixmap p(":assets/images/pls_update.jpg");
|
||||||
|
ui->label_image->setPixmap(p.scaled(320, 320, Qt::KeepAspectRatio, Qt::SmoothTransformation));
|
||||||
|
|
||||||
|
ui->info_label->setText("Current version: " + QString(WOWLET_VERSION_SEMVER) + "\n"
|
||||||
|
"New version: " + version_str);
|
||||||
|
|
||||||
|
ui->label_download->setText("Download: <a href=\"https://git.wownero.com/wowlet/wowlet/releases\">git.wownero.com</a>");
|
||||||
|
ui->label_download->setTextInteractionFlags(Qt::TextBrowserInteraction);
|
||||||
|
ui->label_download->setOpenExternalLinks(true);
|
||||||
|
|
||||||
|
// checkbox
|
||||||
|
connect(ui->checkbox_ignore, &QCheckBox::clicked, this, &UpdateDialog::checkboxIgnoreWarning);
|
||||||
|
|
||||||
|
this->adjustSize();
|
||||||
|
}
|
||||||
|
|
||||||
|
void UpdateDialog::checkboxIgnoreWarning(bool checked) {
|
||||||
|
if(checked)
|
||||||
|
config()->set(Config::ignoreUpdateWarning, WOWLET_VERSION_SEMVER);
|
||||||
|
else
|
||||||
|
config()->set(Config::ignoreUpdateWarning, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
UpdateDialog::~UpdateDialog() {
|
||||||
|
delete ui;
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
// SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
// Copyright (c) 2020-2021, The Monero Project.
|
||||||
|
|
||||||
|
#ifndef WOWLET_UPDATEDIALOG_H
|
||||||
|
#define WOWLET_UPDATEDIALOG_H
|
||||||
|
|
||||||
|
#include <QDialog>
|
||||||
|
#include "appcontext.h"
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
class UpdateDialog;
|
||||||
|
}
|
||||||
|
|
||||||
|
class UpdateDialog : public QDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit UpdateDialog(AppContext *ctx, QWidget *parent = nullptr);
|
||||||
|
~UpdateDialog() override;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void checkboxIgnoreWarning(bool checked);
|
||||||
|
|
||||||
|
private:
|
||||||
|
AppContext *ctx = nullptr;
|
||||||
|
Ui::UpdateDialog *ui;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif //WOWLET_UPDATEDIALOG_H
|
@ -0,0 +1,108 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>UpdateDialog</class>
|
||||||
|
<widget class="QDialog" name="UpdateDialog">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>349</width>
|
||||||
|
<height>189</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Pls update</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_image">
|
||||||
|
<property name="text">
|
||||||
|
<string>image</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="info_label">
|
||||||
|
<property name="text">
|
||||||
|
<string>info_label</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_download">
|
||||||
|
<property name="text">
|
||||||
|
<string>download_label</string>
|
||||||
|
</property>
|
||||||
|
<property name="textFormat">
|
||||||
|
<enum>Qt::RichText</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="checkbox_ignore">
|
||||||
|
<property name="text">
|
||||||
|
<string>Ignore for now</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="standardButtons">
|
||||||
|
<set>QDialogButtonBox::Ok</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections>
|
||||||
|
<connection>
|
||||||
|
<sender>buttonBox</sender>
|
||||||
|
<signal>accepted()</signal>
|
||||||
|
<receiver>UpdateDialog</receiver>
|
||||||
|
<slot>accept()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>248</x>
|
||||||
|
<y>254</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>157</x>
|
||||||
|
<y>274</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>buttonBox</sender>
|
||||||
|
<signal>rejected()</signal>
|
||||||
|
<receiver>UpdateDialog</receiver>
|
||||||
|
<slot>reject()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>316</x>
|
||||||
|
<y>260</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>286</x>
|
||||||
|
<y>274</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
</connections>
|
||||||
|
</ui>
|
Loading…
Reference in new issue