diff options
| author | Niklas Goby | 2011-02-22 14:40:04 +0100 |
|---|---|---|
| committer | Niklas Goby | 2011-02-22 14:40:04 +0100 |
| commit | 8fbc4f6ca1ac9d9ed680248a04f00a91f917cf43 (patch) | |
| tree | 80273e70ea61aba1daca22aeb5cb751eac0d9a20 /src/fbbrowser.cpp | |
| parent | Simplified printing of the application path; more cleanup (diff) | |
| download | fbgui-8fbc4f6ca1ac9d9ed680248a04f00a91f917cf43.tar.gz fbgui-8fbc4f6ca1ac9d9ed680248a04f00a91f917cf43.tar.xz fbgui-8fbc4f6ca1ac9d9ed680248a04f00a91f917cf43.zip | |
changes in the fbbrowser class, added some slots for the jsOject and signals in the jsObject
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() { /* |
