summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrius Štikonas <andrius@stikonas.eu>2016-06-06 15:38:47 (GMT)
committerAndrius Štikonas <andrius@stikonas.eu>2016-06-06 15:38:47 (GMT)
commite438bf9b7ab5eb50633898a5c60059e4d2de2c6a (patch)
tree28e15389ac2e6a71b831f173e4bd14c3f7f5ada9
parent76e83d3be2a3bbe4c7c26f2aecb8c8448866eae5 (diff)
Convert some KDialogs to QDialogs.
-rw-r--r--CMakeLists.txt9
-rw-r--r--detailedconsole.cpp22
-rw-r--r--detailedconsole.h4
-rw-r--r--editor/kgpgeditor.cpp21
-rw-r--r--editor/kgpgmd5widget.cpp25
-rw-r--r--editor/kgpgmd5widget.h2
-rw-r--r--editor/kgpgtextedit.cpp3
-rw-r--r--keyinfodialog.cpp69
-rw-r--r--keyinfodialog.h19
-rw-r--r--keysmanager.cpp2
-rw-r--r--kgpgKeyInfo.ui8
-rw-r--r--kgpgexternalactions.cpp1
-rw-r--r--kgpgkeygenerate.cpp49
-rw-r--r--kgpgkeygenerate.h8
-rw-r--r--kgpgkeygenerate.ui13
-rw-r--r--kgpgoptions.cpp12
-rw-r--r--kgpgrevokewidget.cpp22
-rw-r--r--kgpgrevokewidget.h4
-rw-r--r--selectexpirydate.cpp26
-rw-r--r--selectexpirydate.h6
-rw-r--r--selectpublickeydialog.cpp74
-rw-r--r--selectpublickeydialog.h19
-rw-r--r--selectsecretkey.cpp27
-rw-r--r--selectsecretkey.h6
-rw-r--r--transactions/kgpgtransaction.cpp18
25 files changed, 301 insertions, 168 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e3f26fa..62bd155 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,6 +17,7 @@ include(ECMPackageConfigHelpers)
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
Core
+ DBus
Gui
Widgets
)
@@ -26,11 +27,11 @@ find_package(KF5 REQUIRED
AkonadiContact
Archive
DocTools
- I18n
- IconThemes
Codecs
Contacts
CoreAddons
+ I18n
+ IconThemes
KIO
KDELibs4Support
Service
@@ -220,13 +221,15 @@ if (KGPG_DEBUG_TRANSACTIONS)
endif (KGPG_DEBUG_TRANSACTIONS)
target_link_libraries(kgpg
+ KF5::AkonadiContact
KF5::Archive
KF5::Codecs
KF5::Contacts
KF5::CoreAddons
+ KF5::IconThemes
KF5::KDELibs4Support
KF5::KIOCore
- KF5::AkonadiContact
+ KF5::WidgetsAddons
)
install(TARGETS kgpg ${INSTALL_TARGETS_DEFAULT_ARGS} )
diff --git a/detailedconsole.cpp b/detailedconsole.cpp
index 113dcdc..12c2c48 100644
--- a/detailedconsole.cpp
+++ b/detailedconsole.cpp
@@ -19,18 +19,32 @@
#include <KLocale>
#include <KMessageBox>
+#include <KConfigGroup>
+#include <QDialogButtonBox>
+#include <QPushButton>
+#include <QVBoxLayout>
KgpgDetailedInfo::KgpgDetailedInfo(QWidget *parent, const QString &boxLabel, const QString &errormessage,
const QStringList &keysList, const QString &caption)
- : KDialog(parent)
+ : QDialog(parent)
{
if (!caption.isEmpty())
setWindowTitle(caption);
else
setWindowTitle(i18n("Info"));
- setButtons(Details | Ok);
- setDefaultButton(Ok);
+ QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok);
+ QWidget *mainWidget = new QWidget(this);
+ QVBoxLayout *mainLayout = new QVBoxLayout;
+ setLayout(mainLayout);
+ mainLayout->addWidget(mainWidget);
+ QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
+ okButton->setDefault(true);
+ okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
+ connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
+ connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
+ mainLayout->addWidget(buttonBox);
+ okButton->setDefault(true);
setModal(true);
// KMessageBox::createKMessageBox(this, QMessageBox::Information, // krazy:exclude=qtclasses
-// boxLabel, keysList, QString(), Q_NULLPTR, 0, errormessage); FIXME:KF5
+// boxLabel, keysList, QString(), Q_NULLPTR, 0, errormessage); FIXME: KF5
}
diff --git a/detailedconsole.h b/detailedconsole.h
index 9761f00..5f72cc4 100644
--- a/detailedconsole.h
+++ b/detailedconsole.h
@@ -18,11 +18,11 @@
#ifndef KGPGDETAILEDCONSOLE_H
#define KGPGDETAILEDCONSOLE_H
-#include <KDialog>
+#include <QDialog>
#include <kgpgcompiler.h>
-class KgpgDetailedInfo : public KDialog
+class KgpgDetailedInfo : public QDialog
{
public:
explicit KgpgDetailedInfo(QWidget *parent = Q_NULLPTR, const QString &boxLabel = QString(),
diff --git a/editor/kgpgeditor.cpp b/editor/kgpgeditor.cpp
index 8736452..c04dda4 100644
--- a/editor/kgpgeditor.cpp
+++ b/editor/kgpgeditor.cpp
@@ -57,6 +57,9 @@
#include <QWidget>
#include <kio/netaccess.h>
#include <kio/renamedialog.h>
+#include <KConfigGroup>
+#include <QDialogButtonBox>
+#include <QPushButton>
class KgpgView : public QWidget {
public:
@@ -491,14 +494,24 @@ void KgpgEditor::slotFilePreDec()
oldname.append(QLatin1String( ".clear" ));
oldname.prepend(url.adjusted(QUrl::RemoveFilename).path());
- QPointer<KDialog> popn = new KDialog(this);
+ QPointer<QDialog> popn = new QDialog(this);
popn->setWindowTitle(i18n("Decrypt File To"));
- popn->setButtons( KDialog::Ok | KDialog::Cancel );
- popn->setDefaultButton( KDialog::Ok );
+ QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
+ QWidget *mainWidget = new QWidget(this);
+ QVBoxLayout *mainLayout = new QVBoxLayout;
+ popn->setLayout(mainLayout);
+ mainLayout->addWidget(mainWidget);
+ QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
+ okButton->setDefault(true);
+ okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
+ popn->connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
+ popn->connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
+ buttonBox->button(QDialogButtonBox::Ok)->setDefault(true);
popn->setModal( true );
SrcSelect *page = new SrcSelect();
- popn->setMainWidget(page);
+ mainLayout->addWidget(page);
+ mainLayout->addWidget(buttonBox);
page->newFilename->setUrl(QUrl(oldname));
page->newFilename->setMode(KFile::File);
page->newFilename->setWindowTitle(i18n("Save File"));
diff --git a/editor/kgpgmd5widget.cpp b/editor/kgpgmd5widget.cpp
index 2805849..5495336 100644
--- a/editor/kgpgmd5widget.cpp
+++ b/editor/kgpgmd5widget.cpp
@@ -20,15 +20,25 @@
#include <KMessageBox>
#include <KLocale>
#include <KLed>
+#include <KConfigGroup>
+#include <QDialogButtonBox>
+#include <QPushButton>
+#include <QVBoxLayout>
Md5Widget::Md5Widget(QWidget *parent, const QUrl &url)
- : KDialog(parent)
+ : QDialog(parent)
{
setWindowTitle(i18n("MD5 Checksum"));
- setButtons(Apply | Close);
- setDefaultButton(Close);
- setButtonText(Apply, i18n("Compare MD5 with Clipboard"));
+ QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close|QDialogButtonBox::Apply);
+ QWidget *mainWidget = new QWidget(this);
+ QVBoxLayout *mainLayout = new QVBoxLayout;
+ setLayout(mainLayout);
+ mainLayout->addWidget(mainWidget);
+ connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
+ connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
+ buttonBox->button(QDialogButtonBox::Close)->setDefault(true);
+ buttonBox->button(QDialogButtonBox::Apply)->setText(i18n("Compare MD5 with Clipboard"));
QFile f(url.path());
QCryptographicHash checkfile(QCryptographicHash::Md5);
@@ -63,16 +73,15 @@ Md5Widget::Md5Widget(QWidget *parent, const QUrl &url)
ledlayout->addWidget(m_label);
QVBoxLayout *dialoglayout = new QVBoxLayout(page);
- dialoglayout->setMargin(marginHint());
- dialoglayout->setSpacing(spacingHint());
dialoglayout->addWidget(firstlabel);
dialoglayout->addWidget(md5lineedit);
dialoglayout->addLayout(ledlayout);
dialoglayout->addStretch();
- setMainWidget(page);
+ mainLayout->addWidget(page);
+ mainLayout->addWidget(buttonBox);
- connect(this, SIGNAL(applyClicked()), this, SLOT(slotApply()));
+ connect(buttonBox->button(QDialogButtonBox::Apply), SIGNAL(clicked()), this, SLOT(slotApply()));
}
void Md5Widget::slotApply()
diff --git a/editor/kgpgmd5widget.h b/editor/kgpgmd5widget.h
index 11ffcdf..96ed105 100644
--- a/editor/kgpgmd5widget.h
+++ b/editor/kgpgmd5widget.h
@@ -19,7 +19,7 @@ class QLabel;
class KLed;
-class Md5Widget : public KDialog
+class Md5Widget : public QDialog
{
Q_OBJECT
diff --git a/editor/kgpgtextedit.cpp b/editor/kgpgtextedit.cpp
index 8bb9a17..8351f40 100644
--- a/editor/kgpgtextedit.cpp
+++ b/editor/kgpgtextedit.cpp
@@ -37,6 +37,7 @@
#include <QMimeData>
#include <QTextStream>
#include <kio/netaccess.h>
+#include <KConfigGroup>
#define SIGNEDMESSAGE_BEGIN QLatin1String( "-----BEGIN PGP SIGNED MESSAGE-----" )
#define SIGNEDMESSAGE_END QLatin1String( "-----END PGP SIGNATURE-----" )
@@ -159,7 +160,7 @@ void KgpgTextEdit::openDroppedFile(const QUrl &url, const bool probe)
void KgpgTextEdit::slotEncode()
{
QPointer<KgpgSelectPublicKeyDlg> dialog = new KgpgSelectPublicKeyDlg(this, m_model, m_keysmanager->goDefaultShortcut(), true);
- if (dialog->exec() == KDialog::Accepted) {
+ if (dialog->exec() == QDialog::Accepted) {
QStringList options;
KGpgEncrypt::EncryptOptions opts = KGpgEncrypt::DefaultEncryption;
diff --git a/keyinfodialog.cpp b/keyinfodialog.cpp
index c1309d1..c3e4697 100644
--- a/keyinfodialog.cpp
+++ b/keyinfodialog.cpp
@@ -26,17 +26,22 @@
#include "model/kgpgitemnode.h"
#include "transactions/kgpgchangepass.h"
+#include <KConfigGroup>
#include <KGlobal>
#include <KLocale>
#include <KMessageBox>
#include <KPushButton>
#include <KToolInvocation>
+
#include <QApplication>
#include <QCheckBox>
+#include <QDialogButtonBox>
#include <QFormLayout>
#include <QHBoxLayout>
#include <QImage>
#include <QPixmap>
+#include <QPushButton>
+#include <QVBoxLayout>
using namespace KgpgCore;
@@ -95,7 +100,7 @@ void KgpgTrustLabel::change()
}
KgpgKeyInfo::KgpgKeyInfo(KGpgKeyNode *node, KGpgItemModel *model, QWidget *parent)
- : KDialog(parent),
+ : QDialog(parent),
keychange(new KGpgChangeKey(node, this)),
m_node(node),
m_model(model),
@@ -107,10 +112,20 @@ KgpgKeyInfo::KgpgKeyInfo(KGpgKeyNode *node, KGpgItemModel *model, QWidget *paren
setupUi(this);
- setButtons(Ok | Apply | Cancel);
- setDefaultButton(Ok);
- setModal(true);
- enableButtonApply(false);
+ QVBoxLayout *mainLayout = new QVBoxLayout(this);
+ QWidget *mainWidget = new QWidget(this);
+ setLayout(mainLayout);
+ mainLayout->addWidget(mainWidget);
+ buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel|QDialogButtonBox::Apply);
+ QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
+ okButton->setDefault(true);
+ okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
+ connect(buttonBox, &QDialogButtonBox::accepted, this, &KgpgKeyInfo::okButtonClicked);
+ connect(buttonBox->button(QDialogButtonBox::Apply), &QPushButton::clicked, this, &KgpgKeyInfo::applyButtonClicked);
+ connect(buttonBox->button(QDialogButtonBox::Cancel), &QPushButton::clicked, this, &KgpgKeyInfo::cancelButtonClicked);
+ connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
+ okButton->setDefault(true);
+ buttonBox->button(QDialogButtonBox::Apply)->setEnabled(false);
m_email->setUnderline(false);
m_trust = new KgpgTrustLabel(this);
@@ -124,7 +139,8 @@ KgpgKeyInfo::KgpgKeyInfo(KGpgKeyNode *node, KGpgItemModel *model, QWidget *paren
m_password->hide();
}
- setMainWidget(page);
+ mainLayout->addWidget(page);
+ mainLayout->addWidget(buttonBox);
connect(m_owtrust, SIGNAL(activated(int)), this, SLOT(slotChangeTrust(int)));
connect(m_photoid, SIGNAL(activated(QString)), this, SLOT(slotLoadPhoto(QString)));
@@ -262,7 +278,7 @@ void KgpgKeyInfo::slotChangeDate()
QPointer<SelectExpiryDate> dialog = new SelectExpiryDate(this, m_node->getExpiration());
if (dialog->exec() == QDialog::Accepted) {
keychange->setExpiration(dialog->date());
- enableButtonApply(keychange->wasChanged());
+ buttonBox->button(QDialogButtonBox::Apply)->setEnabled(keychange->wasChanged());
}
delete dialog;
}
@@ -270,7 +286,7 @@ void KgpgKeyInfo::slotChangeDate()
void KgpgKeyInfo::slotDisableKey(const bool ison)
{
keychange->setDisable(ison);
- enableButtonApply(keychange->wasChanged());
+ buttonBox->button(QDialogButtonBox::Apply)->setEnabled(keychange->wasChanged());
}
void KgpgKeyInfo::slotChangePass()
@@ -306,14 +322,14 @@ void KgpgKeyInfo::slotInfoPasswordChanged(int result)
void KgpgKeyInfo::slotChangeTrust(const int newtrust)
{
keychange->setOwTrust(static_cast<gpgme_validity_t>(newtrust + 1));
- enableButtonApply(keychange->wasChanged());
+ buttonBox->button(QDialogButtonBox::Apply)->setEnabled(keychange->wasChanged());
}
void KgpgKeyInfo::setControlEnable(const bool b)
{
m_owtrust->setEnabled(b);
m_disable->setEnabled(b);
- enableButtonApply(b && keychange->wasChanged());
+ buttonBox->button(QDialogButtonBox::Apply)->setEnabled(b && keychange->wasChanged());
if (m_expirationbtn)
m_expirationbtn->setEnabled(b);
@@ -326,24 +342,23 @@ void KgpgKeyInfo::setControlEnable(const bool b)
QApplication::setOverrideCursor(QCursor(Qt::BusyCursor));
}
-void KgpgKeyInfo::slotButtonClicked(int button)
+void KgpgKeyInfo::okButtonClicked()
{
- switch (button) {
- case Ok:
- m_closewhendone = true;
- // Fall-through
- case Apply:
- setControlEnable(false);
- keychange->apply();
- break;
- case Cancel:
- if (m_keywaschanged && m_node)
- emit keyNeedsRefresh(m_node);
- reject();
- break;
- default:
- KDialog::slotButtonClicked(button);
- }
+ m_closewhendone = true;
+ applyButtonClicked();
+}
+
+void KgpgKeyInfo::applyButtonClicked()
+{
+ setControlEnable(false);
+ keychange->apply();
+}
+
+void KgpgKeyInfo::cancelButtonClicked()
+{
+ if (m_keywaschanged && m_node)
+ emit keyNeedsRefresh(m_node);
+ reject();
}
void KgpgKeyInfo::slotApplied(int result)
diff --git a/keyinfodialog.h b/keyinfodialog.h
index 8296a9f..9b47252 100644
--- a/keyinfodialog.h
+++ b/keyinfodialog.h
@@ -17,15 +17,16 @@
#ifndef KGPGKEYINFODIALOG_H
#define KGPGKEYINFODIALOG_H
-#include <QString>
-#include <QLabel>
#include <QColor>
-
-#include <KDialog>
+#include <QDialog>
+#include <QLabel>
+#include <QString>
#include <kgpgcompiler.h>
#include "ui_kgpgKeyInfo.h"
+class QDialogButtonBox;
+
class KGpgItemModel;
class KGpgKeyNode;
class KGpgChangeKey;
@@ -53,7 +54,7 @@ private:
QColor m_color;
};
-class KgpgKeyInfo : public KDialog, public Ui::kgpgKeyInfo
+class KgpgKeyInfo : public QDialog, public Ui::kgpgKeyInfo
{
Q_OBJECT
@@ -68,14 +69,14 @@ public:
signals:
void keyNeedsRefresh(KGpgKeyNode *node);
-protected slots:
- void slotButtonClicked(int button);
-
private:
void reloadKey();
void reloadNode();
void displayKey();
void setControlEnable(const bool b);
+ void okButtonClicked();
+ void applyButtonClicked();
+ void cancelButtonClicked();
private slots:
void slotOpenUrl(const QString &url) const;
@@ -101,6 +102,8 @@ private:
KgpgTrustLabel *m_trust;
+ QDialogButtonBox *buttonBox;
+
bool m_keywaschanged;
bool m_closewhendone;
};
diff --git a/keysmanager.cpp b/keysmanager.cpp
index f90e097..9875487 100644
--- a/keysmanager.cpp
+++ b/keysmanager.cpp
@@ -1312,7 +1312,7 @@ KeysManager::slotMenu(const QPoint &pos)
void KeysManager::revokeWidget()
{
KGpgNode *nd = iview->selectedNode();
- KDialog *keyRevokeDialog = new KGpgRevokeDialog(this, nd->toKeyNode());
+ QDialog *keyRevokeDialog = new KGpgRevokeDialog(this, nd->toKeyNode());
connect(keyRevokeDialog, SIGNAL(finished(int)), SLOT(slotRevokeDialogFinished(int)));
diff --git a/kgpgKeyInfo.ui b/kgpgKeyInfo.ui
index af7a77f..21486a4 100644
--- a/kgpgKeyInfo.ui
+++ b/kgpgKeyInfo.ui
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>kgpgKeyInfo</class>
- <widget class="KDialog" name="kgpgKeyInfo">
+ <widget class="QDialog" name="kgpgKeyInfo">
<property name="geometry">
<rect>
<x>0</x>
@@ -442,12 +442,6 @@
</widget>
<customwidgets>
<customwidget>
- <class>KDialog</class>
- <extends>QDialog</extends>
- <header>kdialog.h</header>
- <container>1</container>
- </customwidget>
- <customwidget>
<class>KPushButton</class>
<extends>QPushButton</extends>
<header>kpushbutton.h</header>
diff --git a/kgpgexternalactions.cpp b/kgpgexternalactions.cpp
index de72f7e..76637b9 100644
--- a/kgpgexternalactions.cpp
+++ b/kgpgexternalactions.cpp
@@ -37,6 +37,7 @@
#include <KActionCollection>
#include <KHelpClient>
#include <KMessageBox>
+#include <KHBox>
#include <QFont>
#include <QProcess>
diff --git a/kgpgkeygenerate.cpp b/kgpgkeygenerate.cpp
index a32b09f..1132203 100644
--- a/kgpgkeygenerate.cpp
+++ b/kgpgkeygenerate.cpp
@@ -28,27 +28,39 @@
#include <QVBoxLayout>
#include <QWhatsThis>
#include <QWidget>
+#include <KConfigGroup>
+#include <QDialogButtonBox>
+#include <QPushButton>
using namespace KgpgCore;
KgpgKeyGenerate::KgpgKeyGenerate(QWidget *parent)
- : KDialog(parent),
+ : QDialog(parent),
m_expert(false)
{
setupUi(this);
- setButtons(User1 | Ok | Cancel);
-
- setButtonText(User1, i18n("&Expert Mode"));
- setButtonToolTip(User1, i18n("Go to Expert Mode"));
- setButtonWhatsThis(User1, i18n( "If you go to expert mode, you will use the command line to create your key." ));
+ QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
+ QWidget *mainWidget = new QWidget(this);
+ QVBoxLayout *mainLayout = new QVBoxLayout;
+ setLayout(mainLayout);
+ mainLayout->addWidget(mainWidget);
+ okButton = buttonBox->button(QDialogButtonBox::Ok);
+ okButton->setDefault(true);
+ okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
+ QPushButton *user1Button = new QPushButton;
+ buttonBox->addButton(user1Button, QDialogButtonBox::ActionRole);
+ connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
+ connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
+
+ user1Button->setText(i18n("&Expert Mode"));
+ user1Button->setToolTip(i18n("Go to Expert Mode"));
+ user1Button->setWhatsThis(i18n( "If you go to expert mode, you will use the command line to create your key." ));
connect(m_kname, SIGNAL(textChanged(QString)), this, SLOT(slotEnableOk()));
KHBox *hgroup = new KHBox(vgroup);
hgroup->setFrameShape(QFrame::StyledPanel);
- hgroup->setMargin(marginHint());
- hgroup->setSpacing(spacingHint());
m_days->setParent(hgroup);
QIntValidator *validator = new QIntValidator(m_days);
validator->setBottom(0);
@@ -84,29 +96,18 @@ KgpgKeyGenerate::KgpgKeyGenerate(QWidget *parent)
slotEnableCaps(m_keykind->currentIndex());
m_keykind->setMinimumSize(m_keykind->sizeHint());
- setMainWidget(vgroup);
+ mainLayout->addWidget(vgroup);
+ mainLayout->addWidget(buttonBox);
slotEnableOk();
updateGeometry();
show();
- connect(this, SIGNAL(okClicked()), this, SLOT(slotOk()));
- connect(this, SIGNAL(user1Clicked()), this, SLOT(slotUser1()));
+ connect(okButton, SIGNAL(clicked()), this, SLOT(slotOk()));
+ connect(user1Button, SIGNAL(clicked()), this, SLOT(slotUser1()));
connect(m_keykind, SIGNAL(activated(int)), SLOT(slotEnableCaps(int)));
}
-void KgpgKeyGenerate::slotButtonClicked(int button)
-{
- if (button == Ok)
- slotOk();
- else
- if (button == User1)
- slotUser1();
- else
- if (button == Cancel)
- reject();
-}
-
void KgpgKeyGenerate::slotOk()
{
if (m_kname->text().simplified().isEmpty())
@@ -164,7 +165,7 @@ void KgpgKeyGenerate::slotEnableCaps(const int state)
void KgpgKeyGenerate::slotEnableOk()
{
- enableButtonOk((m_kname->text().simplified().length() >= 5) &&
+ okButton->setEnabled((m_kname->text().simplified().length() >= 5) &&
!m_kname->text().simplified().at(0).isDigit());
}
diff --git a/kgpgkeygenerate.h b/kgpgkeygenerate.h
index f19345c..393b640 100644
--- a/kgpgkeygenerate.h
+++ b/kgpgkeygenerate.h
@@ -19,11 +19,12 @@
#include "core/kgpgkey.h"
-#include <KDialog>
+#include <QDialog>
+#include <QPushButton>
class KComboBox;
-class KgpgKeyGenerate : public KDialog, public Ui::kgpgKeyGenerate
+class KgpgKeyGenerate : public QDialog, public Ui::kgpgKeyGenerate
{
Q_OBJECT
@@ -48,12 +49,13 @@ public:
private slots:
void slotOk();
void slotUser1();
- void slotButtonClicked(int button);
void slotEnableOk();
void slotEnableDays(const int state);
void slotEnableCaps(const int state);
private:
+ QPushButton *okButton;
+
KComboBox *m_keyexp;
bool m_expert;
};
diff --git a/kgpgkeygenerate.ui b/kgpgkeygenerate.ui
index f45c850..54176cb 100644
--- a/kgpgkeygenerate.ui
+++ b/kgpgkeygenerate.ui
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>kgpgKeyGenerate</class>
- <widget class="KDialog" name="kgpgKeyGenerate">
+ <widget class="QDialog" name="kgpgKeyGenerate">
<property name="geometry">
<rect>
<x>0</x>
@@ -184,21 +184,10 @@
</widget>
<customwidgets>
<customwidget>
- <class>KDialog</class>
- <extends>QDialog</extends>
- <header>kdialog.h</header>
- <container>1</container>
- </customwidget>
- <customwidget>
<class>KComboBox</class>
<extends>QComboBox</extends>
<header>kcombobox.h</header>
</customwidget>
- <customwidget>
- <class>QLineEdit</class>
- <extends>QLineEdit</extends>
- <header>klineedit.h</header>
- </customwidget>
</customwidgets>
<resources/>
<connections/>
diff --git a/kgpgoptions.cpp b/kgpgoptions.cpp
index 339c841..3346201 100644
--- a/kgpgoptions.cpp
+++ b/kgpgoptions.cpp
@@ -38,6 +38,7 @@
#include <QTextStream>
#include <QVBoxLayout>
#include <QStandardPaths>
+#include <KConfigGroup>
using namespace KgpgCore;
@@ -221,14 +222,13 @@ void kgpgOptions::slotAddKeyServer()
return;
m_serverModel->setStringList(m_serverModel->stringList() << newServer);
-
-// enableButtonApply(true); FIXME: KF5
+ settingsChangedSlot();
}
void kgpgOptions::slotChangeEncryptTo()
{
bool enable = (m_page1->encrypt_to_always->isChecked() != m_encrypttoalways);
-// enableButtonApply(enable); FIXME: KF5
+ settingsChangedSlot();
}
void kgpgOptions::slotDelKeyServer()
@@ -236,7 +236,7 @@ void kgpgOptions::slotDelKeyServer()
QModelIndex cur = m_page6->ServerBox->selectionModel()->currentIndex();
m_serverModel->removeRows(cur.row(), 1);
-// enableButtonApply(true); FIXME: KF5
+ settingsChangedSlot();
}
void kgpgOptions::slotEditKeyServer()
@@ -251,7 +251,7 @@ void kgpgOptions::slotEditKeyServer(const QModelIndex &index)
m_page6->ServerBox->edit(index);
-// enableButtonApply(true); FIXME: KF5
+ settingsChangedSlot();
}
void kgpgOptions::slotDefaultKeyServer()
@@ -260,7 +260,7 @@ void kgpgOptions::slotDefaultKeyServer()
m_serverModel->setDefault(cur.row());
-// enableButtonApply(true); FIXME: KF5
+ settingsChangedSlot();
}
void kgpgOptions::slotChangeKeyServerButtonEnable()
diff --git a/kgpgrevokewidget.cpp b/kgpgrevokewidget.cpp
index 11992d0..445cf64 100644
--- a/kgpgrevokewidget.cpp
+++ b/kgpgrevokewidget.cpp
@@ -20,6 +20,10 @@
#include <QUrl>
#include <QDir>
+#include <KConfigGroup>
+#include <QDialogButtonBox>
+#include <QPushButton>
+#include <QVBoxLayout>
KgpgRevokeWidget::KgpgRevokeWidget(QWidget* parent)
: QWidget(parent),
@@ -35,13 +39,22 @@ void KgpgRevokeWidget::cbSave_toggled(bool isOn)
}
KGpgRevokeDialog::KGpgRevokeDialog(QWidget* parent, const KGpgKeyNode *node)
- : KDialog(parent),
+ : QDialog(parent),
m_revWidget(new KgpgRevokeWidget(this)),
m_id(node->getId())
{
setWindowTitle(i18n("Create Revocation Certificate"));
- setButtons(KDialog::Ok | KDialog::Cancel);
- setDefaultButton(KDialog::Ok);
+ QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
+ QWidget *mainWidget = new QWidget(this);
+ QVBoxLayout *mainLayout = new QVBoxLayout;
+ setLayout(mainLayout);
+ mainLayout->addWidget(mainWidget);
+ QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
+ okButton->setDefault(true);
+ okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
+ connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
+ connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
+ buttonBox->button(QDialogButtonBox::Ok)->setDefault(true);
setModal(true);
m_revWidget->keyID->setText(i18nc("<Name> (<Email>) ID: <KeyId>", "%1 (%2) ID: %3",
@@ -50,7 +63,8 @@ KGpgRevokeDialog::KGpgRevokeDialog(QWidget* parent, const KGpgKeyNode *node)
m_revWidget->outputFile->setMode(KFile::File);
setMinimumSize(m_revWidget->sizeHint());
- setMainWidget(m_revWidget);
+ mainLayout->addWidget(m_revWidget);
+ mainLayout->addWidget(buttonBox);
}
QString KGpgRevokeDialog::getDescription() const
diff --git a/kgpgrevokewidget.h b/kgpgrevokewidget.h
index a1e71a8..8828d10 100644
--- a/kgpgrevokewidget.h
+++ b/kgpgrevokewidget.h
@@ -17,7 +17,7 @@
#ifndef KGPGREVOKEWIDGET_H
#define KGPGREVOKEWIDGET_H
-#include <KDialog>
+#include <QDialog>
#include <kgpgcompiler.h>
#include "ui_kgpgrevokewidget.h"
@@ -37,7 +37,7 @@ public slots:
virtual void cbSave_toggled(bool isOn);
};
-class KGpgRevokeDialog: public KDialog
+class KGpgRevokeDialog: public QDialog
{
Q_OBJECT
diff --git a/selectexpirydate.cpp b/selectexpirydate.cpp
index ab4dc61..7105803 100644
--- a/selectexpirydate.cpp
+++ b/selectexpirydate.cpp
@@ -20,13 +20,26 @@
#include <KDatePicker>
#include <KLocale>
+#include <KConfigGroup>
+
+#include <QDialogButtonBox>
+#include <QPushButton>
SelectExpiryDate::SelectExpiryDate(QWidget* parent, QDateTime date)
- : KDialog(parent)
+ : QDialog(parent)
{
setWindowTitle(i18n("Choose New Expiration"));
- setButtons(Ok | Cancel);
- setDefaultButton(Ok);
+ QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
+ QWidget *mainWidget = new QWidget(this);
+ QVBoxLayout *mainLayout = new QVBoxLayout;
+ setLayout(mainLayout);
+ mainLayout->addWidget(mainWidget);
+ okButton = buttonBox->button(QDialogButtonBox::Ok);
+ okButton->setDefault(true);
+ okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
+ connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
+ connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
+ okButton->setDefault(true);
setModal(true);
QWidget *page = new QWidget(this);
@@ -51,7 +64,8 @@ SelectExpiryDate::SelectExpiryDate(QWidget* parent, QDateTime date)
connect(m_datepicker, SIGNAL(dateChanged(QDate)), this, SLOT(slotCheckDate(QDate)));
connect(m_datepicker, SIGNAL(dateEntered(QDate)), this, SLOT(slotCheckDate(QDate)));
- setMainWidget(page);
+ mainLayout->addWidget(page);
+ mainLayout->addWidget(buttonBox);
show();
slotEnableDate(m_unlimited->isChecked());
@@ -67,14 +81,14 @@ QDateTime SelectExpiryDate::date() const
void SelectExpiryDate::slotCheckDate(const QDate& date)
{
- enableButtonOk(QDateTime(date) >= QDateTime::currentDateTime());
+ okButton->setEnabled(QDateTime(date) >= QDateTime::currentDateTime());
}
void SelectExpiryDate::slotEnableDate(const bool ison)
{
m_datepicker->setEnabled(!ison);
if (ison)
- enableButtonOk(true);
+ okButton->setEnabled(true);
else
slotCheckDate(m_datepicker->date());
}
diff --git a/selectexpirydate.h b/selectexpirydate.h
index 6cb49b6..11c18f5 100644
--- a/selectexpirydate.h
+++ b/selectexpirydate.h
@@ -16,13 +16,14 @@
#ifndef SELECTEXPIRYDATE_H
#define SELECTEXPIRYDATE_H
-#include <KDialog>
#include <QDateTime>
+#include <QDialog>
#include <kgpgcompiler.h>
class KDatePicker;
class QCheckBox;
+class QPushButton;
/**
* @brief shows a dialog to choose expiry date
@@ -30,7 +31,7 @@ class QCheckBox;
* This dialog allows the user to choose a expiry date or set a
* checkbox to select that the given item will never expire.
*/
-class SelectExpiryDate : public KDialog
+class SelectExpiryDate : public QDialog
{
Q_OBJECT
@@ -45,6 +46,7 @@ private slots:
private:
QCheckBox *m_unlimited;
+ QPushButton *okButton;
KDatePicker *m_datepicker;
};
diff --git a/selectpublickeydialog.cpp b/selectpublickeydialog.cpp
index 560c8f1..513b8cd 100644
--- a/selectpublickeydialog.cpp
+++ b/selectpublickeydialog.cpp
@@ -29,22 +29,41 @@
#include <QVBoxLayout>
#include <KActionCollection>
-#include <KHBox>
+#include <QHBoxLayout>
+#include <KIconLoader>
#include <KLocale>
-#include <KVBox>
+#include <QVBoxLayout>
+#include <KConfigGroup>
+#include <QDialogButtonBox>
+#include <QPushButton>
using namespace KgpgCore;
KgpgSelectPublicKeyDlg::KgpgSelectPublicKeyDlg(QWidget *parent, KGpgItemModel *model, const QKeySequence &goDefaultKey, const bool hideasciioption, const QList<QUrl> &files)
- : KDialog(parent),
+ : QDialog(parent),
m_customoptions(Q_NULLPTR),
imodel(model),
m_files(files),
m_hideasciioption(hideasciioption)
{
- setButtons(Details | Ok | Cancel);
- setDefaultButton(Ok);
- setButtonText(Details, i18n("O&ptions"));
+ QWidget *mainWidget = new QWidget(this);
+ QVBoxLayout *mainLayout = new QVBoxLayout;
+ setLayout(mainLayout);
+ mainLayout->setSizeConstraint(QLayout::SetMinimumSize);
+ mainLayout->addWidget(mainWidget);
+
+ QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
+ m_okButton = buttonBox->button(QDialogButtonBox::Ok);
+ m_okButton->setDefault(true);
+ m_okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
+ m_detailsButton = new QPushButton;
+ m_detailsButton->setText(i18n("&O&ptions") + QStringLiteral(" >>"));
+ m_detailsButton->setIcon(QIcon::fromTheme(QStringLiteral("help-about")).pixmap(IconSize(KIconLoader::Toolbar)));
+ connect(m_detailsButton, &QPushButton::clicked, this, &KgpgSelectPublicKeyDlg::toggleDetails);
+ buttonBox->addButton(m_detailsButton, QDialogButtonBox::ActionRole);
+ connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
+ connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
+ m_okButton->setDefault(true);
int fcount = files.count();
bool fmode = (fcount > 0);
@@ -62,13 +81,14 @@ KgpgSelectPublicKeyDlg::KgpgSelectPublicKeyDlg(QWidget *parent, KGpgItemModel *m
QWidget *page = new QWidget(this);
- m_searchbar = new KHBox(page);
- m_searchbar->setSpacing(spacingHint());
- m_searchbar->setFrameShape(QFrame::StyledPanel);
-
+ m_searchbar = new QWidget(page);
+ QHBoxLayout *searchbarHBoxLayout = new QHBoxLayout(m_searchbar);
+ searchbarHBoxLayout->setMargin(0);
QLabel *searchlabel = new QLabel(i18n("&Search: "), m_searchbar);
+ searchbarHBoxLayout->addWidget(searchlabel);
m_searchlineedit = new QLineEdit(m_searchbar);
+ searchbarHBoxLayout->addWidget(m_searchlineedit);
m_searchlineedit->setClearButtonEnabled(true);
searchlabel->setBuddy(m_searchlineedit);
@@ -84,26 +104,30 @@ KgpgSelectPublicKeyDlg::KgpgSelectPublicKeyDlg(QWidget *parent, KGpgItemModel *m
m_keyslist->setWhatsThis(i18n("<b>Public keys list</b>: select the key that will be used for encryption."));
connect(m_searchlineedit, SIGNAL(textChanged(QString)), iproxy, SLOT(setFilterFixedString(QString)));
- optionsbox = new KVBox();
- optionsbox->setFrameShape(QFrame::StyledPanel);
- setDetailsWidget(optionsbox);
+ optionsbox = new QWidget();
+ QVBoxLayout *optionsboxVBoxLayout = new QVBoxLayout(optionsbox);
+ optionsboxVBoxLayout->setMargin(0);
+ optionsbox->hide();
if (m_hideasciioption)
m_cbarmor = 0;
else
{
m_cbarmor = new QCheckBox(i18n("ASCII armored encryption"), optionsbox);
+ optionsboxVBoxLayout->addWidget(m_cbarmor);
m_cbarmor->setChecked(KGpgSettings::asciiArmor());
m_cbarmor->setWhatsThis(i18n("<b>ASCII encryption</b>: makes it possible to open the encrypted file/message in a text editor"));
}
m_cbuntrusted = new QCheckBox(i18n("Allow encryption with untrusted keys"), optionsbox);
+ optionsboxVBoxLayout->addWidget(m_cbuntrusted);
m_cbuntrusted->setChecked(KGpgSettings::allowUntrustedKeys());
m_cbuntrusted->setWhatsThis(i18n("<b>Allow encryption with untrusted keys</b>: when you import a public key, it is usually "
"marked as untrusted and you cannot use it unless you sign it in order to make it 'trusted'. Checking this "
"box enables you to use any key, even if it has not be signed."));
m_cbhideid = new QCheckBox(i18n("Hide user id"), optionsbox);
+ optionsboxVBoxLayout->addWidget(m_cbhideid);
connect(m_cbuntrusted, SIGNAL(toggled(bool)), this, SLOT(slotUntrusted(bool)));
m_cbhideid->setChecked(KGpgSettings::hideUserID());
m_cbhideid->setWhatsThis(i18n("<b>Hide user ID</b>: Do not put the keyid into encrypted packets. This option hides the receiver "
@@ -111,11 +135,11 @@ KgpgSelectPublicKeyDlg::KgpgSelectPublicKeyDlg(QWidget *parent, KGpgItemModel *m
"all available secret keys are tried."));
m_cbsymmetric = new QCheckBox(i18n("Symmetrical encryption"), optionsbox);
+ optionsboxVBoxLayout->addWidget(m_cbsymmetric);
m_cbsymmetric->setWhatsThis(i18n("<b>Symmetrical encryption</b>: encryption does not use keys. You just need to give a password "
"to encrypt/decrypt the file"));
QVBoxLayout *dialoglayout = new QVBoxLayout(page);
- dialoglayout->setSpacing(spacingHint());
dialoglayout->setMargin(0);
dialoglayout->addWidget(m_searchbar);
dialoglayout->addWidget(m_keyslist);
@@ -123,10 +147,13 @@ KgpgSelectPublicKeyDlg::KgpgSelectPublicKeyDlg(QWidget *parent, KGpgItemModel *m
if (KGpgSettings::allowCustomEncryptionOptions())
{
- KHBox *expertbox = new KHBox(page);
+ QWidget *expertbox = new QWidget(page);
+ QHBoxLayout *expertboxHBoxLayout = new QHBoxLayout(expertbox);
+ expertboxHBoxLayout->setMargin(0);
(void) new QLabel(i18n("Custom option:"), expertbox);
m_customoptions = new QLineEdit(expertbox);
+ expertboxHBoxLayout->addWidget(m_customoptions);
m_customoptions->setText(KGpgSettings::customEncryptionOptions());
m_customoptions->setWhatsThis(i18n("<b>Custom option</b>: for experienced users only, allows you to enter a gpg command line option, like: '--armor'"));
@@ -146,7 +173,9 @@ KgpgSelectPublicKeyDlg::KgpgSelectPublicKeyDlg(QWidget *parent, KGpgItemModel *m
setMinimumSize(550, 200);
updateGeometry();
- setMainWidget(page);
+ mainLayout->addWidget(page);
+ mainLayout->addWidget(optionsbox);
+ mainLayout->addWidget(buttonBox);
slotSelectionChanged();
if (fmode)
@@ -207,13 +236,13 @@ bool KgpgSelectPublicKeyDlg::getHideId() const
void KgpgSelectPublicKeyDlg::slotOk()
{
- if (getSymmetric() || m_keyslist->selectionModel()->hasSelection())
- slotButtonClicked(Ok);
+// if (getSymmetric() || m_keyslist->selectionModel()->hasSelection())
+// slotButtonClicked(Ok); FIXME: KF5
}
void KgpgSelectPublicKeyDlg::slotSelectionChanged()
{
- enableButtonOk(getSymmetric() || m_keyslist->selectionModel()->hasSelection());
+ m_okButton->setEnabled(getSymmetric() || m_keyslist->selectionModel()->hasSelection());
}
void KgpgSelectPublicKeyDlg::slotSymmetric(const bool state)
@@ -239,3 +268,10 @@ void KgpgSelectPublicKeyDlg::slotGotoDefaultKey()
QModelIndex pidx = iproxy->mapFromSource(sidx);
m_keyslist->selectionModel()->setCurrentIndex(pidx, QItemSelectionModel::Clear | QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows);
}
+
+void KgpgSelectPublicKeyDlg::toggleDetails()
+{
+ const bool isVisible = optionsbox->isVisible();
+ optionsbox->setVisible(!isVisible);
+ m_detailsButton->setText(i18n("&O&ptions") + (isVisible ? QStringLiteral(" >>") : QStringLiteral(" <<")));
+}
diff --git a/selectpublickeydialog.h b/selectpublickeydialog.h
index 0f6c3c9..26da9e0 100644
--- a/selectpublickeydialog.h
+++ b/selectpublickeydialog.h
@@ -18,17 +18,17 @@
#include "core/kgpgkey.h"
-#include <KDialog>
+#include <QDialog>
#include <QKeySequence>
#include <QUrl>
-#include <KVBox>
-#include <QKeySequence>
+
+#include <QVBoxLayout>
class QCheckBox;
class QTableView;
class QLineEdit;
-class KHBox;
+
class SelectKeyProxyModel;
class KGpgItemModel;
@@ -36,7 +36,7 @@ class KGpgItemModel;
/**
* @brief shows a dialog to select a public key for encryption
*/
-class KgpgSelectPublicKeyDlg : public KDialog
+class KgpgSelectPublicKeyDlg : public QDialog
{
Q_OBJECT
@@ -57,7 +57,7 @@ public:
*/
const QList<QUrl> &getFiles() const;
- KVBox *optionsbox;
+ QWidget *optionsbox;
private slots:
void slotOk();
@@ -67,12 +67,17 @@ private slots:
void slotGotoDefaultKey();
private:
+ void toggleDetails();
+private:
QCheckBox *m_cbarmor;
QCheckBox *m_cbuntrusted;
QCheckBox *m_cbhideid;
QCheckBox *m_cbsymmetric;
- KHBox *m_searchbar;
+ QPushButton *m_okButton;
+ QPushButton *m_detailsButton;
+
+ QWidget *m_searchbar;
QLineEdit *m_customoptions;
QTableView *m_keyslist;
QLineEdit *m_searchlineedit;
diff --git a/selectsecretkey.cpp b/selectsecretkey.cpp
index b464c13..0effe58 100644
--- a/selectsecretkey.cpp
+++ b/selectsecretkey.cpp
@@ -21,19 +21,31 @@
#include <QCheckBox>
#include <QLabel>
#include <QTableView>
+#include <KConfigGroup>
+#include <QDialogButtonBox>
+#include <QPushButton>
using namespace KgpgCore;
KgpgSelectSecretKey::KgpgSelectSecretKey(QWidget *parent, KGpgItemModel *model, const int countkey, const bool allowLocal, const bool allowTerminal)
- : KDialog(parent),
+ : QDialog(parent),
m_localsign(Q_NULLPTR),
m_terminalsign(Q_NULLPTR),
m_signtrust(Q_NULLPTR),
m_proxy(new SelectSecretKeyProxyModel(this))
{
setWindowTitle(i18n("Private Key List"));
- setButtons(Ok | Cancel);
- setDefaultButton(Ok);
+ QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
+ QWidget *mainWidget = new QWidget(this);
+ QVBoxLayout *mainLayout = new QVBoxLayout;
+ setLayout(mainLayout);
+ mainLayout->addWidget(mainWidget);
+ m_okButton = buttonBox->button(QDialogButtonBox::Ok);
+ m_okButton->setDefault(true);
+ m_okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
+ connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
+ connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
+ m_okButton->setDefault(true);
QWidget *page = new QWidget(this);
QLabel *label = new QLabel(i18n("Choose secret key for signing:"), page);
@@ -84,7 +96,8 @@ KgpgSelectSecretKey::KgpgSelectSecretKey(QWidget *parent, KGpgItemModel *model,
setMinimumSize(550, 200);
slotSelectionChanged();
- setMainWidget(page);
+ mainLayout->addWidget(page);
+ mainLayout->addWidget(buttonBox);
connect(m_keyslist->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(slotSelectionChanged()));
connect(m_keyslist, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(slotOk()));
@@ -127,11 +140,11 @@ bool KgpgSelectSecretKey::isTerminalSign() const
void KgpgSelectSecretKey::slotSelectionChanged()
{
- enableButtonOk(m_keyslist->selectionModel()->hasSelection());
+ m_okButton->setEnabled(m_keyslist->selectionModel()->hasSelection());
}
void KgpgSelectSecretKey::slotOk()
{
- if (m_keyslist->selectionModel()->hasSelection())
- slotButtonClicked(Ok);
+// if (m_keyslist->selectionModel()->hasSelection())
+// slotButtonClicked(Ok); FIXME: KF5
}
diff --git a/selectsecretkey.h b/selectsecretkey.h
index 9c4b610..a46c11b 100644
--- a/selectsecretkey.h
+++ b/selectsecretkey.h
@@ -10,7 +10,7 @@
#ifndef KGPGSELECTSECRETKEY_H
#define KGPGSELECTSECRETKEY_H
-#include <KDialog>
+#include <QDialog>
class QCheckBox;
class QTableView;
@@ -20,7 +20,7 @@ class KComboBox;
class KGpgItemModel;
class SelectSecretKeyProxyModel;
-class KgpgSelectSecretKey : public KDialog
+class KgpgSelectSecretKey : public QDialog
{
Q_OBJECT
@@ -63,6 +63,8 @@ private:
QCheckBox *m_localsign;
QCheckBox *m_terminalsign;
+ QPushButton *m_okButton;
+
KComboBox *m_signtrust;
QTableView *m_keyslist;
SelectSecretKeyProxyModel *m_proxy;
diff --git a/transactions/kgpgtransaction.cpp b/transactions/kgpgtransaction.cpp
index 8f3cb63..8ea727a 100644
--- a/transactions/kgpgtransaction.cpp
+++ b/transactions/kgpgtransaction.cpp
@@ -16,20 +16,22 @@
#include "gpgproc.h"
#include "kgpginterface.h"
-#include <KDebug>
-#include <KDialog>
-#include <kio/renamedialog.h>
-#include <KPasswordDialog>
-#include <knewpassworddialog.h>
-#include <KLocale>
-#include <KPushButton>
-#include <QUrl>
#include <QByteArray>
+#include <QDialog>
#include <QPointer>
#include <QStringList>
+#include <QUrl>
#include <QWeakPointer>
#include <QWidget>
+#include <KConfigGroup>
+#include <KDebug>
+#include <KIO/RenameDialog>
+#include <KNewPasswordDialog>
+#include <KLocale>
+#include <KPasswordDialog>
+#include <KPushButton>
+
KGpgTransaction::KGpgTransaction(QObject *parent, const bool allowChaining)
: QObject(parent),
d(new KGpgTransactionPrivate(this, allowChaining))