parent
d71a36f0ef
commit
86c512a2ff
@ -0,0 +1,42 @@
|
||||
#include "upgradedelaywindow.h"
|
||||
#include "ui_upgradedelaywindow.h"
|
||||
|
||||
UpgradeDelayWindow::UpgradeDelayWindow(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::UpgradeDelayWindow)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
connect(ui->okButton, &QPushButton::clicked, this, &UpgradeDelayWindow::onOkClicked);
|
||||
connect(ui->cancelButton, &QPushButton::clicked, this, &UpgradeDelayWindow::onCancelClicked);
|
||||
}
|
||||
|
||||
UpgradeDelayWindow::~UpgradeDelayWindow()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
qint64 UpgradeDelayWindow::getDelayDays()
|
||||
{
|
||||
return delayDays;
|
||||
}
|
||||
|
||||
void UpgradeDelayWindow::onOkClicked()
|
||||
{
|
||||
switch (ui->timeTypeComboBox->currentIndex()) {
|
||||
case 0: // days
|
||||
delayDays = ui->timeSpinBox->value();
|
||||
break;
|
||||
case 1: // weeks
|
||||
delayDays = ui->timeSpinBox->value() * 7;
|
||||
break;
|
||||
case 2: // months
|
||||
delayDays = ui->timeSpinBox->value() * 28;
|
||||
break;
|
||||
}
|
||||
this->done(0);
|
||||
}
|
||||
|
||||
void UpgradeDelayWindow::onCancelClicked()
|
||||
{
|
||||
this->done(0);
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
#ifndef UPGRADEDELAYWINDOW_H
|
||||
#define UPGRADEDELAYWINDOW_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class UpgradeDelayWindow;
|
||||
}
|
||||
|
||||
class UpgradeDelayWindow : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit UpgradeDelayWindow(QWidget *parent = nullptr);
|
||||
~UpgradeDelayWindow();
|
||||
qint64 getDelayDays();
|
||||
|
||||
private slots:
|
||||
void onOkClicked();
|
||||
void onCancelClicked();
|
||||
|
||||
private:
|
||||
Ui::UpgradeDelayWindow *ui;
|
||||
qint64 delayDays;
|
||||
};
|
||||
|
||||
#endif // UPGRADEDELAYWINDOW_H
|
@ -0,0 +1,94 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>UpgradeDelayWindow</class>
|
||||
<widget class="QDialog" name="UpgradeDelayWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>457</width>
|
||||
<height>106</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>How long would you like to wait before being reminded of the upgrade again?</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>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="1">
|
||||
<widget class="QSpinBox" name="timeSpinBox"/>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="okButton">
|
||||
<property name="text">
|
||||
<string>OK</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="cancelButton">
|
||||
<property name="text">
|
||||
<string>Cancel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QComboBox" name="timeTypeComboBox">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Days</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Weeks</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Months</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
Loading…
Reference in new issue