diff options
Diffstat (limited to 'src/JSObject.cpp')
| -rw-r--r-- | src/JSObject.cpp | 39 |
1 files changed, 11 insertions, 28 deletions
diff --git a/src/JSObject.cpp b/src/JSObject.cpp index 57fa984..5d29d72 100644 --- a/src/JSObject.cpp +++ b/src/JSObject.cpp @@ -15,41 +15,24 @@ JSObject::JSObject(QWebFrame* qwf) { //------------------------------------------------------------------------------------------------------- JSObject::~JSObject() {} //------------------------------------------------------------------------------------------------------- -void JSObject::enableJavascriptAccess() +void JSObject::attachToDOM() { // Attaches itself to the DOM owner->addToJavaScriptWindowObject(QString("jsObject"), this); - - // connect the signals of the jsObject to the slots of the fbbrowser - QObject::connect(this, SIGNAL(closeBrowser()), this, SLOT(quitAll())); - QObject::connect(this, SIGNAL(startDownload(QString)), this, SLOT(startDownload_Slot(QString))); - QObject::connect(this, SIGNAL(getMacAddress()), this, SLOT(getMacAddress_Slot())); - QObject::connect(this, SIGNAL(showTime()), this, SLOT(showTime_Slot())); - QObject::connect(this, SIGNAL(showHelloWorld()), this, SLOT(showHelloWorld_Slot())); - - // for testing reasons - QObject::connect(this, SIGNAL(showDate()), this, SLOT(showDate_Slot())); - - // TODO: Implement this? - QObject::connect(this, SIGNAL(getIpAddress()), this, SLOT(getIpAddress_Slot())); - QObject::connect(this, SIGNAL(getIntegratedHardwareDevices()), - this, SLOT(getIntegratedHardwareDevices_Slot())); - QObject::connect(this, SIGNAL(getUsbDevices()), this, SLOT(getUsbDevices_Slot())); - QObject::connect(this, SIGNAL(getHardDrives()), this, SLOT(getHardDrives_Slot())); } //------------------------------------------------------------------------------------------------------- -void JSObject::startDownload_Slot(QString filename) +void JSObject::startDownload(QString filename) { emit downloadFile(filename); } //------------------------------------------------------------------------------------------------------- -void JSObject::updateProgressSlot(int i) +void JSObject::updateProgress(int i) { QString code = QString("updateProgress(\%1)").arg(i); owner->evaluateJavaScript(code); } //------------------------------------------------------------------------------------------------------- -void JSObject::getMacAddress_Slot() +void JSObject::getMacAddress() { QNetworkInterface *qNetI = new QNetworkInterface(); QList<QNetworkInterface> list; @@ -68,7 +51,7 @@ void JSObject::getMacAddress_Slot() owner->evaluateJavaScript(code); } //------------------------------------------------------------------------------------------------------- -void JSObject::showTime_Slot() +void JSObject::showTime() { qDebug() << "---- call: showTime_Slot"; QString time = QTime::currentTime().toString("hh:mm:ss"); @@ -79,14 +62,14 @@ void JSObject::showTime_Slot() owner->evaluateJavaScript(code); } //------------------------------------------------------------------------------------------------------- -void JSObject::showDate_Slot() +void JSObject::showDate() { QString date = QDate::currentDate().toString("dd.MM.yyyy"); //TODO:: edit jsFunction name owner->evaluateJavaScript(""); } //------------------------------------------------------------------------------------------------------- -void JSObject::showHelloWorld_Slot() +void JSObject::showHelloWorld() { owner->evaluateJavaScript("alert(\"Hello World\")"); } @@ -107,10 +90,10 @@ void JSObject::getSysInfo(){ */ } //------------------------------------------------------------------------------------------------------- -void JSObject::getIpAddress_Slot(){} +void JSObject::getIpAddress(){} //------------------------------------------------------------------------------------------------------- -void JSObject::getIntegratedHardwareDevices_Slot(){} +void JSObject::getIntegratedHardwareDevices(){} //------------------------------------------------------------------------------------------------------- -void JSObject::getUsbDevices_Slot(){} +void JSObject::getUsbDevices(){} //------------------------------------------------------------------------------------------------------- -void JSObject::getHardDrives_Slot(){} +void JSObject::getHardDrives(){} |
