#include "fbgui.h" #include "CommandLineOptions.h" #include "fbbrowser.h" #include "DownloadManager.h" #include #include #include void printUsage() { // Prints usage information. // TODO: Complete usage info. QTextStream qout(stdout); qout << QObject::tr("Usage: ./fbgui [OPTIONS] ") << 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[]) { // This is the main object of a QT Application. QApplication a(argc, argv); /* SETTINGS TEST */ CommandLineOptions clOptions(argc, argv); QUrl url; if (clOptions.contains("url")) { qDebug() << "URL from clOptions is: " << clOptions.value("url"); url = clOptions.value("url"); } else url = QUrl("qrc:/html/errorPage.html"); // TODO: parse url arg from CommmandLineOptions object. /* SETTINGS TEST */ // 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(); }