summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-rw-r--r--CMakeLists.txt4
-rw-r--r--README4
-rwxr-xr-xbuild.sh9
-rwxr-xr-xrun.sh12
-rw-r--r--src/fbsplash.cpp31
-rw-r--r--src/fbsplash.h8
7 files changed, 56 insertions, 16 deletions
diff --git a/.gitignore b/.gitignore
index 378eac2..d980e9f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,5 @@
build
+bin
+.cproject
+.project
+Makefile
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 98d9d3a..0f1d554 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,6 +9,9 @@ else(QT4_FOUND)
message(FATAL_ERROR "QT4 not found!")
endif(QT4_FOUND)
+set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/../bin)
+set(QT_USE_QTNETWORK TRUE)
+
file(GLOB_RECURSE FBSPLASH_SOURCES src/*.cpp)
file(GLOB_RECURSE FBSPLASH_MOC_HEADERS src/*.h)
file(GLOB_RECURSE FBSPLASH_UIS src/*.ui)
@@ -27,6 +30,7 @@ add_executable(fbsplash
${FBSPLASH_UI_HEADERS}
${FBSPLASH_RC_SOURCES})
+message(${QT_LIBRARIES})
target_link_libraries(fbsplash ${QT_LIBRARIES})
include_directories(${CMAKE_CURRENT_BINARY_DIR})
diff --git a/README b/README
index 810ec31..c6b431e 100644
--- a/README
+++ b/README
@@ -6,8 +6,8 @@ To compile, use:
./build.sh
-This script will compile the source code in the build/ subdirectory.
-(with the option "-c" can the build directory be cleaned before rebuilding)
+The binary will end up in bin/
+(use "-c" to make a clean build)
Note: Make sure qmake (from QtEmbedded) is in your PATH variable.
diff --git a/build.sh b/build.sh
index 9aa411d..c5ed95b 100755
--- a/build.sh
+++ b/build.sh
@@ -1,5 +1,9 @@
#!/bin/bash
-# fbsplash builder script for cmake
+#########################################
+# #
+# fbsplash builder with CMake #
+# #
+#########################################
DIR=$(pwd)
BUILDDIR=build
@@ -21,7 +25,6 @@ fi
[ ! -d $BUILDDIR ] && mkdir -p $BUILDDIR
cd $BUILDDIR
-
+# create Makefile from CMakeLists.txt and run make
cmake "$DIR" && make
-
cd $DIR
diff --git a/run.sh b/run.sh
index 61edfcd..c0e7ad3 100755
--- a/run.sh
+++ b/run.sh
@@ -3,6 +3,9 @@
# Set the QT version of the qvfb here
QT_VERSION=Qt-4.7.2
+# clear socket, needed? crashes without...
+rm /tmp/foo >/dev/null
+
if [ $# -eq 2 ]
then
QVFB_WIDTH=$1
@@ -13,11 +16,8 @@ else
QVFB_HEIGHT=600
fi
-# path to script (including script name)
-script_path="$(cd "${0%/*}" 2>/dev/null; echo "$PWD"/"${0##*/}")"
-
-# to get the path only: use dirname which strips the filename from a path
-working_path=`dirname "$script_path"`
+# path to script
+script_path=$(dirname $(readlink -f $0))
# construct unique display_id based on user, needed for multi-user qvfb usage
display_id=$(grep -n $(whoami) /etc/passwd| head -n 1|awk -F : '{print $1}')
@@ -29,5 +29,5 @@ display_id=$(grep -n $(whoami) /etc/passwd| head -n 1|awk -F : '{print $1}')
sleep 0.2
# Start fbsplash connected to QVFb with display_id from above.
-$working_path/build/fbsplash -display QVFb:$display_id $@
+$script_path/bin/fbsplash -display QVFb:$display_id $@
killall qvfb
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);
}
diff --git a/src/fbsplash.h b/src/fbsplash.h
index 26b66b0..c26e07f 100644
--- a/src/fbsplash.h
+++ b/src/fbsplash.h
@@ -15,6 +15,7 @@
#define FBSPLASH_H
#include <QtGui>
+//#include <QtNetwork>
namespace Ui {
class fbsplash;
@@ -33,14 +34,19 @@ private:
void setupTheme();
// members
- QAction* _quit;
+ //QAction* _quit;
Ui::fbsplash *ui;
+ //QLocalServer *server;
+ //QLocalSocket *socket;
+
// ** TESTING **
// ** TESTING **
private slots:
void increaseProgressBar();
+ void newConnection();
+ void newData();
};
#endif // FBSPLASH_H