From 0e55f3c74dda329f3723f28deca2a437340ed1e0 Mon Sep 17 00:00:00 2001 From: Fredrik Arvidsson Date: Sat, 24 Nov 2012 14:55:46 +0100 Subject: [PATCH 01/12] OP-723 Changed default locale to English. Updated default configuration files to have tag set to en_US. --- .../default_configurations/OpenPilotGCS.xml | 2 +- .../OpenPilotGCS_wide.xml | 1 + ground/openpilotgcs/src/app/main.cpp | 5 ++ .../coreplugin/dialogs/importsettings.cpp | 32 +++++----- .../coreplugin/dialogs/importsettings.h | 6 +- .../src/plugins/coreplugin/mainwindow.cpp | 58 +++++++++---------- 6 files changed, 53 insertions(+), 51 deletions(-) diff --git a/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS.xml b/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS.xml index 3c79bd742..619c00b9e 100644 --- a/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS.xml +++ b/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS.xml @@ -6,7 +6,7 @@ Default configuration
Default configuration built to work on all screen sizes
false - en_AU + en_US true 700 800 diff --git a/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS_wide.xml b/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS_wide.xml index c79ffd3ed..4e344fcf1 100644 --- a/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS_wide.xml +++ b/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS_wide.xml @@ -8,6 +8,7 @@ true 700 800 + en_US false Wide configuration
Default configuration built for wide screens (17"up)
diff --git a/ground/openpilotgcs/src/app/main.cpp b/ground/openpilotgcs/src/app/main.cpp index 9d4010165..a5fe5ca8a 100644 --- a/ground/openpilotgcs/src/app/main.cpp +++ b/ground/openpilotgcs/src/app/main.cpp @@ -241,6 +241,11 @@ int main(int argc, char **argv) #ifdef Q_OS_LINUX QApplication::setAttribute(Qt::AA_X11InitThreads, true); #endif + + //Set the default locale to EN, if this is not set the system locale will be used + //and as of now we dont want that behaviour. + QLocale::setDefault(QLocale::English); + QApplication::setGraphicsSystem("raster"); SharedTools::QtSingleApplication app((QLatin1String(appNameC)), argc, argv); diff --git a/ground/openpilotgcs/src/plugins/coreplugin/dialogs/importsettings.cpp b/ground/openpilotgcs/src/plugins/coreplugin/dialogs/importsettings.cpp index c48f5a6a6..715b95e88 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/dialogs/importsettings.cpp +++ b/ground/openpilotgcs/src/plugins/coreplugin/dialogs/importsettings.cpp @@ -10,47 +10,47 @@ importSettings::importSettings(QWidget *parent) : ui(new Ui::importSettings) { ui->setupUi(this); - connect(ui->cbConfigs,SIGNAL(currentIndexChanged(int)),this,SLOT(updateDetails(int))); - connect(ui->btnLoad,SIGNAL(clicked()),this,SLOT(accept())); - QTimer::singleShot(500,this,SLOT(repaint())); + connect(ui->cbConfigs, SIGNAL(currentIndexChanged(int)), this, SLOT(updateDetails(int))); + connect(ui->btnLoad, SIGNAL(clicked()), this, SLOT(accept())); + QTimer::singleShot(500, this, SLOT(repaint())); } + void importSettings::loadFiles(QString path) { QDir myDir(path); QStringList filters; filters << "*.xml"; QStringList list = myDir.entryList(filters,QDir::Files); - int x=0; - foreach(QString fileStr, list) - { - fileInfo * info=new fileInfo; - QSettings settings(path+QDir::separator()+fileStr, XmlConfig::XmlSettingsFormat); + int x = 0; + foreach(QString fileStr, list) { + fileInfo *info = new fileInfo; + QSettings settings(path+QDir::separator() + fileStr, XmlConfig::XmlSettingsFormat); settings.beginGroup("General"); - info->description=settings.value("Description","None").toString(); - info->details=settings.value("Details","None").toString(); + info->description = settings.value("Description", "None").toString(); + info->details = settings.value("Details", "None").toString(); settings.endGroup(); - info->file=path+QDir::separator()+fileStr; + info->file = path + QDir::separator() + fileStr; configList.insert(x,info); - ui->cbConfigs->addItem(info->description,x); + ui->cbConfigs->addItem(info->description, x); ++x; } } void importSettings::updateDetails(int index) { - fileInfo * info=configList.value(ui->cbConfigs->itemData(index).toInt()); + fileInfo *info = configList.value(ui->cbConfigs->itemData(index).toInt()); ui->lblDetails->setText(info->details); } + QString importSettings::choosenConfig() { - fileInfo * info=configList.value(ui->cbConfigs->itemData(ui->cbConfigs->currentIndex()).toInt()); + fileInfo *info = configList.value(ui->cbConfigs->itemData(ui->cbConfigs->currentIndex()).toInt()); return info->file; } importSettings::~importSettings() { - foreach(fileInfo * info,configList.values()) - { + foreach(fileInfo * info,configList.values()) { delete info; } delete ui; diff --git a/ground/openpilotgcs/src/plugins/coreplugin/dialogs/importsettings.h b/ground/openpilotgcs/src/plugins/coreplugin/dialogs/importsettings.h index 58e5e8e44..8bf5f303f 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/dialogs/importsettings.h +++ b/ground/openpilotgcs/src/plugins/coreplugin/dialogs/importsettings.h @@ -1,3 +1,4 @@ + #ifndef IMPORTSETTINGS_H #define IMPORTSETTINGS_H @@ -10,8 +11,7 @@ class importSettings; class importSettings : public QDialog { Q_OBJECT - struct fileInfo - { + struct fileInfo { QString file; QString description; QString details; @@ -23,9 +23,11 @@ public: void loadFiles(QString path); QString choosenConfig(); + private: Ui::importSettings *ui; QMap configList; + private slots: void updateDetails(int); }; diff --git a/ground/openpilotgcs/src/plugins/coreplugin/mainwindow.cpp b/ground/openpilotgcs/src/plugins/coreplugin/mainwindow.cpp index dc74094a5..ff71ce839 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/mainwindow.cpp +++ b/ground/openpilotgcs/src/plugins/coreplugin/mainwindow.cpp @@ -266,18 +266,15 @@ void MainWindow::modeChanged(Core::IMode */*mode*/) void MainWindow::extensionsInitialized() { - - QSettings* qs = m_settings; - QSettings * settings; + QSettings *qs = m_settings; + QSettings *settings; QString commandLine; - if ( ! qs->allKeys().count() ){ - foreach(QString str,qApp->arguments()) - { - if(str.contains("configfile")) - { - qDebug()<<"ass"; - commandLine=str.split("=").at(1); - qDebug()<allKeys().count() ) { + foreach(QString str, qApp->arguments()) { + if(str.contains("configfile")) { + qDebug() << "ass"; + commandLine = str.split("=").at(1); + qDebug() << commandLine; } } QDir directory(QCoreApplication::applicationDirPath()); @@ -289,37 +286,34 @@ void MainWindow::extensionsInitialized() directory.cd("share"); directory.cd("openpilotgcs"); #endif - directory.cd("default_configurations"); + directory.cd("default_configurations"); - qDebug() << "Looking for default config files in: " + directory.absolutePath(); - bool showDialog=true; + qDebug() << "Looking for default config files in: " + directory.absolutePath(); + bool showDialog = true; QString filename; - if(!commandLine.isEmpty()) - { - if(QFile::exists(directory.absolutePath()+QDir::separator()+commandLine)) - { - filename=directory.absolutePath()+QDir::separator()+commandLine; - qDebug()<<"Load configuration from command line"; - settings=new QSettings(filename, XmlConfig::XmlSettingsFormat); - showDialog=false; + if(!commandLine.isEmpty()) { + if(QFile::exists(directory.absolutePath() + QDir::separator()+commandLine)) { + filename = directory.absolutePath() + QDir::separator()+commandLine; + qDebug() << "Load configuration from command line"; + settings = new QSettings(filename, XmlConfig::XmlSettingsFormat); + showDialog = false; } } - if(showDialog) - { - importSettings * dialog=new importSettings(this); + if(showDialog) { + importSettings *dialog = new importSettings(this); dialog->loadFiles(directory.absolutePath()); dialog->exec(); - filename=dialog->choosenConfig(); - settings=new QSettings(filename, XmlConfig::XmlSettingsFormat); + filename = dialog->choosenConfig(); + settings = new QSettings(filename, XmlConfig::XmlSettingsFormat); delete dialog; } - qs=settings; - qDebug() << "Load default config from resource "<beginGroup("General"); - m_config_description=qs->value("Description","none").toString(); - m_config_details=qs->value("Details","none").toString(); - m_config_stylesheet=qs->value("StyleSheet","none").toString(); + m_config_description=qs->value("Description", "none").toString(); + m_config_details=qs->value("Details", "none").toString(); + m_config_stylesheet=qs->value("StyleSheet", "none").toString(); loadStyleSheet(m_config_stylesheet); qs->endGroup(); m_uavGadgetInstanceManager = new UAVGadgetInstanceManager(this); From 67fe7a5e04f1fbeb53eee5616a327264775ddd97 Mon Sep 17 00:00:00 2001 From: Fredrik Arvidsson Date: Sat, 24 Nov 2012 22:48:32 +0100 Subject: [PATCH 02/12] OP-723 Changed from ISO locale 'en_US' to Qt special locale 'C'. --- .../share/openpilotgcs/default_configurations/OpenPilotGCS.xml | 2 +- .../openpilotgcs/default_configurations/OpenPilotGCS_wide.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS.xml b/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS.xml index 619c00b9e..cb549aff9 100644 --- a/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS.xml +++ b/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS.xml @@ -6,7 +6,7 @@ Default configuration
Default configuration built to work on all screen sizes
false - en_US + C true 700 800 diff --git a/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS_wide.xml b/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS_wide.xml index 4e344fcf1..170f5a732 100644 --- a/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS_wide.xml +++ b/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS_wide.xml @@ -8,7 +8,7 @@ true 700 800 - en_US + C false Wide configuration
Default configuration built for wide screens (17"up)
From fb153fa6696e3741ba6271eca2f06086593f9f2a Mon Sep 17 00:00:00 2001 From: Oleg Semyonov Date: Sat, 1 Dec 2012 20:54:38 +0200 Subject: [PATCH 03/12] [OP-685] Hide the debug window in the GCS by default Currently GCS prints in the debug window too many messages confusing users. Until it is fixed (so only important messages are printed) the debug windows is removed from default GCS configurations. It still is available as a widget and can be added to a GCS workspace. It is better than hide it using options checkbox (as suggested in OP-685) and keep empty window frame. --- .../default_configurations/OpenPilotGCS.xml | 23 ++++++------------- .../OpenPilotGCS_wide.xml | 23 ++++++------------- 2 files changed, 14 insertions(+), 32 deletions(-) diff --git a/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS.xml b/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS.xml index 3c79bd742..abc5f524a 100644 --- a/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS.xml +++ b/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS.xml @@ -2592,27 +2592,18 @@ - - LoggingGadget - uavGadget - - - GpsDisplayGadget - - Flight GPS - - uavGadget - - 2 - @Variant(AAAACQAAAAIAAAACAAAAcAAAAAIAAAHo) - splitter + LoggingGadget + uavGadget - DebugGadget + GpsDisplayGadget + + Flight GPS + uavGadget 2 - @Variant(AAAACQAAAAIAAAACAAAB3wAAAAIAAAEp) + @Variant(AAAACQAAAAIAAAACAAAAVAAAAAIAAAGu) splitter 1 diff --git a/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS_wide.xml b/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS_wide.xml index c79ffd3ed..c1c3b5a68 100644 --- a/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS_wide.xml +++ b/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS_wide.xml @@ -2604,27 +2604,18 @@ - - LoggingGadget - uavGadget - - - GpsDisplayGadget - - Flight GPS - - uavGadget - - 2 - @Variant(AAAACQAAAAIAAAACAAAAcAAAAAIAAAHo) - splitter + LoggingGadget + uavGadget - DebugGadget + GpsDisplayGadget + + Flight GPS + uavGadget 2 - @Variant(AAAACQAAAAIAAAACAAAB3wAAAAIAAAEp) + @Variant(AAAACQAAAAIAAAACAAAAVAAAAAIAAAGu) splitter 1 From 903bbffc6b48d5559bdc9afcc8c33a16e093c20d Mon Sep 17 00:00:00 2001 From: a*morale Date: Tue, 27 Nov 2012 23:30:11 +0100 Subject: [PATCH 04/12] Changed reference to PipXtreme to OPLink on config tab and Firmware tab/OP-750 --- ground/openpilotgcs/src/plugins/config/configgadgetwidget.cpp | 2 +- .../src/plugins/uavobjectutil/devicedescriptorstruct.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/configgadgetwidget.cpp b/ground/openpilotgcs/src/plugins/config/configgadgetwidget.cpp index 8f1310c82..ab2c722c8 100644 --- a/ground/openpilotgcs/src/plugins/config/configgadgetwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configgadgetwidget.cpp @@ -278,7 +278,7 @@ void ConfigGadgetWidget::updatePipXStatus(UAVObject *object) icon->addFile(":/configgadget/images/pipx-selected.png", QSize(), QIcon::Selected, QIcon::Off); QWidget *qwd = new ConfigPipXtremeWidget(this); - ftw->insertTab(ConfigGadgetWidget::pipxtreme, qwd, *icon, QString("PipXtreme")); + ftw->insertTab(ConfigGadgetWidget::pipxtreme, qwd, *icon, QString("OPLink")); pipxConnected = true; } } diff --git a/ground/openpilotgcs/src/plugins/uavobjectutil/devicedescriptorstruct.h b/ground/openpilotgcs/src/plugins/uavobjectutil/devicedescriptorstruct.h index 886ebe649..dfb158189 100644 --- a/ground/openpilotgcs/src/plugins/uavobjectutil/devicedescriptorstruct.h +++ b/ground/openpilotgcs/src/plugins/uavobjectutil/devicedescriptorstruct.h @@ -22,7 +22,7 @@ public: return QString("OpenPilot INS"); break; case 0x0301://PipX - return QString("PipXtreme"); + return QString("OPLink"); break; case 0x0401://Coptercontrol return QString("CopterControl"); From 43f5bf09c2e921a622b65679aea873e6bbe6845f Mon Sep 17 00:00:00 2001 From: a*morale Date: Sat, 1 Dec 2012 17:26:22 +0100 Subject: [PATCH 05/12] Changed missing PipX labels for setup wizard --- .../src/plugins/setupwizard/pages/controllerpage.cpp | 2 +- ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/controllerpage.cpp b/ground/openpilotgcs/src/plugins/setupwizard/pages/controllerpage.cpp index deed9d6eb..7601fff62 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/controllerpage.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/controllerpage.cpp @@ -123,7 +123,7 @@ void ControllerPage::setupBoardTypes() ui->boardTypeCombo->addItem(tr("OpenPilot CopterControl 3D"), SetupWizard::CONTROLLER_CC3D); ui->boardTypeCombo->addItem(tr("OpenPilot Revolution"), SetupWizard::CONTROLLER_REVO); //ui->boardTypeCombo->model()->setData(ui->boardTypeCombo->model()->index(ui->boardTypeCombo->count() - 1, 0), v, Qt::UserRole - 1); - ui->boardTypeCombo->addItem(tr("OpenPilot PipX Radio Modem"), SetupWizard::CONTROLLER_PIPX); + ui->boardTypeCombo->addItem(tr("OpenPilot OPLink Radio Modem"), SetupWizard::CONTROLLER_PIPX); //ui->boardTypeCombo->model()->setData(ui->boardTypeCombo->model()->index(ui->boardTypeCombo->count() - 1, 0), v, Qt::UserRole - 1); } diff --git a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp index c0061d83d..3e6b6916b 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp @@ -148,7 +148,7 @@ QString SetupWizard::getSummaryText() summary.append(tr("OpenPilot Revolution")); break; case CONTROLLER_PIPX: - summary.append(tr("OpenPilot PipX Radio Modem")); + summary.append(tr("OpenPilot OPLink Radio Modem")); break; default: summary.append(tr("Unknown")); From 8b2780bf71b5cd99cff24f7804f3f94cd14ac79d Mon Sep 17 00:00:00 2001 From: Oleg Semyonov Date: Tue, 4 Dec 2012 00:46:09 +0200 Subject: [PATCH 06/12] Update CREDITS --- CREDITS.txt | 3 +++ ground/openpilotgcs/src/plugins/coreplugin/CREDITS.html | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CREDITS.txt b/CREDITS.txt index 1df183158..395cb19cc 100644 --- a/CREDITS.txt +++ b/CREDITS.txt @@ -198,3 +198,6 @@ D: Russian translation of the GCS N: Brian Webb D: Modem lead developer M: OP Modems + +N: Dmitriy Zaitsev +D: AeroSim-RC HiTL plugin diff --git a/ground/openpilotgcs/src/plugins/coreplugin/CREDITS.html b/ground/openpilotgcs/src/plugins/coreplugin/CREDITS.html index e61d5f9ed..f9b5e601c 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/CREDITS.html +++ b/ground/openpilotgcs/src/plugins/coreplugin/CREDITS.html @@ -4,8 +4,7 @@ Without the work of the people in this file OpenPilot would not be what it is to

