From 3367b32feac061c69892618dc5e82c0c47c0e1db Mon Sep 17 00:00:00 2001 From: Leonardo Robol Date: Mon, 23 Apr 2012 22:17:27 +0200 Subject: [PATCH] Added progressbar to the webview --- include/mainwindow.h | 4 ++++ larss/mainwindow.cpp | 13 +++++++++++++ ui/mainwindow.ui | 28 ++++++++++++++++++++++++++-- 3 files changed, 43 insertions(+), 2 deletions(-) diff --git a/include/mainwindow.h b/include/mainwindow.h index b9a7ab4..2c58f7d 100644 --- a/include/mainwindow.h +++ b/include/mainwindow.h @@ -45,6 +45,10 @@ private slots: void removeSelectedCategory (); + void on_webView_loadFinished(bool arg1); + + void on_webView_loadStarted(); + public slots: /** * @brief Callback for the start of an update of a feed. diff --git a/larss/mainwindow.cpp b/larss/mainwindow.cpp index 7d626c7..e230631 100644 --- a/larss/mainwindow.cpp +++ b/larss/mainwindow.cpp @@ -14,6 +14,9 @@ MainWindow::MainWindow(QWidget *parent) : { ui->setupUi(this); + // Don't show the progressbar by default, it will be shown only if really useful + ui->webProgressBar->hide(); + // Open the database, and create the directories for the data // storage if they are not yet present in the filesystem. QString location = QDesktopServices::storageLocation(QDesktopServices::DataLocation); @@ -394,3 +397,13 @@ void Larss::MainWindow::removeSelectedCategory() feedModel->removeElement(index.row()); } } + +void Larss::MainWindow::on_webView_loadFinished(bool arg1) +{ + ui->webProgressBar->hide(); +} + +void Larss::MainWindow::on_webView_loadStarted() +{ + ui->webProgressBar->show(); +} diff --git a/ui/mainwindow.ui b/ui/mainwindow.ui index 7d7e7e4..82027df 100644 --- a/ui/mainwindow.ui +++ b/ui/mainwindow.ui @@ -104,6 +104,13 @@ + + + + 24 + + + @@ -120,7 +127,7 @@ 0 0 420 - 24 + 25 @@ -183,5 +190,22 @@ - + + + webView + loadProgress(int) + webProgressBar + setValue(int) + + + 260 + 202 + + + 260 + 274 + + + + -- 2.1.4