From 7e2b635eecbec0f159122cc4d4145dd0da23af08 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Thu, 3 Jan 2013 17:02:29 +0100 Subject: Restore (in 2.x way) shortcuts configuration options BUG: 311886 BUG: 305403 --- src/webwindow/rekonqui.rc | 3 ++- src/webwindow/webwindow.cpp | 36 ++++++++++++++++++++++++++++++++++++ src/webwindow/webwindow.h | 1 + 3 files changed, 39 insertions(+), 1 deletion(-) (limited to 'src/webwindow') diff --git a/src/webwindow/rekonqui.rc b/src/webwindow/rekonqui.rc index c6d28455..ea068e56 100644 --- a/src/webwindow/rekonqui.rc +++ b/src/webwindow/rekonqui.rc @@ -1,6 +1,6 @@ - + @@ -69,6 +69,7 @@ + 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 #include #include +#include #include #include @@ -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 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(); +} diff --git a/src/webwindow/webwindow.h b/src/webwindow/webwindow.h index a8c2f236..85c9395f 100644 --- a/src/webwindow/webwindow.h +++ b/src/webwindow/webwindow.h @@ -137,6 +137,7 @@ private Q_SLOTS: // Settings Menu slot void preferences(); + void keyBindings(); Q_SIGNALS: void titleChanged(QString); -- cgit v1.2.1