diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2013-01-03 17:02:29 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2013-01-03 17:02:29 +0100 |
commit | 7e2b635eecbec0f159122cc4d4145dd0da23af08 (patch) | |
tree | 98f28e47ccfe3436ae538883283be62ef9908fad /src/webwindow/webwindow.cpp | |
parent | Restore rekonq 1.x shortcuts (diff) | |
download | rekonq-7e2b635eecbec0f159122cc4d4145dd0da23af08.tar.xz |
Restore (in 2.x way) shortcuts configuration options
BUG: 311886
BUG: 305403
Diffstat (limited to 'src/webwindow/webwindow.cpp')
-rw-r--r-- | src/webwindow/webwindow.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/webwindow/webwindow.cpp b/src/webwindow/webwindow.cpp index 1a492b5b..f5f0896d 100644 --- a/src/webwindow/webwindow.cpp +++ b/src/webwindow/webwindow.cpp @@ -31,6 +31,7 @@ #include "rekonq.h" #include "application.h" +#include "tabwindow.h" #include "adblockmanager.h" #include "bookmarkmanager.h" @@ -59,6 +60,7 @@ #include <KUrl> #include <KToolBar> #include <KToggleFullScreenAction> +#include <KShortcutsEditor> #include <QLabel> #include <QStyle> @@ -207,6 +209,7 @@ void WebWindow::setupActions() KStandardAction::saveAs(this, SLOT(fileSaveAs()), actionCollection()); KStandardAction::print(_tab, SLOT(printFrame()), actionCollection()); KStandardAction::preferences(this, SLOT(preferences()), actionCollection()); + KStandardAction::keyBindings(this, SLOT(keyBindings()), actionCollection()); KStandardAction::quit(rApp, SLOT(queryQuit()), actionCollection()); // Bookmark Toolbar @@ -328,6 +331,8 @@ void WebWindow::setupActions() a->setCheckable(true); actionCollection()->addAction(QL1S("web_inspector"), a); connect(a, SIGNAL(triggered(bool)), _tab, SLOT(toggleInspector(bool))); + + _ac->readSettings(); } @@ -964,3 +969,34 @@ void WebWindow::keyPressEvent(QKeyEvent *kev) return QWidget::keyPressEvent(kev); } + + +void WebWindow::keyBindings() +{ + QPointer<KDialog> dialog = new KDialog(this); + + KShortcutsEditor widget(this); + + widget.addCollection(actionCollection(), i18n("web window")); + TabWindow *tw = rApp->tabWindow(); + if (tw) + { + widget.addCollection(tw->actionCollection(), i18n("tab window")); + } + + dialog->setMainWidget(&widget); + + dialog->setCaption(i18nc("@title:window", "Configure Shortcuts")); + dialog->setButtons(KDialog::Ok | KDialog::Cancel | KDialog::Reset); + dialog->setMinimumSize(700, 525); + + connect(dialog, SIGNAL(resetClicked()), &widget, SLOT(allDefault())); + + if (dialog->exec() == QDialog::Accepted) + { + kDebug() << "OK"; + widget.save(); + } + + dialog->deleteLater(); +} |