diff --git a/ground/openpilotgcs/src/plugins/config/configcamerastabilizationwidget.cpp b/ground/openpilotgcs/src/plugins/config/configcamerastabilizationwidget.cpp index 3e757de63..c15af11b2 100644 --- a/ground/openpilotgcs/src/plugins/config/configcamerastabilizationwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configcamerastabilizationwidget.cpp @@ -33,12 +33,19 @@ #include #include #include +#include +#include ConfigCameraStabilizationWidget::ConfigCameraStabilizationWidget(QWidget *parent) : ConfigTaskWidget(parent) { // TODO: this widget should use the addUAVObjectToWidgetRelation() m_camerastabilization = new Ui_CameraStabilizationWidget(); m_camerastabilization->setupUi(this); + + ExtensionSystem::PluginManager *pm=ExtensionSystem::PluginManager::instance(); + Core::Internal::GeneralSettings * settings=pm->getObject(); + if(!settings->useExpertMode()) + m_camerastabilization->camerastabilizationSaveRAM->setVisible(false); QComboBox *outputs[3] = { m_camerastabilization->rollChannel, diff --git a/ground/openpilotgcs/src/plugins/config/configccattitudewidget.cpp b/ground/openpilotgcs/src/plugins/config/configccattitudewidget.cpp index 10064b835..044dd7770 100644 --- a/ground/openpilotgcs/src/plugins/config/configccattitudewidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configccattitudewidget.cpp @@ -35,6 +35,8 @@ #include #include "accels.h" #include "gyros.h" +#include +#include ConfigCCAttitudeWidget::ConfigCCAttitudeWidget(QWidget *parent) : ConfigTaskWidget(parent), @@ -43,7 +45,11 @@ ConfigCCAttitudeWidget::ConfigCCAttitudeWidget(QWidget *parent) : ui->setupUi(this); connect(ui->zeroBias,SIGNAL(clicked()),this,SLOT(startAccelCalibration())); - + ExtensionSystem::PluginManager *pm=ExtensionSystem::PluginManager::instance(); + Core::Internal::GeneralSettings * settings=pm->getObject(); + if(!settings->useExpertMode()) + ui->applyButton->setVisible(false); + addApplySaveButtons(ui->applyButton,ui->saveButton); addUAVObject("AttitudeSettings"); diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp index 7952b3d70..769790c94 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp @@ -41,6 +41,9 @@ #include #include +#include +#include + #define ACCESS_MIN_MOVE -3 #define ACCESS_MAX_MOVE 3 #define STICK_MIN_MOVE -8 @@ -53,7 +56,14 @@ ConfigInputWidget::ConfigInputWidget(QWidget *parent) : ConfigTaskWidget(parent) receiverActivityObj=ReceiverActivity::GetInstance(getObjectManager()); m_config = new Ui_InputWidget(); m_config->setupUi(this); + + addApplySaveButtons(m_config->saveRCInputToRAM,m_config->saveRCInputToSD); + ExtensionSystem::PluginManager *pm=ExtensionSystem::PluginManager::instance(); + Core::Internal::GeneralSettings * settings=pm->getObject(); + if(!settings->useExpertMode()) + m_config->saveRCInputToRAM->setVisible(false); + addApplySaveButtons(m_config->saveRCInputToRAM,m_config->saveRCInputToSD); //Generate the rows of buttons in the input channel form GUI diff --git a/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp index 6985e7561..cb1918888 100644 --- a/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp @@ -46,15 +46,20 @@ #include "systemalarms.h" #include "systemsettings.h" #include "uavsettingsimportexport/uavsettingsimportexportfactory.h" - +#include +#include ConfigOutputWidget::ConfigOutputWidget(QWidget *parent) : ConfigTaskWidget(parent),wasItMe(false) { m_config = new Ui_OutputWidget(); m_config->setupUi(this); + + ExtensionSystem::PluginManager *pm=ExtensionSystem::PluginManager::instance(); + Core::Internal::GeneralSettings * settings=pm->getObject(); + if(!settings->useExpertMode()) + m_config->saveRCOutputToRAM->setVisible(false); - ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); UAVSettingsImportExportFactory * importexportplugin = pm->getObject(); diff --git a/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp b/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp index a535914ac..bc277a2c3 100644 --- a/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp @@ -36,17 +36,27 @@ #include #include + +#include +#include + + ConfigStabilizationWidget::ConfigStabilizationWidget(QWidget *parent) : ConfigTaskWidget(parent) { m_stabilization = new Ui_StabilizationWidget(); m_stabilization->setupUi(this); + + ExtensionSystem::PluginManager *pm=ExtensionSystem::PluginManager::instance(); + Core::Internal::GeneralSettings * settings=pm->getObject(); + if(!settings->useExpertMode()) + m_stabilization->saveStabilizationToRAM_6->setVisible(false); + autoLoadWidgets(); realtimeUpdates=new QTimer(this); connect(m_stabilization->realTimeUpdates_6,SIGNAL(stateChanged(int)),this,SLOT(realtimeUpdatesSlot(int))); - //connect(m_stabilization->realTimeUpdates_7,SIGNAL(stateChanged(int)),this,SLOT(realtimeUpdatesSlot(int))); connect(realtimeUpdates,SIGNAL(timeout()),this,SLOT(apply())); connect(m_stabilization->checkBox_7,SIGNAL(stateChanged(int)),this,SLOT(linkCheckBoxes(int))); @@ -58,21 +68,7 @@ ConfigStabilizationWidget::ConfigStabilizationWidget(QWidget *parent) : ConfigTa disableMouseWheelEvents(); - // This is needed because new style tries to compact things as much as possible in grid - // and on OSX the widget sizes of PushButtons is reported incorrectly: - // https://bugreports.qt-project.org/browse/QTBUG-14591 -// m_stabilization->saveStabilizationToRAM_6->setAttribute(Qt::WA_LayoutUsesWidgetRect); -// m_stabilization->saveStabilizationToSD_6->setAttribute(Qt::WA_LayoutUsesWidgetRect); -// m_stabilization->stabilizationReloadBoardData_6->setAttribute(Qt::WA_LayoutUsesWidgetRect); -// m_stabilization->pushButton_2->setAttribute(Qt::WA_LayoutUsesWidgetRect); -// m_stabilization->pushButton_3->setAttribute(Qt::WA_LayoutUsesWidgetRect); -// m_stabilization->pushButton_4->setAttribute(Qt::WA_LayoutUsesWidgetRect); -// m_stabilization->pushButton_19->setAttribute(Qt::WA_LayoutUsesWidgetRect); -// m_stabilization->pushButton_20->setAttribute(Qt::WA_LayoutUsesWidgetRect); -// m_stabilization->pushButton_21->setAttribute(Qt::WA_LayoutUsesWidgetRect); -// m_stabilization->pushButton_22->setAttribute(Qt::WA_LayoutUsesWidgetRect); -// m_stabilization->pushButton_23->setAttribute(Qt::WA_LayoutUsesWidgetRect); -// m_stabilization->pushButton_24->setAttribute(Qt::WA_LayoutUsesWidgetRect); + } diff --git a/ground/openpilotgcs/src/plugins/config/configtxpidwidget.cpp b/ground/openpilotgcs/src/plugins/config/configtxpidwidget.cpp index 30c87bd78..6c6ac1c9a 100644 --- a/ground/openpilotgcs/src/plugins/config/configtxpidwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configtxpidwidget.cpp @@ -28,11 +28,18 @@ #include "configtxpidwidget.h" #include "txpidsettings.h" #include "hwsettings.h" +#include +#include ConfigTxPIDWidget::ConfigTxPIDWidget(QWidget *parent) : ConfigTaskWidget(parent) { m_txpid = new Ui_TxPIDWidget(); m_txpid->setupUi(this); + + ExtensionSystem::PluginManager *pm=ExtensionSystem::PluginManager::instance(); + Core::Internal::GeneralSettings * settings=pm->getObject(); + if(!settings->useExpertMode()) + m_txpid->Apply->setVisible(false); addApplySaveButtons(m_txpid->Apply, m_txpid->Save); diff --git a/ground/openpilotgcs/src/plugins/config/configvehicletypewidget.cpp b/ground/openpilotgcs/src/plugins/config/configvehicletypewidget.cpp index 1a765a381..5c91204b4 100644 --- a/ground/openpilotgcs/src/plugins/config/configvehicletypewidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configvehicletypewidget.cpp @@ -41,6 +41,9 @@ #include "systemsettings.h" #include "mixersettings.h" #include "actuatorsettings.h" +#include +#include + /** Helper delegate for the custom mixer editor table. @@ -97,6 +100,11 @@ ConfigVehicleTypeWidget::ConfigVehicleTypeWidget(QWidget *parent) : ConfigTaskWi { m_aircraft = new Ui_AircraftWidget(); m_aircraft->setupUi(this); + + ExtensionSystem::PluginManager *pm=ExtensionSystem::PluginManager::instance(); + Core::Internal::GeneralSettings * settings=pm->getObject(); + if(!settings->useExpertMode()) + m_aircraft->saveAircraftToRAM->setVisible(false); addApplySaveButtons(m_aircraft->saveAircraftToRAM,m_aircraft->saveAircraftToSD);