diff options
-rw-r--r-- | src/fbgui.cpp | 11 | ||||
-rwxr-xr-x | src/testApp.sh | 14 |
2 files changed, 13 insertions, 12 deletions
diff --git a/src/fbgui.cpp b/src/fbgui.cpp index c6f7e0d..1851ad4 100644 --- a/src/fbgui.cpp +++ b/src/fbgui.cpp @@ -23,10 +23,11 @@ void printUsage() int main(int argc, char *argv[]) { - - // This is the main object of a QT Application. - QApplication a(argc, argv); + // The third argument sets the application as the GUI-Server, + // so the same as using "-qws" when calling the application. + QApplication a(argc, argv, QApplication::GuiServer); + a.setQuitOnLastWindowClosed(true); // Note: The QT arguments (-qws, -display etc) seems to be gone at this point. // So we should be able to ignore the QT arguments when calling fbgui, @@ -63,13 +64,15 @@ int main(int argc, char *argv[]) // Get the application path and prints on screen. qDebug() << "Application Path: " << a.applicationDirPath(); - QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); +; // Create a new Framebuffer-Browser object for displaying the given URL. fbbrowser* fbb = new fbbrowser(url); // Listen to the signalQuitAll() Signal to kill the app from within the browser. QObject::connect(fbb, SIGNAL(killApp()), &a, SLOT(quit())); + // Alternative + // Display the browser. fbb->show(); diff --git a/src/testApp.sh b/src/testApp.sh index 81093d7..3949361 100755 --- a/src/testApp.sh +++ b/src/testApp.sh @@ -1,5 +1,6 @@ #!/bin/sh -# This script now needs to have the URL to load as an argument. +# If an argument is passed (=URL), set the URL. +# If no arg are passed, set the default test URL. if [ $# = 0 ]; then url="http://132.230.4.3/webkitTest.html" else @@ -12,15 +13,12 @@ script_path="$(cd "${0%/*}" 2>/dev/null; echo "$PWD"/"${0##*/}")" working_path=`dirname "$script_path"` display_id=$(grep -n $(whoami) /etc/passwd| head -n 1|awk -F : '{print $1}') -# Start QT's virtual framebuffer +# Start QT's virtual framebuffer with proper displayID /usr/local/Trolltech/Qt-4.7.1/bin/qvfb -width 800 -height 600 -qwsdisplay :$display_id & -# Wait for it to load (needed?) +# Wait for it to load (needed?) Probably not ;o sleep 1 -# Start the fbbrowser app. -# This requires the fbgui git repository to be in the user's home directory. -echo "fbgui call:" -echo "$working_path/fbgui -qws -display QVFb:$display_id -u $url" -$working_path/fbgui -qws -display QVFb:$display_id --url=$url +# Start fbgui. +$working_path/fbgui -display QVFb:$display_id --url=$url # Check if fbbrowser is not running, if so kill the qvfb. if [ $(ps aux | grep -v grep | grep -c fbgui) -eq 1 ] then |