1
0
forked from BRT/arc

Ensure BankSetupWizard triggers only when bankProfileId is empty and pinCodeChecked is false in DeviceSettingsWindow and DeviceWidget.

This commit is contained in:
slava 2026-04-06 20:01:52 +07:00
parent a046a27569
commit c5e8fc4ed5
2 changed files with 2 additions and 2 deletions

View File

@ -147,7 +147,7 @@ void DeviceSettingsWindow::reloadContent(QTableWidget *tableWidget) {
connect(settingsBtn, &QPushButton::clicked, this, [this, app, tableWidget]() { connect(settingsBtn, &QPushButton::clicked, this, [this, app, tableWidget]() {
const BankProfileInfo dbApp = BankProfileDAO::getApplication(m_deviceId, app.code); const BankProfileInfo dbApp = BankProfileDAO::getApplication(m_deviceId, app.code);
if (dbApp.id < 0 || !dbApp.pinCodeChecked) { if (dbApp.id < 0 || (!dbApp.pinCodeChecked && dbApp.bankProfileId.isEmpty())) {
auto *wizard = new BankSetupWizard(this, m_deviceId, dbApp.id >= 0 ? dbApp : app); auto *wizard = new BankSetupWizard(this, m_deviceId, dbApp.id >= 0 ? dbApp : app);
wizard->setAttribute(Qt::WA_DeleteOnClose); wizard->setAttribute(Qt::WA_DeleteOnClose);
connect(wizard, &QDialog::finished, this, [this, tableWidget]() { connect(wizard, &QDialog::finished, this, [this, tableWidget]() {

View File

@ -239,7 +239,7 @@ void DeviceWidget::setOpenBanksSettings(QPushButton *button, const BankProfileIn
QString deviceName = m_device.name; QString deviceName = m_device.name;
connect(button, &QPushButton::clicked, this, [deviceId, deviceName, app]() { connect(button, &QPushButton::clicked, this, [deviceId, deviceName, app]() {
const BankProfileInfo dbApp = BankProfileDAO::getApplication(deviceId, app.code); const BankProfileInfo dbApp = BankProfileDAO::getApplication(deviceId, app.code);
if (dbApp.id < 0 || !dbApp.pinCodeChecked) { if (dbApp.id < 0 || (!dbApp.pinCodeChecked && dbApp.bankProfileId.isEmpty())) {
auto *wizard = new BankSetupWizard(nullptr, deviceId, dbApp.id >= 0 ? dbApp : app); auto *wizard = new BankSetupWizard(nullptr, deviceId, dbApp.id >= 0 ? dbApp : app);
wizard->setAttribute(Qt::WA_DeleteOnClose); wizard->setAttribute(Qt::WA_DeleteOnClose);
wizard->show(); wizard->show();