1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-01 09:24:10 +01:00

Merged in paul_jewell/librepilot/LP-94-set-up-wiki-link-in-gcs (pull request #38)

Removed openpilot hard coding from wiki buttons in GCS
This commit is contained in:
Alessio Morale 2015-09-04 09:45:13 +02:00
commit 529105489d
22 changed files with 58 additions and 26 deletions

View File

@ -59,6 +59,8 @@ GCS_BIG_NAME := ${ORG_BIG_NAME} GCS
# These should be lowercase with no spaces
export 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)

View File

@ -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

View File

@ -1364,7 +1364,6 @@ The same value is used for all axes.</string>
<property name="objrelation" stdset="0">
<stringlist>
<string>button:help</string>
<string>url:http://wiki.openpilot.org/display/Doc/Camera+Stabilization+Configuration</string>
</stringlist>
</property>
</widget>

View File

@ -148,7 +148,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));
}
/**

View File

@ -2,7 +2,8 @@
******************************************************************************
*
* @file configcamerastabilizationwidget.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2011-2012.
* @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2015.
* The OpenPilot Team, http://www.openpilot.org Copyright (C) 2011-2012.
* @addtogroup GCSPlugins GCS Plugins
* @{
* @addtogroup ConfigPlugin Config Plugin
@ -73,6 +74,7 @@ ConfigCameraStabilizationWidget::ConfigCameraStabilizationWidget(QWidget *parent
}
}
setWikiURL("Camera+Stabilisation+Configuration");
// Load UAVObjects to widget relations from UI file
// using objrelation dynamic property
autoLoadWidgets();

View File

@ -2,7 +2,8 @@
******************************************************************************
*
* @file configccattitudewidget.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2015.
* The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @addtogroup GCSPlugins GCS Plugins
* @{
* @addtogroup ConfigPlugin Config Plugin
@ -214,7 +215,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)

View File

@ -2,7 +2,8 @@
******************************************************************************
*
* @file configinputwidget.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2015.
* The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @addtogroup GCSPlugins GCS Plugins
* @{
* @addtogroup ConfigPlugin Config Plugin
@ -393,7 +394,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()

View File

@ -2,7 +2,8 @@
******************************************************************************
*
* @file configtxpidswidget.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
* @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2015.
* The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
* @addtogroup GCSPlugins GCS Plugins
* @{
* @addtogroup ConfigPlugin Config Plugin
@ -112,6 +113,7 @@ ConfigOPLinkWidget::ConfigOPLinkWidget(QWidget *parent) : ConfigTaskWidget(paren
// Request and update of the setting object.
settingsUpdated = false;
setWikiURL("OPLink+Configuration");
autoLoadWidgets();
disableMouseWheelEvents();
updateEnableControls();

View File

@ -2,7 +2,8 @@
******************************************************************************
*
* @file configoutputwidget.cpp
* @author E. Lafargue & The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2015.
* E. Lafargue & The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @addtogroup GCSPlugins GCS Plugins
* @{
* @addtogroup ConfigPlugin Config Plugin
@ -444,7 +445,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()

View File

@ -2,7 +2,8 @@
******************************************************************************
*
* @file configrevohwwidget.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2015.
* The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @addtogroup GCSPlugins GCS Plugins
* @{
* @addtogroup ConfigPlugin Config Plugin
@ -336,5 +337,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));
}

View File

@ -2,7 +2,8 @@
******************************************************************************
*
* @file configrevohwwidget.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2015.
* The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @addtogroup GCSPlugins GCS Plugins
* @{
* @addtogroup ConfigPlugin Config Plugin
@ -334,5 +335,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));
}

View File

@ -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);
}
}

View File

@ -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<Core::Internal::GeneralSettings>();
if (!settings->useExpertMode()) {

View File

@ -2,7 +2,8 @@
******************************************************************************
*
* @file configvehicletypewidget.cpp
* @author E. Lafargue, K. Sebesta & The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012
* @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2015.
* E. Lafargue, K. Sebesta & The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012
* @addtogroup GCSPlugins GCS Plugins
* @{
* @addtogroup ConfigPlugin Config Plugin
@ -347,5 +348,6 @@ VehicleConfig *ConfigVehicleTypeWidget::createVehicleConfigWidget(int frameCateg
*/
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));
}

View File

@ -1778,7 +1778,6 @@
<property name="objrelation" stdset="0">
<stringlist>
<string>button:help</string>
<string>url:http://wiki.openpilot.org/x/hgAGAQ</string>
</stringlist>
</property>
</widget>

View File

@ -1068,7 +1068,6 @@ p, li { white-space: pre-wrap; }
<property name="objrelation" stdset="0">
<stringlist>
<string>button:help</string>
<string>url:http://wiki.openpilot.org/display/Doc/Revolution+Manual+Sensor+Calibration</string>
</stringlist>
</property>
</widget>

View File

@ -27264,7 +27264,6 @@ border-radius: 5;</string>
<property name="objrelation" stdset="0">
<stringlist>
<string>button:help</string>
<string>url:http://wiki.openpilot.org/x/DAO9</string>
</stringlist>
</property>
</widget>

View File

@ -1479,7 +1479,6 @@ font:bold;</string>
<property name="objrelation" stdset="0">
<stringlist>
<string>button:help</string>
<string>url:http://wiki.openpilot.org/x/DACiAQ</string>
</stringlist>
</property>
</widget>

View File

@ -135,7 +135,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

View File

@ -108,8 +108,8 @@ bool VehicleConfigurationHelper::isApplicable(UAVObject *dataObj)
return false;
}
default:
return true;
}
return true;
}
}
void VehicleConfigurationHelper::addModifiedObject(UAVDataObject *object, QString description)

View File

@ -2,7 +2,8 @@
******************************************************************************
*
* @file configtaskwidget.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2015.
* The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @addtogroup GCSPlugins GCS Plugins
* @{
* @addtogroup UAVObjectWidgetUtils Plugin
@ -550,6 +551,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 +690,7 @@ void ConfigTaskWidget::autoLoadWidgets()
case help_button:
button = qobject_cast<QPushButton *>(widget);
if (button) {
addHelpButton(button, uiRelation.url);
addHelpButton(button, WIKI_URL_ROOT + m_wikiURL);
}
break;

View File

@ -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<int, WidgetBinding *> m_reloadGroups;
QMultiHash<QWidget *, WidgetBinding *> m_widgetBindingsPerWidget;