summaryrefslogtreecommitdiffstats
path: root/src/javascriptInterface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/javascriptInterface.cpp')
-rw-r--r--src/javascriptInterface.cpp60
1 files changed, 0 insertions, 60 deletions
diff --git a/src/javascriptInterface.cpp b/src/javascriptInterface.cpp
deleted file mode 100644
index a15cf8d..0000000
--- a/src/javascriptInterface.cpp
+++ /dev/null
@@ -1,60 +0,0 @@
-#include "fbgui.h"
-#include "javascriptInterface.h"
-#include "sysInfo.h"
-
-
-//-------------------------------------------------------------------------------------------------------
-javascriptInterface::javascriptInterface(QWebFrame *parent){
- qxtLog->debug() << "Initializing javascript interface...";
- _parent = parent;
-}
-//-------------------------------------------------------------------------------------------------------
-javascriptInterface::~javascriptInterface() {}
-//-------------------------------------------------------------------------------------------------------
-const QString javascriptInterface::getSysInfo(const QString& info){
- sysInfo si;
- return si.getInfo(info);
-}
-//-------------------------------------------------------------------------------------------------------
-void javascriptInterface::attachToDOM(){
- _parent->addToJavaScriptWindowObject(QString("fbgui"), this);
-}
-//-------------------------------------------------------------------------------------------------------
-void javascriptInterface::startDownload(const QString& filename){
- // ignore if empty filename
- if (filename.isEmpty()){
- _parent->evaluateJavaScript("alert(\"No filename!\")");
- return;
- }
- emit requestFile(filename);
-}
-//-------------------------------------------------------------------------------------------------------
-void javascriptInterface::downloadInfo(const QString& filename, const double& filesize){
- QString code = QString("downloadInfo('\%1', \%2)").arg(filename).arg(filesize);
- _parent->evaluateJavaScript(code);
-}
-//-------------------------------------------------------------------------------------------------------
-void javascriptInterface::notify(const QString& msg){
-
- QString code = QString("notify('\%1')").arg(msg);
- _parent->evaluateJavaScript(code);
-}
-//-------------------------------------------------------------------------------------------------------
-void javascriptInterface::updateProgressBar(const int& percent, const double& speed, const QString& unit){
- if (percent == 0) return;
- QString code = QString("updateProgress(\%1, \%2, '\%3')").arg(percent).arg(speed).arg(unit);
- _parent->evaluateJavaScript(code);
-}
-//-------------------------------------------------------------------------------------------------------
-void javascriptInterface::setCallbackOnDlQueueFinished(QString& jsFunction){
- _callBackOnDownloadsFinished = jsFunction;
-}
-//-------------------------------------------------------------------------------------------------------
-void javascriptInterface::callbackOnDlQueueFinished(){
- QString code = QString("\%1").arg(_callBackOnDownloadsFinished);
- _parent->evaluateJavaScript(code);
-}
-//-------------------------------------------------------------------------------------------------------
-void javascriptInterface::quit(){
- emit quitFbgui();
-}