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(-) 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(-) 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(-) 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(-) 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(+) 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 --- icons/CMakeLists.txt | 2 ++ icons/pics/CMakeLists.txt | 4 ++++ icons/pics/hi64-actions-download.png | Bin 0 -> 4518 bytes src/application.cpp | 27 ++++++++++++++++----------- src/application.h | 7 ++++--- 5 files changed, 26 insertions(+), 14 deletions(-) create mode 100644 icons/pics/CMakeLists.txt create mode 100644 icons/pics/hi64-actions-download.png diff --git a/icons/CMakeLists.txt b/icons/CMakeLists.txt index 9d7ead58..d575cf4d 100644 --- a/icons/CMakeLists.txt +++ b/icons/CMakeLists.txt @@ -1,2 +1,4 @@ # install standard icons KDE4_INSTALL_ICONS( ${ICON_INSTALL_DIR} ) + +ADD_SUBDIRECTORY( pics ) diff --git a/icons/pics/CMakeLists.txt b/icons/pics/CMakeLists.txt new file mode 100644 index 00000000..53d04224 --- /dev/null +++ b/icons/pics/CMakeLists.txt @@ -0,0 +1,4 @@ +INSTALL( + FILES hi64-actions-download.png + DESTINATION ${DATA_INSTALL_DIR}/rekonq/pics +) diff --git a/icons/pics/hi64-actions-download.png b/icons/pics/hi64-actions-download.png new file mode 100644 index 00000000..aa1101c1 Binary files /dev/null and b/icons/pics/hi64-actions-download.png differ 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(-) 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(-) 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(-) 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(-) 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 --- CMakeLists.txt | 2 +- src/main.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b246296..9b3d7ff4 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 "5") +SET(REKONQ_PATCH_VERSION "6") SET(REKONQ_VERSION_STR "${REKONQ_MAJOR_VERSION}.${REKONQ_MINOR_VERSION}.${REKONQ_PATCH_VERSION}" 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 From a9b1302f2bf5b590c5352c7c90a9319fac5cc21b Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Mon, 22 Jun 2009 11:31:10 +0200 Subject: Fixing popup pos && removing unwanted statusBar --- src/mainwindow.cpp | 8 +++++++- src/rekonqui.rc | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index c7e3c945..519081d6 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -136,6 +136,9 @@ MainWindow::MainWindow() // toolbar position, icon size, etc. setupGUI(); + // no more status bar.. + setStatusBar(0); + QTimer::singleShot(0, this, SLOT(postLaunch())); } @@ -887,9 +890,12 @@ void MainWindow::notifyMessage(const QString &msg, Rekonq::Notify status) m_popup->setView(msg); + int h = KGlobalSettings::generalFont().pointSize(); + kWarning() << "h: " << h; + // setting popus in bottom-left position int x = geometry().x(); - int y = geometry().y() + height() - 45; + int y = geometry().y() + height() - h*4; QPoint p(x,y); m_popup->show(p); diff --git a/src/rekonqui.rc b/src/rekonqui.rc index 67b07c1c..dfc8bd2b 100644 --- a/src/rekonqui.rc +++ b/src/rekonqui.rc @@ -1,6 +1,6 @@ - + -- cgit v1.2.1