summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRolf Eike Beer <eb@emlix.com>2016-06-28 10:59:15 (GMT)
committerRolf Eike Beer <kde@opensource.sf-tec.de>2016-06-28 18:05:36 (GMT)
commitd8887e0931d75dc635e32ee664d463007ebe409a (patch)
tree0642ee5170b5ce05c96086029afd71e3b2725e33
parentabe6cabe39f36ee56484ceb224f59bc12c962c99 (diff)
KgpgDetailedInfo: bring back the "Details" button
Code copied from KMessageBox for now, this will hopefully provide a helper function to create that button one day.
-rw-r--r--detailedconsole.cpp27
1 files changed, 19 insertions, 8 deletions
diff --git a/detailedconsole.cpp b/detailedconsole.cpp
index d2edb04..93a45ec 100644
--- a/detailedconsole.cpp
+++ b/detailedconsole.cpp
@@ -1,10 +1,8 @@
-/***************************************************************************
- detailedconsole.cpp - description
- -------------------
- begin : Mon Jul 8 2002
- copyright : (C) 2002 by Jean-Baptiste Mardelle
- email : bj@altern.org
- ***************************************************************************/
+/*
+ * Copyright (C) 2003,2004 Jean-Baptiste Mardelle <bj@altern.org>
+ * Copyright (C) 2007,2010,2012,2014,2016 Rolf Eike Beer <kde@opensource.sf-tec.de>
+ * Copyright (C) 2016 Andrius Ć tikoans <andrius@stikonas.eu>
+ */
/***************************************************************************
* *
@@ -19,6 +17,7 @@
#include <KLocalizedString>
#include <KMessageBox>
+#include <QApplication>
#include <QDialogButtonBox>
#include <QPushButton>
@@ -30,7 +29,19 @@ KgpgDetailedInfo::KgpgDetailedInfo(QWidget *parent, const QString &boxLabel, con
setWindowTitle(caption);
else
setWindowTitle(i18n("Info"));
- QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok);
+
+ // FIXME: hopefully KMessageBox will provide a helper for this one day...
+ // code copied from KMessageBox for now
+ QPushButton *detailsButton = new QPushButton;
+ detailsButton->setObjectName(QStringLiteral("detailsButton"));
+ detailsButton->setText(QApplication::translate("KMessageBox", "&Details") + QStringLiteral(" >>"));
+ detailsButton->setIcon(QIcon::fromTheme(QStringLiteral("help-about")));
+
+ QDialogButtonBox *buttonBox = new QDialogButtonBox(this);
+ buttonBox->addButton(detailsButton, QDialogButtonBox::HelpRole);
+ buttonBox->addButton(QDialogButtonBox::Ok);
+ buttonBox->button(QDialogButtonBox::Ok)->setFocus();
+
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);