From 8fbc4f6ca1ac9d9ed680248a04f00a91f917cf43 Mon Sep 17 00:00:00 2001 From: Niklas Goby Date: Tue, 22 Feb 2011 14:40:04 +0100 Subject: changes in the fbbrowser class, added some slots for the jsOject and signals in the jsObject --- src/fbbrowser.cpp | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 62 insertions(+), 1 deletion(-) (limited to 'src/fbbrowser.cpp') 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() { /* -- cgit v1.2.3-55-g7522