diff options
Diffstat (limited to 'fbbrowser')
| -rwxr-xr-x | fbbrowser/fbbrowser | bin | 529673 -> 0 bytes | |||
| -rw-r--r-- | fbbrowser/fbbrowser.h | 7 | ||||
| -rw-r--r-- | fbbrowser/fbbrowser.pro | 12 | ||||
| -rw-r--r-- | fbbrowser/fbbrowser.qrc | 5 | ||||
| -rw-r--r-- | fbbrowser/main.cpp | 81 | ||||
| -rwxr-xr-x | fbbrowser/testApp.sh | 8 |
6 files changed, 9 insertions, 104 deletions
diff --git a/fbbrowser/fbbrowser b/fbbrowser/fbbrowser Binary files differdeleted file mode 100755 index 4a622f9..0000000 --- a/fbbrowser/fbbrowser +++ /dev/null diff --git a/fbbrowser/fbbrowser.h b/fbbrowser/fbbrowser.h index 9e06512..9e7c0fd 100644 --- a/fbbrowser/fbbrowser.h +++ b/fbbrowser/fbbrowser.h @@ -6,9 +6,9 @@ #include <QtNetwork> class QWebView; -QT_BEGIN_NAMESPACE +//QT_BEGIN_NAMESPACE //class QLineEdit; -QT_END_NAMESPACE +//QT_END_NAMESPACE class fbbrowser : public QMainWindow { @@ -22,6 +22,9 @@ public: Q_INVOKABLE void quitAll(); private: + // QUrl url; + // QNetworkRequest request; + // QNetworkReply reply; QWebView * view; QNetworkAccessManager * manager; //QApplication * app(int & argc, char ** argv); diff --git a/fbbrowser/fbbrowser.pro b/fbbrowser/fbbrowser.pro deleted file mode 100644 index f3cd992..0000000 --- a/fbbrowser/fbbrowser.pro +++ /dev/null @@ -1,12 +0,0 @@ -TEMPLATE = app -TARGET = fbbrowser -CONFIG += qt debug -QT += core \ - gui \ - webkit \ - network -HEADERS += fbbrowser.h -SOURCES += main.cpp \ - fbbrowser.cpp -FORMS += fbbrowser.ui -RESOURCES += fbbrowser.qrc diff --git a/fbbrowser/fbbrowser.qrc b/fbbrowser/fbbrowser.qrc deleted file mode 100644 index da051a4..0000000 --- a/fbbrowser/fbbrowser.qrc +++ /dev/null @@ -1,5 +0,0 @@ -<!DOCTYPE RCC><RCC version="1.0"> - <qresource> - <file>html/errorPage.html</file> - </qresource> - </RCC> diff --git a/fbbrowser/main.cpp b/fbbrowser/main.cpp deleted file mode 100644 index 1355f6f..0000000 --- a/fbbrowser/main.cpp +++ /dev/null @@ -1,81 +0,0 @@ -#include "fbbrowser.h" - -#include <QtGui> -#include <QApplication> -#include <iostream> -#include <getopt.h> - -void printUsage() -{ - // Prints usage information, incomplete. - // Q: How is the -qws option handled, mention it here or not? - QTextStream qout(stdout); - qout << QObject::tr("Usage: ./fbbrowser [OPTIONS] <URL>") << endl; - qout << QObject::tr("Options:") << endl; - qout << "-h or --help " << QObject::tr("Prints usage information.") << endl; - qout << "-qws " << QObject::tr("Set this application to also be the server application.") << endl; - qout << " " << QObject::tr("Skip this option if you have a QT server application") << endl; - exit(1); -} - -QString getPath(const char* c) -{ - QString appPath = c; - // Locate last '/' in the full path and remove all the chars after it. - appPath.chop(appPath.length() - 1 - - appPath.lastIndexOf("/", appPath.length()-1)); - qDebug() << "Application path: " << appPath; - return appPath; -} - -int main(int argc, char *argv[]) -{ - // Parse command line arguments. - int opt = 1; - int longIndex = 0; - // Declare the short options as a char*, these have exactly one - followed by letter from optString. - // For example: ./fbbrowser -h - // Declare the long options in the const struct, these have two - followed by a string found in longOpts[]. - // Same as: ./fbbrowser --help - // Note: I included 'qws' here to not have errors, when setting fbbrowser to be the server app aswell. - static const char *optString = "hqws"; - static const struct option longOpts[] = - { - // If an option requires parameters, write this number instead of no_argument. - // The last argument, is the corresponding char to the option string. - {"help", no_argument, NULL, 'h'} - }; - // getopt_long returns the index of the next argument to be read, -1 if there are no more arguments. - opt = getopt_long(argc, argv, optString, longOpts, &longIndex); - while (opt != -1) - { - switch(opt) - { - case 'h': - printUsage(); - break; - } - opt = getopt_long(argc, argv, optString, longOpts, &longIndex); - } - // 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())); - // Get the application path. - QString appPath = getPath(argv[0]); - // 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 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(); -} diff --git a/fbbrowser/testApp.sh b/fbbrowser/testApp.sh index 5809507..9d3c2d2 100755 --- a/fbbrowser/testApp.sh +++ b/fbbrowser/testApp.sh @@ -10,12 +10,12 @@ fi sleep 1 # Start the fbbrowser app. # This requires the fbgui git repository to be in the user's home directory. -~/fbgui/fbbrowser/fbbrowser -qws $1 +~/fbgui/fbbrowser/fbgui -qws $1 # Check if fbbrowser is not running, if so kill the qvfb. -if [ $(ps aux | grep -v grep | grep -c fbbrowser) -eq 1 ] +if [ $(ps aux | grep -v grep | grep -c fbgui) -eq 1 ] then - echo "fbbrowser is still running ..." + echo "fbgui is still running ..." else - echo "fbbrowser stopped running, killing qvfb ..." + echo "fbgui stopped running, killing qvfb ..." killall qvfb fi |
