mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
1e04aec7fd
commit
230ba7ace8
2 changed files with 19 additions and 0 deletions
|
@ -9,6 +9,10 @@
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
#include <QWebElement>
|
||||||
|
#include <QWebFrame>
|
||||||
|
#include <QWebPage>
|
||||||
|
|
||||||
struct product {
|
struct product {
|
||||||
const char *product;
|
const char *product;
|
||||||
dc_descriptor_t *descriptor;
|
dc_descriptor_t *descriptor;
|
||||||
|
@ -183,6 +187,16 @@ ConfigureDiveComputerDialog::ConfigureDiveComputerDialog(QWidget *parent) :
|
||||||
}
|
}
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
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()
|
ConfigureDiveComputerDialog::~ConfigureDiveComputerDialog()
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#include "../libdivecomputer.h"
|
#include "../libdivecomputer.h"
|
||||||
#include "configuredivecomputer.h"
|
#include "configuredivecomputer.h"
|
||||||
#include <QStyledItemDelegate>
|
#include <QStyledItemDelegate>
|
||||||
|
#include <QWebPage>
|
||||||
|
|
||||||
class GasSpinBoxItemDelegate : public QStyledItemDelegate
|
class GasSpinBoxItemDelegate : public QStyledItemDelegate
|
||||||
{
|
{
|
||||||
|
@ -73,6 +74,8 @@ private slots:
|
||||||
void on_updateFirmwareButton_clicked();
|
void on_updateFirmwareButton_clicked();
|
||||||
|
|
||||||
void on_DiveComputerList_currentRowChanged(int currentRow);
|
void on_DiveComputerList_currentRowChanged(int currentRow);
|
||||||
|
void findVersion();
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::ConfigureDiveComputerDialog ui;
|
Ui::ConfigureDiveComputerDialog ui;
|
||||||
|
@ -99,6 +102,8 @@ private:
|
||||||
|
|
||||||
QString selected_vendor;
|
QString selected_vendor;
|
||||||
QString selected_product;
|
QString selected_product;
|
||||||
|
QWebPage hwVersionPage;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CONFIGUREDIVECOMPUTERDIALOG_H
|
#endif // CONFIGUREDIVECOMPUTERDIALOG_H
|
||||||
|
|
Loading…
Add table
Reference in a new issue