Changeset View
Changeset View
Standalone View
Standalone View
AuthDialog.cpp
Show First 20 Lines • Show All 131 Lines • ▼ Show 20 Line(s) | 50 | { | |||
---|---|---|---|---|---|
132 | foreach(const PolkitQt1::ActionDescription &desc, PolkitQt1::Authority::instance()->enumerateActionsSync()) { | 132 | foreach(const PolkitQt1::ActionDescription &desc, PolkitQt1::Authority::instance()->enumerateActionsSync()) { | ||
133 | if (actionId == desc.actionId()) { | 133 | if (actionId == desc.actionId()) { | ||
134 | m_actionDescription = desc; | 134 | m_actionDescription = desc; | ||
135 | qDebug() << "Action description has been found" ; | 135 | qDebug() << "Action description has been found" ; | ||
136 | break; | 136 | break; | ||
137 | } | 137 | } | ||
138 | } | 138 | } | ||
139 | 139 | | |||
140 | AuthDetails *detailsDialog = new AuthDetails(details, m_actionDescription, m_appname, this); | 140 | AuthDetails *detailsDialog = new AuthDetails(details, m_actionDescription, this); | ||
141 | detailsWidgetContainer->layout()->addWidget(detailsDialog); | 141 | detailsWidgetContainer->layout()->addWidget(detailsDialog); | ||
142 | 142 | | |||
143 | userCB->hide(); | 143 | userCB->hide(); | ||
144 | lePassword->setFocus(); | 144 | lePassword->setFocus(); | ||
145 | 145 | | |||
146 | errorMessageWidget->setMessageType(KMessageWidget::Error); | 146 | errorMessageWidget->setMessageType(KMessageWidget::Error); | ||
147 | errorMessageWidget->hide(); | 147 | errorMessageWidget->hide(); | ||
148 | 148 | | |||
▲ Show 20 Lines • Show All 164 Lines • ▼ Show 20 Line(s) | 307 | { | |||
313 | lblPassword->setFont(bold); | 313 | lblPassword->setFont(bold); | ||
314 | lePassword->setEnabled(true); | 314 | lePassword->setEnabled(true); | ||
315 | lePassword->clear(); | 315 | lePassword->clear(); | ||
316 | lePassword->setFocus(); | 316 | lePassword->setFocus(); | ||
317 | } | 317 | } | ||
318 | 318 | | |||
319 | AuthDetails::AuthDetails(const PolkitQt1::Details &details, | 319 | AuthDetails::AuthDetails(const PolkitQt1::Details &details, | ||
320 | const PolkitQt1::ActionDescription &actionDescription, | 320 | const PolkitQt1::ActionDescription &actionDescription, | ||
321 | const QString &appname, | | |||
322 | QWidget *parent) | 321 | QWidget *parent) | ||
323 | : QWidget(parent) | 322 | : QWidget(parent) | ||
324 | { | 323 | { | ||
325 | setupUi(this); | 324 | setupUi(this); | ||
326 | 325 | | |||
bruns: This hunk should go into D15885, also all the changes with `appname`/`m_appname` | |||||
327 | // better N/A than a blank space | | |||
328 | if (appname.isEmpty()) { | | |||
329 | QFont nameFont = app_label->font(); | | |||
330 | nameFont.setItalic(true); | | |||
331 | app_label->setFont(nameFont); | | |||
332 | app_label->setText(i18n("Not Applicable")); | | |||
333 | } else { | | |||
334 | app_label->setText(appname); | | |||
335 | } | | |||
336 | | ||||
337 | foreach(const QString &key, details.keys()) { //krazy:exclude=foreach (Details is not a map/hash, but rather a method) | 326 | foreach(const QString &key, details.keys()) { //krazy:exclude=foreach (Details is not a map/hash, but rather a method) | ||
338 | int row = gridLayout->rowCount() + 1; | 327 | int row = gridLayout->rowCount() + 1; | ||
339 | 328 | | |||
340 | QLabel *keyLabel = new QLabel(this); | 329 | QLabel *keyLabel = new QLabel(this); | ||
341 | keyLabel->setText(i18nc("%1 is the name of a detail about the current action " | 330 | keyLabel->setText(i18nc("%1 is the name of a detail about the current action " | ||
342 | "provided by polkit", "%1:", key)); | 331 | "provided by polkit", "%1:", key)); | ||
343 | gridLayout->addWidget(keyLabel, row, 0); | 332 | gridLayout->addWidget(keyLabel, row, 0); | ||
344 | 333 | | |||
345 | keyLabel->setAlignment(Qt::AlignRight); | 334 | keyLabel->setAlignment(Qt::AlignRight); | ||
346 | QFont lblFont(keyLabel->font()); | 335 | QFont lblFont(keyLabel->font()); | ||
347 | lblFont.setBold(true); | 336 | lblFont.setBold(true); | ||
348 | keyLabel->setFont(lblFont); | 337 | keyLabel->setFont(lblFont); | ||
349 | 338 | | |||
350 | QLabel *valueLabel = new QLabel(this); | 339 | QLabel *valueLabel = new QLabel(this); | ||
351 | valueLabel->setText(details.lookup(key)); | 340 | valueLabel->setText(details.lookup(key)); | ||
352 | gridLayout->addWidget(valueLabel, row, 1); | 341 | gridLayout->addWidget(valueLabel, row, 1); | ||
353 | } | 342 | } | ||
354 | 343 | | |||
355 | if (actionDescription.description().isEmpty()) { | 344 | if (actionDescription.description().isEmpty()) { | ||
bruns: ` == ""` should be identical to .isEmpty(), please recheck | |||||
356 | QFont descrFont(action_label->font()); | 345 | QFont descrFont(action_label->font()); | ||
357 | descrFont.setItalic(true); | 346 | descrFont.setItalic(true); | ||
358 | action_label->setFont(descrFont); | 347 | action_label->setFont(descrFont); | ||
359 | action_label->setText(i18n("'Description' not provided")); | 348 | action_label->setText(i18n("'Description' not provided")); | ||
According to https://www.freedesktop.org/software/polkit/docs/latest/polkit.8.html#polkit-rules bruns: According to https://www.freedesktop.org/software/polkit/docs/latest/polkit.8.html#polkit-rules… | |||||
I was checking to see if this was still open, and would like to discuss "Missing". I considered "Missing" while I was originally coding this, but thought it sounded a little negative, like we weren't able to access the information. I realize that "Missing" is the official response per the FDO spec, could we settle on something like "Not Provided"? After all, it's not our fault the information is missing. Just an idea. sharvey: I was checking to see if this was still open, and would like to discuss "Missing". I considered… | |||||
I prefer 'missing', to give upstream a 'hint' they are doing something wrong. bruns: I prefer 'missing', to give upstream a 'hint' they are doing something wrong. | |||||
360 | } else { | 349 | } else { | ||
361 | action_label->setText(actionDescription.description()); | 350 | action_label->setText(actionDescription.description()); | ||
362 | } | 351 | } | ||
363 | 352 | | |||
364 | action_id_label->setText(actionDescription.actionId()); | 353 | action_id_label->setText(actionDescription.actionId()); | ||
365 | 354 | | |||
366 | QString vendor = actionDescription.vendorName(); | 355 | QString vendor = actionDescription.vendorName(); | ||
367 | QString vendorUrl = actionDescription.vendorUrl(); | 356 | QString vendorUrl = actionDescription.vendorUrl(); | ||
Show All 21 Lines |
This hunk should go into D15885, also all the changes with appname/m_appname