1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-29 14:52:12 +01:00

CameraStab UI: fix spacing and add comments according to OP coding style guidelines

More info:
http://wiki.openpilot.org/display/Doc/Coding+Style
http://qt-project.org/wiki/Qt_Coding_Style
This commit is contained in:
Oleg Semyonov 2012-08-15 10:31:19 +03:00
parent d3c5fcfa7e
commit fd9f1491ba
2 changed files with 12 additions and 1 deletions

View File

@ -65,8 +65,10 @@ ConfigCameraStabilizationWidget::ConfigCameraStabilizationWidget(QWidget *parent
addUAVObject("HwSettings");
addUAVObject("MixerSettings");
// To set special widgets to defaults when requested
connect(this, SIGNAL(defaultRequested(int)), this, SLOT(defaultRequestedSlot(int)));
disableMouseWheelEvents();
connect(this,SIGNAL(defaultRequested(int)),this,SLOT(defaultRequestedSlot(int)));
}
ConfigCameraStabilizationWidget::~ConfigCameraStabilizationWidget()
@ -215,13 +217,21 @@ void ConfigCameraStabilizationWidget::updateObjectsFromWidgets()
ConfigTaskWidget::updateObjectsFromWidgets();
}
/*
* This slot function is called when "Default" button is clicked.
* All special widgets which belong to the group passed should be set here.
*/
void ConfigCameraStabilizationWidget::defaultRequestedSlot(int group)
{
Q_UNUSED(group);
HwSettings *hwSettings = HwSettings::GetInstance(getObjectManager());
HwSettings *hwSettingsDefault=(HwSettings*)hwSettings->dirtyClone();
HwSettings::DataFields hwSettingsData = hwSettingsDefault->getData();
m_camerastabilization->enableCameraStabilization->setChecked(
hwSettingsData.OptionalModules[HwSettings::OPTIONALMODULES_CAMERASTAB] == HwSettings::OPTIONALMODULES_ENABLED);
QComboBox *outputs[] = {
m_camerastabilization->rollChannel,
m_camerastabilization->pitchChannel,

View File

@ -46,6 +46,7 @@ private:
Ui_CameraStabilizationWidget *m_camerastabilization;
void refreshWidgetsValues(UAVObject *obj);
void updateObjectsFromWidgets();
private slots:
void defaultRequestedSlot(int group);
};