Checkpoint

This commit is contained in:
Leonardo Murillo 2014-01-10 15:18:24 -06:00
parent da2f814b7a
commit 1c2b27f0f4
5 changed files with 16 additions and 20 deletions

View file

@ -19,7 +19,7 @@ set(UVCCAMERACONTROL_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external/UVCCameraCont
if (DEFINED ENV{JOB_ID})
set(BUILD_SEQ $ENV{JOB_ID})
else ()
set(BUILD_SEQ "0")
set(BUILD_SEQ "0.1")
endif ()
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} $ENV{QT_CMAKE_PREFIX_PATH})

View file

@ -89,6 +89,8 @@ const float MIRROR_FULLSCREEN_DISTANCE = 0.35f;
const float MIRROR_REARVIEW_DISTANCE = 0.65f;
const float MIRROR_REARVIEW_BODY_DISTANCE = 2.3f;
const QString CHECK_VERSION_URL = "http://www.google.com";
void messageHandler(QtMsgType type, const QMessageLogContext& context, const QString &message) {
fprintf(stdout, "%s", message.toLocal8Bit().constData());
@ -196,20 +198,21 @@ Application::Application(int& argc, char** argv, timeval &startup_time) :
setOrganizationDomain(applicationInfo.value("organizationDomain").toString());
#ifdef Q_WS_X11
_operatingSystem = "ubuntu";
_operatingSystem = new QString("ubuntu");
#endif
#ifdef Q_WS_WIN
_operatingSystem = "win";
_operatingSystem = new QString("win");
#endif
#ifdef Q_WS_MACX
_operatingSystem = "mac";
_operatingSystem = new QString("mac");
#endif
checkVersion();
qDebug("[VERSION] Build sequence: %s\n", applicationVersion().toStdString().c_str());
qDebug("[OS] %s", _operatingSystem->toStdString().c_str());
_settings = new QSettings(this);
@ -4555,40 +4558,33 @@ void Application::checkVersion() {
void Application::parseVersionXml(QNetworkReply *reply) {
QString _releaseDate;
QString _releaseNotes;
QUrl *_downloadLink;
QXmlStreamReader xml(reply);
while (!xml.atEnd() && !xml.hasError()) {
QXmlStreamReader::TokenType token = xml.readNext();
if (token == QXmlStreamReader::StartElement) {
if (xml.name() == "ReleaseDate") {
xml.readNext();
_releaseDate = xml.text().toString();
}
if (xml.name() == "ReleaseNotes") {
xml.readNext();
_releaseNotes = xml.text().toString();
}
if (xml.name() == "Version") {
xml.readNext();
_latestVersion = new QString(xml.text().toString());
}
}
}
_downloadURL = new QUrl(CHECK_VERSION_URL);
if (!shouldSkipVersion() && applicationVersion() != _latestVersion) {
UpdateDialog *_updateDialog = new UpdateDialog(_glWidget, _releaseNotes);
_updateDialog->exec();
}
_downloadLink = new QUrl("http://www.google.com");
UpdateDialog *_updateDialog = new UpdateDialog(_glWidget, _releaseNotes, _downloadLink);
_updateDialog->exec();
}
QFile *Application::loadSkipFile() {

View file

@ -224,6 +224,7 @@ public:
QString *_latestVersion;
QString *_operatingSystem;
QUrl *_downloadURL;
public slots:
void sendAvatarFaceVideoMessage(int frameCount, const QByteArray& data);

View file

@ -24,10 +24,9 @@ const int dialogHeigth = 300;
const QString dialogTitle = "Update Required";
UpdateDialog::UpdateDialog(QWidget *parent, QString releaseNotes, QUrl *downloadURL) : QDialog(parent, Qt::Dialog) {
UpdateDialog::UpdateDialog(QWidget *parent, QString releaseNotes) : QDialog(parent, Qt::Dialog) {
Application* application = Application::getInstance();
_downloadURL = downloadURL;
const QString updateRequired = QString("You are currently running build %1, the latest build released is %2.\n \
Please download and install the most recent release to access the latest \
@ -73,7 +72,7 @@ UpdateDialog::UpdateDialog(QWidget *parent, QString releaseNotes, QUrl *download
void UpdateDialog::handleDownload() {
Application* application = Application::getInstance();
QDesktopServices::openUrl((*_downloadURL));
QDesktopServices::openUrl(*application->_downloadURL);
application->quit();
}

View file

@ -20,7 +20,7 @@ class UpdateDialog : public QDialog {
Q_OBJECT
public:
UpdateDialog(QWidget*, QString releaseNotes, QUrl *downloadURL);
UpdateDialog(QWidget*, QString releaseNotes);
private:
QLabel *_updateRequired;