From 8ed850338461fa0264864c3177f94effd9cc8427 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Thu, 13 Jan 2011 15:32:59 +0100 Subject: test commit --- fbbrowser/main.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'fbbrowser') diff --git a/fbbrowser/main.cpp b/fbbrowser/main.cpp index e0210f5..7f51a6f 100644 --- a/fbbrowser/main.cpp +++ b/fbbrowser/main.cpp @@ -6,6 +6,7 @@ int main(int argc, char *argv[]) { QApplication a(argc, argv); + // Is this really needed, since we kill the app through the fbbrowser object? QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); QUrl url; -- cgit v1.2.3-55-g7522 From 3a94024664a2ac3198b2cc3a99ea769db228c0ab Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Thu, 13 Jan 2011 15:36:53 +0100 Subject: einige kommentare hingefügt... --- fbbrowser/main.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'fbbrowser') diff --git a/fbbrowser/main.cpp b/fbbrowser/main.cpp index 7f51a6f..aa6da2e 100644 --- a/fbbrowser/main.cpp +++ b/fbbrowser/main.cpp @@ -9,14 +9,18 @@ int main(int argc, char *argv[]) // Is this really needed, since we kill the app through the fbbrowser object? QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); + // This part reads the URL to load from the arguments given through the commandline. QUrl url; if (argc > 1) url = QUrl(argv[1]); - else //Default + else //Default URL to load url = QUrl("http://132.230.4.3/webkitTest.html"); - + // 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(signalQuitAll()), &a, SLOT(quit())); + // Display the browser. fbb->show(); + // Exit the application. return a.exec(); } -- cgit v1.2.3-55-g7522 From 0e0f78882d2a6d5da20b82557ff8a63738d6c14a Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Thu, 13 Jan 2011 16:02:26 +0100 Subject: Script for testing the app ine one go... --- fbbrowser/main.cpp | 1 + fbbrowser/testApp.sh | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100755 fbbrowser/testApp.sh (limited to 'fbbrowser') diff --git a/fbbrowser/main.cpp b/fbbrowser/main.cpp index aa6da2e..fc333fb 100644 --- a/fbbrowser/main.cpp +++ b/fbbrowser/main.cpp @@ -5,6 +5,7 @@ int main(int argc, char *argv[]) { + // This is the main object of a QT Application. QApplication a(argc, argv); // Is this really needed, since we kill the app through the fbbrowser object? QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); diff --git a/fbbrowser/testApp.sh b/fbbrowser/testApp.sh new file mode 100755 index 0000000..4041cf3 --- /dev/null +++ b/fbbrowser/testApp.sh @@ -0,0 +1,15 @@ +#!/bin/sh +# Start QT's virtual framebuffer +/usr/local/Trolltech/Qt-4.7.1/bin/qvfb -width 800 -height 600 & +# Wait for it to load (needed?) +sleep 1 +# Start the fbbrowser app. +/home/joe/fbgui/fbbrowser/fbbrowser -qws +# Check if fbbrowser is not running, if so kill the qvfb. +if ps aux | grep -v grep | grep fbbrowser > /dev/null +then + echo "fbbrowser is still running ..." +else + echo "fbbrowser stopped running, killing qvfb ..." + killall qvfb +fi -- cgit v1.2.3-55-g7522 From 6a48516547b8ae276cf8407b1dda3a7552fa3775 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Thu, 13 Jan 2011 16:03:47 +0100 Subject: path fixup... --- fbbrowser/testApp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fbbrowser') diff --git a/fbbrowser/testApp.sh b/fbbrowser/testApp.sh index 4041cf3..0c50180 100755 --- a/fbbrowser/testApp.sh +++ b/fbbrowser/testApp.sh @@ -4,7 +4,7 @@ # Wait for it to load (needed?) sleep 1 # Start the fbbrowser app. -/home/joe/fbgui/fbbrowser/fbbrowser -qws +~/fbgui/fbbrowser/fbbrowser -qws # Check if fbbrowser is not running, if so kill the qvfb. if ps aux | grep -v grep | grep fbbrowser > /dev/null then -- cgit v1.2.3-55-g7522 From ec2bcfb9d6228f3c936c0480b1890f0e6efd253f Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Thu, 13 Jan 2011 16:04:54 +0100 Subject: commented home dir requirement ... --- fbbrowser/testApp.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'fbbrowser') diff --git a/fbbrowser/testApp.sh b/fbbrowser/testApp.sh index 0c50180..57f37b7 100755 --- a/fbbrowser/testApp.sh +++ b/fbbrowser/testApp.sh @@ -4,6 +4,7 @@ # Wait for it to load (needed?) sleep 1 # Start the fbbrowser app. +# This requires the fbgui git repository to be in the user's home directory. ~/fbgui/fbbrowser/fbbrowser -qws # Check if fbbrowser is not running, if so kill the qvfb. if ps aux | grep -v grep | grep fbbrowser > /dev/null -- cgit v1.2.3-55-g7522 From bb59a001a45dc9275bdbf59aa38d9ea2ec5c80b5 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Thu, 13 Jan 2011 16:09:14 +0100 Subject: more commentaries.... --- fbbrowser/fbbrowser.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'fbbrowser') diff --git a/fbbrowser/fbbrowser.cpp b/fbbrowser/fbbrowser.cpp index 813b14e..b53134c 100644 --- a/fbbrowser/fbbrowser.cpp +++ b/fbbrowser/fbbrowser.cpp @@ -8,18 +8,21 @@ fbbrowser::fbbrowser(const QUrl & url) { - view = new QWebView(this); - // check Internet connection + // Check Internet connection + // Create QNetworkAccessManager which is needed to send/receive requests. manager = new QNetworkAccessManager(this); + // Create a QNetworkRequest object and set its URL. QNetworkRequest request; request.setUrl(url); + // Let the manager send the request and receive the reply. QNetworkReply *reply = manager->get(request); //connect(reply, SIGNAL(error()), this, SLOT()); //connect(reply, SIGNAL(finished()), this, SLOT()); + // Check if the reply is an error message (?) qDebug() << reply->error(); //TODO: error differentiation @@ -46,11 +49,12 @@ fbbrowser::fbbrowser(const QUrl & url) setCentralWidget(view); } +// Destructor fbbrowser::~fbbrowser() { - } +// void fbbrowser::addJSObject() { view->page()->mainFrame()->addToJavaScriptWindowObject(QString("webkitTest"), this); @@ -66,6 +70,7 @@ void fbbrowser::writeText(QString text) out << text << "\n"; } +// This function needed now ? void fbbrowser::quitAll() { //emit lastWindowClosed(); -- cgit v1.2.3-55-g7522