diff options
author | Jonathan Bauer | 2011-07-01 15:35:13 +0200 |
---|---|---|
committer | Jonathan Bauer | 2011-07-01 15:35:13 +0200 |
commit | df3af2be38e0412ffc228acfbda9ad9a7f983fdb (patch) | |
tree | 077741968c89bee3d16da9907a8ef9c0bbc1140d | |
parent | scripts changes (diff) | |
download | fbsplash-df3af2be38e0412ffc228acfbda9ad9a7f983fdb.tar.gz fbsplash-df3af2be38e0412ffc228acfbda9ad9a7f983fdb.tar.xz fbsplash-df3af2be38e0412ffc228acfbda9ad9a7f983fdb.zip |
progress bar animated (increases by 1% every 0.1 second)
-rw-r--r-- | .gitignore | 1 | ||||
-rwxr-xr-x | build.sh | 11 | ||||
-rw-r--r-- | src/fbsplash.cpp | 18 | ||||
-rw-r--r-- | src/fbsplash.h | 2 | ||||
-rw-r--r-- | src/fbsplash.ui | 2 |
5 files changed, 20 insertions, 14 deletions
@@ -1,2 +1 @@ build -core @@ -1,9 +1,9 @@ -#!/bin/sh +#!/bin/bash # fbsplash builder script for cmake DIR=$(pwd) BUILDDIR=build -# if --clean, remove build dir +# if -c option was given, remove build dir if [ "$1" = "-c" ] then rm -rf $BUILDDIR @@ -21,10 +21,7 @@ fi [ ! -d $BUILDDIR ] && mkdir -p $BUILDDIR cd $BUILDDIR -# use cmake to create Makefile -echo "Invoking cmake ..." -cmake "$DIR" -echo "Invoking make ..." -make + +cmake "$DIR" && make cd $DIR diff --git a/src/fbsplash.cpp b/src/fbsplash.cpp index 7e97d91..292431c 100644 --- a/src/fbsplash.cpp +++ b/src/fbsplash.cpp @@ -1,15 +1,16 @@ -#include <QProgressBar> #include "fbsplash.h" #include "ui_fbsplash.h" //----------------------------------------------------------------------------- fbsplash::fbsplash(QWidget *parent) : QWidget(parent), ui(new Ui::fbsplash) { - ui->setupUi(this); createActions(); - //setupTheme(); + + QTimer *timer = new QTimer(this); + connect(timer, SIGNAL(timeout()), this, SLOT(increaseProgressBar())); + timer->start(100); setWindowFlags(Qt::FramelessWindowHint); showFullScreen(); @@ -21,8 +22,7 @@ fbsplash::~fbsplash() { } //----------------------------------------------------------------------------- void fbsplash::setupTheme() { - // TODO configurable per cmdline - // TODO set per css + // TODO: set styles from config file (or default theme) } //----------------------------------------------------------------------------- void fbsplash::createActions() { @@ -33,3 +33,11 @@ void fbsplash::createActions() { connect(_quit, SIGNAL(triggered()), this, SLOT(close())); // per default, QT closes the app when the last widget is closed } + +void fbsplash::increaseProgressBar() { + int currentValue = ui->progressBar->value(); + if (currentValue < 100) + ui->progressBar->setValue(currentValue + 1); + else + ui->progressBar->setValue(0); +} diff --git a/src/fbsplash.h b/src/fbsplash.h index 69ef69a..26b66b0 100644 --- a/src/fbsplash.h +++ b/src/fbsplash.h @@ -39,6 +39,8 @@ private: // ** TESTING ** // ** TESTING ** +private slots: + void increaseProgressBar(); }; #endif // FBSPLASH_H diff --git a/src/fbsplash.ui b/src/fbsplash.ui index a5ed56b..0710b35 100644 --- a/src/fbsplash.ui +++ b/src/fbsplash.ui @@ -69,7 +69,7 @@ border-radius: 8px; }</string> </property> <property name="value"> - <number>24</number> + <number>0</number> </property> <property name="format"> <string/> |