mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-28 17:54:15 +01:00
OP-955 Moved generated version info to its own lib. Updated code using version info in all referenced places.
This commit is contained in:
parent
76be45242c
commit
62ee55fbb8
@ -1,16 +1,16 @@
|
|||||||
include(../../openpilotgcs.pri)
|
include(../../openpilotgcs.pri)
|
||||||
include(../shared/qtsingleapplication/qtsingleapplication.pri)
|
include(../shared/qtsingleapplication/qtsingleapplication.pri)
|
||||||
include(version_info.pri)
|
|
||||||
|
|
||||||
TEMPLATE = app
|
TEMPLATE = app
|
||||||
TARGET = $$GCS_APP_TARGET
|
TARGET = $$GCS_APP_TARGET
|
||||||
DESTDIR = $$GCS_APP_PATH
|
DESTDIR = $$GCS_APP_PATH
|
||||||
QT += xml
|
QT += xml
|
||||||
SOURCES += main.cpp \
|
SOURCES += main.cpp \
|
||||||
gcssplashscreen.cpp \
|
gcssplashscreen.cpp
|
||||||
version_info.cpp
|
|
||||||
include(../rpath.pri)
|
include(../rpath.pri)
|
||||||
include(../libs/utils/utils.pri)
|
include(../libs/utils/utils.pri)
|
||||||
|
include(../libs/versioninfo/versioninfo.pri)
|
||||||
|
|
||||||
LIBS *= -l$$qtLibraryName(ExtensionSystem) -l$$qtLibraryName(Aggregation)
|
LIBS *= -l$$qtLibraryName(ExtensionSystem) -l$$qtLibraryName(Aggregation)
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "gcssplashscreen.h"
|
#include "gcssplashscreen.h"
|
||||||
|
#include "versioninfo/version_info.h"
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
const QChar CopyrightSymbol(0x00a9);
|
const QChar CopyrightSymbol(0x00a9);
|
||||||
@ -33,20 +34,6 @@ const QChar CopyrightSymbol(0x00a9);
|
|||||||
GCSSplashScreen::GCSSplashScreen() :
|
GCSSplashScreen::GCSSplashScreen() :
|
||||||
QSplashScreen(), m_pixmap(0), m_painter(0)
|
QSplashScreen(), m_pixmap(0), m_painter(0)
|
||||||
{
|
{
|
||||||
QString revision;
|
|
||||||
QString year;
|
|
||||||
#ifdef GCS_REVISION
|
|
||||||
revision = GCS_REVISION;
|
|
||||||
#else
|
|
||||||
revision = tr("N/A");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef GCS_YEAR
|
|
||||||
year = GCS_YEAR;
|
|
||||||
#else
|
|
||||||
year = "2013";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
setWindowFlags(windowFlags());
|
setWindowFlags(windowFlags());
|
||||||
m_pixmap = new QPixmap(":/app/splash.png");
|
m_pixmap = new QPixmap(":/app/splash.png");
|
||||||
|
|
||||||
@ -55,11 +42,11 @@ GCSSplashScreen::GCSSplashScreen() :
|
|||||||
QFont font("Tahoma", 8);
|
QFont font("Tahoma", 8);
|
||||||
m_painter->setFont(font);
|
m_painter->setFont(font);
|
||||||
m_painter->drawText(405, 170, QString(CopyrightSymbol) +
|
m_painter->drawText(405, 170, QString(CopyrightSymbol) +
|
||||||
QString(" 2010-") + year +
|
QString(" 2010-") + VersionInfo::year() +
|
||||||
QString(tr(" The OpenPilot Project - All Rights Reserved")));
|
QString(tr(" The OpenPilot Project - All Rights Reserved")));
|
||||||
|
|
||||||
m_painter->drawText(406, 173, 310, 100, Qt::TextWordWrap|Qt::AlignTop|Qt::AlignLeft,
|
m_painter->drawText(406, 173, 310, 100, Qt::TextWordWrap|Qt::AlignTop|Qt::AlignLeft,
|
||||||
QString(tr("GCS Revision - ")) + revision);
|
QString(tr("GCS Revision - ")) + VersionInfo::revision());
|
||||||
setPixmap(*m_pixmap);
|
setPixmap(*m_pixmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,8 +33,6 @@
|
|||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <extensionsystem/pluginspec.h>
|
#include <extensionsystem/pluginspec.h>
|
||||||
|
|
||||||
#include "../gcs_version_info.h"
|
|
||||||
|
|
||||||
class GCSSplashScreen : public QSplashScreen
|
class GCSSplashScreen : public QSplashScreen
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@ -2,6 +2,7 @@ TEMPLATE = subdirs
|
|||||||
CONFIG += ordered
|
CONFIG += ordered
|
||||||
|
|
||||||
SUBDIRS = \
|
SUBDIRS = \
|
||||||
|
versioninfo \
|
||||||
qscispinbox\
|
qscispinbox\
|
||||||
qtconcurrent \
|
qtconcurrent \
|
||||||
aggregation \
|
aggregation \
|
||||||
|
@ -23,5 +23,5 @@
|
|||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../version_info.h"
|
#include "version_info.h"
|
||||||
#include "../../../../build/openpilotgcs-synthetics/version_info.cpp"
|
#include "../../../../build/openpilotgcs-synthetics/version_info.cpp"
|
1
ground/openpilotgcs/src/libs/versioninfo/versioninfo.pri
Normal file
1
ground/openpilotgcs/src/libs/versioninfo/versioninfo.pri
Normal file
@ -0,0 +1 @@
|
|||||||
|
LIBS *= -l$$qtLibraryName(VersionInfo)
|
@ -1,3 +1,10 @@
|
|||||||
|
TEMPLATE = lib
|
||||||
|
TARGET = VersionInfo
|
||||||
|
|
||||||
|
include(../../openpilotgcslibrary.pri)
|
||||||
|
|
||||||
|
HEADERS = version_info.h
|
||||||
|
|
||||||
#
|
#
|
||||||
# This qmake file generates a version info class implementation.
|
# This qmake file generates a version info class implementation.
|
||||||
#
|
#
|
||||||
@ -34,7 +41,7 @@ PYTHON_DIR = python-2.7.4
|
|||||||
VERSION_INFO_DIR = $$GCS_BUILD_TREE/../openpilotgcs-synthetics
|
VERSION_INFO_DIR = $$GCS_BUILD_TREE/../openpilotgcs-synthetics
|
||||||
VERSION_INFO_SCRIPT = $$ROOT_DIR/make/scripts/version-info.py
|
VERSION_INFO_SCRIPT = $$ROOT_DIR/make/scripts/version-info.py
|
||||||
VERSION_INFO_COMMAND = $$PYTHON \"$$VERSION_INFO_SCRIPT\"
|
VERSION_INFO_COMMAND = $$PYTHON \"$$VERSION_INFO_SCRIPT\"
|
||||||
VERSION_INFO_TEMPLATE = $$GCS_SOURCE_TREE/src/app/version_info.cpp.template
|
VERSION_INFO_TEMPLATE = $$GCS_SOURCE_TREE/src/libs/versioninfo/version_info.cpp.template
|
||||||
VERSION_INFO_FILE = $$VERSION_INFO_DIR/version_info.cpp
|
VERSION_INFO_FILE = $$VERSION_INFO_DIR/version_info.cpp
|
||||||
UAVO_DEF_PATH = $$ROOT_DIR/shared/uavobjectdefinition
|
UAVO_DEF_PATH = $$ROOT_DIR/shared/uavobjectdefinition
|
||||||
|
|
||||||
@ -60,3 +67,7 @@ PYTHON_DIR = python-2.7.4
|
|||||||
}
|
}
|
||||||
QMAKE_EXTRA_TARGETS += version_info_hook
|
QMAKE_EXTRA_TARGETS += version_info_hook
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SOURCES = version_info.cpp
|
||||||
|
|
@ -11,24 +11,24 @@
|
|||||||
* @brief The Core GCS plugin
|
* @brief The Core GCS plugin
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
/*
|
/*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 3 of the License, or
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
* for more details.
|
* for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License along
|
* You should have received a copy of the GNU General Public License along
|
||||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "authorsdialog.h"
|
#include "authorsdialog.h"
|
||||||
|
|
||||||
#include "../../gcs_version_info.h"
|
#include "versioninfo/version_info.h"
|
||||||
#include "coreconstants.h"
|
#include "coreconstants.h"
|
||||||
#include "icore.h"
|
#include "icore.h"
|
||||||
|
|
||||||
@ -43,7 +43,7 @@
|
|||||||
#include <QtGui/QLabel>
|
#include <QtGui/QLabel>
|
||||||
#include <QtGui/QPushButton>
|
#include <QtGui/QPushButton>
|
||||||
#include <QtGui/QTextBrowser>
|
#include <QtGui/QTextBrowser>
|
||||||
|
|
||||||
#include <QtDeclarative/qdeclarative.h>
|
#include <QtDeclarative/qdeclarative.h>
|
||||||
#include <QtDeclarative/qdeclarativeview.h>
|
#include <QtDeclarative/qdeclarativeview.h>
|
||||||
#include <QtDeclarative/qdeclarativeengine.h>
|
#include <QtDeclarative/qdeclarativeengine.h>
|
||||||
@ -62,71 +62,70 @@ AuthorsDialog::AuthorsDialog(QWidget *parent)
|
|||||||
setWindowIcon(QIcon(":/core/images/openpilot_logo_32.png"));
|
setWindowIcon(QIcon(":/core/images/openpilot_logo_32.png"));
|
||||||
setWindowTitle(tr("About OpenPilot"));
|
setWindowTitle(tr("About OpenPilot"));
|
||||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||||
// This loads a QML doc containing a Tabbed view
|
// This loads a QML doc containing a Tabbed view
|
||||||
QDeclarativeView *view = new QDeclarativeView(this);
|
QDeclarativeView *view = new QDeclarativeView(this);
|
||||||
view->setSource(QUrl("qrc:/core/qml/AboutDialog.qml"));
|
view->setSource(QUrl("qrc:/core/qml/AboutDialog.qml"));
|
||||||
|
|
||||||
|
|
||||||
|
QString version = QLatin1String(GCS_VERSION_LONG);
|
||||||
|
version += QDate(2007, 25, 10).toString(Qt::SystemLocaleDate);
|
||||||
|
|
||||||
QString version = QLatin1String(GCS_VERSION_LONG);
|
QString ideRev;
|
||||||
version += QDate(2007, 25, 10).toString(Qt::SystemLocaleDate);
|
|
||||||
|
|
||||||
QString ideRev;
|
|
||||||
#ifdef GCS_REVISION
|
|
||||||
//: This gets conditionally inserted as argument %8 into the description string.
|
|
||||||
ideRev = tr("From revision %1<br/>").arg(QString::fromLatin1(GCS_REVISION_STR).left(10));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef UAVO_HASH
|
// : This gets conditionally inserted as argument %8 into the description string.
|
||||||
//: This gets conditionally inserted as argument %11 into the description string.
|
ideRev = tr("From revision %1<br/>").arg(VersionInfo::revision().left(10));
|
||||||
QByteArray uavoHashArray;
|
|
||||||
QString uavoHash = QString::fromLatin1(Core::Constants::UAVOSHA1_STR);
|
QString uavoHashStr;
|
||||||
uavoHash.chop(2);
|
if (VersionInfo::uavoHash().length() > 15) {
|
||||||
uavoHash.remove(0, 2);
|
// : This gets conditionally inserted as argument %11 into the description string.
|
||||||
uavoHash = uavoHash.trimmed();
|
QByteArray uavoHashArray;
|
||||||
bool ok;
|
QString uavoHash = VersionInfo::uavoHash();
|
||||||
foreach(QString str, uavoHash.split(",")) {
|
uavoHash.chop(2);
|
||||||
uavoHashArray.append(str.toInt(&ok, 16));
|
uavoHash.remove(0, 2);
|
||||||
}
|
uavoHash = uavoHash.trimmed();
|
||||||
QString gcsUavoHashStr;
|
bool ok;
|
||||||
foreach(char i, uavoHashArray) {
|
foreach(QString str, uavoHash.split(",")) {
|
||||||
gcsUavoHashStr.append(QString::number(i, 16).right(2));
|
uavoHashArray.append(str.toInt(&ok, 16));
|
||||||
}
|
}
|
||||||
QString uavoHashStr = gcsUavoHashStr;
|
QString gcsUavoHashStr;
|
||||||
#else
|
foreach(char i, uavoHashArray) {
|
||||||
QString uavoHashStr = "N/A";
|
gcsUavoHashStr.append(QString::number(i, 16).right(2));
|
||||||
#endif
|
}
|
||||||
const QString description = tr(
|
uavoHashStr = gcsUavoHashStr;
|
||||||
"<h3>OpenPilot Ground Control Station</h3>"
|
} else {
|
||||||
"GCS Revision: <b>%1</b><br/>"
|
uavoHashStr = "N/A";
|
||||||
"UAVO Hash: %2<br/>"
|
}
|
||||||
"<br/>"
|
|
||||||
"Built from %3<br/>"
|
const QString description = tr(
|
||||||
"Built on %4 at %5<br/>"
|
"<h3>OpenPilot Ground Control Station</h3>"
|
||||||
"Based on Qt %6 (%7 bit)<br/>"
|
"GCS Revision: <b>%1</b><br/>"
|
||||||
"<br/>"
|
"UAVO Hash: %2<br/>"
|
||||||
"© %8, 2010-%9. All rights reserved.<br/>"
|
"<br/>"
|
||||||
"<br/>"
|
"Built from %3<br/>"
|
||||||
"<small>This program is free software; you can redistribute it and/or modify<br/>"
|
"Built on %4 at %5<br/>"
|
||||||
"it under the terms of the GNU General Public License as published by<br/>"
|
"Based on Qt %6 (%7 bit)<br/>"
|
||||||
"the Free Software Foundation; either version 3 of the License, or<br/>"
|
"<br/>"
|
||||||
"(at your option) any later version.<br/>"
|
"© %8, 2010-%9. All rights reserved.<br/>"
|
||||||
"<br/>"
|
"<br/>"
|
||||||
"The program is provided AS IS with NO WARRANTY OF ANY KIND, "
|
"<small>This program is free software; you can redistribute it and/or modify<br/>"
|
||||||
"INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A "
|
"it under the terms of the GNU General Public License as published by<br/>"
|
||||||
"PARTICULAR PURPOSE.</small>"
|
"the Free Software Foundation; either version 3 of the License, or<br/>"
|
||||||
).arg(
|
"(at your option) any later version.<br/>"
|
||||||
QString::fromLatin1(GCS_REVISION_STR).left(60), // %1
|
"<br/>"
|
||||||
uavoHashStr, // %2
|
"The program is provided AS IS with NO WARRANTY OF ANY KIND, "
|
||||||
QLatin1String(GCS_ORIGIN_STR), // $3
|
"INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A "
|
||||||
QLatin1String(__DATE__), // %4
|
"PARTICULAR PURPOSE.</small>"
|
||||||
QLatin1String(__TIME__), // %5
|
).arg(
|
||||||
QLatin1String(QT_VERSION_STR), // %6
|
VersionInfo::revision().left(60), // %1
|
||||||
QString::number(QSysInfo::WordSize), // %7
|
uavoHashStr, // %2
|
||||||
QLatin1String(GCS_AUTHOR), // %8
|
VersionInfo::origin(), // $3
|
||||||
QLatin1String(GCS_YEAR_STR) // %9
|
QLatin1String(__DATE__), // %4
|
||||||
);
|
QLatin1String(__TIME__), // %5
|
||||||
// Expose the version description to the QML doc
|
QLatin1String(QT_VERSION_STR), // %6
|
||||||
view->rootContext()->setContextProperty("version", description);
|
QString::number(QSysInfo::WordSize), // %7
|
||||||
|
QLatin1String(GCS_AUTHOR), // %8
|
||||||
|
VersionInfo::year() // %9
|
||||||
|
);
|
||||||
|
// Expose the version description to the QML doc
|
||||||
|
view->rootContext()->setContextProperty("version", description);
|
||||||
}
|
}
|
||||||
|
@ -44,31 +44,6 @@ namespace Constants {
|
|||||||
"." STRINGIFY(GCS_VERSION_RELEASE)
|
"." STRINGIFY(GCS_VERSION_RELEASE)
|
||||||
|
|
||||||
const char * const GCS_VERSION_LONG = GCS_VERSION;
|
const char * const GCS_VERSION_LONG = GCS_VERSION;
|
||||||
|
|
||||||
#ifdef GCS_REVISION
|
|
||||||
const char * const GCS_REVISION_STR = GCS_REVISION;
|
|
||||||
#else
|
|
||||||
const char * const GCS_REVISION_STR = "N/A";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef GCS_YEAR
|
|
||||||
const char * const GCS_YEAR_STR = GCS_YEAR;
|
|
||||||
#else
|
|
||||||
const char * const GCS_YEAR_STR = "2013";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef GCS_ORIGIN
|
|
||||||
const char * const GCS_ORIGIN_STR = GCS_ORIGIN;
|
|
||||||
#else
|
|
||||||
const char * const GCS_ORIGIN_STR = "unknown repository";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef UAVO_HASH
|
|
||||||
const char * const UAVOSHA1_STR = STRINGIFY(UAVO_HASH);
|
|
||||||
#else
|
|
||||||
const char * const UAVOSHA1_STR = "";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
const char * const GCS_AUTHOR = "The OpenPilot Project";
|
const char * const GCS_AUTHOR = "The OpenPilot Project";
|
||||||
const char * const GCS_HELP = "http://wiki.openpilot.org";
|
const char * const GCS_HELP = "http://wiki.openpilot.org";
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ QT += declarative \
|
|||||||
|
|
||||||
include(../../openpilotgcsplugin.pri)
|
include(../../openpilotgcsplugin.pri)
|
||||||
include(../../libs/utils/utils.pri)
|
include(../../libs/utils/utils.pri)
|
||||||
|
include(../../libs/versioninfo/versioninfo.pri)
|
||||||
include(../../shared/scriptwrapper/scriptwrapper.pri)
|
include(../../shared/scriptwrapper/scriptwrapper.pri)
|
||||||
include(coreplugin_dependencies.pri)
|
include(coreplugin_dependencies.pri)
|
||||||
|
|
||||||
|
@ -11,23 +11,23 @@
|
|||||||
* @brief The Core GCS plugin
|
* @brief The Core GCS plugin
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
/*
|
/*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 3 of the License, or
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
* for more details.
|
* for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License along
|
* You should have received a copy of the GNU General Public License along
|
||||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "versiondialog.h"
|
#include "versiondialog.h"
|
||||||
|
#include "versioninfo/version_info.h"
|
||||||
#include "coreconstants.h"
|
#include "coreconstants.h"
|
||||||
#include "icore.h"
|
#include "icore.h"
|
||||||
|
|
||||||
@ -59,29 +59,28 @@ VersionDialog::VersionDialog(QWidget *parent)
|
|||||||
QGridLayout *layout = new QGridLayout(this);
|
QGridLayout *layout = new QGridLayout(this);
|
||||||
layout->setSizeConstraint(QLayout::SetFixedSize);
|
layout->setSizeConstraint(QLayout::SetFixedSize);
|
||||||
|
|
||||||
#ifdef UAVO_HASH
|
QString uavoHashStr;
|
||||||
//: This gets conditionally inserted as argument %11 into the description string.
|
if (VersionInfo::uavoHash().length() > 15) {
|
||||||
QByteArray uavoHashArray;
|
// : This gets conditionally inserted as argument %11 into the description string.
|
||||||
QString uavoHash = QString::fromLatin1(Core::Constants::UAVOSHA1_STR);
|
QByteArray uavoHashArray;
|
||||||
uavoHash.chop(2);
|
QString uavoHash = VersionInfo::uavoHash();
|
||||||
uavoHash.remove(0,2);
|
uavoHash.chop(2);
|
||||||
uavoHash=uavoHash.trimmed();
|
uavoHash.remove(0, 2);
|
||||||
bool ok;
|
uavoHash = uavoHash.trimmed();
|
||||||
foreach(QString str,uavoHash.split(","))
|
bool ok;
|
||||||
{
|
foreach(QString str, uavoHash.split(",")) {
|
||||||
uavoHashArray.append(str.toInt(&ok,16));
|
uavoHashArray.append(str.toInt(&ok, 16));
|
||||||
}
|
}
|
||||||
QString gcsUavoHashStr;
|
QString gcsUavoHashStr;
|
||||||
foreach(char i, uavoHashArray)
|
foreach(char i, uavoHashArray) {
|
||||||
{
|
gcsUavoHashStr.append(QString::number(i, 16).right(2));
|
||||||
gcsUavoHashStr.append(QString::number(i,16).right(2));
|
}
|
||||||
}
|
uavoHashStr = gcsUavoHashStr;
|
||||||
QString uavoHashStr = gcsUavoHashStr;
|
} else {
|
||||||
#else
|
uavoHashStr = "N/A";
|
||||||
QString uavoHashStr = "N/A";
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
const QString description = tr(
|
const QString description = tr(
|
||||||
"<h3>OpenPilot Ground Control Station</h3>"
|
"<h3>OpenPilot Ground Control Station</h3>"
|
||||||
"GCS Revision: <b>%1</b><br/>"
|
"GCS Revision: <b>%1</b><br/>"
|
||||||
"UAVO Hash: %2<br/>"
|
"UAVO Hash: %2<br/>"
|
||||||
@ -100,17 +99,17 @@ VersionDialog::VersionDialog(QWidget *parent)
|
|||||||
"The program is provided AS IS with NO WARRANTY OF ANY KIND, "
|
"The program is provided AS IS with NO WARRANTY OF ANY KIND, "
|
||||||
"INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A "
|
"INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A "
|
||||||
"PARTICULAR PURPOSE.</small>"
|
"PARTICULAR PURPOSE.</small>"
|
||||||
).arg(
|
).arg(
|
||||||
QString::fromLatin1(GCS_REVISION_STR).left(60), // %1
|
VersionInfo::revision().left(60), // %1
|
||||||
uavoHashStr, // %2
|
uavoHashStr, // %2
|
||||||
QLatin1String(GCS_ORIGIN_STR), // $3
|
VersionInfo::origin(), // $3
|
||||||
QLatin1String(__DATE__), // %4
|
QLatin1String(__DATE__), // %4
|
||||||
QLatin1String(__TIME__), // %5
|
QLatin1String(__TIME__), // %5
|
||||||
QLatin1String(QT_VERSION_STR), // %6
|
QLatin1String(QT_VERSION_STR), // %6
|
||||||
QString::number(QSysInfo::WordSize), // %7
|
QString::number(QSysInfo::WordSize), // %7
|
||||||
QLatin1String(GCS_AUTHOR), // %8
|
QLatin1String(GCS_AUTHOR), // %8
|
||||||
QLatin1String(GCS_YEAR_STR) // %9
|
VersionInfo::year() // %9
|
||||||
);
|
);
|
||||||
|
|
||||||
QLabel *copyRightLabel = new QLabel(description);
|
QLabel *copyRightLabel = new QLabel(description);
|
||||||
copyRightLabel->setWordWrap(true);
|
copyRightLabel->setWordWrap(true);
|
||||||
@ -118,14 +117,14 @@ VersionDialog::VersionDialog(QWidget *parent)
|
|||||||
copyRightLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
|
copyRightLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
|
||||||
|
|
||||||
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
|
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
|
||||||
QPushButton *closeButton = buttonBox->button(QDialogButtonBox::Close);
|
QPushButton *closeButton = buttonBox->button(QDialogButtonBox::Close);
|
||||||
QTC_ASSERT(closeButton, /**/);
|
QTC_ASSERT(closeButton, /**/);
|
||||||
buttonBox->addButton(closeButton, QDialogButtonBox::ButtonRole(QDialogButtonBox::RejectRole | QDialogButtonBox::AcceptRole));
|
buttonBox->addButton(closeButton, QDialogButtonBox::ButtonRole(QDialogButtonBox::RejectRole | QDialogButtonBox::AcceptRole));
|
||||||
connect(buttonBox , SIGNAL(rejected()), this, SLOT(reject()));
|
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
||||||
|
|
||||||
QLabel *logoLabel = new QLabel;
|
QLabel *logoLabel = new QLabel;
|
||||||
logoLabel->setPixmap(QPixmap(QLatin1String(":/core/images/openpilot_logo_128.png")));
|
logoLabel->setPixmap(QPixmap(QLatin1String(":/core/images/openpilot_logo_128.png")));
|
||||||
layout->addWidget(logoLabel , 0, 0, 1, 1);
|
layout->addWidget(logoLabel, 0, 0, 1, 1);
|
||||||
layout->addWidget(copyRightLabel, 0, 1, 4, 4);
|
layout->addWidget(copyRightLabel, 0, 1, 4, 4);
|
||||||
layout->addWidget(buttonBox, 4, 0, 1, 5);
|
layout->addWidget(buttonBox, 4, 0, 1, 5);
|
||||||
}
|
}
|
||||||
|
@ -29,8 +29,6 @@
|
|||||||
#ifndef VERSIONDIALOG_H
|
#ifndef VERSIONDIALOG_H
|
||||||
#define VERSIONDIALOG_H
|
#define VERSIONDIALOG_H
|
||||||
|
|
||||||
#include "../../gcs_version_info.h"
|
|
||||||
|
|
||||||
#include <QtGui/QDialog>
|
#include <QtGui/QDialog>
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
|
@ -30,8 +30,8 @@
|
|||||||
#include <extensionsystem/iplugin.h>
|
#include <extensionsystem/iplugin.h>
|
||||||
#include "uavobjectutil/uavobjectutilmanager.h"
|
#include "uavobjectutil/uavobjectutilmanager.h"
|
||||||
#include "uavsettingsimportexport_global.h"
|
#include "uavsettingsimportexport_global.h"
|
||||||
#include "../../gcs_version_info.h"
|
|
||||||
#include "uavsettingsimportexportfactory.h"
|
#include "uavsettingsimportexportfactory.h"
|
||||||
|
|
||||||
class UAVSETTINGSIMPORTEXPORT_EXPORT UAVSettingsImportExportPlugin : public ExtensionSystem::IPlugin
|
class UAVSETTINGSIMPORTEXPORT_EXPORT UAVSettingsImportExportPlugin : public ExtensionSystem::IPlugin
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@ -6,6 +6,7 @@ TARGET = UAVSettingsImportExport
|
|||||||
DEFINES += UAVSETTINGSIMPORTEXPORT_LIBRARY
|
DEFINES += UAVSETTINGSIMPORTEXPORT_LIBRARY
|
||||||
include(../../openpilotgcsplugin.pri)
|
include(../../openpilotgcsplugin.pri)
|
||||||
include(uavsettingsimportexport_dependencies.pri)
|
include(uavsettingsimportexport_dependencies.pri)
|
||||||
|
include(../../libs/versioninfo/versioninfo.pri)
|
||||||
|
|
||||||
HEADERS += uavsettingsimportexport.h \
|
HEADERS += uavsettingsimportexport.h \
|
||||||
importsummary.h \
|
importsummary.h \
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QCheckBox>
|
#include <QCheckBox>
|
||||||
#include "importsummary.h"
|
#include "importsummary.h"
|
||||||
|
#include "versioninfo/version_info.h"
|
||||||
|
|
||||||
// for menu item
|
// for menu item
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
@ -244,7 +245,7 @@ QString UAVSettingsImportExportFactory::createXMLDocument(const enum storedData
|
|||||||
fw.setAttribute("tag", board.gitTag);
|
fw.setAttribute("tag", board.gitTag);
|
||||||
versionInfo.appendChild(fw);
|
versionInfo.appendChild(fw);
|
||||||
|
|
||||||
QString gcsRevision = QString::fromLatin1(Core::Constants::GCS_REVISION_STR);
|
QString gcsRevision = VersionInfo::revision();
|
||||||
QString gcsGitDate = gcsRevision.mid(gcsRevision.indexOf(" ") + 1, 14);
|
QString gcsGitDate = gcsRevision.mid(gcsRevision.indexOf(" ") + 1, 14);
|
||||||
QString gcsGitHash = gcsRevision.mid(gcsRevision.indexOf(":") + 1, 8);
|
QString gcsGitHash = gcsRevision.mid(gcsRevision.indexOf(":") + 1, 8);
|
||||||
QString gcsGitTag = gcsRevision.left(gcsRevision.indexOf(":"));
|
QString gcsGitTag = gcsRevision.left(gcsRevision.indexOf(":"));
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
#define UAVSETTINGSIMPORTEXPORTFACTORY_H
|
#define UAVSETTINGSIMPORTEXPORTFACTORY_H
|
||||||
#include "uavsettingsimportexport_global.h"
|
#include "uavsettingsimportexport_global.h"
|
||||||
#include "uavobjectutil/uavobjectutilmanager.h"
|
#include "uavobjectutil/uavobjectutilmanager.h"
|
||||||
#include "../../gcs_version_info.h"
|
|
||||||
class UAVSETTINGSIMPORTEXPORT_EXPORT UAVSettingsImportExportFactory : public QObject
|
class UAVSETTINGSIMPORTEXPORT_EXPORT UAVSettingsImportExportFactory : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@ -3,6 +3,7 @@ TARGET = Uploader
|
|||||||
DEFINES += UPLOADER_LIBRARY
|
DEFINES += UPLOADER_LIBRARY
|
||||||
QT += svg
|
QT += svg
|
||||||
include(uploader_dependencies.pri)
|
include(uploader_dependencies.pri)
|
||||||
|
include(../../libs/versioninfo/versioninfo.pri)
|
||||||
INCLUDEPATH += ../../libs/qextserialport/src
|
INCLUDEPATH += ../../libs/qextserialport/src
|
||||||
macx {
|
macx {
|
||||||
QMAKE_CXXFLAGS += -fpermissive
|
QMAKE_CXXFLAGS += -fpermissive
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
#include "uploadergadgetwidget.h"
|
#include "uploadergadgetwidget.h"
|
||||||
#include "../../gcs_version_info.h"
|
#include "versioninfo/version_info.h"
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include "flightstatus.h"
|
#include "flightstatus.h"
|
||||||
@ -907,7 +907,7 @@ void UploaderGadgetWidget::versionMatchCheck()
|
|||||||
UAVObjectUtilManager *utilMngr = pm->getObject<UAVObjectUtilManager>();
|
UAVObjectUtilManager *utilMngr = pm->getObject<UAVObjectUtilManager>();
|
||||||
deviceDescriptorStruct boardDescription = utilMngr->getBoardDescriptionStruct();
|
deviceDescriptorStruct boardDescription = utilMngr->getBoardDescriptionStruct();
|
||||||
QByteArray uavoHashArray;
|
QByteArray uavoHashArray;
|
||||||
QString uavoHash = QString::fromLatin1(Core::Constants::UAVOSHA1_STR);
|
QString uavoHash = VersionInfo::uavoHash();
|
||||||
uavoHash.chop(2);
|
uavoHash.chop(2);
|
||||||
uavoHash.remove(0,2);
|
uavoHash.remove(0,2);
|
||||||
uavoHash=uavoHash.trimmed();
|
uavoHash=uavoHash.trimmed();
|
||||||
@ -920,7 +920,7 @@ void UploaderGadgetWidget::versionMatchCheck()
|
|||||||
QByteArray fwVersion=boardDescription.uavoHash;
|
QByteArray fwVersion=boardDescription.uavoHash;
|
||||||
if (fwVersion != uavoHashArray) {
|
if (fwVersion != uavoHashArray) {
|
||||||
|
|
||||||
QString gcsDescription = QString::fromLatin1(Core::Constants::GCS_REVISION_STR);
|
QString gcsDescription = VersionInfo::revision();
|
||||||
QString gcsGitHash = gcsDescription.mid(gcsDescription.indexOf(":")+1, 8);
|
QString gcsGitHash = gcsDescription.mid(gcsDescription.indexOf(":")+1, 8);
|
||||||
gcsGitHash.remove( QRegExp("^[0]*") );
|
gcsGitHash.remove( QRegExp("^[0]*") );
|
||||||
QString gcsGitDate = gcsDescription.mid(gcsDescription.indexOf(" ")+1, 14);
|
QString gcsGitDate = gcsDescription.mid(gcsDescription.indexOf(" ")+1, 14);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user