summaryrefslogtreecommitdiffstats
path: root/qt-ui/configuredivecomputerdialog.cpp
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2014-12-26 22:39:53 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-12-27 07:14:31 -0800
commit230ba7ace8fe274f0130a9b25fa532ceb39ecbdd (patch)
treeb1d9fa81c2a49c1eb8a1510aef09dd30fced61b2 /qt-ui/configuredivecomputerdialog.cpp
parent1e04aec7fd46afc2c922f6d019e0344f0e1f4fa1 (diff)
downloadsubsurface-230ba7ace8fe274f0130a9b25fa532ceb39ecbdd.tar.gz
Read current version from H&W web page
This is only partial. It prints the current version string (to be processed by a regex) via qDebug(). Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/configuredivecomputerdialog.cpp')
-rw-r--r--qt-ui/configuredivecomputerdialog.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/qt-ui/configuredivecomputerdialog.cpp b/qt-ui/configuredivecomputerdialog.cpp
index ce25d0ee3..67f79a778 100644
--- a/qt-ui/configuredivecomputerdialog.cpp
+++ b/qt-ui/configuredivecomputerdialog.cpp
@@ -9,6 +9,10 @@
#include <QFileDialog>
#include <QMessageBox>
#include <QSettings>
+#include <QWebElement>
+#include <QWebFrame>
+#include <QWebPage>
+
struct product {
const char *product;
dc_descriptor_t *descriptor;
@@ -183,6 +187,16 @@ ConfigureDiveComputerDialog::ConfigureDiveComputerDialog(QWidget *parent) :
}
settings.endGroup();
settings.endGroup();
+
+ hwVersionPage.mainFrame()->load(QUrl("http://www.heinrichsweikamp.com/?id=162"));
+ connect(&hwVersionPage, SIGNAL(loadFinished(bool)), this, SLOT(findVersion()));
+}
+
+void ConfigureDiveComputerDialog::findVersion()
+{
+ QWebElement parse = hwVersionPage.mainFrame()->documentElement();
+ QWebElement result = parse.findFirst("div[id=content_firmware_headline_typ0]");
+ qDebug() << "Version" << result.toPlainText();
}
ConfigureDiveComputerDialog::~ConfigureDiveComputerDialog()