diff --git a/ground/openpilotgcs/src/plugins/coreplugin/coreconstants.h b/ground/openpilotgcs/src/plugins/coreplugin/coreconstants.h index 2117843b8..b57a2dbb5 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/coreconstants.h +++ b/ground/openpilotgcs/src/plugins/coreplugin/coreconstants.h @@ -35,8 +35,6 @@ namespace Constants { #define GCS_VERSION_MAJOR 1 #define GCS_VERSION_MINOR 0 #define GCS_VERSION_RELEASE 0 -const char * const GCS_VERSION_TYPE = "Alpha"; -const char * const GCS_VERSION_CODENAME = "Pascal"; #define STRINGIFY_INTERNAL(x) #x #define STRINGIFY(x) STRINGIFY_INTERNAL(x) @@ -46,18 +44,34 @@ const char * const GCS_VERSION_CODENAME = "Pascal"; "." STRINGIFY(GCS_VERSION_RELEASE) const char * const GCS_VERSION_LONG = GCS_VERSION; -const char * const GCS_AUTHOR = "OpenPilot Project"; -const char * const GCS_YEAR = "2012"; -const char * const GCS_HELP = "http://wiki.openpilot.org"; #ifdef GCS_REVISION -const char * const GCS_REVISION_STR = STRINGIFY(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 GCS_REVISION_STR = ""; const char * const UAVOSHA1_STR = ""; #endif +const char * const GCS_AUTHOR = "The OpenPilot Project"; +const char * const GCS_HELP = "http://wiki.openpilot.org"; + #undef GCS_VERSION #undef STRINGIFY #undef STRINGIFY_INTERNAL diff --git a/ground/openpilotgcs/src/plugins/coreplugin/versiondialog.cpp b/ground/openpilotgcs/src/plugins/coreplugin/versiondialog.cpp index 70a125d3b..6beb36570 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/versiondialog.cpp +++ b/ground/openpilotgcs/src/plugins/coreplugin/versiondialog.cpp @@ -59,16 +59,7 @@ VersionDialog::VersionDialog(QWidget *parent) QGridLayout *layout = new QGridLayout(this); layout->setSizeConstraint(QLayout::SetFixedSize); - QString version = QLatin1String(GCS_VERSION_LONG); - 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
").arg(QString::fromLatin1(GCS_REVISION_STR).left(60)); -#endif - QString uavoHashStr; - #ifdef UAVO_HASH +#ifdef UAVO_HASH //: This gets conditionally inserted as argument %11 into the description string. QByteArray uavoHashArray; QString uavoHash = QString::fromLatin1(Core::Constants::UAVOSHA1_STR); @@ -85,31 +76,41 @@ VersionDialog::VersionDialog(QWidget *parent) { gcsUavoHashStr.append(QString::number(i,16).right(2)); } - uavoHashStr = tr("UAVO hash %1
").arg(gcsUavoHashStr); - #endif + QString uavoHashStr = gcsUavoHashStr; +#else + QString uavoHashStr = "N/A"; +#endif const QString description = tr( - "

OpenPilot GCS %1 %9 (%10)

" - "Based on Qt %2 (%3 bit)
" + "

OpenPilot Ground Control Station

" + "GCS Revision: %1
" + "UAVO Hash: %2
" "
" - "Built on %4 at %5
" + "Built from %3
" + "Built on %4 at %5
" + "Based on Qt %6 (%7 bit)
" "
" - "%8" + "© %8, 2010-%9. All rights reserved.
" "
" - "%11" + "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
" + "the Free Software Foundation; either version 3 of the License, or
" + "(at your option) any later version.
" "
" - "Copyright 2010-%6 %7. All rights reserved.
" - "
" - "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
" - "the Free Software Foundation; either version 3 of the License, or
" - "(at your option) any later version.

" "The program is provided AS IS with NO WARRANTY OF ANY KIND, " "INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A " - "PARTICULAR PURPOSE.

") - .arg(version, QLatin1String(QT_VERSION_STR), QString::number(QSysInfo::WordSize), - QLatin1String(__DATE__), QLatin1String(__TIME__), QLatin1String(GCS_YEAR), - (QLatin1String(GCS_AUTHOR)), ideRev).arg(QLatin1String(GCS_VERSION_TYPE), QLatin1String(GCS_VERSION_CODENAME), uavoHashStr); + "PARTICULAR PURPOSE.
" + ).arg( + QString::fromLatin1(GCS_REVISION_STR).left(60), // %1 + uavoHashStr, // %2 + QLatin1String(GCS_ORIGIN_STR), // $3 + QLatin1String(__DATE__), // %4 + QLatin1String(__TIME__), // %5 + QLatin1String(QT_VERSION_STR), // %6 + QString::number(QSysInfo::WordSize), // %7 + QLatin1String(GCS_AUTHOR), // %8 + QLatin1String(GCS_YEAR_STR) // %9 + ); QLabel *copyRightLabel = new QLabel(description); copyRightLabel->setWordWrap(true); diff --git a/make/templates/gcsversioninfotemplate.h b/make/templates/gcsversioninfotemplate.h index 7b7dc8100..04d45d580 100644 --- a/make/templates/gcsversioninfotemplate.h +++ b/make/templates/gcsversioninfotemplate.h @@ -25,8 +25,16 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#define GCS_REVISION ${TAG_OR_BRANCH}:${HASH8}${DIRTY} ${DATETIME} -#define UAVO_HASH "{ ${UAVOSHA1} }" +#ifndef _GCSVERSIONINFO_H +#define _GCSVERSIONINFO_H + +#define GCS_REVISION "${REVISION}" +#define GCS_YEAR "${YEAR}" +#define GCS_ORIGIN "${ORIGIN}" +#define UAVO_HASH "{ ${UAVOSHA1} }" + +#endif // _GCSVERSIONINFO_H + /** * @} */