summaryrefslogtreecommitdiffstats
path: root/src/JSObject.cpp
diff options
context:
space:
mode:
authorJonathan Bauer2011-03-06 14:11:43 +0100
committerJonathan Bauer2011-03-06 14:11:43 +0100
commit697a3dc9fd50de4960d002212d0aeca738cfeb53 (patch)
treee579b3638cdb05803ca18cae8a4e265e1dab1a43 /src/JSObject.cpp
parentURL forward to DownloadManager fixup (diff)
downloadfbgui-697a3dc9fd50de4960d002212d0aeca738cfeb53.tar.gz
fbgui-697a3dc9fd50de4960d002212d0aeca738cfeb53.tar.xz
fbgui-697a3dc9fd50de4960d002212d0aeca738cfeb53.zip
updated JSObject to only mediate functions calls, fbbrowser does all the info fetching etc
Diffstat (limited to 'src/JSObject.cpp')
-rw-r--r--src/JSObject.cpp30
1 files changed, 11 insertions, 19 deletions
diff --git a/src/JSObject.cpp b/src/JSObject.cpp
index e899b5f..5f9c4ab 100644
--- a/src/JSObject.cpp
+++ b/src/JSObject.cpp
@@ -7,7 +7,7 @@
#include "JSObject.h"
#include <QTime>
-#include <QNetworkInterface>
+
//-------------------------------------------------------------------------------------------------------
JSObject::JSObject(QWebFrame *parent) {
_parent = parent;
@@ -43,34 +43,26 @@ void JSObject::updateProgress(int i)
//-------------------------------------------------------------------------------------------------------
void JSObject::getMacAddress()
{
- QNetworkInterface *qNetI = new QNetworkInterface();
- QList<QNetworkInterface> list;
- list=qNetI->allInterfaces();
- QString str;
- QString macAddress;
- for (int i = 0; i < list.size(); ++i) {
- str = list.at(i).name();
- macAddress = list.at(i).hardwareAddress();
- qDebug() << str;
- qDebug() << macAddress;
- }
-
- //TODO:: edit jsFunction name
+ emit getMAC();
+}
+//-------------------------------------------------------------------------------------------------------
+void JSObject::printMAC(QString& macAddress)
+{
QString code = QString("printMacAddress(\"%1\")").arg(macAddress);
_parent->evaluateJavaScript(code);
}
//-------------------------------------------------------------------------------------------------------
void JSObject::showTime()
{
- qDebug() << "---- call: showTime_Slot";
- QString time = QTime::currentTime().toString("hh:mm:ss");
-
- //TODO:: edit jsFunction name
+ emit getTime();
+}
+//-------------------------------------------------------------------------------------------------------
+void JSObject::printTime(QString& time)
+{
QString code;
code = QString("printTime(\"%1\")").arg(time);
_parent->evaluateJavaScript(code);
}
-//-------------------------------------------------------------------------------------------------------
void JSObject::showDate()
{
QString date = QDate::currentDate().toString("dd.MM.yyyy");