Changeset View
Changeset View
Standalone View
Standalone View
AuthDialog.cpp
Show First 20 Lines • Show All 64 Lines • ▼ Show 20 Line(s) | 50 | { | |||
---|---|---|---|---|---|
65 | } | 65 | } | ||
66 | 66 | | |||
67 | setupUi(this); | 67 | setupUi(this); | ||
68 | 68 | | |||
69 | connect(buttonBox, &QDialogButtonBox::accepted, this, &AuthDialog::okClicked); | 69 | connect(buttonBox, &QDialogButtonBox::accepted, this, &AuthDialog::okClicked); | ||
70 | connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept); | 70 | connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept); | ||
71 | connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject); | 71 | connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject); | ||
72 | 72 | | |||
73 | // shrink user selection combo box, but keep it in place | ||||
74 | userCB->setGeometry(QRect(91, 76, 407, 1)); | ||||
75 | | ||||
76 | // shrink authentication failure notice, but keep it in place | ||||
77 | errorMessageWidget->setGeometry(91, 110, 407, 1); | ||||
78 | | ||||
79 | | ||||
73 | QString detailsButtonText = i18n("Details"); | 80 | QString detailsButtonText = i18n("Details"); | ||
74 | QPushButton* detailsButton = new QPushButton(detailsButtonText + " >>"); | 81 | QPushButton* detailsButton = new QPushButton(detailsButtonText + " >>"); | ||
75 | detailsButton->setIcon(QIcon::fromTheme("help-about")); | 82 | detailsButton->setIcon(QIcon::fromTheme("help-about")); | ||
76 | detailsButton->setCheckable(true); | 83 | detailsButton->setCheckable(true); | ||
77 | connect(detailsButton, &QAbstractButton::toggled, this, [=](bool toggled) { | 84 | connect(detailsButton, &QAbstractButton::toggled, this, [=](bool toggled) { | ||
78 | detailsWidgetContainer->setVisible(toggled); | 85 | detailsWidgetContainer->setVisible(toggled); | ||
79 | if (toggled) { | 86 | if (toggled) { | ||
80 | detailsButton->setText(detailsButtonText + " <<"); | 87 | detailsButton->setText(detailsButtonText + " <<"); | ||
▲ Show 20 Lines • Show All 128 Lines • ▼ Show 20 Line(s) | |||||
209 | } | 216 | } | ||
210 | 217 | | |||
211 | void AuthDialog::createUserCB(const PolkitQt1::Identity::List &identities) | 218 | void AuthDialog::createUserCB(const PolkitQt1::Identity::List &identities) | ||
212 | { | 219 | { | ||
213 | /* if we've already built the list of admin users once, then avoid | 220 | /* if we've already built the list of admin users once, then avoid | ||
214 | * doing it again.. (this is mainly used when the user entered the | 221 | * doing it again.. (this is mainly used when the user entered the | ||
215 | * wrong password and the dialog is recycled) | 222 | * wrong password and the dialog is recycled) | ||
216 | */ | 223 | */ | ||
224 | | ||||
225 | // restore original size of user combobox | ||||
226 | userCB->setGeometry(QRect(91, 76, 407, 31)); | ||||
227 | | ||||
228 | | ||||
217 | if (identities.count() && (userCB->count() - 1) != identities.count()) { | 229 | if (identities.count() && (userCB->count() - 1) != identities.count()) { | ||
218 | // Clears the combobox in the case some user be added | 230 | // Clears the combobox in the case some user be added | ||
219 | userCB->clear(); | 231 | userCB->clear(); | ||
220 | 232 | | |||
221 | // Adds a Dummy user | 233 | // Adds a Dummy user | ||
222 | userCB->addItem(i18n("Select User"), QString()); | 234 | userCB->addItem(i18n("Select User"), QString()); | ||
223 | qobject_cast<QStandardItemModel *>(userCB->model())->item(userCB->count()-1)->setEnabled(false); | 235 | qobject_cast<QStandardItemModel *>(userCB->model())->item(userCB->count()-1)->setEnabled(false); | ||
224 | 236 | | |||
▲ Show 20 Lines • Show All 74 Lines • ▼ Show 20 Line(s) | |||||
299 | 311 | | |||
300 | QString AuthDialog::password() const | 312 | QString AuthDialog::password() const | ||
301 | { | 313 | { | ||
302 | return lePassword->text(); | 314 | return lePassword->text(); | ||
303 | } | 315 | } | ||
304 | 316 | | |||
305 | void AuthDialog::authenticationFailure() | 317 | void AuthDialog::authenticationFailure() | ||
306 | { | 318 | { | ||
319 | // restore size of error message widget | ||||
320 | errorMessageWidget->setGeometry(91, 110, 407, 44); | ||||
321 | | ||||
307 | errorMessageWidget->setText(i18n("Authentication failure, please try again.")); | 322 | errorMessageWidget->setText(i18n("Authentication failure, please try again.")); | ||
308 | errorMessageWidget->animatedShow(); | 323 | errorMessageWidget->animatedShow(); | ||
309 | 324 | | |||
310 | QFont bold = font(); | 325 | QFont bold = font(); | ||
311 | bold.setBold(true); | 326 | bold.setBold(true); | ||
312 | lblPassword->setFont(bold); | 327 | lblPassword->setFont(bold); | ||
313 | lePassword->setEnabled(true); | 328 | lePassword->setEnabled(true); | ||
314 | lePassword->clear(); | 329 | lePassword->clear(); | ||
▲ Show 20 Lines • Show All 52 Lines • Show Last 20 Lines |