mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJClient.git
synced 2026-03-28 05:25:39 +03:00
feat: add translate field and autoStartBox
This commit is contained in:
@@ -26,6 +26,7 @@ void MainWindow::Initialize()
|
||||
ui->startButton->setEnabled(false);
|
||||
ui->debugText->hide();
|
||||
ui->displayGroupWidget->hide();
|
||||
ui->autostartCheckBox->hide();
|
||||
|
||||
updateControllerThread = new QThread;
|
||||
connectionThread = new QThread;
|
||||
@@ -53,6 +54,8 @@ void MainWindow::Initialize()
|
||||
connect(recognizeSystem,&RecognizeSystem::SaveLoginData,this,&MainWindow::CheckLoginResult);
|
||||
connect(recognizeSystem,&RecognizeSystem::SocketWaitForReadyRead,client,&TCPClient::WaitRead,Qt::AutoConnection);
|
||||
|
||||
connect(client,&TCPClient::signalGetXmlAnswer,dataParser,&DataParser::slotGetXmlAnswer);
|
||||
|
||||
connectionThread->start();
|
||||
updateControllerThread->start();
|
||||
|
||||
@@ -80,11 +83,14 @@ void MainWindow::Initialize()
|
||||
|
||||
maxBytesAvailable = 0;
|
||||
globalValue = 0;
|
||||
|
||||
ui->loadingProgressBar->setValue(0);
|
||||
|
||||
loadStaticData();
|
||||
emit onSetConnect(dataParser->GetServerSettings());
|
||||
|
||||
CheckAppAvailable();
|
||||
|
||||
}
|
||||
|
||||
void MainWindow::UpdateProgress(qint64 size,quint64 sended)
|
||||
@@ -101,6 +107,8 @@ void MainWindow::LoadComplete()
|
||||
ui->updateButton->setEnabled(false);
|
||||
externalExecuter->FindApp();
|
||||
ui->startButton->setEnabled(true);
|
||||
autoStart();
|
||||
ui->inlineTextDebug->setText("Обновление завершено...");
|
||||
}
|
||||
|
||||
void MainWindow::SetNeedUpdate(bool flag,quint64 size, quint64 fileCount)
|
||||
@@ -117,6 +125,7 @@ void MainWindow::SetNeedUpdate(bool flag,quint64 size, quint64 fileCount)
|
||||
else
|
||||
{
|
||||
ui->inlineTextDebug->setText("Установлена последняя версия");
|
||||
autoStart();
|
||||
}
|
||||
|
||||
ui->updateButton->setEnabled(flag);
|
||||
@@ -135,11 +144,14 @@ void MainWindow::CheckLoginResult(ServerAuthorization *serverAuth)
|
||||
emit onSendMessage("check");
|
||||
|
||||
ui->inlineTextDebug->setText("Проверка обновлений...");
|
||||
|
||||
ui->loadingProgressBar->show();
|
||||
ui->updateButton->show();
|
||||
ui->displayGroupWidget->show();
|
||||
ui->autostartCheckBox->show();
|
||||
|
||||
dataParser->CreateAuthData(serverAuth);
|
||||
ui->loginWidget->hide();
|
||||
ui->displayGroupWidget->show();
|
||||
|
||||
}
|
||||
else {
|
||||
@@ -162,6 +174,23 @@ void MainWindow::CheckAppAvailable()
|
||||
ui->startButton->setEnabled(isAvailable);
|
||||
}
|
||||
|
||||
void MainWindow::autoStart()
|
||||
{
|
||||
if(ui->autostartCheckBox->isChecked()){
|
||||
on_startButton_clicked();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::loadStaticData()
|
||||
{
|
||||
ServerSettings *currentSettings = dataParser->GetServerSettings();
|
||||
|
||||
ui->serverInputField->setText(currentSettings->Address);
|
||||
ui->portInputField->setText(currentSettings->Port);
|
||||
ui->languageComboBox->setCurrentText(currentSettings->Language);
|
||||
ui->autostartCheckBox->setChecked(currentSettings->isAutoStart);
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_loginButton_clicked()
|
||||
{
|
||||
@@ -207,11 +236,6 @@ void MainWindow::on_settingsButton_clicked()
|
||||
{
|
||||
ui->settingsWidget->show();
|
||||
ui->loginWidget->hide();
|
||||
|
||||
ServerSettings *currentSettings = dataParser->GetServerSettings();
|
||||
|
||||
ui->serverInputField->setText(currentSettings->Address);
|
||||
ui->portInputField->setText(currentSettings->Port);
|
||||
}
|
||||
|
||||
void MainWindow::disableNotify()
|
||||
@@ -261,6 +285,8 @@ MainWindow::~MainWindow()
|
||||
updateControllerThread->quit();
|
||||
updateControllerThread->wait();
|
||||
|
||||
client->sendDisable();
|
||||
|
||||
delete connectionThread;
|
||||
delete updateControllerThread;
|
||||
delete ui;
|
||||
@@ -270,3 +296,9 @@ void MainWindow::on_connectButton_clicked()
|
||||
{
|
||||
emit onSetConnect(dataParser->GetServerSettings());
|
||||
}
|
||||
|
||||
void MainWindow::on_languageComboBox_activated(const QString &arg1)
|
||||
{
|
||||
qDebug() << arg1;
|
||||
dataParser->saveClientSettrings(arg1,ui->autostartCheckBox->isChecked());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user