Port away from KDialog to unbreak the build
I couldn't reach this code before from the Qt4 build, sorry for the temporary breakage.
This commit is contained in:
parent
6a3903262c
commit
7676a7142c
@ -335,10 +335,9 @@ KConfigDialog *AppletPrivate::generateGenericConfigDialog()
|
|||||||
dialog->setWindowTitle(configWindowTitle());
|
dialog->setWindowTitle(configWindowTitle());
|
||||||
dialog->setAttribute(Qt::WA_DeleteOnClose, true);
|
dialog->setAttribute(Qt::WA_DeleteOnClose, true);
|
||||||
q->createConfigurationInterface(dialog);
|
q->createConfigurationInterface(dialog);
|
||||||
dialog->showButton(KDialog::Default, false);
|
dialog->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Apply | QDialogButtonBox::Cancel);
|
||||||
dialog->showButton(KDialog::Help, false);
|
QObject::connect(dialog->button(QDialogButtonBox::Apply), SIGNAL(clicked()), q, SLOT(configDialogFinished()));
|
||||||
QObject::connect(dialog, SIGNAL(applyClicked()), q, SLOT(configDialogFinished()));
|
QObject::connect(dialog->button(QDialogButtonBox::Ok), SIGNAL(clicked()), q, SLOT(configDialogFinished()));
|
||||||
QObject::connect(dialog, SIGNAL(okClicked()), q, SLOT(configDialogFinished()));
|
|
||||||
return dialog;
|
return dialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -450,7 +449,7 @@ void AppletPrivate::configDialogFinished()
|
|||||||
// the config loader will trigger this for us, so we don't need to.
|
// the config loader will trigger this for us, so we don't need to.
|
||||||
propagateConfigChanged();
|
propagateConfigChanged();
|
||||||
if (KConfigDialog *dialog = qobject_cast<KConfigDialog *>(q->sender())) {
|
if (KConfigDialog *dialog = qobject_cast<KConfigDialog *>(q->sender())) {
|
||||||
dialog->enableButton(KDialog::Apply, false);
|
dialog->button(QDialogButtonBox::Apply)->setEnabled(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include "accessappletjob.h"
|
#include "accessappletjob.h"
|
||||||
|
|
||||||
|
#include <QPushButton>
|
||||||
#include <qtimer.h>
|
#include <qtimer.h>
|
||||||
#include <qtemporarydir.h>
|
#include <qtemporarydir.h>
|
||||||
|
|
||||||
@ -129,17 +130,19 @@ public:
|
|||||||
message+= i18n("</table>");
|
message+= i18n("</table>");
|
||||||
message+= i18n("<br><br>Are you sure you want to open this widget on your system?");
|
message+= i18n("<br><br>Are you sure you want to open this widget on your system?");
|
||||||
|
|
||||||
KDialog *dialog = new KDialog;
|
QDialog *dialog = new QDialog;
|
||||||
dialog->setWindowTitle(i18n("Remote Widget"));
|
dialog->setWindowTitle(i18n("Remote Widget"));
|
||||||
dialog->setButtons(KDialog::Yes|KDialog::No);
|
|
||||||
dialog->setButtonText(KDialog::Yes, i18n("Open Widget"));
|
|
||||||
dialog->setButtonText(KDialog::No, i18n("Reject Widget"));
|
|
||||||
|
|
||||||
int answer = KMessageBox::createKMessageBox(dialog, KDE::icon(iconName), message,
|
QDialogButtonBox *buttonBox = new QDialogButtonBox;
|
||||||
|
buttonBox->setStandardButtons(QDialogButtonBox::Yes | QDialogButtonBox::No);
|
||||||
|
buttonBox->button(QDialogButtonBox::Yes)->setText(i18n("Open Widget"));
|
||||||
|
buttonBox->button(QDialogButtonBox::No)->setText(i18n("Reject Widget"));
|
||||||
|
|
||||||
|
int answer = KMessageBox::createKMessageBox(dialog, buttonBox, KDE::icon(iconName), message,
|
||||||
QStringList(), QString(), 0,
|
QStringList(), QString(), 0,
|
||||||
KMessageBox::Dangerous);
|
KMessageBox::Dangerous);
|
||||||
|
|
||||||
if (answer!=KDialog::Yes) {
|
if (answer!=QDialogButtonBox::Yes) {
|
||||||
q->setError(-1);
|
q->setError(-1);
|
||||||
q->setErrorText(i18nc("A remote widget was rejected by the user.", "User rejected"));
|
q->setErrorText(i18nc("A remote widget was rejected by the user.", "User rejected"));
|
||||||
q->emitResult();
|
q->emitResult();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user