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(-) (limited to 'src') 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 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(-) (limited to 'src') 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 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(-) (limited to 'src') 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(-) (limited to 'src') 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(-) (limited to 'src') 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 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(-) (limited to 'src') 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(-) (limited to 'src') 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(-) (limited to 'src') 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(-) (limited to 'src') 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(-) (limited to 'src') 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(-) (limited to 'src') 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(-) (limited to 'src') 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(-) (limited to 'src') 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 (limited to 'src') 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(-) (limited to 'src') 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(-) (limited to 'src') 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(-) (limited to 'src') 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 --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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 From d13488e90ada61c9a9b3eef6ae017d42029740b5 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sat, 20 Jun 2009 18:29:22 +0200 Subject: history menu fix --- src/modelmenu.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/modelmenu.cpp b/src/modelmenu.cpp index 8f174797..282256a8 100644 --- a/src/modelmenu.cpp +++ b/src/modelmenu.cpp @@ -147,17 +147,19 @@ void ModelMenu::aboutToShow() void ModelMenu::createMenu(const QModelIndex &parent, int max, QMenu *parentMenu, QMenu *menu) { + Q_UNUSED(parentMenu) + if (!menu) { - QString title = parent.data().toString(); - menu = new QMenu(title, this); - QIcon icon = qvariant_cast(parent.data(Qt::DecorationRole)); - menu->setIcon(icon); - parentMenu->addMenu(menu); - QVariant v; - v.setValue(parent); - menu->menuAction()->setData(v); - connect(menu, SIGNAL(aboutToShow()), this, SLOT(aboutToShow())); +// QString title = parent.data().toString(); +// menu = new QMenu(title, this); +// QIcon icon = qvariant_cast(parent.data(Qt::DecorationRole)); +// menu->setIcon(icon); +// parentMenu->addMenu(menu); +// QVariant v; +// v.setValue(parent); +// menu->menuAction()->setData(v); +// connect(menu, SIGNAL(aboutToShow()), this, SLOT(aboutToShow())); return; } -- cgit v1.2.1 From 4a023c89a83322cebb3a878c9512874772f791b9 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sat, 20 Jun 2009 18:34:25 +0200 Subject: New history menu code comments --- src/modelmenu.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/modelmenu.cpp b/src/modelmenu.cpp index 282256a8..41c197f3 100644 --- a/src/modelmenu.cpp +++ b/src/modelmenu.cpp @@ -145,6 +145,10 @@ void ModelMenu::aboutToShow() postPopulated(); } + +// WARNING +// the code commented out here is to create a second separator in the history menu +// with ALL history, subdivided by days. void ModelMenu::createMenu(const QModelIndex &parent, int max, QMenu *parentMenu, QMenu *menu) { Q_UNUSED(parentMenu) @@ -173,12 +177,12 @@ 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)) - { - createMenu(idx, -1, menu); - } - else - {*/ +// if (m_model->hasChildren(idx)) +// { +// createMenu(idx, -1, menu); +// } +// else +// { if (m_separatorRole != 0 && idx.data(m_separatorRole).toBool()) addSeparator(); -- cgit v1.2.1 From 0e4a3b6077a276767f76bf52b5c09036b3d89114 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sat, 20 Jun 2009 19:25:43 +0200 Subject: Finally fixed F5 shortcut --- src/mainview.h | 2 -- src/mainwindow.cpp | 6 +++++- src/mainwindow.h | 2 -- src/rekonqui.rc | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/mainview.h b/src/mainview.h index 9ee2f12a..36fadfb4 100644 --- a/src/mainview.h +++ b/src/mainview.h @@ -133,8 +133,6 @@ public slots: private slots: void slotCurrentChanged(int index); -// void aboutToShow/*Rec*/entTabsMenu(); -// void aboutToShowRecentTriggeredAction(QAction *action); // need QAction! void webViewLoadStarted(); void webViewLoadProgress(int progress); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index a555df9a..2e2cc6cd 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -251,7 +251,6 @@ 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); @@ -426,6 +425,11 @@ void MainWindow::slotOpenLocation() void MainWindow::slotFileSaveAs() { + QWebFrame* frame = m_view->currentWebView()->page()->currentFrame(); + + QString title = frame->title(); + QString content = frame->toPlainText(); + KUrl srcUrl = currentTab()->url(); // FIXME implement download file } diff --git a/src/mainwindow.h b/src/mainwindow.h index 0d17ef4d..d9180b69 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -89,11 +89,9 @@ private slots: void slotUpdateActions(); void slotUpdateWindowTitle(const QString &title = QString()); void slotOpenLocation(); -// void slotAboutToShowBackMenu(); void geometryChangeRequested(const QRect &geometry); // history related -// void slotOpenActionUrl(QAction *action); void slotOpenPrevious(); void slotOpenNext(); diff --git a/src/rekonqui.rc b/src/rekonqui.rc index 2a366229..6269df3b 100644 --- a/src/rekonqui.rc +++ b/src/rekonqui.rc @@ -36,7 +36,7 @@ &View - + -- cgit v1.2.1 From 9f9f30aec59b16b94711b3fdd3729b2ea160456d Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sat, 20 Jun 2009 19:33:09 +0200 Subject: slot Save File As --- src/mainwindow.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 2e2cc6cd..4e6ff643 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -57,6 +57,7 @@ #include #include #include +#include #include #include @@ -425,13 +426,14 @@ void MainWindow::slotOpenLocation() void MainWindow::slotFileSaveAs() { - QWebFrame* frame = m_view->currentWebView()->page()->currentFrame(); - - QString title = frame->title(); - QString content = frame->toPlainText(); - KUrl srcUrl = currentTab()->url(); - // FIXME implement download file + + const QString destUrl = KFileDialog::getSaveFileName(srcUrl.fileName(), QString(), this); + if (destUrl.isEmpty()) return; + KIO::Job *job = KIO::file_copy(srcUrl, KUrl(destUrl), -1, KIO::Overwrite); + job->addMetaData("MaxCacheSize", "0"); // Don't store in http cache. + job->addMetaData("cache", "cache"); // Use entry from cache if available. + job->uiDelegate()->setAutoErrorHandlingEnabled(true); } -- cgit v1.2.1 From 7bebf3e547f5bd63e868a24f926daf904c520efb Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 7 Jun 2009 01:55:07 +0200 Subject: start moving things.. --- src/application.cpp | 22 ++++++++++++++++++++++ src/application.h | 9 +++++++++ 2 files changed, 31 insertions(+) (limited to 'src') diff --git a/src/application.cpp b/src/application.cpp index 94821653..0a6d641d 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -252,3 +252,25 @@ KUrl Application::guessUrlFromString(const QString &string) } return url; } + +void Application::notify(const QString &msg, Rekonq::Notify status) +{ + switch(status) + { + case Rekonq::success: +// hi32-actions-emoticon.png + KPassivePopup::message(); + break; + case Rekonq::error: +// hi32-actions-edit-delete.png + KPassivePopup::message(); + break; + case Rekonq::download: +// kget/pics + KPassivePopup::message(); + break; + default: + kDebug() << "nothing to be notified.."; + break; + } +} \ No newline at end of file diff --git a/src/application.h b/src/application.h index a5658703..acb300ed 100644 --- a/src/application.h +++ b/src/application.h @@ -58,6 +58,13 @@ namespace Rekonq New, ///< open url in new tab and make it current Background ///< open url in new tab in background }; + + enum Notify + { + Success, ///< url successfully (down)loaded + Error, ///< url failed to (down)load + Download ///< downloading url + } } @@ -79,6 +86,8 @@ public: KIcon icon(const KUrl &url) const; + void notify(const QString &msg, Rekonq::Notify status); + static KUrl guessUrlFromString(const QString &url); static HistoryManager *historyManager(); -- cgit v1.2.1 From 0cd3c09a8c51682a2e39ef51834c38785db4bda3 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Wed, 10 Jun 2009 00:31:11 +0200 Subject: Working on new notify system... new download icon --- src/application.cpp | 27 ++++++++++++++++----------- src/application.h | 7 ++++--- 2 files changed, 20 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/application.cpp b/src/application.cpp index 0a6d641d..b9b15acd 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -42,6 +42,7 @@ #include #include #include +#include // Qt Includes #include @@ -253,24 +254,28 @@ KUrl Application::guessUrlFromString(const QString &string) return url; } -void Application::notify(const QString &msg, Rekonq::Notify status) + +void Application::notifyMsg(const QString &msg, Rekonq::Notify status) { + QPixmap px; + switch(status) { - case Rekonq::success: -// hi32-actions-emoticon.png - KPassivePopup::message(); + case Rekonq::Success: + px.load("hi32-actions-emoticon.png"); + KPassivePopup::message( i18n("Success!"), msg, px, this, 2); break; - case Rekonq::error: -// hi32-actions-edit-delete.png - KPassivePopup::message(); + case Rekonq::Error: + px.load("hi32-actions-edit-delete.png"); + KPassivePopup::message( i18n("Error!"), msg, px, this, 2); break; - case Rekonq::download: -// kget/pics - KPassivePopup::message(); + case Rekonq::Download: + QString path = KStandardDirs::locate("appdata", "pics/hi64-actions-download.png"); + px.load(path); + KPassivePopup::message( i18n("Download!"), msg, px, this, 2); break; default: kDebug() << "nothing to be notified.."; break; } -} \ No newline at end of file +} diff --git a/src/application.h b/src/application.h index acb300ed..05db3ecb 100644 --- a/src/application.h +++ b/src/application.h @@ -63,8 +63,9 @@ namespace Rekonq { Success, ///< url successfully (down)loaded Error, ///< url failed to (down)load - Download ///< downloading url - } + Download, ///< downloading url + Info ///< information + }; } @@ -86,7 +87,7 @@ public: KIcon icon(const KUrl &url) const; - void notify(const QString &msg, Rekonq::Notify status); + void notifyMsg(const QString &msg, Rekonq::Notify status); static KUrl guessUrlFromString(const QString &url); -- cgit v1.2.1 From 8e094f1119d4073e78697052397c42a90c527601 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 21 Jun 2009 01:29:05 +0200 Subject: New notify system --- src/application.cpp | 26 --------------------- src/application.h | 10 -------- src/mainview.cpp | 30 ++++++++++++------------ src/mainview.h | 19 ++++++++++++++- src/mainwindow.cpp | 67 +++++++++++++++++++++++++++++++++++++++-------------- src/mainwindow.h | 15 +++++++++++- src/rekonqui.rc | 1 - src/webpage.cpp | 2 +- src/webpage.h | 6 +---- 9 files changed, 99 insertions(+), 77 deletions(-) (limited to 'src') diff --git a/src/application.cpp b/src/application.cpp index b9b15acd..5b458438 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -253,29 +253,3 @@ KUrl Application::guessUrlFromString(const QString &string) } return url; } - - -void Application::notifyMsg(const QString &msg, Rekonq::Notify status) -{ - QPixmap px; - - switch(status) - { - case Rekonq::Success: - px.load("hi32-actions-emoticon.png"); - KPassivePopup::message( i18n("Success!"), msg, px, this, 2); - break; - case Rekonq::Error: - px.load("hi32-actions-edit-delete.png"); - KPassivePopup::message( i18n("Error!"), msg, px, this, 2); - break; - case Rekonq::Download: - QString path = KStandardDirs::locate("appdata", "pics/hi64-actions-download.png"); - px.load(path); - KPassivePopup::message( i18n("Download!"), msg, px, this, 2); - break; - default: - kDebug() << "nothing to be notified.."; - break; - } -} diff --git a/src/application.h b/src/application.h index 05db3ecb..a5658703 100644 --- a/src/application.h +++ b/src/application.h @@ -58,14 +58,6 @@ namespace Rekonq New, ///< open url in new tab and make it current Background ///< open url in new tab in background }; - - enum Notify - { - Success, ///< url successfully (down)loaded - Error, ///< url failed to (down)load - Download, ///< downloading url - Info ///< information - }; } @@ -87,8 +79,6 @@ public: KIcon icon(const KUrl &url) const; - void notifyMsg(const QString &msg, Rekonq::Notify status); - static KUrl guessUrlFromString(const QString &url); static HistoryManager *historyManager(); diff --git a/src/mainview.cpp b/src/mainview.cpp index d6c97511..2db26988 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -371,7 +371,7 @@ WebView *MainView::newWebView(Rekonq::OpenType type) // connecting webview with mainview connect(webView, SIGNAL(loadStarted()), this, SLOT(webViewLoadStarted())); - connect(webView, SIGNAL(loadProgress(int)), this, SLOT(webViewLoadProgress(int))); +// connect(webView, SIGNAL(loadProgress(int)), this, SLOT(webViewLoadProgress(int))); connect(webView, SIGNAL(loadFinished(bool)), this, SLOT(webViewLoadFinished(bool))); connect(webView, SIGNAL(iconChanged()), this, SLOT(webViewIconChanged())); connect(webView, SIGNAL(titleChanged(const QString &)), this, SLOT(webViewTitleChanged(const QString &))); @@ -553,20 +553,20 @@ void MainView::webViewLoadStarted() } -void MainView::webViewLoadProgress(int progress) -{ - WebView *webView = qobject_cast(sender()); - int index = webViewIndex(webView); - if (index != currentIndex() || index < 0) - { - return; - } - - double totalBytes = static_cast(webView->page()->totalBytes() / 1024); - - QString message = i18n("Loading %1% (%2 %3)...", progress, totalBytes, QLatin1String("kB")); - emit showStatusBarMessage(message); -} +// void MainView::webViewLoadProgress(int progress) +// { +// WebView *webView = qobject_cast(sender()); +// int index = webViewIndex(webView); +// if (index != currentIndex() || index < 0) +// { +// return; +// } +// +// double totalBytes = static_cast(webView->page()->totalBytes() / 1024); +// +// QString message = i18n("Loading %1% (%2 %3)...", progress, totalBytes, QLatin1String("kB")); +// emit showStatusBarMessage(message); +// } void MainView::webViewLoadFinished(bool ok) diff --git a/src/mainview.h b/src/mainview.h index 36fadfb4..aad99ddd 100644 --- a/src/mainview.h +++ b/src/mainview.h @@ -47,6 +47,23 @@ class TabBar; class UrlBar; +namespace Rekonq +{ + /** + * @short notifying message status + * Different message status + */ + + enum Notify + { + Success, ///< url successfully (down)loaded + Error, ///< url failed to (down)load + Download, ///< downloading url + Info ///< information + }; +} + + /** * This class represent rekonq Main View. It contains all WebViews and a stack widget * of associated line edits. @@ -112,6 +129,7 @@ public slots: * @param url The url to load */ void loadUrl(const KUrl &url); + void slotCloneTab(int index = -1); void slotCloseTab(int index = -1); void slotCloseOtherTabs(int index); @@ -135,7 +153,6 @@ private slots: void slotCurrentChanged(int index); void webViewLoadStarted(); - void webViewLoadProgress(int progress); void webViewLoadFinished(bool ok); void webViewIconChanged(); void webViewTitleChanged(const QString &title); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 4e6ff643..ccd40e3c 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -58,6 +58,8 @@ #include #include #include +#include +#include #include #include @@ -159,9 +161,9 @@ void MainWindow::postLaunch() connect(m_view, SIGNAL(loadProgress(int)), this, SLOT(slotLoadProgress(int))); connect(m_view, SIGNAL(printRequested(QWebFrame *)), this, SLOT(printRequested(QWebFrame *))); - // status bar messages - connect(m_view, SIGNAL(showStatusBarMessage(const QString&)), statusBar(), SLOT(showMessage(const QString&))); - connect(m_view, SIGNAL(linkHovered(const QString&)), statusBar(), SLOT(showMessage(const QString&))); + // "status bar" messages + connect(m_view, SIGNAL(showStatusBarMessage(const QString&)), this, SLOT(notifyMessage(const QString&))); + connect(m_view, SIGNAL(linkHovered(const QString&)), this, SLOT(notifyMessage(const QString&))); // update toolbar actions signals connect(m_view, SIGNAL(tabsChanged()), this, SLOT(slotUpdateActions())); @@ -349,7 +351,6 @@ void MainWindow::setupHistoryMenu() { HistoryMenu *historyMenu = new HistoryMenu(this); connect(historyMenu, SIGNAL(openUrl(const KUrl&)), this, SLOT(loadUrl(const KUrl&))); - connect(historyMenu, SIGNAL(hovered(const QString&)), this, SLOT(slotUpdateStatusbar(const QString&))); historyMenu->setTitle(i18n("&History")); // setting history menu position @@ -455,12 +456,6 @@ void MainWindow::slotPreferences() } -void MainWindow::slotUpdateStatusbar(const QString &string) -{ - statusBar()->showMessage(string, 2000); -} - - void MainWindow::slotUpdateActions() { m_historyBackAction->setEnabled(currentTab()->history()->canGoBack()); @@ -590,7 +585,7 @@ void MainWindow::slotFindNext() if (!currentTab()->findText(m_lastSearch, options)) { - slotUpdateStatusbar(QString(m_lastSearch) + i18n(" not found.")); + notifyMessage(QString(m_lastSearch) + i18n(" not found.")); } } @@ -612,7 +607,7 @@ void MainWindow::slotFindPrevious() if (!currentTab()->findText(m_lastSearch, options)) { - slotUpdateStatusbar(QString(m_lastSearch) + i18n(" not found.")); + notifyMessage(QString(m_lastSearch) + i18n(" not found.")); } } @@ -647,7 +642,6 @@ void MainWindow::slotViewFullScreen(bool makeFullScreen) static bool menubarFlag; static bool mainToolBarFlag; static bool bookmarksToolBarFlag; - static bool statusBarFlag; static bool sidePanelFlag; if (makeFullScreen == true) @@ -656,13 +650,11 @@ void MainWindow::slotViewFullScreen(bool makeFullScreen) menubarFlag = menuBar()->isHidden(); mainToolBarFlag = toolBar("mainToolBar")->isHidden(); bookmarksToolBarFlag = toolBar("bookmarksToolBar")->isHidden(); - statusBarFlag = statusBar()->isHidden(); sidePanelFlag = sidePanel()->isHidden(); menuBar()->hide(); toolBar("mainToolBar")->hide(); toolBar("bookmarksToolBar")->hide(); - statusBar()->hide(); sidePanel()->hide(); } else @@ -673,8 +665,6 @@ void MainWindow::slotViewFullScreen(bool makeFullScreen) toolBar("mainToolBar")->show(); if (!bookmarksToolBarFlag) toolBar("bookmarksToolBar")->show(); - if (!statusBarFlag) - statusBar()->show(); if (!sidePanelFlag) sidePanel()->show(); } @@ -858,3 +848,46 @@ QAction *MainWindow::actionByName(const QString name) return new QAction(this); // return empty object instead of NULL pointer } + + +void MainWindow::notifyMessage(const QString &msg, Rekonq::Notify status) +{ + if(msg.isEmpty()) + return; + + if(m_popup) + delete m_popup; + + m_popup = new KPassivePopup(this); + m_popup->setAutoDelete(true); + + QPixmap px; + + switch(status) + { + case Rekonq::Info: + m_popup->setView(msg); + break; + case Rekonq::Success: + px.load("hi32-actions-emoticon.png"); + m_popup->setView( i18n("Success!"), msg, px); + break; + case Rekonq::Error: + px.load("hi32-actions-edit-delete.png"); + m_popup->setView( i18n("Error!"), msg, px); + break; + case Rekonq::Download: + px.load( KStandardDirs::locate("appdata", "pics/hi64-actions-download.png") ); + m_popup->setView( i18n("Download!"), msg, px); + break; + default: + kDebug() << "nothing to be notified.."; + break; + } + + int x = geometry().x(); + int y = geometry().y() + height() - 45; + QPoint p(x,y); + + m_popup->show(p); +} diff --git a/src/mainwindow.h b/src/mainwindow.h index d9180b69..51bea5e5 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -41,6 +41,7 @@ class KUrl; class KAction; class KActionMenu; class KMenu; +class KPassivePopup; class HistoryMenu; class FindBar; @@ -78,6 +79,17 @@ public slots: void loadUrl(const KUrl &url); void slotUpdateBrowser(); + /** + * Notifies a message in a popup + * + * @param msg The message to notify + * + * @param status The status message + * + */ + void notifyMessage(const QString &msg, Rekonq::Notify status = Rekonq::Info); + + protected: bool queryClose(); @@ -85,7 +97,6 @@ private slots: void postLaunch(); void slotUpdateConfiguration(); void slotLoadProgress(int); - void slotUpdateStatusbar(const QString &string); void slotUpdateActions(); void slotUpdateWindowTitle(const QString &title = QString()); void slotOpenLocation(); @@ -139,6 +150,8 @@ private: QString m_lastSearch; QString m_homePage; + + QPointer m_popup; }; #endif // MAINWINDOW_H diff --git a/src/rekonqui.rc b/src/rekonqui.rc index 6269df3b..67b07c1c 100644 --- a/src/rekonqui.rc +++ b/src/rekonqui.rc @@ -67,7 +67,6 @@ &Settings - diff --git a/src/webpage.cpp b/src/webpage.cpp index 39511760..8c6c0d2a 100644 --- a/src/webpage.cpp +++ b/src/webpage.cpp @@ -141,7 +141,7 @@ void WebPage::slotHandleUnsupportedContent(QNetworkReply *reply) KParts::BrowserRun::AskSaveResult res = KParts::BrowserRun::askSave( url, offer, - mimetype, + mimetype, filename ); switch (res) diff --git a/src/webpage.h b/src/webpage.h index 8ed53a2d..8fe9517d 100644 --- a/src/webpage.h +++ b/src/webpage.h @@ -3,9 +3,7 @@ * This file is a part of the rekonq project * * Copyright (C) 2007-2008 Trolltech ASA. All rights reserved -* Copyright (C) 2008 Benjamin C. Meyer * Copyright (C) 2008-2009 by Andrea Diamantini -* Copyright (C) 2009 by Paweł Prażak * * * This program is free software; you can redistribute it @@ -24,6 +22,7 @@ #ifndef WEBPAGE_H #define WEBPAGE_H + // KDE Includes #include @@ -34,13 +33,10 @@ #include // Forward Declarations - - class QWebFrame; class QNetworkReply; - class WebPage : public KWebPage { Q_OBJECT -- cgit v1.2.1 From 27a1d6d45142134c849f40fd9662cff29f2b9645 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 21 Jun 2009 01:34:55 +0200 Subject: Comments and Fixes --- src/mainview.h | 17 ----------------- src/mainwindow.h | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/mainview.h b/src/mainview.h index aad99ddd..91a09e09 100644 --- a/src/mainview.h +++ b/src/mainview.h @@ -47,23 +47,6 @@ class TabBar; class UrlBar; -namespace Rekonq -{ - /** - * @short notifying message status - * Different message status - */ - - enum Notify - { - Success, ///< url successfully (down)loaded - Error, ///< url failed to (down)load - Download, ///< downloading url - Info ///< information - }; -} - - /** * This class represent rekonq Main View. It contains all WebViews and a stack widget * of associated line edits. diff --git a/src/mainwindow.h b/src/mainwindow.h index 51bea5e5..df2c183e 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -49,6 +49,23 @@ class SidePanel; class WebView; +namespace Rekonq +{ + /** + * @short notifying message status + * Different message status + */ + + enum Notify + { + Success, ///< url successfully (down)loaded + Error, ///< url failed to (down)load + Download, ///< downloading url + Info ///< information + }; +} + + /** * This class serves as the main window for rekonq. * It handles the menus, toolbars, and status bars. -- cgit v1.2.1 From 554b30dd0101524d846df6c76a07db011d4d0c00 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 21 Jun 2009 12:17:36 +0200 Subject: Deleting popup in empty msg --- src/mainview.cpp | 4 ++-- src/mainwindow.cpp | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/mainview.cpp b/src/mainview.cpp index 2db26988..05a32e7d 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -303,7 +303,7 @@ void MainView::slotCurrentChanged(int index) WebView *oldWebView = this->webView(m_urlBars->currentIndex()); if (oldWebView) { - disconnect(oldWebView, SIGNAL(statusBarMessage(const QString&)), + disconnect(oldWebView->page(), SIGNAL(statusBarMessage(const QString&)), this, SIGNAL(showStatusBarMessage(const QString&))); disconnect(oldWebView->page(), SIGNAL(linkHovered(const QString&, const QString&, const QString&)), this, SIGNAL(linkHovered(const QString&))); @@ -311,7 +311,7 @@ void MainView::slotCurrentChanged(int index) this, SIGNAL(loadProgress(int))); } - connect(webView, SIGNAL(statusBarMessage(const QString&)), this, SIGNAL(showStatusBarMessage(const QString&))); + connect(webView->page(), SIGNAL(statusBarMessage(const QString&)), this, SIGNAL(showStatusBarMessage(const QString&))); connect(webView->page(), SIGNAL(linkHovered(const QString&, const QString&, const QString&)), this, SIGNAL(linkHovered(const QString&))); connect(webView, SIGNAL(loadProgress(int)), this, SIGNAL(loadProgress(int))); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index ccd40e3c..811d607b 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -161,7 +161,7 @@ void MainWindow::postLaunch() connect(m_view, SIGNAL(loadProgress(int)), this, SLOT(slotLoadProgress(int))); connect(m_view, SIGNAL(printRequested(QWebFrame *)), this, SLOT(printRequested(QWebFrame *))); - // "status bar" messages + // "status bar" messages (new notifyMessage system) connect(m_view, SIGNAL(showStatusBarMessage(const QString&)), this, SLOT(notifyMessage(const QString&))); connect(m_view, SIGNAL(linkHovered(const QString&)), this, SLOT(notifyMessage(const QString&))); @@ -853,7 +853,10 @@ QAction *MainWindow::actionByName(const QString name) void MainWindow::notifyMessage(const QString &msg, Rekonq::Notify status) { if(msg.isEmpty()) + { + delete m_popup; return; + } if(m_popup) delete m_popup; -- cgit v1.2.1 From 9501cf849628c5aeef669f12db87d43ed03c357a Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 21 Jun 2009 22:11:39 +0200 Subject: New notifying system. Perhaps this should be default for rekonq 0.2. Anyway, there are a lot of improvements needed. We'll see.. --- src/application.h | 13 +++++++++++++ src/mainview.cpp | 21 ++------------------- src/mainview.h | 2 +- src/mainwindow.cpp | 16 ++++++++-------- src/mainwindow.h | 30 +++++++++++++++--------------- 5 files changed, 39 insertions(+), 43 deletions(-) (limited to 'src') diff --git a/src/application.h b/src/application.h index a5658703..d2e66d3f 100644 --- a/src/application.h +++ b/src/application.h @@ -58,6 +58,19 @@ namespace Rekonq New, ///< open url in new tab and make it current Background ///< open url in new tab in background }; + + /** + * @short notifying message status + * Different message status + */ + + enum Notify + { + Success, ///< url successfully (down)loaded + Error, ///< url failed to (down)load + Download, ///< downloading url + Info ///< information, (default) + }; } diff --git a/src/mainview.cpp b/src/mainview.cpp index 05a32e7d..75154528 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -371,7 +371,6 @@ WebView *MainView::newWebView(Rekonq::OpenType type) // connecting webview with mainview connect(webView, SIGNAL(loadStarted()), this, SLOT(webViewLoadStarted())); -// connect(webView, SIGNAL(loadProgress(int)), this, SLOT(webViewLoadProgress(int))); connect(webView, SIGNAL(loadFinished(bool)), this, SLOT(webViewLoadFinished(bool))); connect(webView, SIGNAL(iconChanged()), this, SLOT(webViewIconChanged())); connect(webView, SIGNAL(titleChanged(const QString &)), this, SLOT(webViewTitleChanged(const QString &))); @@ -553,22 +552,6 @@ void MainView::webViewLoadStarted() } -// void MainView::webViewLoadProgress(int progress) -// { -// WebView *webView = qobject_cast(sender()); -// int index = webViewIndex(webView); -// if (index != currentIndex() || index < 0) -// { -// return; -// } -// -// double totalBytes = static_cast(webView->page()->totalBytes() / 1024); -// -// QString message = i18n("Loading %1% (%2 %3)...", progress, totalBytes, QLatin1String("kB")); -// emit showStatusBarMessage(message); -// } - - void MainView::webViewLoadFinished(bool ok) { WebView *webView = qobject_cast(sender()); @@ -591,9 +574,9 @@ void MainView::webViewLoadFinished(bool ok) } if (ok) - emit showStatusBarMessage(i18n("Done")); + emit showStatusBarMessage(i18n("Done"), Rekonq::Success); else - emit showStatusBarMessage(i18n("Failed to load")); + emit showStatusBarMessage(i18n("Failed to load"), Rekonq::Error); } diff --git a/src/mainview.h b/src/mainview.h index 91a09e09..7cb4e035 100644 --- a/src/mainview.h +++ b/src/mainview.h @@ -91,7 +91,7 @@ signals: // current tab signals void setCurrentTitle(const QString &url); - void showStatusBarMessage(const QString &message); + void showStatusBarMessage(const QString &message, Rekonq::Notify status = Rekonq::Info); void linkHovered(const QString &link); void loadProgress(int progress); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 811d607b..c7e3c945 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -60,6 +60,7 @@ #include #include #include +#include #include #include @@ -162,7 +163,7 @@ void MainWindow::postLaunch() connect(m_view, SIGNAL(printRequested(QWebFrame *)), this, SLOT(printRequested(QWebFrame *))); // "status bar" messages (new notifyMessage system) - connect(m_view, SIGNAL(showStatusBarMessage(const QString&)), this, SLOT(notifyMessage(const QString&))); + connect(m_view, SIGNAL(showStatusBarMessage(const QString&, Rekonq::Notify)), this, SLOT(notifyMessage(const QString&, Rekonq::Notify))); connect(m_view, SIGNAL(linkHovered(const QString&)), this, SLOT(notifyMessage(const QString&))); // update toolbar actions signals @@ -850,8 +851,10 @@ QAction *MainWindow::actionByName(const QString name) } +// FIXME: better implement me, please!! void MainWindow::notifyMessage(const QString &msg, Rekonq::Notify status) { + // deleting popus if empty msgs if(msg.isEmpty()) { delete m_popup; @@ -865,29 +868,26 @@ void MainWindow::notifyMessage(const QString &msg, Rekonq::Notify status) m_popup->setAutoDelete(true); QPixmap px; + QString pixPath; switch(status) { case Rekonq::Info: - m_popup->setView(msg); break; case Rekonq::Success: - px.load("hi32-actions-emoticon.png"); - m_popup->setView( i18n("Success!"), msg, px); break; case Rekonq::Error: - px.load("hi32-actions-edit-delete.png"); - m_popup->setView( i18n("Error!"), msg, px); break; case Rekonq::Download: - px.load( KStandardDirs::locate("appdata", "pics/hi64-actions-download.png") ); - m_popup->setView( i18n("Download!"), msg, px); break; default: kDebug() << "nothing to be notified.."; break; } + m_popup->setView(msg); + + // setting popus in bottom-left position int x = geometry().x(); int y = geometry().y() + height() - 45; QPoint p(x,y); diff --git a/src/mainwindow.h b/src/mainwindow.h index df2c183e..4e32e215 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -49,21 +49,21 @@ class SidePanel; class WebView; -namespace Rekonq -{ - /** - * @short notifying message status - * Different message status - */ - - enum Notify - { - Success, ///< url successfully (down)loaded - Error, ///< url failed to (down)load - Download, ///< downloading url - Info ///< information - }; -} +// namespace Rekonq +// { +// /** +// * @short notifying message status +// * Different message status +// */ +// +// enum Notify +// { +// Success, ///< url successfully (down)loaded +// Error, ///< url failed to (down)load +// Download, ///< downloading url +// Info ///< information, (default) +// }; +// } /** -- cgit v1.2.1 From 18a1f7f6dbae5d7c1d60920ab1dd3ed024d2ec41 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 21 Jun 2009 22:24:16 +0200 Subject: 0.1.6 version with new notifying system --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index 6a4e9a6f..d97017ca 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.5"; +static const char version[] = "0.1.6"; int main(int argc, char **argv) -- cgit v1.2.1