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

Uncrustify

This commit is contained in:
m_thread 2015-02-23 00:01:22 +01:00
parent 9e6d71120b
commit 14d4156d1f
3 changed files with 45 additions and 32 deletions

View File

@ -636,7 +636,7 @@ void ConfigInputWidget::wizardSetUpStep(enum wizardSteps step)
case wizardChooseMode:
{
wizardUi->wzBack->setEnabled(true);
QRadioButton* modeButtons[] = {
QRadioButton *modeButtons[] = {
wizardUi->mode1Button,
wizardUi->mode2Button,
wizardUi->mode3Button,
@ -755,20 +755,20 @@ void ConfigInputWidget::wizardTearDownStep(enum wizardSteps step)
}
break;
case wizardChooseMode:
{
QRadioButton* modeButtons[] = {
wizardUi->mode1Button,
wizardUi->mode2Button,
wizardUi->mode3Button,
wizardUi->mode4Button
};
for (int i = mode1; i <= mode4; ++i) {
if (modeButtons[i]->isChecked()) {
transmitterMode = static_cast<txMode>(i);
}
{
QRadioButton *modeButtons[] = {
wizardUi->mode1Button,
wizardUi->mode2Button,
wizardUi->mode3Button,
wizardUi->mode4Button
};
for (int i = mode1; i <= mode4; ++i) {
if (modeButtons[i]->isChecked()) {
transmitterMode = static_cast<txMode>(i);
}
}
break;
}
break;
case wizardIdentifySticks:
disconnect(receiverActivityObj, SIGNAL(objectUpdated(UAVObject *)), this, SLOT(identifyControls()));
wizardUi->wzNext->setEnabled(true);
@ -861,7 +861,7 @@ void ConfigInputWidget::setChannel(int newChan)
wizardUi->identifyStickInstructions->setText(QString(tr("Please disable throttle hold mode.\n\nMove the Throttle stick.")));
} else {
wizardUi->identifyStickInstructions->setText(QString(tr("Please move each control one at a time according to the instructions and picture below.\n\n"
"Move the %1 stick.")).arg(manualSettingsObj->getField("ChannelGroups")->getElementNames().at(newChan)));
"Move the %1 stick.")).arg(manualSettingsObj->getField("ChannelGroups")->getElementNames().at(newChan)));
}
if (manualSettingsObj->getField("ChannelGroups")->getElementNames().at(newChan).contains("Accessory")) {

View File

@ -93,7 +93,7 @@ ConfigOutputWidget::ConfigOutputWidget(QWidget *parent) : ConfigTaskWidget(paren
// Associate the buttons with their UAVO fields
addWidget(m_ui->spinningArmed);
MixerSettings* mixer = MixerSettings::GetInstance(getObjectManager());
MixerSettings *mixer = MixerSettings::GetInstance(getObjectManager());
Q_ASSERT(mixer);
m_banks << OutputBankControls(mixer, m_ui->chBank1, QColor("#C6ECAE"), m_ui->cb_outputRate1, m_ui->cb_outputMode1);
m_banks << OutputBankControls(mixer, m_ui->chBank2, QColor("#91E5D3"), m_ui->cb_outputRate2, m_ui->cb_outputMode2);
@ -110,7 +110,7 @@ ConfigOutputWidget::ConfigOutputWidget(QWidget *parent) : ConfigTaskWidget(paren
controls.rateCombo()->addItem(tr("-"), QVariant(0));
controls.rateCombo()->model()->setData(controls.rateCombo()->model()->index(0, 0), QVariant(0), Qt::UserRole - 1);
foreach (int rate, rates) {
foreach(int rate, rates) {
controls.rateCombo()->addItem(tr("%1 Hz").arg(rate), rate);
}
@ -132,6 +132,7 @@ ConfigOutputWidget::ConfigOutputWidget(QWidget *parent) : ConfigTaskWidget(paren
ConfigOutputWidget::~ConfigOutputWidget()
{
SystemAlarms *systemAlarmsObj = SystemAlarms::GetInstance(getObjectManager());
disconnect(systemAlarmsObj, SIGNAL(objectUpdated(UAVObject *)), this, SLOT(updateWarnings(UAVObject *)));
foreach(OutputBankControls controls, m_banks) {
disconnect(controls.modeCombo(), SIGNAL(currentIndexChanged(int)), this, SLOT(onBankTypeChange(int)));
@ -367,9 +368,10 @@ void ConfigOutputWidget::refreshWidgetsValues(UAVObject *obj)
int i = 0;
foreach(QString banklabel, bankLabels) {
OutputBankControls controls = m_banks.at(i);
controls.label()->setText(banklabel);
int index = controls.rateCombo()->findData(actuatorSettingsData.BankUpdateFreq[i]);
if (index == -1) {
if (index == -1) {
controls.rateCombo()->addItem(tr("%1 Hz").arg(actuatorSettingsData.BankUpdateFreq[i]), actuatorSettingsData.BankUpdateFreq[i]);
}
controls.rateCombo()->setCurrentIndex(index);
@ -443,7 +445,8 @@ void ConfigOutputWidget::openHelp()
void ConfigOutputWidget::onBankTypeChange()
{
QComboBox* bankModeCombo = qobject_cast<QComboBox*>(sender());
QComboBox *bankModeCombo = qobject_cast<QComboBox *>(sender());
if (bankModeCombo != NULL) {
foreach(OutputBankControls controls, m_banks) {
if (controls.modeCombo() == bankModeCombo) {
@ -487,11 +490,9 @@ void ConfigOutputWidget::setWarning(QString message)
}
OutputBankControls::OutputBankControls(MixerSettings* mixer, QLabel *label, QColor color, QComboBox *rateCombo, QComboBox *modeCombo) :
OutputBankControls::OutputBankControls(MixerSettings *mixer, QLabel *label, QColor color, QComboBox *rateCombo, QComboBox *modeCombo) :
m_mixer(mixer), m_label(label), m_color(color), m_rateCombo(rateCombo), m_modeCombo(modeCombo)
{
}
{}
OutputBankControls::~OutputBankControls()
{
}
{}

View File

@ -46,20 +46,32 @@ class MixerSettings;
class OutputBankControls {
public:
OutputBankControls(MixerSettings *mixer, QLabel* label, QColor color, QComboBox* rateCombo, QComboBox* modeCombo);
OutputBankControls(MixerSettings *mixer, QLabel *label, QColor color, QComboBox *rateCombo, QComboBox *modeCombo);
virtual ~OutputBankControls();
QLabel *label() const { return m_label; }
QColor color() const { return m_color; }
QComboBox *rateCombo() const { return m_rateCombo; }
QComboBox *modeCombo() const { return m_modeCombo; }
QLabel *label() const
{
return m_label;
}
QColor color() const
{
return m_color;
}
QComboBox *rateCombo() const
{
return m_rateCombo;
}
QComboBox *modeCombo() const
{
return m_modeCombo;
}
private:
MixerSettings* m_mixer;
QLabel* m_label;
MixerSettings *m_mixer;
QLabel *m_label;
QColor m_color;
QComboBox* m_rateCombo;
QComboBox* m_modeCombo;
QComboBox *m_rateCombo;
QComboBox *m_modeCombo;
};
class ConfigOutputWidget : public ConfigTaskWidget {