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/mainview.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/mainview.cpp') 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) -- 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 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mainview.cpp') 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))); -- 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/mainview.cpp | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) (limited to 'src/mainview.cpp') 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); } -- cgit v1.2.1