diff options
author | Jonathan Bauer | 2011-03-07 21:20:00 +0100 |
---|---|---|
committer | Jonathan Bauer | 2011-03-07 21:20:00 +0100 |
commit | dad849a0c95aeed383f6ea4b184d7fa46018db0f (patch) | |
tree | daba889e5e14fa2c913161e7600b6a8082bd3ea8 /src/fbgui.cpp | |
parent | Reworked code structure (diff) | |
download | fbgui-dad849a0c95aeed383f6ea4b184d7fa46018db0f.tar.gz fbgui-dad849a0c95aeed383f6ea4b184d7fa46018db0f.tar.xz fbgui-dad849a0c95aeed383f6ea4b184d7fa46018db0f.zip |
first cleanup...
Diffstat (limited to 'src/fbgui.cpp')
-rw-r--r-- | src/fbgui.cpp | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/src/fbgui.cpp b/src/fbgui.cpp index a9e3951..8f6fc88 100644 --- a/src/fbgui.cpp +++ b/src/fbgui.cpp @@ -1,25 +1,41 @@ #include "fbgui.h" -#include "fbbrowser.h" +#include "DownloadManager.h" +#include "JSObject.h" #include <iostream> #include <QUrl> #include <QMap> +#include <QtWebKit> +#include <QApplication> QUrl baseURL; bool debug; fbgui::fbgui(QApplication *parent) { + _parent = parent; /* Browser init. */ - fbbrowser* _fbb = new fbbrowser(); - setWindowFlags(Qt::SplashScreen); - showFullScreen(); - setCentralWidget(_fbb); - + QWebView* webView = new QWebView(this); + webView->load(baseURL); /* Connect fbb with app for killing the app from browser. */ - QObject::connect(_fbb, SIGNAL(killApp()), parent, SLOT(quit())); - // JSO init + /* Init JavaScript interface */ + JSObject* jso = new JSObject(webView->page()->mainFrame()); + + QObject::connect(webView->page()->mainFrame(), SIGNAL(javaScriptWindowObjectCleared()), jso, SLOT(attachToDOM())); + QObject::connect(jso, SIGNAL(signalQuitAll()), parent, SLOT(quit())); + + /* 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(); } |