fix
This commit is contained in:
parent
e24247bdb2
commit
f6033e3a9f
@ -2,7 +2,7 @@ from PySide6.QtWidgets import (
|
||||
QWidget, QLabel, QLineEdit, QPushButton, QVBoxLayout, QMessageBox,
|
||||
QHBoxLayout, QSpacerItem, QSizePolicy, QComboBox
|
||||
)
|
||||
from PySide6.QtCore import Qt
|
||||
from PySide6.QtCore import Qt, QTimer
|
||||
from ..widgets.validation_input import ValidationInput
|
||||
from common_lib.utils.validators import (
|
||||
validate_username as common_validate_username,
|
||||
@ -18,7 +18,7 @@ def validate_username(username, is_login=False):
|
||||
msg = localizer.translate("Неверный логин или пароль")
|
||||
return False, msg
|
||||
return True, username
|
||||
|
||||
|
||||
is_validate, msg = common_validate_username(username, need_back=True)
|
||||
if not is_validate: msg = localizer.translate(msg)
|
||||
return is_validate, msg
|
||||
@ -167,15 +167,19 @@ class LoginView(QWidget):
|
||||
self.reg_password_input.textChanged.connect(self.confirm_password_input.on_text_changed)
|
||||
|
||||
def _update_window_title(self):
|
||||
window = self.window()
|
||||
if not window:
|
||||
return
|
||||
def set_title():
|
||||
window = self.window()
|
||||
if not window:
|
||||
return
|
||||
|
||||
if self.is_registration:
|
||||
title = f"{localizer.translate('Регистрация')} | {config.APP_HEADER}"
|
||||
else:
|
||||
title = f"{localizer.translate('Авторизация')} | {config.APP_HEADER}"
|
||||
window.setWindowTitle(title)
|
||||
if self.is_registration:
|
||||
title = f"{localizer.translate('Регистрация')} | {config.APP_HEADER}"
|
||||
else:
|
||||
title = f"{localizer.translate('Авторизация')} | {config.APP_HEADER}"
|
||||
window.setWindowTitle(title)
|
||||
|
||||
# Откладываем выполнение, чтобы `self.window()` уже был готов
|
||||
QTimer.singleShot(0, set_title)
|
||||
|
||||
def render_form(self):
|
||||
self.clear_form()
|
||||
|
||||
Reference in New Issue
Block a user