summaryrefslogtreecommitdiffstats
path: root/src/javascriptinterface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/javascriptinterface.cpp')
-rw-r--r--src/javascriptinterface.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/javascriptinterface.cpp b/src/javascriptinterface.cpp
index 18949ae..b480635 100644
--- a/src/javascriptinterface.cpp
+++ b/src/javascriptinterface.cpp
@@ -178,10 +178,8 @@ void JavascriptInterface::reboot() {
*
* @todo add some more informations
*/
-void JavascriptInterface::downloadInfo(const QString& filename,
- const double& filesize) {
- QString code = QString("downloadInfo('\%1', \%2)").arg(filename).arg(
- filesize);
+void JavascriptInterface::downloadInfo(const QString& filename, const double& filesize) {
+ QString code = QString("downloadInfo('\%1', \%2)").arg(filename).arg(filesize);
_parent->evaluateJavaScript(code);
}
//-------------------------------------------------------------------------------------------------------
@@ -193,12 +191,11 @@ void JavascriptInterface::downloadInfo(const QString& filename,
*
* @todo add some more informations
*/
-void JavascriptInterface::updateProgressBar(const int& percent,
- const double& speed, const QString& unit) {
+void JavascriptInterface::updateProgressBar(const int& percent, const double& speed,
+ const QString& unit) {
if (percent == 0)
return;
- QString code = QString("updateProgress(\%1, \%2, '\%3')").arg(percent).arg(
- speed).arg(unit);
+ QString code = QString("updateProgress(\%1, \%2, '\%3')").arg(percent).arg(speed).arg(unit);
_parent->evaluateJavaScript(code);
}
//-------------------------------------------------------------------------------------------------------
@@ -223,7 +220,7 @@ void JavascriptInterface::callbackOnFinished() {
//-------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------
/**
- * This method triggers the arriving of the IP address
+ * This method triggers the arriving of the IP address *FOR TESTING PURPOSES*
*
* Used for testing. This method triggers the arriving of the IP address.
* Not needed in the final version since the here simulated event will be
@@ -244,3 +241,8 @@ void JavascriptInterface::trigger() {
}
file.close();
}
+//-------------------------------------------------------------------------------------------------------
+void JavascriptInterface::alert(const QString& message) {
+ // expects a formatted message.
+ _parent->evaluateJavaScript(QString("alert(").append(message));
+}