blob: 06d2e6fd5207c3e9e8583dff3366988179b7e647 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
#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());
ui->argumentsEdit->setText(this->worker->getArguments());
}
void Settings::applySettings()
{
worker->setRemote(ui->serverEdit->text());
worker->setArguments(ui->argumentsEdit->text());
this->hide();
}
void Settings::verify()
{
workerOperate(Worker::TASK_INSTALL);
QMessageBox::information(this, windowTitle(), "Verification Started" );
}
Settings::~Settings()
{
delete ui;
}
|