diff --git a/AuthDialog.h b/AuthDialog.h --- a/AuthDialog.h +++ b/AuthDialog.h @@ -66,7 +66,7 @@ void accept() override; private slots: - void on_userCB_currentIndexChanged(int index); + void checkSelectedUser(); private: QString m_message; diff --git a/AuthDialog.cpp b/AuthDialog.cpp --- a/AuthDialog.cpp +++ b/AuthDialog.cpp @@ -66,6 +66,9 @@ setupUi(this); + connect(userCB, QOverload::of(&QComboBox::currentIndexChanged), + this, &AuthDialog::checkSelectedUser); + connect(buttonBox, &QDialogButtonBox::accepted, this, &AuthDialog::okClicked); connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept); connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject); @@ -279,7 +282,7 @@ return PolkitQt1::Identity::fromString(id); } -void AuthDialog::on_userCB_currentIndexChanged(int /*index*/) +void AuthDialog::checkSelectedUser() { PolkitQt1::Identity identity = adminUserSelected(); // itemData is Null when "Select user" is selected