feat: fix entryWidget button behaviour

This commit is contained in:
semenov
2025-08-15 14:19:33 +03:00
parent 0c805708ef
commit 87db4d0ef4
26 changed files with 5292 additions and 5219 deletions

View File

@@ -18,7 +18,7 @@ MainWindow::MainWindow(QWidget *parent)
ui->setupUi(this);
setAttribute(Qt::WA_TranslucentBackground);
setWindowFlags(windowFlags() | Qt::FramelessWindowHint);
_background.load(":/resource/SSJ_backgroundDarkSM.png");
background.load(":/resource/SSJ_backgroundDarkSM.png");
timer = new QTimer;
}
@@ -31,11 +31,11 @@ void MainWindow::paintEvent(QPaintEvent*) {
path.addRoundedRect(rect(), 8, 8);
painter.setClipPath(path);
if (!_background.isNull())
if (!background.isNull())
{
int x = (width() - _background.width()) / 2;
int y = (height() - _background.height()) / 2;
painter.drawPixmap(x, y, _background);
int x = (width() - background.width()) / 2;
int y = (height() - background.height()) / 2;
painter.drawPixmap(x, y, background);
}
}
@@ -57,6 +57,15 @@ void MainWindow::setStartState()
setUpUi();
}
void MainWindow::updateInitInformation(QString fullSize,QString currentSize)
{
QString info = tr("Инициализация...");
info.append(currentSize);
info.append("/");
info.append(fullSize);
setInlineDebug(info);
}
void MainWindow::bindConnection()
{
connect(timer,&QTimer::timeout,this,&MainWindow::slotDisableNotify);
@@ -224,12 +233,6 @@ void MainWindow::undoCurrentChanges()
{
ui->mainFrame->show();
ui->offlineStartButton->setEnabled(false);
//delay
QTime dieTime= QTime::currentTime().addSecs(10);
while (QTime::currentTime() < dieTime)
QCoreApplication::processEvents(QEventLoop::AllEvents, 100);
ui->unsafeChangingButton->hide();
}
@@ -246,7 +249,7 @@ void MainWindow::on_exitButton_clicked()
exit(0);
}
void MainWindow::showUpdateInfo()
void MainWindow::slotShowUpdateInfo()
{
ui->unsafeChangingButton->show();
ui->offlineStartButton->setGeometry(bottomRightPosition);
@@ -275,7 +278,7 @@ void MainWindow::setUpUi()
ui->autostartCheckBox->hide();
}
void MainWindow::commonWidgetState()
void MainWindow::slotCommonWidgetState()
{
disableUnsaveButton(true);
setInlineDebug(tr("Загрузка..."));
@@ -285,8 +288,10 @@ void MainWindow::keyPressEvent(QKeyEvent *event)
{
if (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return)
{
emit sigTryLogin();
//if (entryWidget->isLoginFieldsFill()) return;
if (!entryWidget->getLoginWidgetIsHidden())
{
emit sigTryLogin();
}
}
}
@@ -319,6 +324,7 @@ void MainWindow::addWidgetToChangeGroup(CommonButtonGroupWidget *commonWidgetGro
void MainWindow::addWidgetToInteractiveGroup(EntryWidget *entryWidget)
{
ui->interactiveGroup->addWidget(entryWidget);
this->entryWidget = entryWidget;
}
void MainWindow::setLoadSettings(ServerSettings *serverSettings)