diff options
Diffstat (limited to 'src/JSObject.cpp')
| -rw-r--r-- | src/JSObject.cpp | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/src/JSObject.cpp b/src/JSObject.cpp deleted file mode 100644 index 11f91c6..0000000 --- a/src/JSObject.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/* - * jsObject.cpp - * - * Created on: Feb 1, 2011 - * Author: niklas - */ -#include "fbgui.h" -#include "JSObject.h" -#include "sysInfo.h" - - -//------------------------------------------------------------------------------------------------------- -JSObject::JSObject(QWebFrame *parent) { - // check for better way to use evaluateJavaScript() - _parent = parent; -} -//------------------------------------------------------------------------------------------------------- -JSObject::~JSObject() {} -//------------------------------------------------------------------------------------------------------- -/* TEST */ -QString JSObject::getSysInfo(QString info) -{ - sysInfo si; - if (debug) qDebug() << "Requested info: " << info; - if (debug) qDebug() << "sysInfo output: " << si.getInfo(info); - if (info == QString("time")){ - return si.getInfo(info); - } - if (info == QString("mac")){ - return si.getInfo(info); - //return "MAC_ADDRESS"; - } - else - return "no value"; -} -//------------------------------------------------------------------------------------------------------- -void JSObject::attachToDOM() -{ - // Attaches itself to the DOM - _parent->addToJavaScriptWindowObject(QString("jsObject"), this); -} -//------------------------------------------------------------------------------------------------------- -void JSObject::startDownload(QString filename) -{ - /* return if no filename in input field */ - if (filename.isEmpty()) - { - _parent->evaluateJavaScript("alert(\"No filename!\")"); - return; - } - if (debug) qDebug() << "Request download: " << baseURL.resolved(QUrl(filename)).toString(); - emit requestFile(filename); - -} -//------------------------------------------------------------------------------------------------------- -void JSObject::updateProgressBar(int i) -{ - if (i == 0) - return; - QString code = QString("updateProgress(\%1)").arg(i); - _parent->evaluateJavaScript(code); -} -//------------------------------------------------------------------------------------------------------- - -void JSObject::quitAll() -{ - if (debug) qDebug() << "Quit signal."; - emit signalQuitAll(); -} - |
