summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-01-09 12:10:19 +0100
committerAndrea Diamantini <adjam7@gmail.com>2009-01-09 12:10:19 +0100
commit5391120be8cfd3a5d752ac8c7b66bf17b690f303 (patch)
tree7fdacbbbcc941e7cf2a05a32175d6ea4a3bb006a /src
parentremoved LoadPage method to semplify API (diff)
downloadrekonq-5391120be8cfd3a5d752ac8c7b66bf17b690f303.tar.xz
BIG change!!
Removed use of proxy webactionmapper to manage web actions..
Diffstat (limited to 'src')
-rw-r--r--src/mainview.cpp115
-rw-r--r--src/mainview.h17
-rw-r--r--src/mainwindow.cpp53
-rw-r--r--src/rekonqui.rc3
4 files changed, 133 insertions, 55 deletions
diff --git a/src/mainview.cpp b/src/mainview.cpp
index d4318cdf..f61a7593 100644
--- a/src/mainview.cpp
+++ b/src/mainview.cpp
@@ -19,9 +19,11 @@
 * ============================================================ */
-// Local Includes
+// Self Includes
#include "mainview.h"
+#include "mainview.moc"
+// Local Includes
#include "tabbar.h"
#include "browserapplication.h"
#include "mainwindow.h"
@@ -212,6 +214,87 @@ MainView::~MainView()
}
+// ========================================================================================================
+ KAction *MainView::newTabAction() const {return m_newTabAction; }
+ KAction *MainView::closeTabAction() const {return m_closeTabAction; }
+ KAction *MainView::recentlyClosedTabsAction() const {return m_recentlyClosedTabsAction;}
+ KAction *MainView::nextTabAction() const{}
+ KAction *MainView::previousTabAction() const{}
+
+ void MainView::slotWebReload()
+ {
+ WebView *webView = currentWebView();
+ QWebPage *currentParent = webView->webPage();
+ QAction *action = currentParent->action(QWebPage::Reload);
+ action->trigger();
+ }
+
+ void MainView::slotWebBack()
+ {
+ WebView *webView = currentWebView();
+ QWebPage *currentParent = webView->webPage();
+ QAction *action = currentParent->action(QWebPage::Back);
+ action->trigger();
+ }
+
+ void MainView::slotWebForward()
+ {
+ WebView *webView = currentWebView();
+ QWebPage *currentParent = webView->webPage();
+ QAction *action = currentParent->action(QWebPage::Forward);
+ action->trigger();
+ }
+
+ void MainView::slotWebUndo()
+ {
+ WebView *webView = currentWebView();
+ QWebPage *currentParent = webView->webPage();
+ QAction *action = currentParent->action(QWebPage::Undo);
+ action->trigger();
+ }
+
+ void MainView::slotWebRedo()
+ {
+ WebView *webView = currentWebView();
+ QWebPage *currentParent = webView->webPage();
+ QAction *action = currentParent->action(QWebPage::Redo);
+ action->trigger();
+ }
+
+ void MainView::slotWebCut()
+ {
+ WebView *webView = currentWebView();
+ QWebPage *currentParent = webView->webPage();
+ QAction *action = currentParent->action(QWebPage::Cut);
+ action->trigger();
+ }
+
+ void MainView::slotWebCopy()
+ {
+ WebView *webView = currentWebView();
+ QWebPage *currentParent = webView->webPage();
+ QAction *action = currentParent->action(QWebPage::Copy);
+ action->trigger();
+ }
+
+ void MainView::slotWebPaste()
+ {
+ WebView *webView = currentWebView();
+ QWebPage *currentParent = webView->webPage();
+ QAction *action = currentParent->action(QWebPage::Paste);
+ action->trigger();
+ }
+
+ void MainView::slotWebSelectAll()
+ {
+ WebView *webView = currentWebView();
+ QWebPage *currentParent = webView->webPage();
+ // FIXME
+ }
+
+// ========================================================================================================
+
+
void MainView::clear()
{
// clear the recently closed tabs
@@ -298,36 +381,6 @@ void MainView::currentChanged(int index)
}
-KAction *MainView::newTabAction() const
-{
- return m_newTabAction;
-}
-
-
-KAction *MainView::closeTabAction() const
-{
- return m_closeTabAction;
-}
-
-
-KAction *MainView::recentlyClosedTabsAction() const
-{
- return m_recentlyClosedTabsAction;
-}
-
-
-KAction *MainView::nextTabAction() const
-{
- return m_nextTabAction;
-}
-
-
-KAction *MainView::previousTabAction() const
-{
- return m_previousTabAction;
-}
-
-
QWidget *MainView::lineEditStack() const
{
return m_lineEdits;
diff --git a/src/mainview.h b/src/mainview.h
index 0458611d..135bad13 100644
--- a/src/mainview.h
+++ b/src/mainview.h
@@ -23,11 +23,10 @@
#ifndef TABWIDGET_H
#define TABWIDGET_H
-// KDE Includes
-#include <KAction>
-
// Qt Includes
#include <QWebPage>
+// KDE Includes
+#include <KAction>
class WebView;
/**
@@ -75,7 +74,6 @@ private:
QT_BEGIN_NAMESPACE
class QCompleter;
-class QMenu;
class QStackedWidget;
QT_END_NAMESPACE
@@ -145,6 +143,17 @@ public slots:
void nextTab();
void previousTab();
+ // WEB slot actions
+ void slotWebReload();
+ void slotWebBack();
+ void slotWebForward();
+ void slotWebUndo();
+ void slotWebRedo();
+ void slotWebCut();
+ void slotWebCopy();
+ void slotWebPaste();
+ void slotWebSelectAll();
+
private slots:
void currentChanged(int index);
void aboutToShowRecentTabsMenu();
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index b941e49b..e85cd7b2 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -137,15 +137,26 @@ void MainWindow::setupActions()
KStandardAction::home( this, SLOT( slotHome() ), actionCollection() );
KStandardAction::preferences( this, SLOT( slotPreferences() ), actionCollection() );
- m_tabWidget->addWebAction( KStandardAction::redisplay( this, 0, actionCollection() ) , QWebPage::Reload );
- m_tabWidget->addWebAction( KStandardAction::back( this, 0, actionCollection() ) , QWebPage::Back );
- m_tabWidget->addWebAction( KStandardAction::forward( this, 0, actionCollection() ) , QWebPage::Forward );
- m_tabWidget->addWebAction( KStandardAction::undo( this , 0 , actionCollection() ) , QWebPage::Undo );
- m_tabWidget->addWebAction( KStandardAction::redo( this , 0 , actionCollection() ) , QWebPage::Redo );
- m_tabWidget->addWebAction( KStandardAction::cut( this , 0 , actionCollection() ) , QWebPage::Cut );
- m_tabWidget->addWebAction( KStandardAction::copy( this , 0 , actionCollection() ) , QWebPage::Copy );
- m_tabWidget->addWebAction( KStandardAction::paste( this , 0 , actionCollection() ) , QWebPage::Paste );
- m_tabWidget->addWebAction( KStandardAction::selectAll( this , 0 , actionCollection() ) , QWebPage::SelectEndOfDocument );
+ // WEB Actions (NO KStandardActions..)
+ KStandardAction::redisplay( m_tabWidget, SLOT( slotWebReload() ), actionCollection() );
+ KStandardAction::back( m_tabWidget, SLOT( slotWebBack() ), actionCollection() );
+ KStandardAction::forward( m_tabWidget, SLOT( slotWebForward() ), actionCollection() );
+ KStandardAction::undo( m_tabWidget, SLOT( slotWebUndo() ), actionCollection() );
+ KStandardAction::redo( m_tabWidget, SLOT( slotWebRedo() ), actionCollection() );
+ KStandardAction::cut( m_tabWidget, SLOT( slotWebCut() ), actionCollection() );
+ KStandardAction::copy( m_tabWidget, SLOT( slotWebCopy() ), actionCollection() );
+ KStandardAction::paste( m_tabWidget, SLOT( slotWebPaste() ), actionCollection() );
+ KStandardAction::selectAll( m_tabWidget, SLOT( slotWebSelectAll() ), actionCollection() );
+
+// m_tabWidget->addWebAction( KStandardAction::redisplay( this, 0, actionCollection() ) , QWebPage::Reload );
+// m_tabWidget->addWebAction( KStandardAction::back( this, 0, actionCollection() ) , QWebPage::Back );
+// m_tabWidget->addWebAction( KStandardAction::forward( this, 0, actionCollection() ) , QWebPage::Forward );
+// m_tabWidget->addWebAction( KStandardAction::undo( this , 0 , actionCollection() ) , QWebPage::Undo );
+// m_tabWidget->addWebAction( KStandardAction::redo( this , 0 , actionCollection() ) , QWebPage::Redo );
+// m_tabWidget->addWebAction( KStandardAction::cut( this , 0 , actionCollection() ) , QWebPage::Cut );
+// m_tabWidget->addWebAction( KStandardAction::copy( this , 0 , actionCollection() ) , QWebPage::Copy );
+// m_tabWidget->addWebAction( KStandardAction::paste( this , 0 , actionCollection() ) , QWebPage::Paste );
+// m_tabWidget->addWebAction( KStandardAction::selectAll( this , 0 , actionCollection() ) , QWebPage::SelectEndOfDocument );
// stop reload Action
m_stopReload = new KAction( KIcon("view-refresh"), i18n("reload"), this );
@@ -197,15 +208,13 @@ void MainWindow::setupActions()
actionCollection()->addAction( QLatin1String("web inspector"), a );
connect( a, SIGNAL( triggered( bool ) ), this, SLOT( slotToggleInspector(bool) ) );
+ // BOOKMARKS MENU
a = new KActionMenu( i18n("B&ookmarks"), this );
actionCollection()->addAction( QLatin1String("bookmarks"), a );
BookmarksMenu *bookmarksMenu = new BookmarksMenu( this );
a->setMenu( bookmarksMenu );
- // ===================================================================================================================
- // ===================================================================================================================
- // FIXME
-
+ // history related actions
KAction *historyBack = new KAction( KIcon("go-previous"), i18n("Back"), this);
m_historyBackMenu = new KMenu(this);
historyBack->setMenu(m_historyBackMenu);
@@ -217,6 +226,10 @@ void MainWindow::setupActions()
KAction *historyForward = new KAction( KIcon("go-next"), i18n("Forward"), this );
connect(historyForward, SIGNAL( triggered( bool ) ), this, SLOT( slotOpenNext() ) );
actionCollection()->addAction( QLatin1String("history forward"), historyForward );
+
+ // ===================================================================================================================
+
+
}
@@ -230,9 +243,8 @@ void MainWindow::setupCustomMenu()
menuBar()->insertMenu( actionCollection()->action("bookmarks"), historyMenu);
QList<QAction*> historyActions;
- historyActions.append( actionCollection()->action("Back") );
- historyActions.append( actionCollection()->action("Forward") );
- historyActions.append( actionCollection()->action("Home") );
+ historyActions.append( actionCollection()->action("history back") );
+ historyActions.append( actionCollection()->action("history forward") );
historyActions.append( m_tabWidget->recentlyClosedTabsAction() );
historyMenu->setInitialActions(historyActions);
@@ -593,20 +605,23 @@ WebView *MainWindow::currentTab() const
void MainWindow::slotLoadProgress(int progress)
{
QAction *stop = actionCollection()->action( "stop" );
- QAction *reload = actionCollection()->action(" redisplay" );
+ QAction *reload = actionCollection()->action( "view_redisplay" );
if (progress < 100 && progress > 0)
{
disconnect( m_stopReload, SIGNAL( triggered( bool ) ), reload , SIGNAL( triggered(bool) ) );
m_stopReload->setIcon( KIcon( "process-stop" ) );
- connect(m_stopReload, SIGNAL( triggered(bool ) ), stop, SIGNAL( triggered(bool) ) );
m_stopReload->setToolTip( i18n("Stop loading the current page") );
+ m_stopReload->setText( i18n("Stop") );
+ connect(m_stopReload, SIGNAL( triggered(bool ) ), stop, SIGNAL( triggered(bool) ) );
}
else
{
disconnect( m_stopReload, SIGNAL( triggered( bool ) ), stop , SIGNAL( triggered(bool ) ) );
m_stopReload->setIcon( KIcon( "view-refresh" ) );
- connect(m_stopReload, SIGNAL( triggered( bool ) ), reload, SIGNAL( triggered(bool) ) );
m_stopReload->setToolTip( i18n("Reload the current page") );
+ m_stopReload->setText( i18n("Reload") );
+ connect(m_stopReload, SIGNAL( triggered( bool ) ), reload, SIGNAL( triggered(bool) ) );
+
}
}
diff --git a/src/rekonqui.rc b/src/rekonqui.rc
index 1022fb20..323e775b 100644
--- a/src/rekonqui.rc
+++ b/src/rekonqui.rc
@@ -1,5 +1,5 @@
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
-<kpartgui name="rekonq" version="9">
+<kpartgui name="rekonq" version="12">
<MenuBar>
<!-- ============ FILE menu =========== -->
<Menu name="file" noMerge="1"><text>&amp;File</text>
@@ -37,6 +37,7 @@
<!-- ============ VIEW menu =========== -->
<Menu name="view" noMerge="1"><text>&amp;View</text>
<Action name="stop reload" />
+ <Action name="go_home" />
<Separator/>
<Action name="bigger font" />
<Action name="normal font" />