diff options
Diffstat (limited to 'src/fbbrowser.cpp')
| -rw-r--r-- | src/fbbrowser.cpp | 63 |
1 files changed, 62 insertions, 1 deletions
diff --git a/src/fbbrowser.cpp b/src/fbbrowser.cpp index 1048d46..6191466 100644 --- a/src/fbbrowser.cpp +++ b/src/fbbrowser.cpp @@ -58,8 +58,26 @@ fbbrowser::~fbbrowser() // void fbbrowser::addJSObject() { - jsObject *jso = new jsObject(); + jso = new jsObject(); view->page()->mainFrame()->addToJavaScriptWindowObject(QString("jsObject"), jso); + + // connect the signals of the jsObject to the slots of the fbbrowser + connectJsSignalsToSlots(); +} + +void fbbrowser::connectJsSignalsToSlots() +{ + QObject::connect(jso, SIGNAL(closeBrowser()), this, SLOT(quitAll())); + QObject::connect(jso, SIGNAL(startDownload()), this, SLOT(startDownload_Slot())); + QObject::connect(jso, SIGNAL(getMacAddress()), this, SLOT(getMacAddress_Slot())); + QObject::connect(jso, SIGNAL(getIpAddress()), this, SLOT(getIpAddress_Slot())); + QObject::connect(jso, SIGNAL(getIntegratedHardwareDevices()), this, SLOT(getIntegratedHardwareDevices_Slot())); + QObject::connect(jso, SIGNAL(getUsbDevices()), this, SLOT(getUsbDevices_Slot())); + QObject::connect(jso, SIGNAL(getHardDrives()), this, SLOT(getHardDrives_Slot())); + + // for testing reasons + QObject::connect(jso, SIGNAL(showTime()), this, SLOT(showTime_Slot())); + QObject::connect(jso, SIGNAL(showDate()), this, SLOT(showDate_Slot())); } void fbbrowser::writeText(QString text) @@ -78,6 +96,49 @@ void fbbrowser::quitAll() emit signalQuitAll(); } +void fbbrowser::startDownload_Slot() +{ + +} + +void fbbrowser::getMacAddress_Slot() +{ + +} + +void fbbrowser::getIpAddress_Slot() +{ + +} + +void fbbrowser::getIntegratedHardwareDevices_Slot() +{ + +} + +void fbbrowser::getUsbDevices_Slot() +{ + +} + +void fbbrowser::getHardDrives_Slot() +{ + +} + +// for testing reasons +void fbbrowser::showTime_Slot() +{ + QString time = QTime::currentTime().toString("hh:mm:ss"); + view->page()->mainFrame->evaluateJavaScript(/*TODO:: edit jsFunction name*/ ""); +} + +void fbbrowser::showDate_Slot() +{ + QString date = QDate::currentDate().toString("dd.MM.yyyy"); + view->page()->mainFrame->evaluateJavaScript(/*TODO:: edit jsFunction name*/ ""); +} + void fbbrowser::getSysInfo() { /* |
