diff --git a/AuthDialog.h b/AuthDialog.h --- a/AuthDialog.h +++ b/AuthDialog.h @@ -69,7 +69,6 @@ void on_userCB_currentIndexChanged(int index); private: - QString m_appname; QString m_message; void createUserCB(const PolkitQt1::Identity::List &identities); @@ -81,7 +80,6 @@ public: AuthDetails(const PolkitQt1::Details &details, const PolkitQt1::ActionDescription &actionDescription, - const QString &appname, QWidget *parent); private slots: diff --git a/AuthDialog.cpp b/AuthDialog.cpp --- a/AuthDialog.cpp +++ b/AuthDialog.cpp @@ -137,7 +137,7 @@ } } - AuthDetails *detailsDialog = new AuthDetails(details, m_actionDescription, m_appname, this); + AuthDetails *detailsDialog = new AuthDetails(details, m_actionDescription, this); detailsWidgetContainer->layout()->addWidget(detailsDialog); userCB->hide(); @@ -317,28 +317,40 @@ AuthDetails::AuthDetails(const PolkitQt1::Details &details, const PolkitQt1::ActionDescription &actionDescription, - const QString &appname, QWidget *parent) : QWidget(parent) { setupUi(this); - app_label->setText(appname); - foreach(const QString &key, details.keys()) { //krazy:exclude=foreach (Details is not a map/hash, but rather a method) int row = gridLayout->rowCount() + 1; QLabel *keyLabel = new QLabel(this); keyLabel->setText(i18nc("%1 is the name of a detail about the current action " "provided by polkit", "%1:", key)); gridLayout->addWidget(keyLabel, row, 0); + keyLabel->setAlignment(Qt::AlignRight); + QFont lblFont(keyLabel->font()); + lblFont.setBold(true); + keyLabel->setFont(lblFont); + QLabel *valueLabel = new QLabel(this); valueLabel->setText(details.lookup(key)); gridLayout->addWidget(valueLabel, row, 1); } - action_label->setText(actionDescription.description()); + // replace blank description + // neither isEmpty() or isNull() worked (?) + if (actionDescription.description() == "") { + QFont descrFont(action_label->font()); + descrFont.setItalic(true); + action_label->setFont(descrFont); + action_label->setText(i18n("Not Available")); + } else { + action_label->setText(actionDescription.description()); + } + action_id_label->setText(actionDescription.actionId()); QString vendor = actionDescription.vendorName(); diff --git a/authdetails.ui b/authdetails.ui --- a/authdetails.ui +++ b/authdetails.ui @@ -17,69 +17,98 @@ - + - - Action: + + + 75 + true + - - - - Action: - - - - - - Qt::Horizontal + + Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing - + Vendor: - + - + + false + + true - - + + - Vendor: + <null> + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - + + + + + 75 + true + + - Application: + Action ID: + + + Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing - - + + + + Qt::Horizontal + + + + + + + + 75 + true + + - Application: + Vendor: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - + IBeamCursor Action ID: + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + Qt::TextSelectableByMouse