#include "fbgui.h" #include "DownloadManager.h" #include "JSObject.h" #include #include #include #include #include QUrl baseURL; QDir downloadDirectory; bool debug; fbgui::fbgui(QApplication *parent) { _parent = parent; /* Browser init. */ QWebView* webView = new QWebView(this); webView->load(baseURL); /* Connect fbb with app for killing the app from browser. */ //QObject::connect(jso, SIGNAL(signalQuitAll()), parent, SLOT(quit())); /* Init JavaScript interface */ JSObject* jso = new JSObject(webView->page()->mainFrame()); QObject::connect(webView->page()->mainFrame(), SIGNAL(javaScriptWindowObjectCleared()), jso, SLOT(attachToDOM())); /* Init Download Manager */ DownloadManager* dm = new DownloadManager(); QObject::connect(jso, SIGNAL(requestFile(QString&)), dm, SLOT(downloadFile(QString&))); QObject::connect(dm, SIGNAL(updateProgress(int)), jso, SLOT(updateProgressBar(int))); setWindowFlags(Qt::SplashScreen); showFullScreen(); setCentralWidget(webView); } void fbgui::quit(){ //parent.quit(); }