diff options
| author | Andrea Diamantini <adjam7@gmail.com> | 2010-03-14 23:46:00 +0100 | 
|---|---|---|
| committer | Andrea Diamantini <adjam7@gmail.com> | 2010-03-14 23:46:00 +0100 | 
| commit | 654e071871b8a72df320189cbf320e5b3cdb4cfe (patch) | |
| tree | abcb251e1faf0c2b2b12040076dc5a79f1a7d23d /src | |
| parent | Changed createRequest method for KIO debugging purposes.. (diff) | |
| parent | Use default value instead of a different function (diff) | |
| download | rekonq-654e071871b8a72df320189cbf320e5b3cdb4cfe.tar.xz | |
Merge commit 'refs/merge-requests/105' of git://gitorious.org/rekonq/mainline into m105
Diffstat (limited to 'src')
| -rw-r--r-- | src/mainwindow.cpp | 36 | ||||
| -rw-r--r-- | src/mainwindow.h | 6 | 
2 files changed, 30 insertions, 12 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 60784af0..4b48157b 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); @@ -929,9 +932,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()) );  } @@ -972,19 +978,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); +    }  } diff --git a/src/mainwindow.h b/src/mainwindow.h index 57b88dfd..b693fec1 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -87,7 +87,7 @@ private:      void setupPanels();  public slots: -    void homePage(); +    void homePage(Qt::MouseButtons = Qt::LeftButton);      /**       * Notifies a message in a popup @@ -122,8 +122,8 @@ private slots:      void updateWindowTitle(const QString &title = QString());      // history related -    void openPrevious(); -    void openNext(); +    void openPrevious(Qt::MouseButtons = Qt::LeftButton); +    void openNext(Qt::MouseButtons = Qt::LeftButton);      // Find Action slots      void find(const QString &);  | 
