From 4a115e6a45c28479c2b4a2afd631c746392ca2cb Mon Sep 17 00:00:00 2001 From: adjam Date: Wed, 20 May 2009 12:11:23 +0000 Subject: Printing dialog pointer deleting git-svn-id: svn+ssh://svn.kde.org/home/kde/trunk/playground/network/rekonq@970526 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- src/mainwindow.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 930a4e64..83ff514b 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -572,13 +572,11 @@ void MainWindow::printRequested(QWebFrame *frame) QPrinter printer; QPointer dialog = KdePrint::createPrintDialog(&printer, this); - if (dialog->exec() != QDialog::Accepted) + if (dialog->exec() == QDialog::Accepted) { - delete dialog; - return; + frame->print(&printer); } delete dialog; - frame->print(&printer); } -- cgit v1.2.1 From baaa7bdb6570af1357bd9645198202df8ec0dd88 Mon Sep 17 00:00:00 2001 From: adjam Date: Wed, 20 May 2009 12:11:26 +0000 Subject: Fixed .desktop file git-svn-id: svn+ssh://svn.kde.org/home/kde/trunk/playground/network/rekonq@970527 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- data/rekonq.desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/rekonq.desktop b/data/rekonq.desktop index 36598ff6..6411c493 100644 --- a/data/rekonq.desktop +++ b/data/rekonq.desktop @@ -12,7 +12,7 @@ Type=Application Exec=rekonq %u X-DocPath=rekonq/index.html Categories=Qt;KDE;Network; -Terminal=0 +Terminal=False MimeType=text/html;application/xhtml+xml;application/xml; X-DBUS-StartupType=Unique X-DBUS-ServiceName=net.sourceforge.rekonq -- cgit v1.2.1 From cf06e94904997aef63b06dd4c2584089d4c2762c Mon Sep 17 00:00:00 2001 From: adjam Date: Wed, 20 May 2009 12:11:29 +0000 Subject: YesNo --> ContinueCancel git-svn-id: svn+ssh://svn.kde.org/home/kde/trunk/playground/network/rekonq@970528 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- src/networkaccessmanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/networkaccessmanager.cpp b/src/networkaccessmanager.cpp index 0de1dde0..6f0e2a3e 100644 --- a/src/networkaccessmanager.cpp +++ b/src/networkaccessmanager.cpp @@ -165,7 +165,7 @@ void NetworkAccessManager::sslErrors(QNetworkReply *reply, const QListurl().toString() + "\n\n" + QString(errors) + "\n\n"); + int ret = KMessageBox::warningContinueCancel(mainWindow, i18n("SSL Errors:\n\n") + reply->url().toString() + "\n\n" + QString(errors) + "\n\n"); if (ret == KMessageBox::Yes) reply->ignoreSslErrors(); } -- cgit v1.2.1 From 87af3540cf8daf7b71947722f609a74fac761295 Mon Sep 17 00:00:00 2001 From: scripty Date: Wed, 20 May 2009 14:44:38 +0000 Subject: SVN_SILENT made messages (.desktop file, second try) git-svn-id: svn+ssh://svn.kde.org/home/kde/trunk/playground/network/rekonq@970675 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- data/rekonq.desktop | 2 ++ 1 file changed, 2 insertions(+) diff --git a/data/rekonq.desktop b/data/rekonq.desktop index 6411c493..c04f6b0a 100644 --- a/data/rekonq.desktop +++ b/data/rekonq.desktop @@ -1,11 +1,13 @@ [Desktop Entry] Name=rekonq Name[sv]=Rekonq +Name[tr]=Rekonq GenericName=Webkit KDE Browser GenericName[et]=KDE Webkiti veebibrauser GenericName[pt]=Navegador Web com WebKit GenericName[pt_BR]=Navegador Webkit do KDE GenericName[sv]=Webkit webbläsare för KDE +GenericName[tr]=Webkit KDE Tarayıcı GenericName[uk]=Переглядач мережі на WebKit для KDE Icon=rekonq Type=Application -- cgit v1.2.1 From 9e35b58b249a59c6185ab3aa2d37bfc65808e516 Mon Sep 17 00:00:00 2001 From: scripty Date: Tue, 26 May 2009 14:24:36 +0000 Subject: SVN_SILENT made messages (.desktop file) git-svn-id: svn+ssh://svn.kde.org/home/kde/trunk/playground/network/rekonq@973197 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- data/rekonq.desktop | 1 + 1 file changed, 1 insertion(+) diff --git a/data/rekonq.desktop b/data/rekonq.desktop index c04f6b0a..dafe8a3b 100644 --- a/data/rekonq.desktop +++ b/data/rekonq.desktop @@ -3,6 +3,7 @@ Name=rekonq Name[sv]=Rekonq Name[tr]=Rekonq GenericName=Webkit KDE Browser +GenericName[de]=Webkit-Browser für KDE GenericName[et]=KDE Webkiti veebibrauser GenericName[pt]=Navegador Web com WebKit GenericName[pt_BR]=Navegador Webkit do KDE -- cgit v1.2.1 From 18d4b4d755a84ab6f24dac8b3601cb8b2a4bd580 Mon Sep 17 00:00:00 2001 From: scripty Date: Wed, 3 Jun 2009 14:54:49 +0000 Subject: SVN_SILENT made messages (.desktop file) git-svn-id: svn+ssh://svn.kde.org/home/kde/trunk/playground/network/rekonq@977204 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- data/rekonq.desktop | 1 + 1 file changed, 1 insertion(+) diff --git a/data/rekonq.desktop b/data/rekonq.desktop index dafe8a3b..8e0e29ee 100644 --- a/data/rekonq.desktop +++ b/data/rekonq.desktop @@ -5,6 +5,7 @@ Name[tr]=Rekonq GenericName=Webkit KDE Browser GenericName[de]=Webkit-Browser für KDE GenericName[et]=KDE Webkiti veebibrauser +GenericName[km]=កម្មវិធី​រុករក​ Webkit KDE GenericName[pt]=Navegador Web com WebKit GenericName[pt_BR]=Navegador Webkit do KDE GenericName[sv]=Webkit webbläsare för KDE -- cgit v1.2.1 From bffad434d26503d24d9f3dc4b55ab2fb6e53b964 Mon Sep 17 00:00:00 2001 From: mlaurent Date: Mon, 8 Jun 2009 11:55:38 +0000 Subject: fixuifiles git-svn-id: svn+ssh://svn.kde.org/home/kde/trunk/playground/network/rekonq@978867 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- src/cookies.ui | 3 --- src/cookiesexceptions.ui | 3 --- src/history.ui | 3 --- 3 files changed, 9 deletions(-) diff --git a/src/cookies.ui b/src/cookies.ui index ae1c4a2b..992cd995 100644 --- a/src/cookies.ui +++ b/src/cookies.ui @@ -16,9 +16,6 @@ 0 - - Form - diff --git a/src/cookiesexceptions.ui b/src/cookiesexceptions.ui index 3e28b42a..0d8ae84f 100644 --- a/src/cookiesexceptions.ui +++ b/src/cookiesexceptions.ui @@ -10,9 +10,6 @@ 400 - - Form - diff --git a/src/history.ui b/src/history.ui index fb694f8f..1f3e1016 100644 --- a/src/history.ui +++ b/src/history.ui @@ -10,9 +10,6 @@ 381 - - Form - -- cgit v1.2.1 From c307691a6356a330940cd29b6f67b5a64f37d336 Mon Sep 17 00:00:00 2001 From: adjam Date: Mon, 8 Jun 2009 14:05:59 +0000 Subject: bookmark toolbar displaying ALL the bookmarks. This commit is based on patch from Matthieu Gicquel (many thanks). While I don't like this "super-filled" bm toolbar, this is probably the best solution, waiting for an akonadi based bookmarks model. git-svn-id: svn+ssh://svn.kde.org/home/kde/trunk/playground/network/rekonq@978915 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- src/application.cpp | 2 +- src/bookmarks.cpp | 56 +++++++++++++++++++++++++++++++++++++++-------------- src/bookmarks.h | 5 ++++- 3 files changed, 47 insertions(+), 16 deletions(-) diff --git a/src/application.cpp b/src/application.cpp index bd6e6d48..94821653 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -178,7 +178,7 @@ BookmarkProvider *Application::bookmarkProvider() { if (!s_bookmarkProvider) { - s_bookmarkProvider = new BookmarkProvider(); + s_bookmarkProvider = new BookmarkProvider(instance()->mainWindow()); } return s_bookmarkProvider; } diff --git a/src/bookmarks.cpp b/src/bookmarks.cpp index d280f376..ace45c2f 100644 --- a/src/bookmarks.cpp +++ b/src/bookmarks.cpp @@ -121,7 +121,12 @@ BookmarkMenu::~BookmarkMenu() KMenu *BookmarkMenu::viewContextMenu(QAction *action) { - return contextMenu(action); + // contextMenu() returns an invalid KMenu (seg fault) for the folders in the toolbar + KMenu *menu = contextMenu(action); + if(menu) + return menu; + + return 0; // new KMenu(); } @@ -145,10 +150,11 @@ void BookmarkMenu::slotAddBookmark() BookmarkProvider::BookmarkProvider(QWidget *parent) - : QWidget(parent) + : QObject(parent) + , m_parent(parent) , m_manager(0) , m_owner(0) - , m_menu(new KMenu(this)) + , m_menu(new KMenu(m_parent)) , m_actionCollection(new KActionCollection(this)) , m_bookmarkMenu(0) , m_bookmarkToolBar(0) @@ -197,7 +203,7 @@ BookmarkProvider::~BookmarkProvider() void BookmarkProvider::setupToolBar() { - m_bookmarkToolBar = new KToolBar(this); + m_bookmarkToolBar = new KToolBar(m_parent); m_bookmarkToolBar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); m_bookmarkToolBar->setIconDimensions(16); m_bookmarkToolBar->setAcceptDrops(true); @@ -222,25 +228,18 @@ void BookmarkProvider::slotBookmarksChanged(const QString &group, const QString return; } - KActionCollection bookmarkCollection(this); - KBookmarkGroup toolBarGroup = m_manager->toolbar(); if (toolBarGroup.isNull()) return; + m_bookmarkToolBar->clear(); + KBookmark bookmark = toolBarGroup.first(); while (!bookmark.isNull()) { - if (!bookmark.isGroup()) - { - KAction *action = new KBookmarkAction(bookmark, m_owner, this); - QString text = bookmark.address(); - bookmarkCollection.addAction(text, action); - } + m_bookmarkToolBar->addAction(fillBookmarkBar(bookmark)); bookmark = toolBarGroup.next(bookmark); } - m_bookmarkToolBar->clear(); - m_bookmarkToolBar->addActions(bookmarkCollection.actions()); } @@ -282,3 +281,32 @@ KAction* BookmarkProvider::bookmarkToolBarAction() bookmarkToolBarAction->setShortcutConfigurable(false); return bookmarkToolBarAction; } + + +KAction *BookmarkProvider::fillBookmarkBar(const KBookmark &bookmark) +{ + if (bookmark.isGroup()) + { + KBookmarkGroup group = bookmark.toGroup(); + KBookmark bm = group.first(); + KActionMenu *menuAction = new KActionMenu(KIcon(bookmark.icon()), bookmark.text(), this); + menuAction->setDelayed(false); + while (!bm.isNull()) + { + menuAction->addAction(fillBookmarkBar(bm)); + bm = group.next(bm); + } + return menuAction; + } + + if(bookmark.isSeparator()) + { + KAction *a = new KAction(this); + a->setSeparator(true); + return a; + } + else + { + return new KBookmarkAction(bookmark, m_owner, this); + } +} diff --git a/src/bookmarks.h b/src/bookmarks.h index 1de181e3..4e2349ad 100644 --- a/src/bookmarks.h +++ b/src/bookmarks.h @@ -156,7 +156,7 @@ protected slots: * * */ -class BookmarkProvider : public QWidget +class BookmarkProvider : public QObject { Q_OBJECT @@ -221,8 +221,11 @@ public slots: void slotBookmarksChanged(const QString &group, const QString &caller); private: + KAction *fillBookmarkBar(const KBookmark &bookmark); void setupToolBar(); + QWidget *m_parent; + KBookmarkManager *m_manager; BookmarkOwner *m_owner; KMenu *m_menu; -- cgit v1.2.1 From 45847ce4f6151aa2ab8e73c6e9172509e712c90b Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 9 Jun 2009 12:18:18 +0200 Subject: Forgot to remove unuseful KDE IS VERSION check. Removed now.. --- src/networkmanager.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/networkmanager.cpp b/src/networkmanager.cpp index bbe89816..e9fd7466 100644 --- a/src/networkmanager.cpp +++ b/src/networkmanager.cpp @@ -51,13 +51,8 @@ #include #include -#if KDE_IS_VERSION(4,2,70) NetworkAccessManager::NetworkAccessManager(QObject *parent) : KIO::AccessManager(parent) -#else -NetworkAccessManager::NetworkAccessManager(QObject *parent) - : KNetworkAccessManager(parent) -#endif { connect(this, SIGNAL(authenticationRequired(QNetworkReply*, QAuthenticator*)), SLOT(authenticationRequired(QNetworkReply*, QAuthenticator*))); -- cgit v1.2.1 From ef7c6f3417d26399abca528fe584292c225ed35a Mon Sep 17 00:00:00 2001 From: scripty Date: Tue, 9 Jun 2009 14:53:28 +0000 Subject: SVN_SILENT made messages (.desktop file) git-svn-id: svn+ssh://svn.kde.org/home/kde/trunk/playground/network/rekonq@979357 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- data/rekonq.desktop | 2 ++ 1 file changed, 2 insertions(+) diff --git a/data/rekonq.desktop b/data/rekonq.desktop index 8e0e29ee..b583dede 100644 --- a/data/rekonq.desktop +++ b/data/rekonq.desktop @@ -2,6 +2,7 @@ Name=rekonq Name[sv]=Rekonq Name[tr]=Rekonq +Name[x-test]=xxrekonqxx GenericName=Webkit KDE Browser GenericName[de]=Webkit-Browser für KDE GenericName[et]=KDE Webkiti veebibrauser @@ -11,6 +12,7 @@ GenericName[pt_BR]=Navegador Webkit do KDE GenericName[sv]=Webkit webbläsare för KDE GenericName[tr]=Webkit KDE Tarayıcı GenericName[uk]=Переглядач мережі на WebKit для KDE +GenericName[x-test]=xxWebkit KDE Browserxx Icon=rekonq Type=Application Exec=rekonq %u -- cgit v1.2.1 From 536e73dce60740ebf4e3d67bc20a6095abf2b1b0 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 9 Jun 2009 23:32:19 +0200 Subject: Cosmetic networkmanager changes --- src/networkmanager.cpp | 4 ++-- src/networkmanager.h | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/networkmanager.cpp b/src/networkmanager.cpp index e9fd7466..2cf65e1c 100644 --- a/src/networkmanager.cpp +++ b/src/networkmanager.cpp @@ -51,8 +51,9 @@ #include #include + NetworkAccessManager::NetworkAccessManager(QObject *parent) - : KIO::AccessManager(parent) + : AccessManager(parent) { connect(this, SIGNAL(authenticationRequired(QNetworkReply*, QAuthenticator*)), SLOT(authenticationRequired(QNetworkReply*, QAuthenticator*))); @@ -96,7 +97,6 @@ void NetworkAccessManager::loadSettings() } - void NetworkAccessManager::authenticationRequired(QNetworkReply *reply, QAuthenticator *auth) { MainWindow *mainWindow = Application::instance()->mainWindow(); diff --git a/src/networkmanager.h b/src/networkmanager.h index 681d296a..84362d1c 100644 --- a/src/networkmanager.h +++ b/src/networkmanager.h @@ -19,8 +19,8 @@ * ============================================================ */ -#ifndef NETWORKACCESSMANAGER_H -#define NETWORKACCESSMANAGER_H +#ifndef NETWORKMANAGER_H +#define NETWORKMANAGER_H // KDE Includes #include @@ -29,8 +29,9 @@ class QNetworkRequest; class QIODevice; +using namespace KIO; -class NetworkAccessManager : public KIO::AccessManager +class NetworkAccessManager : public AccessManager { Q_OBJECT @@ -50,4 +51,4 @@ private slots: }; -#endif // NETWORKACCESSMANAGER_H +#endif // NETWORKMANAGER_H -- cgit v1.2.1 From 02ce36f8b274534a7c843c1a8acacb9a31b4d3d3 Mon Sep 17 00:00:00 2001 From: mlaurent Date: Thu, 11 Jun 2009 11:22:06 +0000 Subject: Fix forward declaration git-svn-id: svn+ssh://svn.kde.org/home/kde/trunk/playground/network/rekonq@980178 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- src/cookiejar.h | 1 - src/kaccessmanager.h | 2 -- src/mainview.h | 3 --- src/mainwindow.h | 1 - src/networkmanager.h | 2 -- src/webpage.h | 7 ------- src/webview.h | 8 -------- 7 files changed, 24 deletions(-) diff --git a/src/cookiejar.h b/src/cookiejar.h index 56adc0b3..5bfe7749 100644 --- a/src/cookiejar.h +++ b/src/cookiejar.h @@ -29,7 +29,6 @@ #include // Forward Declarations -class AutoSaver; class QUrl; diff --git a/src/kaccessmanager.h b/src/kaccessmanager.h index 8325c890..ed5c208d 100644 --- a/src/kaccessmanager.h +++ b/src/kaccessmanager.h @@ -27,8 +27,6 @@ #include // Forward Declarations -class QNetworkRequest; -class QIODevice; class NetworkAccessManager : public KNetworkAccessManager diff --git a/src/mainview.h b/src/mainview.h index dfa498f7..8a8ae3dc 100644 --- a/src/mainview.h +++ b/src/mainview.h @@ -31,17 +31,14 @@ #include // Forward Declarations -class QLineEdit; class QUrl; class QWebFrame; class QLabel; class KAction; -class KCompletion; class KMenu; class KUrl; -class HistoryCompletionModel; class StackedUrlBar; class TabBar; class UrlBar; diff --git a/src/mainwindow.h b/src/mainwindow.h index 411cbe6c..f1ea3a98 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -40,7 +40,6 @@ class QWebFrame; class KUrl; class KAction; class KActionMenu; -class KIcon; class KMenu; class HistoryMenu; diff --git a/src/networkmanager.h b/src/networkmanager.h index 681d296a..a402b6e0 100644 --- a/src/networkmanager.h +++ b/src/networkmanager.h @@ -26,8 +26,6 @@ #include // Forward Declarations -class QNetworkRequest; -class QIODevice; class NetworkAccessManager : public KIO::AccessManager diff --git a/src/webpage.h b/src/webpage.h index 0723cb6d..ac6780ff 100644 --- a/src/webpage.h +++ b/src/webpage.h @@ -34,18 +34,11 @@ #include // Forward Declarations -class MainWindow; -class Application; -class KActionCollection; class QWebFrame; -class QAuthenticator; -class QMouseEvent; -class QNetworkProxy; class QNetworkReply; -class WebView; class WebPage : public KWebPage diff --git a/src/webview.h b/src/webview.h index b5ffa887..389db154 100644 --- a/src/webview.h +++ b/src/webview.h @@ -35,16 +35,8 @@ #include // Forward Declarations -class MainWindow; -class Application; -class KActionCollection; -class QWebFrame; -class QAuthenticator; -class QMouseEvent; -class QNetworkProxy; -class QNetworkReply; class WebPage; -- cgit v1.2.1 From a7f14515a48b3c124cd2dbdf85e0657e10f66c12 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Fri, 19 Jun 2009 01:12:46 +0200 Subject: Restored Unsupport Content Handler (new 1st implementation) --- src/webpage.cpp | 52 ++++++++++++++++++++++++++++++++++++++++++---------- src/webpage.h | 5 +++-- 2 files changed, 45 insertions(+), 12 deletions(-) diff --git a/src/webpage.cpp b/src/webpage.cpp index d26b54aa..27411cda 100644 --- a/src/webpage.cpp +++ b/src/webpage.cpp @@ -42,6 +42,15 @@ #include #include +#include +/*#include +#include +#include +#include +#include */ +#include +#include + #include #include @@ -123,16 +132,39 @@ KWebPage *WebPage::createWindow(QWebPage::WebWindowType type) // FIXME: implement here (perhaps) mimetype discerning && file loading (KToolInvocation??) -// void WebPage::slotHandleUnsupportedContent(QNetworkReply *reply) -// { -// -// if (reply->error() == QNetworkReply::NoError) -// { -// return slotDownloadRequested(reply->request(), reply); -// } -// -// viewErrorPage(reply); -// } +void WebPage::slotHandleUnsupportedContent(QNetworkReply *reply) +{ + + const KUrl url(reply->request().url()); + kDebug() << "title:" << url; + kDebug() << "error:" << reply->errorString(); + + QString filename = url.fileName(); + QString mimetype = reply->header(QNetworkRequest::ContentTypeHeader).toString(); + KService::Ptr offer = KMimeTypeTrader::self()->preferredService(mimetype); + + KParts::BrowserRun::AskSaveResult res = KParts::BrowserRun::askSave( + url, + offer, + mimetype, + filename + ); + switch (res) + { + case KParts::BrowserRun::Save: + slotDownloadRequested(reply->request(), reply); + return; + case KParts::BrowserRun::Cancel: + return; + default: // non existant case + break; + } + + KUrl::List list; + list.append(url); + KRun::run(*offer,url,0); + return; +} void WebPage::manageNetworkErrors(QNetworkReply* reply) diff --git a/src/webpage.h b/src/webpage.h index ac6780ff..8ed53a2d 100644 --- a/src/webpage.h +++ b/src/webpage.h @@ -58,8 +58,9 @@ protected: KWebPage *createWindow(QWebPage::WebWindowType type); -// protected Q_SLOTS: -// virtual void slotHandleUnsupportedContent(QNetworkReply *reply); + +protected Q_SLOTS: + virtual void slotHandleUnsupportedContent(QNetworkReply *reply); private: void viewErrorPage(QNetworkReply *); -- cgit v1.2.1 From c63c6d629af685b71cabf56e339ecb80bf54caf9 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Fri, 19 Jun 2009 01:13:47 +0200 Subject: Fixing webpage headers --- src/webpage.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/webpage.cpp b/src/webpage.cpp index 27411cda..39511760 100644 --- a/src/webpage.cpp +++ b/src/webpage.cpp @@ -43,11 +43,6 @@ #include #include -/*#include -#include -#include -#include -#include */ #include #include -- cgit v1.2.1 From 5257a168febf317f90a6383373586fcb535393d1 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Fri, 19 Jun 2009 17:37:10 +0200 Subject: New Tab tool button --- src/mainview.cpp | 41 +++++++++++++++++++++++++++++++++++++++++ src/mainview.h | 7 +++++++ src/tabbar.cpp | 19 +------------------ 3 files changed, 49 insertions(+), 18 deletions(-) diff --git a/src/mainview.cpp b/src/mainview.cpp index 6f3ad926..ce43cbc2 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -65,6 +65,7 @@ MainView::MainView(QWidget *parent) , m_recentlyClosedTabsMenu(new KMenu(this)) , m_urlBars(new StackedUrlBar(this)) , m_tabBar(new TabBar(this)) + , m_addTabButton(new QToolButton(this)) { // setting tabbar setTabBar(m_tabBar); @@ -97,6 +98,11 @@ MainView::~MainView() void MainView::postLaunch() { + m_addTabButton->setDefaultAction(Application::instance()->mainWindow()->actionByName("new_tab")); + m_addTabButton->setAutoRaise(true); + m_addTabButton->setToolButtonStyle(Qt::ToolButtonIconOnly); + + // Recently Closed Tab Action connect(m_recentlyClosedTabsMenu, SIGNAL(aboutToShow()), this, SLOT(aboutToShowRecentTabsMenu())); connect(m_recentlyClosedTabsMenu, SIGNAL(triggered(QAction *)), this, SLOT(aboutToShowRecentTriggeredAction(QAction *))); @@ -106,6 +112,37 @@ void MainView::postLaunch() } +void MainView::addTabButtonPosition() +{ + static bool ButtonInCorner = false; + + QSize s1 = frameSize(); + int tabWidgetWidth = s1.width(); + + QSize s2 = tabBar()->sizeHint(); + int newPos = s2.width(); + + if( newPos > tabWidgetWidth ) + { + if(ButtonInCorner) + return; + setCornerWidget(m_addTabButton); + ButtonInCorner = true; + } + else + { + if(ButtonInCorner) + { + setCornerWidget(0); + m_addTabButton->show(); + ButtonInCorner = false; + } + m_addTabButton->move(newPos, 0); + } + +} + + UrlBar *MainView::currentUrlBar() const { return urlBar(-1); @@ -387,6 +424,7 @@ WebView *MainView::newWebView(Rekonq::OpenType type) emit tabsChanged(); showTabBar(); + addTabButtonPosition(); return webView; } @@ -446,6 +484,7 @@ void MainView::slotCloseOtherTabs(int index) } showTabBar(); + addTabButtonPosition(); } @@ -460,6 +499,7 @@ void MainView::slotCloneTab(int index) tab->setUrl(webView(index)->url()); showTabBar(); + addTabButtonPosition(); } @@ -521,6 +561,7 @@ void MainView::slotCloseTab(int index) } showTabBar(); + addTabButtonPosition(); } diff --git a/src/mainview.h b/src/mainview.h index 8a8ae3dc..8ff32473 100644 --- a/src/mainview.h +++ b/src/mainview.h @@ -30,6 +30,9 @@ // KDE Includes #include +// Qt Includes +#include + // Forward Declarations class QUrl; class QWebFrame; @@ -160,6 +163,8 @@ protected: private: + void addTabButtonPosition(); + /** * This function creates (if not exists) and returns a QLabel * with a loading QMovie. @@ -184,6 +189,8 @@ private: QString m_loadingGitPath; bool m_makeBackTab; + + QToolButton *m_addTabButton; }; #endif diff --git a/src/tabbar.cpp b/src/tabbar.cpp index 96e3d19c..2680dfb7 100644 --- a/src/tabbar.cpp +++ b/src/tabbar.cpp @@ -70,25 +70,8 @@ TabBar::~TabBar() QSize TabBar::tabSizeHint(int index) const { QSize s = m_parent->sizeHint(); - int w; - int n = count(); - - if (n > 6) - { - w = s.width() / 5; - } - else - { - if (n > 3) - { - w = s.width() / 4; - } - else - { - w = s.width() / 3; - } - } + int w = s.width() / 4; int h = KTabBar::tabSizeHint(index).height(); QSize ts = QSize(w, h); -- cgit v1.2.1 From a4ada885c6a94fff768aad83cf4070a5ebfd8bbf Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Fri, 19 Jun 2009 18:12:56 +0200 Subject: UI changes --- src/mainwindow.cpp | 5 +++++ src/rekonqui.rc | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index abc3fcd5..e4b6773c 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -323,6 +323,11 @@ void MainWindow::setupActions() a->setShortcuts(QApplication::isRightToLeft() ? KStandardShortcut::tabNext() : KStandardShortcut::tabPrev()); actionCollection()->addAction(QLatin1String("show_prev_tab"), a); connect(a, SIGNAL(triggered(bool)), m_view, SLOT(previousTab())); + + // ==================== Bookmarks Actions + a = new KAction(i18n("Add Bookmark"), this); + a->setIcon(KIcon("rating")); + actionCollection()->addAction(QLatin1String("add_bookmark"),a); } diff --git a/src/rekonqui.rc b/src/rekonqui.rc index aa372538..0916bf43 100644 --- a/src/rekonqui.rc +++ b/src/rekonqui.rc @@ -1,6 +1,6 @@ - + @@ -88,11 +88,12 @@ Main Toolbar + - - + + -- cgit v1.2.1 From 8a7e6c079fcc941b5232a03044512135d43b8403 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Fri, 19 Jun 2009 18:19:28 +0200 Subject: No more Action Back Menu --- src/mainwindow.cpp | 42 ------------------------------------------ src/mainwindow.h | 5 ++--- 2 files changed, 2 insertions(+), 45 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index e4b6773c..0cae2ab6 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -292,11 +292,7 @@ void MainWindow::setupActions() // ================ history related actions m_historyBackAction = new KAction(KIcon("go-previous"), i18n("Back"), this); - m_historyBackMenu = new KMenu(this); - m_historyBackAction->setMenu(m_historyBackMenu); connect(m_historyBackAction, SIGNAL(triggered(bool)), this, SLOT(slotOpenPrevious())); - connect(m_historyBackMenu, SIGNAL(aboutToShow()), this, SLOT(slotAboutToShowBackMenu())); - connect(m_historyBackMenu, SIGNAL(triggered(QAction *)), this, SLOT(slotOpenActionUrl(QAction *))); actionCollection()->addAction(QLatin1String("history_back"), m_historyBackAction); m_historyForwardAction = new KAction(KIcon("go-next"), i18n("Forward"), this); @@ -771,44 +767,6 @@ void MainWindow::slotLoadProgress(int progress) } -void MainWindow::slotAboutToShowBackMenu() -{ - m_historyBackMenu->clear(); - if (!currentTab()) - return; - QWebHistory *history = currentTab()->history(); - int historyCount = history->count(); - for (int i = history->backItems(historyCount).count() - 1; i >= 0; --i) - { - QWebHistoryItem item = history->backItems(history->count()).at(i); - KAction *action = new KAction(this); - action->setData(-1*(historyCount - i - 1)); - QIcon icon = Application::instance()->icon(item.url()); - action->setIcon(icon); - action->setText(item.title()); - m_historyBackMenu->addAction(action); - } -} - - -void MainWindow::slotOpenActionUrl(QAction *action) -{ - int offset = action->data().toInt(); - QWebHistory *history = currentTab()->history(); - if (offset < 0) - { - history->goToItem(history->backItems(-1*offset).first()); // back - } - else - { - if (offset > 0) - { - history->goToItem(history->forwardItems(history->count() - offset + 1).back()); // forward - } - } -} - - void MainWindow::slotOpenPrevious() { QWebHistory *history = currentTab()->history(); diff --git a/src/mainwindow.h b/src/mainwindow.h index f1ea3a98..0d17ef4d 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -89,11 +89,11 @@ private slots: void slotUpdateActions(); void slotUpdateWindowTitle(const QString &title = QString()); void slotOpenLocation(); - void slotAboutToShowBackMenu(); +// void slotAboutToShowBackMenu(); void geometryChangeRequested(const QRect &geometry); // history related - void slotOpenActionUrl(QAction *action); +// void slotOpenActionUrl(QAction *action); void slotOpenPrevious(); void slotOpenNext(); @@ -130,7 +130,6 @@ private: FindBar *m_findBar; SidePanel *m_sidePanel; - KMenu *m_historyBackMenu; KMenu *m_windowMenu; KActionMenu *m_historyActionMenu; -- cgit v1.2.1 From 0a8e7f56c426639dd140558dd685c72d24a22e79 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Fri, 19 Jun 2009 18:33:59 +0200 Subject: Removed recently closed tabs history --- src/mainview.cpp | 54 ------------------------------------------------------ src/mainview.h | 11 ++--------- src/mainwindow.cpp | 1 - 3 files changed, 2 insertions(+), 64 deletions(-) diff --git a/src/mainview.cpp b/src/mainview.cpp index ce43cbc2..d6c97511 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -61,8 +61,6 @@ MainView::MainView(QWidget *parent) : KTabWidget(parent) - , m_recentlyClosedTabsAction(0) - , m_recentlyClosedTabsMenu(new KMenu(this)) , m_urlBars(new StackedUrlBar(this)) , m_tabBar(new TabBar(this)) , m_addTabButton(new QToolButton(this)) @@ -101,14 +99,6 @@ void MainView::postLaunch() m_addTabButton->setDefaultAction(Application::instance()->mainWindow()->actionByName("new_tab")); m_addTabButton->setAutoRaise(true); m_addTabButton->setToolButtonStyle(Qt::ToolButtonIconOnly); - - - // Recently Closed Tab Action - connect(m_recentlyClosedTabsMenu, SIGNAL(aboutToShow()), this, SLOT(aboutToShowRecentTabsMenu())); - connect(m_recentlyClosedTabsMenu, SIGNAL(triggered(QAction *)), this, SLOT(aboutToShowRecentTriggeredAction(QAction *))); - m_recentlyClosedTabsAction = new KAction(i18n("Recently Closed Tabs"), this); - m_recentlyClosedTabsAction->setMenu(m_recentlyClosedTabsMenu); - m_recentlyClosedTabsAction->setEnabled(false); } @@ -173,12 +163,6 @@ int MainView::webViewIndex(WebView *webView) const } -KAction *MainView::recentlyClosedTabsAction() const -{ - return m_recentlyClosedTabsAction; -} - - void MainView::setMakeBackTab(bool b) { m_makeBackTab = b; @@ -284,8 +268,6 @@ void MainView::slotWebPaste() void MainView::clear() { - // clear the recently closed tabs - m_recentlyClosedTabs.clear(); // clear the line edit history for (int i = 0; i < m_urlBars->count(); ++i) { @@ -529,20 +511,6 @@ void MainView::slotCloseTab(int index) return; } hasFocus = tab->hasFocus(); - - m_recentlyClosedTabsAction->setEnabled(true); - m_recentlyClosedTabs.prepend(tab->url()); - - // don't add empty urls - if (tab->url().isValid()) - { - m_recentlyClosedTabs.prepend(tab->url()); - } - - if (m_recentlyClosedTabs.size() >= MainView::m_recentlyClosedTabsSize) - { - m_recentlyClosedTabs.removeLast(); - } } QWidget *urlBar = m_urlBars->urlBar(index); @@ -678,28 +646,6 @@ void MainView::webViewUrlChanged(const QUrl &url) } -void MainView::aboutToShowRecentTabsMenu() -{ - m_recentlyClosedTabsMenu->clear(); - for (int i = 0; i < m_recentlyClosedTabs.count(); ++i) - { - KAction *action = new KAction(m_recentlyClosedTabsMenu); - action->setData(m_recentlyClosedTabs.at(i)); - QIcon icon = Application::instance()->icon(m_recentlyClosedTabs.at(i)); - action->setIcon(icon); - action->setText(m_recentlyClosedTabs.at(i).prettyUrl()); - m_recentlyClosedTabsMenu->addAction(action); - } -} - - -void MainView::aboutToShowRecentTriggeredAction(QAction *action) -{ - KUrl url = action->data().toUrl(); - loadUrl(url); -} - - void MainView::loadUrl(const KUrl &url) { if (url.isEmpty()) diff --git a/src/mainview.h b/src/mainview.h index 8ff32473..9ee2f12a 100644 --- a/src/mainview.h +++ b/src/mainview.h @@ -133,8 +133,8 @@ public slots: private slots: void slotCurrentChanged(int index); - void aboutToShowRecentTabsMenu(); - void aboutToShowRecentTriggeredAction(QAction *action); // need QAction! +// void aboutToShow/*Rec*/entTabsMenu(); +// void aboutToShowRecentTriggeredAction(QAction *action); // need QAction! void webViewLoadStarted(); void webViewLoadProgress(int progress); @@ -177,12 +177,6 @@ private: */ QLabel *animatedLoading(int index, bool addMovie); - static const int m_recentlyClosedTabsSize = 10; - KAction *m_recentlyClosedTabsAction; - - KMenu *m_recentlyClosedTabsMenu; - QList m_recentlyClosedTabs; - StackedUrlBar *m_urlBars; TabBar *m_tabBar; @@ -194,4 +188,3 @@ private: }; #endif - diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 0cae2ab6..3faa4699 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -357,7 +357,6 @@ void MainWindow::setupHistoryMenu() QList historyActions; historyActions.append(actionCollection()->action("history_back")); historyActions.append(actionCollection()->action("history_forward")); - historyActions.append(m_view->recentlyClosedTabsAction()); historyMenu->setInitialActions(historyActions); } -- cgit v1.2.1 From f3d3fb6041a870901ba5cf36fb49d46e577cf0d1 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Fri, 19 Jun 2009 19:08:00 +0200 Subject: Removed unuseful history dialog. We use just history panel, from now on.. --- src/CMakeLists.txt | 1 - src/history.cpp | 2 +- src/history.ui | 74 ----------------------------- src/historydialog.cpp | 129 -------------------------------------------------- src/historydialog.h | 57 ---------------------- src/historymenu.cpp | 11 +---- src/historymenu.h | 1 - 7 files changed, 2 insertions(+), 273 deletions(-) delete mode 100644 src/history.ui delete mode 100644 src/historydialog.cpp delete mode 100644 src/historydialog.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 92fd9d53..8660e674 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -21,7 +21,6 @@ SET( rekonq_SRCS edittableview.cpp edittreeview.cpp history.cpp - historydialog.cpp historymenu.cpp bookmarks.cpp modelmenu.cpp diff --git a/src/history.cpp b/src/history.cpp index dcfe4c21..11cd3653 100644 --- a/src/history.cpp +++ b/src/history.cpp @@ -540,7 +540,7 @@ bool HistoryModel::removeRows(int row, int count, const QModelIndex &parent) // ----------------------------------------------------------------------------------------------- -#define MOVEDROWS 10 +#define MOVEDROWS 20 /* diff --git a/src/history.ui b/src/history.ui deleted file mode 100644 index 1f3e1016..00000000 --- a/src/history.ui +++ /dev/null @@ -1,74 +0,0 @@ - - - historyWidget - - - - 0 - 0 - 584 - 381 - - - - - - - - - &Remove - - - - - - - Remove &All - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Search: - - - - - - - - - - - - - - - - KLineEdit - QLineEdit -
klineedit.h
-
- - EditTreeView - QTreeView -
edittreeview.h
-
-
- - -
diff --git a/src/historydialog.cpp b/src/historydialog.cpp deleted file mode 100644 index 6a150952..00000000 --- a/src/historydialog.cpp +++ /dev/null @@ -1,129 +0,0 @@ -/* ============================================================ -* -* This file is a part of the rekonq project -* -* Copyright (C) 2009 by Andrea Diamantini -* -* -* This program is free software; you can redistribute it -* and/or modify it under the terms of the GNU General -* Public License as published by the Free Software Foundation; -* either version 3, or (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* ============================================================ */ - - -// Auto Includes -#include "historydialog.h" -#include "historydialog.moc" - -// Local Includes -#include "history.h" -#include "application.h" - -// KDE Includes -#include -#include - -// Qt Includes -#include - -#include -#include -#include - - -HistoryDialog::HistoryDialog(QWidget *parent, HistoryManager *setHistory) - : KDialog(parent) - , m_historyWidg(new Ui::historyWidget) -{ - HistoryManager *history = setHistory; - if (!history) - history = Application::historyManager(); - - setCaption( i18n("History") ); - setButtons( KDialog::Close ); - - QWidget *widget = new QWidget; - m_historyWidg->setupUi(widget); - setMainWidget(widget); - - m_historyWidg->search->setClearButtonShown(true); - - m_historyWidg->tree->setUniformRowHeights(true); - m_historyWidg->tree->setSelectionBehavior(QAbstractItemView::SelectRows); - m_historyWidg->tree->setTextElideMode(Qt::ElideMiddle); - - QAbstractItemModel *model = history->historyTreeModel(); - TreeProxyModel *proxyModel = new TreeProxyModel(this); - - connect(m_historyWidg->search, SIGNAL(textChanged(QString)), proxyModel, SLOT(setFilterFixedString(QString))); - connect(m_historyWidg->removeButton, SIGNAL(clicked()), m_historyWidg->tree, SLOT(removeOne())); - connect(m_historyWidg->removeAllButton, SIGNAL(clicked()), history, SLOT(clear())); - - proxyModel->setSourceModel(model); - m_historyWidg->tree->setModel(proxyModel); - m_historyWidg->tree->setExpanded(proxyModel->index(0, 0), true); - m_historyWidg->tree->setAlternatingRowColors(true); - - QFontMetrics fm(font()); - int header = fm.width(QLatin1Char('m')) * 25; - m_historyWidg->tree->header()->resizeSection(0, header); - m_historyWidg->tree->header()->setStretchLastSection(true); - - m_historyWidg->tree->setContextMenuPolicy(Qt::CustomContextMenu); - - connect(m_historyWidg->tree, SIGNAL(customContextMenuRequested(const QPoint &)), - this, SLOT(customContextMenuRequested(const QPoint &))); - - connect(m_historyWidg->tree, SIGNAL(activated(const QModelIndex&)), this, SLOT(open())); -} - - -void HistoryDialog::customContextMenuRequested(const QPoint &pos) -{ - KMenu menu; - QModelIndex index = m_historyWidg->tree->indexAt(pos); - index = index.sibling(index.row(), 0); - if (index.isValid() && !m_historyWidg->tree->model()->hasChildren(index)) - { - menu.addAction(i18n("Open"), this, SLOT(open())); - menu.addSeparator(); - menu.addAction(i18n("Copy"), this, SLOT(copy())); - } - menu.addAction(i18n("Delete"), m_historyWidg->tree, SLOT(removeOne())); - menu.exec(QCursor::pos()); -} - - -void HistoryDialog::open() -{ - QModelIndex index = m_historyWidg->tree->currentIndex(); - if (!index.parent().isValid()) - return; - emit openUrl(index.data(HistoryModel::UrlRole).toUrl()); -} - - -void HistoryDialog::copy() -{ - QModelIndex index = m_historyWidg->tree->currentIndex(); - if (!index.parent().isValid()) - return; - QString url = index.data(HistoryModel::UrlStringRole).toString(); - - QClipboard *clipboard = QApplication::clipboard(); - clipboard->setText(url); -} - -QSize HistoryDialog::sizeHint() const -{ - QRect desktopRect = Application::desktop()->screenGeometry(); - QSize size = desktopRect.size() * 0.7; - return size; -} diff --git a/src/historydialog.h b/src/historydialog.h deleted file mode 100644 index 20f92d9d..00000000 --- a/src/historydialog.h +++ /dev/null @@ -1,57 +0,0 @@ -/* ============================================================ -* -* This file is a part of the rekonq project -* -* Copyright (C) 2009 by Andrea Diamantini -* -* -* This program is free software; you can redistribute it -* and/or modify it under the terms of the GNU General -* Public License as published by the Free Software Foundation; -* either version 3, or (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* ============================================================ */ - - - -#ifndef HISTORYDIALOG_H -#define HISTORYDIALOG_H - - -// Ui includes -#include "ui_history.h" - -// KDE Includes -#include - -class KUrl; -class QPoint; -class QWidget; -class HistoryManager; - -class HistoryDialog : public KDialog -{ - Q_OBJECT - -signals: - void openUrl(const KUrl &url); - -public: - explicit HistoryDialog(QWidget *parent = 0, HistoryManager *history = 0); - QSize sizeHint() const; - -private slots: - void customContextMenuRequested(const QPoint &pos); - void open(); - void copy(); - -private: - Ui::historyWidget *m_historyWidg; -}; - -#endif diff --git a/src/historymenu.cpp b/src/historymenu.cpp index 234236ac..df8bb756 100644 --- a/src/historymenu.cpp +++ b/src/historymenu.cpp @@ -23,7 +23,6 @@ #include "historymenu.moc" #include "application.h" -#include "historydialog.h" #include #include @@ -70,7 +69,7 @@ void HistoryMenu::postPopulated() addSeparator(); KAction *showAllAction = new KAction(i18n("Show All History"), this); - connect(showAllAction, SIGNAL(triggered()), this, SLOT(showHistoryDialog())); +// connect(showAllAction, SIGNAL(triggered()), this, SLOT(showHistoryDialog())); addAction(showAllAction); KAction *clearAction = new KAction(i18n("Clear History"), this); @@ -79,14 +78,6 @@ void HistoryMenu::postPopulated() } -void HistoryMenu::showHistoryDialog() -{ - HistoryDialog *dialog = new HistoryDialog(this); - connect(dialog, SIGNAL(openUrl(const KUrl&)), this, SIGNAL(openUrl(const KUrl&))); - dialog->show(); -} - - void HistoryMenu::setInitialActions(QList actions) { m_initialActions = actions; diff --git a/src/historymenu.h b/src/historymenu.h index ec529b65..f0c16d22 100644 --- a/src/historymenu.h +++ b/src/historymenu.h @@ -54,7 +54,6 @@ protected: private slots: void activated(const QModelIndex &index); - void showHistoryDialog(); private: HistoryManager *m_history; -- cgit v1.2.1 From 205e89597c14473f34ace33c30d503eb9b7cf7e7 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sat, 20 Jun 2009 09:46:23 +0200 Subject: History Panel Action fix --- src/CMakeLists.txt | 2 +- src/historymenu.cpp | 9 +++++++-- src/historymenu.h | 4 ++++ src/mainwindow.cpp | 3 ++- src/rekonqui.rc | 3 --- 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8660e674..ed3205b8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -43,7 +43,7 @@ SET( rekonq_SRCS KDE4_ADD_UI_FILES( rekonq_SRCS cookies.ui cookiesexceptions.ui - history.ui + #history.ui password.ui proxy.ui settings_general.ui diff --git a/src/historymenu.cpp b/src/historymenu.cpp index df8bb756..8d75324d 100644 --- a/src/historymenu.cpp +++ b/src/historymenu.cpp @@ -19,16 +19,22 @@ * ============================================================ */ +// Auto Includes #include "historymenu.h" #include "historymenu.moc" +// Local Includes #include "application.h" +#include "mainwindow.h" +// Qt Includes #include #include +// KDE Includes #include + HistoryMenu::HistoryMenu(QWidget *parent) : ModelMenu(parent) , m_history(0) @@ -68,8 +74,7 @@ void HistoryMenu::postPopulated() if (m_history->history().count() > 0) addSeparator(); - KAction *showAllAction = new KAction(i18n("Show All History"), this); -// connect(showAllAction, SIGNAL(triggered()), this, SLOT(showHistoryDialog())); + QAction *showAllAction = Application::instance()->mainWindow()->actionByName("show_history_panel"); addAction(showAllAction); KAction *clearAction = new KAction(i18n("Clear History"), this); diff --git a/src/historymenu.h b/src/historymenu.h index f0c16d22..da1feaed 100644 --- a/src/historymenu.h +++ b/src/historymenu.h @@ -22,16 +22,20 @@ #ifndef HISTORYMENU_H #define HISTORYMENU_H +// Local Includes #include "history.h" +// Qt Includes #include #include +// Forward Declarations class ModelMenu; class QWidget; class QModelIndex; class KUrl; + /** * Menu that is dynamically populated from the history * diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 3faa4699..ec3f45c6 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -338,7 +338,8 @@ void MainWindow::setupSidePanel() // setup side panel actions QAction* a = m_sidePanel->toggleViewAction(); - a->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_H)); + a->setText( i18n("History Panel") ); + a->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_H)); // WARNING : is this the right shortcut ?? actionCollection()->addAction(QLatin1String("show_history_panel"), a); } diff --git a/src/rekonqui.rc b/src/rekonqui.rc index 0916bf43..2a366229 100644 --- a/src/rekonqui.rc +++ b/src/rekonqui.rc @@ -70,9 +70,6 @@ - Side &Panels - - -- cgit v1.2.1 From 33ac88b25eeb188617da4e445e34eddefbfa8b86 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sat, 20 Jun 2009 10:36:31 +0200 Subject: RFC. History Menu Revisited. --- src/historymenu.cpp | 14 +++++++++++++- src/historymenu.h | 1 + src/modelmenu.cpp | 6 +++--- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/historymenu.cpp b/src/historymenu.cpp index 8d75324d..b5edae3f 100644 --- a/src/historymenu.cpp +++ b/src/historymenu.cpp @@ -33,6 +33,7 @@ // KDE Includes #include +#include HistoryMenu::HistoryMenu(QWidget *parent) @@ -78,11 +79,22 @@ void HistoryMenu::postPopulated() addAction(showAllAction); KAction *clearAction = new KAction(i18n("Clear History"), this); - connect(clearAction, SIGNAL(triggered()), m_history, SLOT(clear())); + connect(clearAction, SIGNAL(triggered()), this, SLOT(clearHistory())); addAction(clearAction); } +void HistoryMenu::clearHistory() +{ + int res = KMessageBox::warningYesNo(this, i18n("Are you sure you want to delete history?"), i18n("History") ); + + if (res == KMessageBox::Yes) + { + m_history->clear(); + } +} + + void HistoryMenu::setInitialActions(QList actions) { m_initialActions = actions; diff --git a/src/historymenu.h b/src/historymenu.h index da1feaed..64395951 100644 --- a/src/historymenu.h +++ b/src/historymenu.h @@ -58,6 +58,7 @@ protected: private slots: void activated(const QModelIndex &index); + void clearHistory(); private: HistoryManager *m_history; diff --git a/src/modelmenu.cpp b/src/modelmenu.cpp index 9ff37037..8f174797 100644 --- a/src/modelmenu.cpp +++ b/src/modelmenu.cpp @@ -171,18 +171,18 @@ void ModelMenu::createMenu(const QModelIndex &parent, int max, QMenu *parentMenu for (int i = 0; i < end; ++i) { QModelIndex idx = m_model->index(i, 0, parent); - if (m_model->hasChildren(idx)) +/* if (m_model->hasChildren(idx)) { createMenu(idx, -1, menu); } else - { + {*/ if (m_separatorRole != 0 && idx.data(m_separatorRole).toBool()) addSeparator(); else menu->addAction(makeAction(idx)); - } +// } if (menu == this && i == m_firstSeparator - 1) addSeparator(); } -- cgit v1.2.1 From f9441ee6e3033b370703ce8ab4e86fa5e9400a2c Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sat, 20 Jun 2009 10:37:30 +0200 Subject: Various Fixes --- src/mainwindow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index ec3f45c6..a555df9a 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -251,6 +251,7 @@ void MainWindow::setupActions() // stop reload Action m_stopReloadAction = new KAction(KIcon("view-refresh"), i18n("Reload"), this); + m_stopReloadAction->setShortcut(KShortcut(Qt::Key_F5)); actionCollection()->addAction(QLatin1String("stop_reload") , m_stopReloadAction); m_stopReloadAction->setShortcutConfigurable(false); @@ -337,7 +338,7 @@ void MainWindow::setupSidePanel() addDockWidget(Qt::LeftDockWidgetArea, m_sidePanel); // setup side panel actions - QAction* a = m_sidePanel->toggleViewAction(); + KAction* a = (KAction *) m_sidePanel->toggleViewAction(); a->setText( i18n("History Panel") ); a->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_H)); // WARNING : is this the right shortcut ?? actionCollection()->addAction(QLatin1String("show_history_panel"), a); -- cgit v1.2.1 From c16774a97d0e0eb1fd8196935f89ee8ea38ef5c6 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sat, 20 Jun 2009 10:46:48 +0200 Subject: rekonq 0.1.5: UI changes --- CMakeLists.txt | 2 +- src/main.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 512e25a0..8b246296 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,7 @@ PROJECT( rekonq ) # rekonq info SET(REKONQ_MAJOR_VERSION "0") SET(REKONQ_MINOR_VERSION "1") -SET(REKONQ_PATCH_VERSION "4") +SET(REKONQ_PATCH_VERSION "5") SET(REKONQ_VERSION_STR "${REKONQ_MAJOR_VERSION}.${REKONQ_MINOR_VERSION}.${REKONQ_PATCH_VERSION}" diff --git a/src/main.cpp b/src/main.cpp index d21bb580..6a4e9a6f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -31,7 +31,7 @@ static const char description[] = I18N_NOOP("WebKit based Web Browser for KDE"); -static const char version[] = "0.1.4"; +static const char version[] = "0.1.5"; int main(int argc, char **argv) -- cgit v1.2.1