mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJClient.git
synced 2026-03-28 05:25:39 +03:00
feat: add new states
This commit is contained in:
@@ -97,16 +97,36 @@ void MainWindow::setNeedUpdateState(const QString& notifyText)
|
||||
ui->autostartCheckBox->show();
|
||||
}
|
||||
|
||||
void MainWindow::serverBlocked()
|
||||
{
|
||||
ui->notificationLabel->show();
|
||||
QPalette palette = ui->notificationLabel->palette();
|
||||
QColor orangeColor(255,165,0);
|
||||
palette.setColor(ui->notificationLabel->foregroundRole(),orangeColor);
|
||||
ui->notificationLabel->setText(tr("Сервер заблокирован"));
|
||||
|
||||
ui->notificationLabel->setPalette(palette);
|
||||
timer->start(3000);
|
||||
void MainWindow::showError(ErrorsEnum errorNum)
|
||||
{
|
||||
if (errorNum == ErrorsEnum::BLOCKED)
|
||||
{
|
||||
serverNotifyShow(tr("Сервер заблокирован"));
|
||||
}
|
||||
else if (errorNum == ErrorsEnum::DISABLE)
|
||||
{
|
||||
showConnectionEmpty();
|
||||
}
|
||||
else if (errorNum == ErrorsEnum::LOGIN_OR_PASS)
|
||||
{
|
||||
serverNotifyShow(tr("Неверный логин/пароль"));
|
||||
}
|
||||
else if (errorNum == ErrorsEnum::ARCHIVED)
|
||||
{
|
||||
serverNotifyShow(tr("Пользователь в архиве"));
|
||||
}
|
||||
else if (errorNum == ErrorsEnum::ALREADYLOGIN)
|
||||
{
|
||||
serverNotifyShow(tr("Пользователь уже в сети"));
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::serverNotifyShow(QString text, int durationMS)
|
||||
{
|
||||
ui->notificationLabel->setText(text);
|
||||
ui->notificationLabel->show();
|
||||
timer->start(durationMS);
|
||||
}
|
||||
|
||||
void MainWindow::setLoginSuccessState()
|
||||
@@ -116,19 +136,6 @@ void MainWindow::setLoginSuccessState()
|
||||
ui->versionLayoutWidget->show();
|
||||
}
|
||||
|
||||
void MainWindow::setLoginFailedState()
|
||||
{
|
||||
ui->notificationLabel->setText(tr("Неверный логин/пароль"));
|
||||
timer->setInterval(3000);
|
||||
timer->start();
|
||||
|
||||
QPalette palette = ui->notificationLabel->palette();
|
||||
palette.setColor(ui->notificationLabel->foregroundRole(), Qt::red);
|
||||
|
||||
ui->notificationLabel->setPalette(palette);
|
||||
ui->notificationLabel->show();
|
||||
}
|
||||
|
||||
void MainWindow::setStartOfflineButton(bool isAvailable)
|
||||
{
|
||||
ui->offlineStartButton->setEnabled(isAvailable);
|
||||
|
||||
Reference in New Issue
Block a user