From c912505798004b5edd33f20221ff1546a47f2ffd Mon Sep 17 00:00:00 2001 From: Paul Jewell Date: Wed, 19 Aug 2015 21:15:32 +0100 Subject: [PATCH] Removed openpilot hard coding from wiki buttons in GCS --- Makefile | 3 +++ ground/gcs/gcs.pri | 7 +++++++ ground/gcs/src/plugins/config/camerastabilization.ui | 1 - ground/gcs/src/plugins/config/config_cc_hw_widget.cpp | 3 ++- .../src/plugins/config/configcamerastabilizationwidget.cpp | 1 + ground/gcs/src/plugins/config/configccattitudewidget.cpp | 3 ++- ground/gcs/src/plugins/config/configinputwidget.cpp | 3 ++- ground/gcs/src/plugins/config/configoplinkwidget.cpp | 1 + ground/gcs/src/plugins/config/configoutputwidget.cpp | 3 ++- ground/gcs/src/plugins/config/configrevohwwidget.cpp | 3 ++- ground/gcs/src/plugins/config/configrevonanohwwidget.cpp | 3 ++- .../gcs/src/plugins/config/configstabilizationwidget.cpp | 2 +- ground/gcs/src/plugins/config/configtxpidwidget.cpp | 4 ++++ ground/gcs/src/plugins/config/configvehicletypewidget.cpp | 3 ++- ground/gcs/src/plugins/config/oplink.ui | 1 - ground/gcs/src/plugins/config/revosensors.ui | 1 - ground/gcs/src/plugins/config/stabilization.ui | 1 - ground/gcs/src/plugins/config/txpid.ui | 1 - ground/gcs/src/plugins/coreplugin/mainwindow.cpp | 2 +- .../src/plugins/setupwizard/vehicleconfigurationhelper.cpp | 4 ++-- .../src/plugins/uavobjectwidgetutils/configtaskwidget.cpp | 7 ++++++- .../src/plugins/uavobjectwidgetutils/configtaskwidget.h | 3 +++ 22 files changed, 43 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index ca590b8f5..372f25bdb 100644 --- a/Makefile +++ b/Makefile @@ -59,6 +59,8 @@ GCS_BIG_NAME := ${ORG_BIG_NAME} GCS # These should be lowercase with no spaces ORG_SMALL_NAME := $(call smallify,$(ORG_BIG_NAME)) GCS_SMALL_NAME := $(call smallify,$(GCS_BIG_NAME)) +# Change this once the DNS is set to http://wiki.librepilot.org/ +WIKI_URL_ROOT := https://librepilot.atlassian.net/wiki/display/LPDOC/ # Set up default build configurations (debug | release) GCS_BUILD_CONF := release @@ -471,6 +473,7 @@ gcs_qmake $(GCS_MAKEFILE): | $(GCS_DIR) -spec $(QT_SPEC) -r CONFIG+=$(GCS_BUILD_CONF) CONFIG+=$(GCS_SILENT) \ 'GCS_BIG_NAME="$(GCS_BIG_NAME)"' GCS_SMALL_NAME=$(GCS_SMALL_NAME) \ 'ORG_BIG_NAME="$(ORG_BIG_NAME)"' ORG_SMALL_NAME=$(ORG_SMALL_NAME) \ + 'WIKI_URL_ROOT="$(WIKI_URL_ROOT)"' \ 'GCS_LIBRARY_BASENAME=$(libbasename)' \ $(GCS_QMAKE_OPTS) diff --git a/ground/gcs/gcs.pri b/ground/gcs/gcs.pri index bbe138e0f..f3e1715de 100644 --- a/ground/gcs/gcs.pri +++ b/ground/gcs/gcs.pri @@ -140,6 +140,12 @@ isEmpty(ORG_BIG_NAME) { ORG_BIG_NAME = "$$ORG_BIG_NAME" } +isEmpty(WIKI_URL_ROOT) { + WIKI_URL_ROOT = Unknown +} else { + WIKI_URL_ROOT = "$$WIKI_URL_ROOT" +} + isEmpty(GCS_LIBRARY_BASENAME):GCS_LIBRARY_BASENAME = lib macx { @@ -206,6 +212,7 @@ DEFINES += ORG_BIG_NAME=$$shell_quote(\"$$ORG_BIG_NAME\") DEFINES += GCS_BIG_NAME=$$shell_quote(\"$$GCS_BIG_NAME\") DEFINES += ORG_SMALL_NAME=$$shell_quote(\"$$ORG_SMALL_NAME\") DEFINES += GCS_SMALL_NAME=$$shell_quote(\"$$GCS_SMALL_NAME\") +DEFINES += WIKI_URL_ROOT=$$shell_quote(\"$$WIKI_URL_ROOT\") # DEFINES += QT_NO_CAST_FROM_ASCII DEFINES += QT_NO_CAST_TO_ASCII diff --git a/ground/gcs/src/plugins/config/camerastabilization.ui b/ground/gcs/src/plugins/config/camerastabilization.ui index 808bef209..388d147fc 100644 --- a/ground/gcs/src/plugins/config/camerastabilization.ui +++ b/ground/gcs/src/plugins/config/camerastabilization.ui @@ -1364,7 +1364,6 @@ The same value is used for all axes. button:help - url:http://wiki.openpilot.org/display/Doc/Camera+Stabilization+Configuration diff --git a/ground/gcs/src/plugins/config/config_cc_hw_widget.cpp b/ground/gcs/src/plugins/config/config_cc_hw_widget.cpp index 60faa6dfb..c73af1926 100644 --- a/ground/gcs/src/plugins/config/config_cc_hw_widget.cpp +++ b/ground/gcs/src/plugins/config/config_cc_hw_widget.cpp @@ -147,7 +147,8 @@ void ConfigCCHWWidget::enableSaveButtons(bool enable) void ConfigCCHWWidget::openHelp() { - QDesktopServices::openUrl(QUrl(tr("http://wiki.openpilot.org/x/D4AUAQ"), QUrl::StrictMode)); + QDesktopServices::openUrl(QUrl(QString(WIKI_URL_ROOT) + QString("CC+Hardware+Configuration"), + QUrl::StrictMode)); } /** diff --git a/ground/gcs/src/plugins/config/configcamerastabilizationwidget.cpp b/ground/gcs/src/plugins/config/configcamerastabilizationwidget.cpp index 829a40608..1e5c3e509 100644 --- a/ground/gcs/src/plugins/config/configcamerastabilizationwidget.cpp +++ b/ground/gcs/src/plugins/config/configcamerastabilizationwidget.cpp @@ -73,6 +73,7 @@ ConfigCameraStabilizationWidget::ConfigCameraStabilizationWidget(QWidget *parent } } + setWikiURL("Camera+Stabilisation+Configuration"); // Load UAVObjects to widget relations from UI file // using objrelation dynamic property autoLoadWidgets(); diff --git a/ground/gcs/src/plugins/config/configccattitudewidget.cpp b/ground/gcs/src/plugins/config/configccattitudewidget.cpp index 4e872735b..39be164de 100644 --- a/ground/gcs/src/plugins/config/configccattitudewidget.cpp +++ b/ground/gcs/src/plugins/config/configccattitudewidget.cpp @@ -214,7 +214,8 @@ void ConfigCCAttitudeWidget::startAccelCalibration() void ConfigCCAttitudeWidget::openHelp() { - QDesktopServices::openUrl(QUrl(tr("http://wiki.openpilot.org/x/44Cf"), QUrl::StrictMode)); + QDesktopServices::openUrl(QUrl(QString(WIKI_URL_ROOT) + QString("CC+Attitude+Configuration"), + QUrl::StrictMode)); } void ConfigCCAttitudeWidget::setAccelFiltering(bool active) diff --git a/ground/gcs/src/plugins/config/configinputwidget.cpp b/ground/gcs/src/plugins/config/configinputwidget.cpp index 878d76a78..e5d72b8b0 100644 --- a/ground/gcs/src/plugins/config/configinputwidget.cpp +++ b/ground/gcs/src/plugins/config/configinputwidget.cpp @@ -393,7 +393,8 @@ void ConfigInputWidget::resizeEvent(QResizeEvent *event) void ConfigInputWidget::openHelp() { - QDesktopServices::openUrl(QUrl(tr("http://wiki.openpilot.org/x/04Cf"), QUrl::StrictMode)); + QDesktopServices::openUrl(QUrl(QString(WIKI_URL_ROOT) + QString("Input+Configuration"), + QUrl::StrictMode)); } void ConfigInputWidget::goToWizard() diff --git a/ground/gcs/src/plugins/config/configoplinkwidget.cpp b/ground/gcs/src/plugins/config/configoplinkwidget.cpp index 56a42658e..565024d0b 100644 --- a/ground/gcs/src/plugins/config/configoplinkwidget.cpp +++ b/ground/gcs/src/plugins/config/configoplinkwidget.cpp @@ -112,6 +112,7 @@ ConfigOPLinkWidget::ConfigOPLinkWidget(QWidget *parent) : ConfigTaskWidget(paren // Request and update of the setting object. settingsUpdated = false; + setWikiURL("OPLink+Configuration"); autoLoadWidgets(); disableMouseWheelEvents(); updateEnableControls(); diff --git a/ground/gcs/src/plugins/config/configoutputwidget.cpp b/ground/gcs/src/plugins/config/configoutputwidget.cpp index baeeb9877..0f7af66c5 100644 --- a/ground/gcs/src/plugins/config/configoutputwidget.cpp +++ b/ground/gcs/src/plugins/config/configoutputwidget.cpp @@ -444,7 +444,8 @@ void ConfigOutputWidget::updateObjectsFromWidgets() void ConfigOutputWidget::openHelp() { - QDesktopServices::openUrl(QUrl(tr("http://wiki.openpilot.org/x/WIGf"), QUrl::StrictMode)); + QDesktopServices::openUrl(QUrl(QString(WIKI_URL_ROOT) + QString("Output+Configuration"), + QUrl::StrictMode)); } void ConfigOutputWidget::onBankTypeChange() diff --git a/ground/gcs/src/plugins/config/configrevohwwidget.cpp b/ground/gcs/src/plugins/config/configrevohwwidget.cpp index 867acb13d..7056253f4 100644 --- a/ground/gcs/src/plugins/config/configrevohwwidget.cpp +++ b/ground/gcs/src/plugins/config/configrevohwwidget.cpp @@ -336,5 +336,6 @@ void ConfigRevoHWWidget::rcvrPortChanged(int index) void ConfigRevoHWWidget::openHelp() { - QDesktopServices::openUrl(QUrl(tr("http://wiki.openpilot.org/x/GgDBAQ"), QUrl::StrictMode)); + QDesktopServices::openUrl(QUrl(QString(WIKI_URL_ROOT) + QString("Revolution+Configuration"), + QUrl::StrictMode)); } diff --git a/ground/gcs/src/plugins/config/configrevonanohwwidget.cpp b/ground/gcs/src/plugins/config/configrevonanohwwidget.cpp index 3c56dd338..53fe8db34 100644 --- a/ground/gcs/src/plugins/config/configrevonanohwwidget.cpp +++ b/ground/gcs/src/plugins/config/configrevonanohwwidget.cpp @@ -334,5 +334,6 @@ void ConfigRevoNanoHWWidget::rcvrPortChanged(int index) void ConfigRevoNanoHWWidget::openHelp() { - QDesktopServices::openUrl(QUrl(tr("http://wiki.openpilot.org/x/GgDBAQ"), QUrl::StrictMode)); + QDesktopServices::openUrl(QUrl(QString(WIKI_URL_ROOT) + QString("Revo+Nano+Configuration"), + QUrl::StrictMode)); } diff --git a/ground/gcs/src/plugins/config/configstabilizationwidget.cpp b/ground/gcs/src/plugins/config/configstabilizationwidget.cpp index ca02fcea8..9e2c563f9 100644 --- a/ground/gcs/src/plugins/config/configstabilizationwidget.cpp +++ b/ground/gcs/src/plugins/config/configstabilizationwidget.cpp @@ -572,7 +572,7 @@ void ConfigStabilizationWidget::linkCheckBoxes(bool value) ui->basicResponsivenessCheckBox->setChecked(!value); ui->basicResponsivenessControls->setEnabled(!value); ui->advancedResponsivenessControls->setEnabled(value); - } else if(sender() == ui->checkBoxLinkAcroFactors) { + } else if (sender() == ui->checkBoxLinkAcroFactors) { processLinkedWidgets(ui->AcroFactorRollSlider); } } diff --git a/ground/gcs/src/plugins/config/configtxpidwidget.cpp b/ground/gcs/src/plugins/config/configtxpidwidget.cpp index d66deb77d..06b0d0c19 100644 --- a/ground/gcs/src/plugins/config/configtxpidwidget.cpp +++ b/ground/gcs/src/plugins/config/configtxpidwidget.cpp @@ -42,6 +42,7 @@ ConfigTxPIDWidget::ConfigTxPIDWidget(QWidget *parent) : ConfigTaskWidget(parent) m_txpid = new Ui_TxPIDWidget(); m_txpid->setupUi(this); + setWikiURL("TxPID"); ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); Core::Internal::GeneralSettings *settings = pm->getObject(); if (!settings->useExpertMode()) { @@ -300,11 +301,14 @@ static float defaultValueForPidOption(const StabilizationSettingsBankX *bank, in case TxPIDSettings::PIDS_YAWEXPO: return bank->getStickExpo_Yaw(); + case TxPIDSettings::PIDS_ACROROLLFACTOR: case TxPIDSettings::PIDS_ACROROLLPITCHFACTOR: return bank->getAcroInsanityFactor_Roll(); + case TxPIDSettings::PIDS_ACROPITCHFACTOR: return bank->getAcroInsanityFactor_Pitch(); + case -1: // The PID Option field was uninitialized. return 0.0f; diff --git a/ground/gcs/src/plugins/config/configvehicletypewidget.cpp b/ground/gcs/src/plugins/config/configvehicletypewidget.cpp index 00d3d3811..49c0050b2 100644 --- a/ground/gcs/src/plugins/config/configvehicletypewidget.cpp +++ b/ground/gcs/src/plugins/config/configvehicletypewidget.cpp @@ -457,5 +457,6 @@ void ConfigVehicleTypeWidget::updateFeedForwardUI() */ void ConfigVehicleTypeWidget::openHelp() { - QDesktopServices::openUrl(QUrl(tr("http://wiki.openpilot.org/x/44Cf"), QUrl::StrictMode)); + QDesktopServices::openUrl(QUrl(QString(WIKI_URL_ROOT) + QString("Vehicle+Configuration"), + QUrl::StrictMode)); } diff --git a/ground/gcs/src/plugins/config/oplink.ui b/ground/gcs/src/plugins/config/oplink.ui index 9e462577f..8e3af2033 100644 --- a/ground/gcs/src/plugins/config/oplink.ui +++ b/ground/gcs/src/plugins/config/oplink.ui @@ -1778,7 +1778,6 @@ button:help - url:http://wiki.openpilot.org/x/hgAGAQ diff --git a/ground/gcs/src/plugins/config/revosensors.ui b/ground/gcs/src/plugins/config/revosensors.ui index 555888d1f..21b5da221 100644 --- a/ground/gcs/src/plugins/config/revosensors.ui +++ b/ground/gcs/src/plugins/config/revosensors.ui @@ -1068,7 +1068,6 @@ p, li { white-space: pre-wrap; } button:help - url:http://wiki.openpilot.org/display/Doc/Revolution+Manual+Sensor+Calibration diff --git a/ground/gcs/src/plugins/config/stabilization.ui b/ground/gcs/src/plugins/config/stabilization.ui index 226a6edcc..5e54d3e92 100644 --- a/ground/gcs/src/plugins/config/stabilization.ui +++ b/ground/gcs/src/plugins/config/stabilization.ui @@ -27264,7 +27264,6 @@ border-radius: 5; button:help - url:http://wiki.openpilot.org/x/DAO9 diff --git a/ground/gcs/src/plugins/config/txpid.ui b/ground/gcs/src/plugins/config/txpid.ui index b7a0887a6..9d9866c23 100644 --- a/ground/gcs/src/plugins/config/txpid.ui +++ b/ground/gcs/src/plugins/config/txpid.ui @@ -798,7 +798,6 @@ font:bold; button:help - url:http://wiki.openpilot.org/x/DACiAQ diff --git a/ground/gcs/src/plugins/coreplugin/mainwindow.cpp b/ground/gcs/src/plugins/coreplugin/mainwindow.cpp index cfc134529..a2945f849 100644 --- a/ground/gcs/src/plugins/coreplugin/mainwindow.cpp +++ b/ground/gcs/src/plugins/coreplugin/mainwindow.cpp @@ -134,7 +134,7 @@ MainWindow::MainWindow() : #endif m_toggleFullScreenAction(0) { - setWindowTitle(QLatin1String(GCS_BIG_NAME) + " " + VersionInfo::label()); + setWindowTitle(QLatin1String(GCS_BIG_NAME) + " " + VersionInfo::label()); #ifndef Q_WS_MAC qApp->setWindowIcon(QIcon(":/core/images/librepilot_logo_128.png")); #endif diff --git a/ground/gcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp b/ground/gcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp index 4e330847c..480f4afdd 100644 --- a/ground/gcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp +++ b/ground/gcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp @@ -107,8 +107,8 @@ bool VehicleConfigurationHelper::isApplicable(UAVObject *dataObj) return false; } default: - return true; -} + return true; + } } void VehicleConfigurationHelper::addModifiedObject(UAVDataObject *object, QString description) diff --git a/ground/gcs/src/plugins/uavobjectwidgetutils/configtaskwidget.cpp b/ground/gcs/src/plugins/uavobjectwidgetutils/configtaskwidget.cpp index 1ba588a85..194c76e60 100644 --- a/ground/gcs/src/plugins/uavobjectwidgetutils/configtaskwidget.cpp +++ b/ground/gcs/src/plugins/uavobjectwidgetutils/configtaskwidget.cpp @@ -550,6 +550,11 @@ void ConfigTaskWidget::addHelpButton(QPushButton *button, QString url) connect(button, SIGNAL(clicked()), this, SLOT(helpButtonPressed())); } +void ConfigTaskWidget::setWikiURL(QString url) +{ + m_wikiURL = url; +} + void ConfigTaskWidget::invalidateObjects() { foreach(UAVObject * obj, m_updatedObjects.keys()) { @@ -684,7 +689,7 @@ void ConfigTaskWidget::autoLoadWidgets() case help_button: button = qobject_cast(widget); if (button) { - addHelpButton(button, uiRelation.url); + addHelpButton(button, WIKI_URL_ROOT + m_wikiURL); } break; diff --git a/ground/gcs/src/plugins/uavobjectwidgetutils/configtaskwidget.h b/ground/gcs/src/plugins/uavobjectwidgetutils/configtaskwidget.h index 7809df602..18fa3c3af 100644 --- a/ground/gcs/src/plugins/uavobjectwidgetutils/configtaskwidget.h +++ b/ground/gcs/src/plugins/uavobjectwidgetutils/configtaskwidget.h @@ -155,6 +155,7 @@ public: m_outOfLimitsStyle = style; } void addHelpButton(QPushButton *button, QString url); + void setWikiURL(QString url); void forceShadowUpdates(); void forceConnectedState(); virtual bool shouldObjectBeSaved(UAVObject *object); @@ -215,6 +216,8 @@ private: bool m_isConnected; bool m_isWidgetUpdatesAllowed; QStringList m_objects; + QString m_wikiURL; // Wiki address for help button + // Concatenated with WIKI_URL_ROOT QMultiHash m_reloadGroups; QMultiHash m_widgetBindingsPerWidget;