blob: 5552643cff0428d55171c0578a78e7c74a7db0df (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
#include "fbgui.h"
#include "CommandLineOptions.h"
#include "fbbrowser.h"
#include "DownloadManager.h"
#include <QApplication>
#include <QSettings>
//#include <getopt.h>
//#include <limits.h>
//#include <unistd.h>
void printUsage()
{
// Prints usage information.
// TODO: Complete usage info.
QTextStream qout(stdout);
qout << QObject::tr("Usage: ./fbgui [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);
}
int main(int argc, char *argv[])
{
/* SETTINGS TEST */
//CommandLineOptions clOptions(argc, argv);
// TODO: parse url arg from CommmandLineOptions object.
// hackfix for now...
QUrl url(argv[4]);
QUrl defaultUrl = QUrl("http://132.230.4.3/webkitTest.html");
qDebug() << "URL given: " << url.toString();
/* SETTINGS TEST */
// This is the main object of a QT Application.
QApplication a(argc, argv);
// Get the application path and prints on screen.
qDebug() << "Application Path: " << a.applicationDirPath();
// Is this really needed, since we kill the app through the fbbrowser object?
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()));
// Display the browser.
fbb->show();
// Execute the application.
return a.exec();
}
|