Port away from KDialog
This commit is contained in:
parent
cf98377101
commit
9b94febf60
@ -23,7 +23,9 @@
|
|||||||
#include "ui_pinpairing.h"
|
#include "ui_pinpairing.h"
|
||||||
|
|
||||||
#include <kdebug.h>
|
#include <kdebug.h>
|
||||||
#include <kdialog.h>
|
#include <QDialog>
|
||||||
|
#include <QDialogButtonBox>
|
||||||
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
namespace Plasma
|
namespace Plasma
|
||||||
{
|
{
|
||||||
@ -35,28 +37,35 @@ public:
|
|||||||
: q(q),
|
: q(q),
|
||||||
rule(rule),
|
rule(rule),
|
||||||
request(request),
|
request(request),
|
||||||
dialog(new KDialog(0))
|
dialog(new QDialog(0))
|
||||||
{
|
{
|
||||||
QWidget *widget = new QWidget(dialog);
|
QWidget *mainWidget = new QWidget(dialog);
|
||||||
pairingUI.setupUi(widget);
|
pairingUI.setupUi(mainWidget);
|
||||||
dialog->setMainWidget(widget);
|
|
||||||
if (rule) {
|
if (rule) {
|
||||||
dialog->setCaption(i18n("Incoming connection request"));
|
dialog->setWindowTitle(i18n("Incoming connection request"));
|
||||||
pairingUI.descriptionLabel->setText(rule->description());
|
pairingUI.descriptionLabel->setText(rule->description());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (request) {
|
if (request) {
|
||||||
dialog->setCaption(i18n("Connect with remote widget"));
|
dialog->setWindowTitle(i18n("Connect with remote widget"));
|
||||||
pairingUI.persistentCheckbox->setVisible(false);
|
pairingUI.persistentCheckbox->setVisible(false);
|
||||||
pairingUI.allServicesCheckbox->setVisible(false);
|
pairingUI.allServicesCheckbox->setVisible(false);
|
||||||
pairingUI.descriptionLabel->setText(request->description());
|
pairingUI.descriptionLabel->setText(request->description());
|
||||||
}
|
}
|
||||||
|
|
||||||
dialog->setButtons(KDialog::Ok | KDialog::Cancel);
|
QDialogButtonBox *buttonBox = new QDialogButtonBox(dialog);
|
||||||
|
buttonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
||||||
|
q->connect(buttonBox, SIGNAL(accepted()), dialog, SLOT(accept()));
|
||||||
|
q->connect(buttonBox, SIGNAL(rejected()), dialog, SLOT(reject()));
|
||||||
|
|
||||||
|
QVBoxLayout *layout = new QVBoxLayout;
|
||||||
|
layout->addWidget(mainWidget);
|
||||||
|
layout->addWidget(buttonBox);
|
||||||
|
dialog->setLayout(layout);
|
||||||
dialog->show();
|
dialog->show();
|
||||||
|
|
||||||
q->connect(dialog, SIGNAL(okClicked()), q, SLOT(slotAccept()));
|
q->connect(dialog, SIGNAL(accepted()), q, SLOT(slotAccept()));
|
||||||
q->connect(dialog, SIGNAL(cancelClicked()), q, SLOT(slotReject()));
|
q->connect(dialog, SIGNAL(rejected()), q, SLOT(slotReject()));
|
||||||
}
|
}
|
||||||
|
|
||||||
~PinPairingDialogPrivate()
|
~PinPairingDialogPrivate()
|
||||||
@ -97,7 +106,7 @@ public:
|
|||||||
AuthorizationRule *rule;
|
AuthorizationRule *rule;
|
||||||
ClientPinRequest *request;
|
ClientPinRequest *request;
|
||||||
Ui::pairingDialog pairingUI;
|
Ui::pairingDialog pairingUI;
|
||||||
KDialog *dialog;
|
QDialog *dialog;
|
||||||
};
|
};
|
||||||
|
|
||||||
PinPairingDialog::PinPairingDialog(AuthorizationRule &rule, QObject *parent)
|
PinPairingDialog::PinPairingDialog(AuthorizationRule &rule, QObject *parent)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user