From be191391b66158e6f94598ae416476acc27510f4 Mon Sep 17 00:00:00 2001 From: Leonardo Robol Date: Thu, 3 May 2012 22:32:09 +0200 Subject: [PATCH] Auto-hide for the progress bar. --- include/mainwindow.h | 5 +++++ larss/mainwindow.cpp | 20 +++++++++++++++++--- ui/mainwindow.ui | 2 +- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/include/mainwindow.h b/include/mainwindow.h index 2c58f7d..2d15af5 100644 --- a/include/mainwindow.h +++ b/include/mainwindow.h @@ -104,6 +104,11 @@ private: * @brief System tray icon used to show the notifications. */ QSystemTrayIcon *systrayIcon; + + + void showProgressBar(); + + void hideProgressBar(); }; } diff --git a/larss/mainwindow.cpp b/larss/mainwindow.cpp index e230631..9418808 100644 --- a/larss/mainwindow.cpp +++ b/larss/mainwindow.cpp @@ -15,7 +15,7 @@ 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(); + hideProgressBar(); // Open the database, and create the directories for the data // storage if they are not yet present in the filesystem. @@ -398,12 +398,26 @@ void Larss::MainWindow::removeSelectedCategory() } } +void Larss::MainWindow::hideProgressBar() +{ + ui->webProgressBar->setHidden(true); +} + +void Larss::MainWindow::showProgressBar() +{ + ui->webProgressBar->setHidden(false); + return; +} + void Larss::MainWindow::on_webView_loadFinished(bool arg1) { - ui->webProgressBar->hide(); + Q_UNUSED(arg1); + + hideProgressBar(); + ui->webProgressBar->setValue(0); } void Larss::MainWindow::on_webView_loadStarted() { - ui->webProgressBar->show(); + showProgressBar(); } diff --git a/ui/mainwindow.ui b/ui/mainwindow.ui index 82027df..df026f6 100644 --- a/ui/mainwindow.ui +++ b/ui/mainwindow.ui @@ -107,7 +107,7 @@ - 24 + 0 -- 2.1.4