summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp38
1 files changed, 29 insertions, 9 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index b5df7acb..d15ce0c4 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -286,7 +286,8 @@ void MainWindow::setupActions()
fullScreenShortcut.setAlternate( Qt::Key_F11 );
a->setShortcut( fullScreenShortcut );
- KStandardAction::home(this, SLOT(homePage()), actionCollection());
+ a = actionCollection()->addAction( KStandardAction::Home );
+ connect(a, SIGNAL(triggered(Qt::MouseButtons,Qt::KeyboardModifiers)), this, SLOT(homePage(Qt::MouseButtons)));
KStandardAction::preferences(this, SLOT(preferences()), actionCollection());
a = KStandardAction::redisplay(m_view, SLOT(webReload()), actionCollection());
@@ -345,14 +346,16 @@ void MainWindow::setupActions()
connect(a, SIGNAL(triggered(bool)), this, SLOT(clearPrivateData()));
// ========================= History related actions ==============================
- a = KStandardAction::back(this, SLOT(openPrevious()) , actionCollection());
+ a = actionCollection()->addAction( KStandardAction::Back );
+ connect(a, SIGNAL(triggered(Qt::MouseButtons,Qt::KeyboardModifiers)), this, SLOT(openPrevious(Qt::MouseButtons)));
m_historyBackMenu = new KMenu(this);
a->setMenu(m_historyBackMenu);
connect(m_historyBackMenu, SIGNAL(aboutToShow()), this, SLOT(aboutToShowBackMenu()));
connect(m_historyBackMenu, SIGNAL(triggered(QAction *)), this, SLOT(openActionUrl(QAction *)));
- KStandardAction::forward(this, SLOT(openNext()) , actionCollection());
+ a = actionCollection()->addAction( KStandardAction::Forward );
+ connect(a, SIGNAL(triggered(Qt::MouseButtons,Qt::KeyboardModifiers)), this, SLOT(openNext(Qt::MouseButtons)));
// ============================== General Tab Actions ====================================
a = new KAction(KIcon("tab-new"), i18n("New &Tab"), this);
@@ -796,6 +799,8 @@ void MainWindow::findNext()
return;
}
+ highlightAll();
+
QWebPage::FindFlags options = QWebPage::FindWrapsAroundDocument;
if (m_findBar->matchCase())
options |= QWebPage::FindCaseSensitively;
@@ -949,9 +954,12 @@ void MainWindow::viewPageSource()
}
-void MainWindow::homePage()
+void MainWindow::homePage(Qt::MouseButtons btn)
{
- currentTab()->view()->load( QUrl(ReKonfig::homePage()) );
+ if(btn == Qt::MidButton)
+ Application::instance()->loadUrl( KUrl(ReKonfig::homePage()), Rekonq::SettingOpenTab );
+ else
+ currentTab()->view()->load( QUrl(ReKonfig::homePage()) );
}
@@ -992,19 +1000,31 @@ void MainWindow::browserLoading(bool v)
}
-void MainWindow::openPrevious()
+void MainWindow::openPrevious(Qt::MouseButtons btn)
{
QWebHistory *history = currentTab()->view()->history();
if (history->canGoBack())
- history->goToItem(history->backItem());
+ {
+ KUrl back = history->backItem().url();
+ if(btn == Qt::MidButton)
+ Application::instance()->loadUrl(back, Rekonq::SettingOpenTab);
+ else
+ Application::instance()->loadUrl(back);
+ }
}
-void MainWindow::openNext()
+void MainWindow::openNext(Qt::MouseButtons btn)
{
QWebHistory *history = currentTab()->view()->history();
if (history->canGoForward())
- history->goToItem(history->forwardItem());
+ {
+ KUrl next = history->forwardItem().url();
+ if(btn == Qt::MidButton)
+ Application::instance()->loadUrl(next, Rekonq::SettingOpenTab);
+ else
+ Application::instance()->loadUrl(next);
+ }
}