Drone checks for updated software version at startup

This commit is contained in:
Srivats P 2016-06-07 21:11:38 +05:30
parent 4a2c0066b9
commit cd100aa6e0
3 changed files with 20 additions and 1 deletions

View File

@ -22,6 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
#include "myservice.h"
#include "rpcserver.h"
#include "settings.h"
#include "../common/updater.h"
#include <QMetaType>
@ -32,8 +33,15 @@ extern const char* revision;
Drone::Drone(QObject *parent)
: QObject(parent)
{
Updater *updater = new Updater();
rpcServer = new RpcServer();
service = new MyService();
connect(updater, SIGNAL(newVersionAvailable(QString)),
this, SLOT(onNewVersion(QString)));
updater->checkForNewVersion();
}
Drone::~Drone()
@ -74,3 +82,11 @@ MyService* Drone::rpcService()
{
return service;
}
void Drone::onNewVersion(QString newVersion)
{
qWarning("%s", qPrintable(QString("New Ostinato version %1 available. "
"Visit http://ostinato.org to download").arg(newVersion)));
}

View File

@ -34,6 +34,9 @@ public:
bool init();
MyService* rpcService();
private slots:
void onNewVersion(QString version);
private:
RpcServer *rpcServer;
MyService *service;

View File

@ -1,6 +1,6 @@
TEMPLATE = app
CONFIG += qt ver_info
QT += network script
QT += network script xml
QT -= gui
DEFINES += HAVE_REMOTE WPCAP
linux*:system(grep -q IFLA_STATS64 /usr/include/linux/if_link.h): \