summaryrefslogtreecommitdiffstats
path: root/src/fbsplash.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/fbsplash.cpp')
-rw-r--r--src/fbsplash.cpp31
1 files changed, 27 insertions, 4 deletions
diff --git a/src/fbsplash.cpp b/src/fbsplash.cpp
index 292431c..b00f094 100644
--- a/src/fbsplash.cpp
+++ b/src/fbsplash.cpp
@@ -1,3 +1,4 @@
+#include <QTimer>
#include "fbsplash.h"
#include "ui_fbsplash.h"
@@ -8,6 +9,16 @@ fbsplash::fbsplash(QWidget *parent) :
createActions();
+ /*
+ server = new QLocalServer(this);
+ if (!server->listen("/tmp/foo")){
+ qDebug() << "Cannot listen...";
+ exit(1);
+ }
+ */
+ // listening
+ //connect(server, SIGNAL(newConnection()), this, SLOT(newConnection()));
+
QTimer *timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(increaseProgressBar()));
timer->start(100);
@@ -26,18 +37,30 @@ void fbsplash::setupTheme() {
}
//-----------------------------------------------------------------------------
void fbsplash::createActions() {
+ /*
// For testing: quit through CTRL + X
_quit = new QAction(tr("&quit"), this);
_quit->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_X));
this->addAction(_quit);
connect(_quit, SIGNAL(triggered()), this, SLOT(close()));
// per default, QT closes the app when the last widget is closed
+ */
+}
+
+void fbsplash::newConnection(){
+ //socket = server->nextPendingConnection();
+ //connect(socket, SIGNAL(readyRead()), this, SLOT(newData()));
+}
+
+void fbsplash::newData(){
+ //QByteArray data = socket->readAll();
+ //int newProgress = data.toInt();
}
void fbsplash::increaseProgressBar() {
int currentValue = ui->progressBar->value();
- if (currentValue < 100)
- ui->progressBar->setValue(currentValue + 1);
- else
- ui->progressBar->setValue(0);
+ int newValue;
+ (currentValue < 100) ? newValue = currentValue + 1
+ : newValue = 0;
+ ui->progressBar->setValue(newValue);
}