Commit 6e286af3 authored by Kurt Hindenburg's avatar Kurt Hindenburg
Browse files

Port KeyBindingEditorDialog from KDialog to QDialog

parent e6275c98
......@@ -43,7 +43,6 @@
// KDE
#include <KCodecAction>
#include <KDialog>
#include <KIconDialog>
#include <KUrlCompletion>
#include <KWindowSystem>
......@@ -880,15 +879,18 @@ void EditProfileDialog::showKeyBindingEditor(bool isNewTranslator)
Q_ASSERT(translator);
QWeakPointer<KDialog> dialog = new KDialog(this);
QDialog dialog(this);
QDialogButtonBox *buttonBox = new QDialogButtonBox(&dialog);
buttonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
connect(buttonBox, SIGNAL(accepted()), &dialog, SLOT(accept()));
connect(buttonBox, SIGNAL(rejected()), &dialog, SLOT(reject()));
if (isNewTranslator)
dialog.data()->setWindowTitle(i18n("New Key Binding List"));
dialog.setWindowTitle(i18n("New Key Binding List"));
else
dialog.data()->setWindowTitle(i18n("Edit Key Binding List"));
dialog.setWindowTitle(i18n("Edit Key Binding List"));
KeyBindingEditor* editor = new KeyBindingEditor;
dialog.data()->setMainWidget(editor);
if (translator)
editor->setup(translator);
......@@ -896,7 +898,12 @@ void EditProfileDialog::showKeyBindingEditor(bool isNewTranslator)
if (isNewTranslator)
editor->setDescription(i18n("New Key Binding List"));
if (dialog.data()->exec() == QDialog::Accepted) {
QVBoxLayout *layout = new QVBoxLayout;
layout->addWidget(editor);
layout->addWidget(buttonBox);
dialog.setLayout(layout);
if (dialog.exec() == QDialog::Accepted) {
KeyboardTranslator* newTranslator = new KeyboardTranslator(*editor->translator());
if (isNewTranslator)
......@@ -913,7 +920,6 @@ void EditProfileDialog::showKeyBindingEditor(bool isNewTranslator)
updateTempProfileProperty(Profile::KeyBindings, newTranslator->name());
}
}
delete dialog.data();
}
void EditProfileDialog::newKeyBinding()
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment