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 | |
parent | Restore rekonq 1.x shortcuts (diff) | |
download | rekonq-7e2b635eecbec0f159122cc4d4145dd0da23af08.tar.xz |
Restore (in 2.x way) shortcuts configuration options
BUG: 311886
BUG: 305403
-rw-r--r-- | src/tabwindow/tabwindow.cpp | 2 | ||||
-rw-r--r-- | src/webwindow/rekonqui.rc | 3 | ||||
-rw-r--r-- | src/webwindow/webwindow.cpp | 36 | ||||
-rw-r--r-- | src/webwindow/webwindow.h | 1 |
4 files changed, 41 insertions, 1 deletions
diff --git a/src/tabwindow/tabwindow.cpp b/src/tabwindow/tabwindow.cpp index 04a47b5e..915eb8dc 100644 --- a/src/tabwindow/tabwindow.cpp +++ b/src/tabwindow/tabwindow.cpp @@ -196,6 +196,8 @@ void TabWindow::init() favoritesSignalMapper->setMapping(a, i); } connect(favoritesSignalMapper, SIGNAL(mapped(int)), this, SLOT(loadFavorite(int))); + + _ac->readSettings(); } 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 @@ <?xml version="1.0"?> <!DOCTYPE gui SYSTEM "kpartgui.dtd"> -<gui name="rekonq" version="66"> +<gui name="rekonq" version="67"> <!--- =========== Rekonq Menu ============= --> <Menu name="rekonqMenu" noMerge="1"> @@ -69,6 +69,7 @@ <Action name="help_about_kde"/> </Menu> + <Action name="options_configure_keybinding" /> <Action name="options_configure" /> <Separator/> <Action name="file_quit" /> 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(); +} 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); |