summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bookmarks/bookmarksmanager.cpp2
-rw-r--r--src/cleardata.ui12
-rw-r--r--src/data/home.html4
-rw-r--r--src/mainwindow.cpp31
-rw-r--r--src/mainwindow.h6
-rw-r--r--src/newtabpage.cpp32
-rw-r--r--src/urltreeview.cpp4
-rw-r--r--src/webview.cpp8
-rw-r--r--src/webview.h1
9 files changed, 74 insertions, 26 deletions
diff --git a/src/bookmarks/bookmarksmanager.cpp b/src/bookmarks/bookmarksmanager.cpp
index 95adf387..6a5417fc 100644
--- a/src/bookmarks/bookmarksmanager.cpp
+++ b/src/bookmarks/bookmarksmanager.cpp
@@ -66,7 +66,7 @@ void BookmarkOwner::openBookmark(const KBookmark & bookmark,
{
if (keyboardModifiers & Qt::ControlModifier || mouseButtons == Qt::MidButton)
{
- emit openUrl(bookmark.url(), Rekonq::NewCurrentTab);
+ emit openUrl(bookmark.url(), Rekonq::SettingOpenTab);
}
else
{
diff --git a/src/cleardata.ui b/src/cleardata.ui
index b70d3b5a..7de7543f 100644
--- a/src/cleardata.ui
+++ b/src/cleardata.ui
@@ -24,7 +24,17 @@
<item>
<widget class="QCheckBox" name="clearHistory">
<property name="text">
- <string>History</string>
+ <string>Visited pages history</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="clearDownloads">
+ <property name="text">
+ <string>Downloads history</string>
</property>
<property name="checked">
<bool>true</bool>
diff --git a/src/data/home.html b/src/data/home.html
index 4afbf2ed..97bec22d 100644
--- a/src/data/home.html
+++ b/src/data/home.html
@@ -62,12 +62,12 @@ border-width: 5px;
#navigation {
-webkit-border-image: url(%2/bg2.png) 12 12 12 12 stretch stretch;
-max-width: 75%;
+max-width: 55%;
}
#actions, #balance {
margin-top: 12px;
-width: 10%;
+width: 20%;
}
#actions {
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 85f14738..d5831fdb 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -287,7 +287,7 @@ void MainWindow::setupActions()
a->setShortcut( fullScreenShortcut );
a = actionCollection()->addAction( KStandardAction::Home );
- connect(a, SIGNAL(triggered(Qt::MouseButtons,Qt::KeyboardModifiers)), this, SLOT(homePage(Qt::MouseButtons)));
+ connect(a, SIGNAL(triggered(Qt::MouseButtons, Qt::KeyboardModifiers)), this, SLOT(homePage(Qt::MouseButtons, Qt::KeyboardModifiers)));
KStandardAction::preferences(this, SLOT(preferences()), actionCollection());
a = KStandardAction::redisplay(m_view, SLOT(webReload()), actionCollection());
@@ -347,7 +347,7 @@ void MainWindow::setupActions()
// ========================= History related actions ==============================
a = actionCollection()->addAction( KStandardAction::Back );
- connect(a, SIGNAL(triggered(Qt::MouseButtons,Qt::KeyboardModifiers)), this, SLOT(openPrevious(Qt::MouseButtons)));
+ connect(a, SIGNAL(triggered(Qt::MouseButtons, Qt::KeyboardModifiers)), this, SLOT(openPrevious(Qt::MouseButtons, Qt::KeyboardModifiers)));
m_historyBackMenu = new KMenu(this);
a->setMenu(m_historyBackMenu);
@@ -355,7 +355,7 @@ void MainWindow::setupActions()
connect(m_historyBackMenu, SIGNAL(triggered(QAction *)), this, SLOT(openActionUrl(QAction *)));
a = actionCollection()->addAction( KStandardAction::Forward );
- connect(a, SIGNAL(triggered(Qt::MouseButtons,Qt::KeyboardModifiers)), this, SLOT(openNext(Qt::MouseButtons)));
+ connect(a, SIGNAL(triggered(Qt::MouseButtons, Qt::KeyboardModifiers)), this, SLOT(openNext(Qt::MouseButtons, Qt::KeyboardModifiers)));
// ============================== General Tab Actions ====================================
a = new KAction(KIcon("tab-new"), i18n("New &Tab"), this);
@@ -955,9 +955,9 @@ void MainWindow::viewPageSource()
}
-void MainWindow::homePage(Qt::MouseButtons btn)
+void MainWindow::homePage(Qt::MouseButtons mouseButtons, Qt::KeyboardModifiers keyboardModifiers)
{
- if(btn == Qt::MidButton)
+ if(mouseButtons == Qt::MidButton || keyboardModifiers == Qt::ControlModifier)
Application::instance()->loadUrl( KUrl(ReKonfig::homePage()), Rekonq::SettingOpenTab );
else
currentTab()->view()->load( QUrl(ReKonfig::homePage()) );
@@ -1001,15 +1001,14 @@ void MainWindow::browserLoading(bool v)
}
-void MainWindow::openPrevious(Qt::MouseButtons btn)
+void MainWindow::openPrevious(Qt::MouseButtons mouseButtons, Qt::KeyboardModifiers keyboardModifiers)
{
QWebHistory *history = currentTab()->view()->history();
if (history->canGoBack())
{
- if(btn == Qt::MidButton)
+ if(mouseButtons == Qt::MidButton || keyboardModifiers == Qt::ControlModifier)
{
- KUrl back = history->backItem().url();
- Application::instance()->loadUrl(back, Rekonq::SettingOpenTab);
+ Application::instance()->loadUrl(history->backItem().url(), Rekonq::SettingOpenTab);
}
else
{
@@ -1022,15 +1021,14 @@ void MainWindow::openPrevious(Qt::MouseButtons btn)
}
-void MainWindow::openNext(Qt::MouseButtons btn)
+void MainWindow::openNext(Qt::MouseButtons mouseButtons, Qt::KeyboardModifiers keyboardModifiers)
{
QWebHistory *history = currentTab()->view()->history();
if (history->canGoForward())
{
- if(btn == Qt::MidButton)
+ if(mouseButtons == Qt::MidButton || keyboardModifiers == Qt::ControlModifier)
{
- KUrl next = history->forwardItem().url();
- Application::instance()->loadUrl(next, Rekonq::SettingOpenTab);
+ Application::instance()->loadUrl(history->forwardItem().url(), Rekonq::SettingOpenTab);
}
else
{
@@ -1186,7 +1184,12 @@ void MainWindow::clearPrivateData()
{
Application::historyManager()->clear();
}
-
+
+ if(clearWidget.clearDownloads->isChecked())
+ {
+ Application::historyManager()->clearDownloadsHistory();
+ }
+
if(clearWidget.clearCookies->isChecked())
{
QDBusInterface kcookiejar("org.kde.kded", "/modules/kcookiejar", "org.kde.KCookieServer");
diff --git a/src/mainwindow.h b/src/mainwindow.h
index 4ccd7bf3..d1509066 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -87,7 +87,7 @@ private:
void setupPanels();
public slots:
- void homePage(Qt::MouseButtons = Qt::LeftButton);
+ void homePage(Qt::MouseButtons = Qt::LeftButton, Qt::KeyboardModifiers = Qt::NoModifier);
/**
* Notifies a message in a popup
@@ -122,8 +122,8 @@ private slots:
void updateWindowTitle(const QString &title = QString());
// history related
- void openPrevious(Qt::MouseButtons = Qt::LeftButton);
- void openNext(Qt::MouseButtons = Qt::LeftButton);
+ void openPrevious(Qt::MouseButtons = Qt::LeftButton, Qt::KeyboardModifiers = Qt::NoModifier);
+ void openNext(Qt::MouseButtons = Qt::LeftButton, Qt::KeyboardModifiers = Qt::NoModifier);
// Find Action slots
void find(const QString &);
diff --git a/src/newtabpage.cpp b/src/newtabpage.cpp
index 3e21d0fe..e2837f94 100644
--- a/src/newtabpage.cpp
+++ b/src/newtabpage.cpp
@@ -115,6 +115,17 @@ void NewTabPage::generate(const KUrl &url)
return;
}
}
+ if(url.fileName() == QString("clear"))
+ {
+ Application::instance()->mainWindow()->actionByName("clear_private_data")->trigger();
+ generate(QString("about:" + url.directory()));
+ return;
+ }
+ if(url == KUrl("about:bookmarks/edit"))
+ {
+ Application::bookmarkProvider()->bookmarkManager()->slotEditBookmarks();
+ return;
+ }
QWebPage *page = m_root.webFrame()->page();
page->mainFrame()->setHtml(m_html);
@@ -369,6 +380,13 @@ void NewTabPage::historyPage()
{
m_root.addClass("history");
+ QWebElement clearData = markup(".link");
+ clearData.findFirst("a").setAttribute("href", "about:history/clear");
+ QString iconPath = QString("file:///" + KIconLoader::global()->iconPath("edit-clear", KIconLoader::SizeSmall || KIconLoader::Small));
+ clearData.findFirst("img").setAttribute("src" , iconPath );
+ clearData.findFirst("span").appendInside(i18n("Clear Private Data"));
+ m_root.document().findFirst("#actions").appendInside(clearData);
+
HistoryTreeModel *model = Application::historyManager()->historyTreeModel();
int i = 0;
@@ -401,6 +419,13 @@ void NewTabPage::bookmarksPage()
{
m_root.addClass("bookmarks");
+ QWebElement editBookmarks = markup(".link");
+ editBookmarks.findFirst("a").setAttribute("href", "about:bookmarks/edit");
+ QString iconPath = QString("file:///" + KIconLoader::global()->iconPath("bookmarks-organize", KIconLoader::SizeSmall || KIconLoader::Small));
+ editBookmarks.findFirst("img").setAttribute("src" , iconPath);
+ editBookmarks.findFirst("span").appendInside(i18n("Edit Bookmarks"));
+ m_root.document().findFirst("#actions").appendInside(editBookmarks);
+
KBookmarkGroup bookGroup = Application::bookmarkProvider()->rootGroup();
if (bookGroup.isNull())
{
@@ -485,6 +510,13 @@ QString NewTabPage::checkTitle(const QString &title)
void NewTabPage::downloadsPage()
{
m_root.addClass("downloads");
+
+ QWebElement clearData = markup(".link");
+ clearData.findFirst("a").setAttribute("href", "about:downloads/clear");
+ QString iconPath = QString("file:///" + KIconLoader::global()->iconPath("edit-clear", KIconLoader::SizeSmall || KIconLoader::Small));
+ clearData.findFirst("img").setAttribute("src" , iconPath );
+ clearData.findFirst("span").appendInside(i18n("Clear Private Data"));
+ m_root.document().findFirst("#actions").appendInside(clearData);
DownloadList list = Application::historyManager()->downloads();
diff --git a/src/urltreeview.cpp b/src/urltreeview.cpp
index 507a7973..aeaef2f7 100644
--- a/src/urltreeview.cpp
+++ b/src/urltreeview.cpp
@@ -95,8 +95,8 @@ void UrlTreeView::mouseReleaseEvent(QMouseEvent *event)
if(!index.isValid())
return;
- if(event->button() == Qt::MidButton)
- validOpenUrl(qVariantValue< KUrl >(index.data(Qt::UserRole)), Rekonq::NewCurrentTab);
+ if(event->button() == Qt::MidButton || event->modifiers() == Qt::ControlModifier)
+ validOpenUrl(qVariantValue< KUrl >(index.data(Qt::UserRole)), Rekonq::SettingOpenTab);
else if(event->button() == Qt::LeftButton)
{
diff --git a/src/webview.cpp b/src/webview.cpp
index 2083cef3..e874411d 100644
--- a/src/webview.cpp
+++ b/src/webview.cpp
@@ -66,6 +66,7 @@ WebView::WebView(QWidget* parent)
, _scrollTimer( new QTimer(this) )
, _VScrollSpeed(0)
, _HScrollSpeed(0)
+ , _disableAutoScroll(false)
{
WebPage *page = new WebPage(this);
setPage(page);
@@ -320,6 +321,9 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
void WebView::mousePressEvent(QMouseEvent *event)
{
+ QWebHitTestResult result = page()->mainFrame()->hitTestContent( event->pos() );
+ _disableAutoScroll = result.isContentEditable();
+
switch(event->button())
{
case Qt::XButton1:
@@ -426,9 +430,7 @@ void WebView::keyPressEvent(QKeyEvent *event)
}
}
- QWebHitTestResult result = page()->mainFrame()->hitTestContent( mapFromGlobal( QCursor::pos() ) );
-
- if( result.isContentEditable() )
+ if(_disableAutoScroll)
{
KWebView::keyPressEvent(event);
return;
diff --git a/src/webview.h b/src/webview.h
index 85ebf46a..0fe83ae4 100644
--- a/src/webview.h
+++ b/src/webview.h
@@ -79,6 +79,7 @@ private:
QTimer *_scrollTimer;
int _VScrollSpeed;
int _HScrollSpeed;
+ bool _disableAutoScroll;
};
#endif