diff options
Diffstat (limited to 'src/qt/settings.cpp')
-rw-r--r-- | src/qt/settings.cpp | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/qt/settings.cpp b/src/qt/settings.cpp new file mode 100644 index 0000000..507e8c8 --- /dev/null +++ b/src/qt/settings.cpp @@ -0,0 +1,44 @@ +#include <QMessageBox> +#include <iostream> + +#include "workers.hpp" +#include "settings.hpp" +#include "./ui_settings.h" + +Settings::Settings(Worker* pworker, QWidget *parent) + : QDialog(parent) + , ui(new Ui::Settings) +{ + this->worker = pworker; + ui->setupUi(this); + + connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(applySettings())); + connect(ui->verifyButton, SIGNAL(clicked()), this, SLOT(verify())); + connect(this, &Settings::workerOperate, worker, &Worker::doWork); +} + +void Settings::refresh() +{ + ui->serverEdit->setText(this->worker->getRemote()); + + ui->revisionLabel->setText(QString("%1").arg(this->worker->getRevision())); + ui->installLabel->setText(this->worker->getOfDir()); +} + +void Settings::applySettings() +{ + worker->setRemote(ui->serverEdit->text()); + this->hide(); +} + +void Settings::verify() +{ + workerOperate(Worker::TASK_INSTALL); + QMessageBox::information(this, windowTitle(), "Verification Started" ); +} + +Settings::~Settings() +{ + delete ui; +} + |