It is sorted alphabetically by name

-
-Connor Abbott
+
Connor Abbott
 David Ankers
 Sergiy Anikeyev
 Pedro Assuncao
@@ -75,6 +74,7 @@ Brian Webb
 Justin Welander
 Mat Wellington
 Kendal Wells
+Dmitriy Zaitsev
 
From 3668ecede3540c7e62fabffa3b99e2f8abc028d2 Mon Sep 17 00:00:00 2001 From: Oleg Semyonov Date: Tue, 4 Dec 2012 00:00:27 +0200 Subject: [PATCH 07/12] [OP-703] Add new variables to version-info.py and use them in Makefiles ${REVISION} - revision info string (tag or branch:hash date time) ${LABEL} - package label string (tag or date-hash) ${DAY} - day of last commit ${MONTH} - month of last commit ${YEAR} - year of last commit --- make/scripts/version-info.py | 21 +++++++++++++++++++++ package/Makefile | 8 +------- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/make/scripts/version-info.py b/make/scripts/version-info.py index 7e7c22d58..f84ba23b8 100644 --- a/make/scripts/version-info.py +++ b/make/scripts/version-info.py @@ -158,6 +158,20 @@ class Repo: else: return clean + def label(self): + """Return package label (tag if defined, or date-hash if no tag)""" + if self._tag == None: + return ''.join([self.time('%Y%m%d'), "-", self.hash(8, 'untagged'), self.dirty()]) + else: + return ''.join([self.tag(''), self.dirty()]) + + def revision(self): + """Return full revison string (tag if defined, or branch:hash date time if no tag""" + if self._tag == None: + return ''.join([self.branch('no-branch'), ":", self.hash(8, 'no-hash'), self.dirty(), self.time(' %Y%m%d %H:%M')]) + else: + return ''.join([self.tag(''), self.dirty()]) + def info(self): """Print some repository info""" print "path: ", self.path() @@ -169,6 +183,8 @@ class Repo: print "branch: ", self.branch() print "commit tag: ", self.tag('') print "dirty: ", self.dirty('yes', 'no') + print "label: ", self.label() + print "revision: ", self.revision() def file_from_template(tpl_name, out_name, dict): """Create or update file from template using dictionary @@ -380,10 +396,15 @@ string given. TAG = r.tag(''), TAG_OR_BRANCH = r.tag(r.branch('unreleased')), TAG_OR_HASH8 = r.tag(r.hash(8, 'untagged')), + LABEL = r.label(), + REVISION = r.revision(), DIRTY = r.dirty(), FWTAG = xtrim(r.tag(r.branch('unreleased')), r.dirty(), 25), UNIXTIME = r.time(), DATE = r.time('%Y%m%d'), + DAY=r.time('%d'), + MONTH=r.time('%m'), + YEAR=r.time('%Y'), DATETIME = r.time('%Y%m%d %H:%M'), BOARD_TYPE = args.type, BOARD_REVISION = args.revision, diff --git a/package/Makefile b/package/Makefile index f7e2d1568..495431da8 100644 --- a/package/Makefile +++ b/package/Makefile @@ -14,13 +14,7 @@ ROOT_DIR := $(realpath $(WHEREAMI)/../) # Set up some macros BUILD_DIR := $(ROOT_DIR)/build VERSION_CMD := python $(ROOT_DIR)/make/scripts/version-info.py --path="$(ROOT_DIR)" -# If there is a tag, use it for label instead of date-hash string -PACKAGE_TAG := $(shell $(VERSION_CMD) --format=\$${TAG}) -ifneq ($(PACKAGE_TAG),) -PACKAGE_LBL := $(shell $(VERSION_CMD) --format=\$${TAG}\$${DIRTY}) -else -PACKAGE_LBL := $(shell $(VERSION_CMD) --format=\$${DATE}-\$${TAG_OR_HASH8}\$${DIRTY}) -endif +PACKAGE_LBL := $(shell $(VERSION_CMD) --format=\$${LABEL}) PACKAGE_DIR := $(BUILD_DIR)/package-$(PACKAGE_LBL) FW_DIR := $(PACKAGE_DIR)/firmware-$(PACKAGE_LBL) BL_DIR := $(FW_DIR)/bootloaders From 2d938eaaa3391d88f9a073f16c67a668f5905e73 Mon Sep 17 00:00:00 2001 From: Oleg Semyonov Date: Tue, 4 Dec 2012 00:06:59 +0200 Subject: [PATCH 08/12] [OP-703] Rework GCS About dialog to remove 1.0.0 and show more repository info --- .../src/plugins/coreplugin/coreconstants.h | 28 +++++++--- .../src/plugins/coreplugin/versiondialog.cpp | 55 ++++++++++--------- make/templates/gcsversioninfotemplate.h | 12 +++- 3 files changed, 59 insertions(+), 36 deletions(-) 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 + /** * @} */ From aa6886c305efa841bd75ef6bb5773895f37be5e0 Mon Sep 17 00:00:00 2001 From: Oleg Semyonov Date: Tue, 4 Dec 2012 00:07:32 +0200 Subject: [PATCH 09/12] [OP-703] Swap "About GCS" and "About plugins" menu items --- .../src/plugins/coreplugin/mainwindow.cpp | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/coreplugin/mainwindow.cpp b/ground/openpilotgcs/src/plugins/coreplugin/mainwindow.cpp index dc74094a5..01ba6aa28 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/mainwindow.cpp +++ b/ground/openpilotgcs/src/plugins/coreplugin/mainwindow.cpp @@ -799,16 +799,6 @@ void MainWindow::registerDefaultActions() mhelp->addAction(cmd, Constants::G_HELP_ABOUT); #endif - //About Plugins Action - tmpaction = new QAction(QIcon(Constants::ICON_PLUGIN), tr("About &Plugins..."), this); - cmd = am->registerAction(tmpaction, Constants::ABOUT_PLUGINS, m_globalContext); - mhelp->addAction(cmd, Constants::G_HELP_ABOUT); - tmpaction->setEnabled(true); -#ifdef Q_WS_MAC - cmd->action()->setMenuRole(QAction::ApplicationSpecificRole); -#endif - connect(tmpaction, SIGNAL(triggered()), this, SLOT(aboutPlugins())); - // About GCS Action #ifdef Q_WS_MAC tmpaction = new QAction(QIcon(Constants::ICON_OPENPILOT), tr("About &OpenPilot GCS"), this); // it's convention not to add dots to the about menu @@ -823,6 +813,16 @@ void MainWindow::registerDefaultActions() #endif connect(tmpaction, SIGNAL(triggered()), this, SLOT(aboutOpenPilotGCS())); + //About Plugins Action + tmpaction = new QAction(QIcon(Constants::ICON_PLUGIN), tr("About &Plugins..."), this); + cmd = am->registerAction(tmpaction, Constants::ABOUT_PLUGINS, m_globalContext); + mhelp->addAction(cmd, Constants::G_HELP_ABOUT); + tmpaction->setEnabled(true); +#ifdef Q_WS_MAC + cmd->action()->setMenuRole(QAction::ApplicationSpecificRole); +#endif + connect(tmpaction, SIGNAL(triggered()), this, SLOT(aboutPlugins())); + //Credits Action tmpaction = new QAction(QIcon(Constants::ICON_PLUGIN), tr("About &Authors..."), this); cmd = am->registerAction(tmpaction, Constants::ABOUT_AUTHORS, m_globalContext); From 8079c669f741f45db3a61a39d5b93abd59c8a233 Mon Sep 17 00:00:00 2001 From: Oleg Semyonov Date: Tue, 4 Dec 2012 02:34:39 +0200 Subject: [PATCH 10/12] [OP-703] Fix for missing ")" in a comment --- make/scripts/version-info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make/scripts/version-info.py b/make/scripts/version-info.py index f84ba23b8..924cf18fb 100644 --- a/make/scripts/version-info.py +++ b/make/scripts/version-info.py @@ -166,7 +166,7 @@ class Repo: return ''.join([self.tag(''), self.dirty()]) def revision(self): - """Return full revison string (tag if defined, or branch:hash date time if no tag""" + """Return full revison string (tag if defined, or branch:hash date time if no tag)""" if self._tag == None: return ''.join([self.branch('no-branch'), ":", self.hash(8, 'no-hash'), self.dirty(), self.time(' %Y%m%d %H:%M')]) else: From 6d0885d87dac058252ce61e7bde1691075e36ea6 Mon Sep 17 00:00:00 2001 From: Oleg Semyonov Date: Tue, 4 Dec 2012 12:34:05 +0200 Subject: [PATCH 11/12] [OP-723] Add to KNOWN_ISSUES.txt --- KNOWN_ISSUES.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/KNOWN_ISSUES.txt b/KNOWN_ISSUES.txt index 9dab0c133..ad2d0a574 100644 --- a/KNOWN_ISSUES.txt +++ b/KNOWN_ISSUES.txt @@ -13,3 +13,4 @@ following URL: http://bugs.openpilot.org/browse/OP-XXX + [OP-732] Import UAV Settings for inactive modules crashes the running firmware (board restarts). Workaround: update firmware, power cycle, enable modules, power cycle, import configuration. + [OP-747] Board infinitely reboots itself after firmware upgrade (settings erase firmware is a workaround). ++ [OP-723] GCS uses the system language ot the 1st run. After restart it uses English (can be changed later). From ffbd173d8fb899844667ade52ff1601db7b13c9f Mon Sep 17 00:00:00 2001 From: Oleg Semyonov Date: Tue, 4 Dec 2012 12:40:27 +0200 Subject: [PATCH 12/12] [OP-725] Add to KNOWN_ISSUES.txt --- KNOWN_ISSUES.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/KNOWN_ISSUES.txt b/KNOWN_ISSUES.txt index ad2d0a574..b6ad70dfc 100644 --- a/KNOWN_ISSUES.txt +++ b/KNOWN_ISSUES.txt @@ -14,3 +14,4 @@ following URL: http://bugs.openpilot.org/browse/OP-XXX Workaround: update firmware, power cycle, enable modules, power cycle, import configuration. + [OP-747] Board infinitely reboots itself after firmware upgrade (settings erase firmware is a workaround). + [OP-723] GCS uses the system language ot the 1st run. After restart it uses English (can be changed later). ++ [OP-725] GCS camera stab config error message disappears too fast (but config error is cleared as it should)