mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-03-01 18:29:16 +01:00
Uncrustify
This commit is contained in:
parent
54eb5d8894
commit
8325cc3be7
@ -196,6 +196,7 @@ void ConfigStabilizationWidget::onBoardConnected()
|
|||||||
{
|
{
|
||||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||||
UAVObjectUtilManager *utilMngr = pm->getObject<UAVObjectUtilManager>();
|
UAVObjectUtilManager *utilMngr = pm->getObject<UAVObjectUtilManager>();
|
||||||
|
|
||||||
Q_ASSERT(utilMngr);
|
Q_ASSERT(utilMngr);
|
||||||
|
|
||||||
// If Revolution board enable misc tab, otherwise disable it
|
// If Revolution board enable misc tab, otherwise disable it
|
||||||
|
@ -39,7 +39,6 @@ class QWidget;
|
|||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
|
|
||||||
class CORE_EXPORT IOptionsPage : public QObject {
|
class CORE_EXPORT IOptionsPage : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@ -89,13 +88,11 @@ public:
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
virtual void updateState()
|
virtual void updateState()
|
||||||
{
|
{};
|
||||||
};
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QIcon m_icon;
|
QIcon m_icon;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Core
|
} // namespace Core
|
||||||
|
|
||||||
#endif // IOPTIONSPAGE_H
|
#endif // IOPTIONSPAGE_H
|
||||||
|
@ -179,6 +179,7 @@ Q_DECLARE_METATYPE(::PageData) SettingsDialog::SettingsDialog(QWidget *parent, c
|
|||||||
// add plugin pages
|
// add plugin pages
|
||||||
foreach(IOptionsPage * page, pluginPages) {
|
foreach(IOptionsPage * page, pluginPages) {
|
||||||
QTreeWidgetItem *item = addPage(page);
|
QTreeWidgetItem *item = addPage(page);
|
||||||
|
|
||||||
// automatically expand all plugin categories
|
// automatically expand all plugin categories
|
||||||
item->parent()->setExpanded(true);
|
item->parent()->setExpanded(true);
|
||||||
if (page->id() == initialPage && page->category() == initialCategory) {
|
if (page->id() == initialPage && page->category() == initialCategory) {
|
||||||
@ -289,6 +290,7 @@ QTreeWidgetItem *SettingsDialog::addPage(IOptionsPage *page)
|
|||||||
void SettingsDialog::onItemSelected()
|
void SettingsDialog::onItemSelected()
|
||||||
{
|
{
|
||||||
QTreeWidgetItem *item = pageTree->currentItem();
|
QTreeWidgetItem *item = pageTree->currentItem();
|
||||||
|
|
||||||
if (!item) {
|
if (!item) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -297,8 +299,7 @@ void SettingsDialog::onItemSelected()
|
|||||||
if (item->childCount() == 1) {
|
if (item->childCount() == 1) {
|
||||||
// single child : category will not be expanded
|
// single child : category will not be expanded
|
||||||
item = item->child(0);
|
item = item->child(0);
|
||||||
}
|
} else if (item->childCount() > 1) {
|
||||||
else if (item->childCount() > 1) {
|
|
||||||
// multiple children : expand category and select 1st child
|
// multiple children : expand category and select 1st child
|
||||||
emit categoryItemSelected();
|
emit categoryItemSelected();
|
||||||
return;
|
return;
|
||||||
@ -331,6 +332,7 @@ void SettingsDialog::onItemSelected()
|
|||||||
void SettingsDialog::onCategorySelected()
|
void SettingsDialog::onCategorySelected()
|
||||||
{
|
{
|
||||||
QTreeWidgetItem *item = pageTree->currentItem();
|
QTreeWidgetItem *item = pageTree->currentItem();
|
||||||
|
|
||||||
if (item->childCount() > 1) {
|
if (item->childCount() > 1) {
|
||||||
item->setExpanded(true);
|
item->setExpanded(true);
|
||||||
pageTree->setCurrentItem(item->child(0), 0, QItemSelectionModel::SelectCurrent);
|
pageTree->setCurrentItem(item->child(0), 0, QItemSelectionModel::SelectCurrent);
|
||||||
|
@ -41,7 +41,6 @@ class PluginManager;
|
|||||||
}
|
}
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
class SettingsDialog;
|
class SettingsDialog;
|
||||||
}
|
}
|
||||||
@ -120,7 +119,6 @@ private:
|
|||||||
void readConfigs_1_1_0(QSettings *qs);
|
void readConfigs_1_1_0(QSettings *qs);
|
||||||
void readConfigs_1_2_0(QSettings *qs);
|
void readConfigs_1_2_0(QSettings *qs);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Core
|
} // namespace Core
|
||||||
|
|
||||||
#endif // UAVGADGETINSTANCEMANAGER_H
|
#endif // UAVGADGETINSTANCEMANAGER_H
|
||||||
|
@ -35,7 +35,6 @@ PfdQmlGadgetConfiguration::PfdQmlGadgetConfiguration(QString classId, QSettings
|
|||||||
m_speedFactor(1.0),
|
m_speedFactor(1.0),
|
||||||
m_altitudeFactor(1.0)
|
m_altitudeFactor(1.0)
|
||||||
{
|
{
|
||||||
|
|
||||||
m_speedMap[1.0] = "m/s";
|
m_speedMap[1.0] = "m/s";
|
||||||
m_speedMap[3.6] = "km/h";
|
m_speedMap[3.6] = "km/h";
|
||||||
m_speedMap[2.2369] = "mph";
|
m_speedMap[2.2369] = "mph";
|
||||||
|
@ -64,16 +64,14 @@ QWidget *PfdQmlGadgetOptionsPage::createPage(QWidget *parent)
|
|||||||
|
|
||||||
// Setup units combos
|
// Setup units combos
|
||||||
QMapIterator<double, QString> iter = m_config->speedMapIterator();
|
QMapIterator<double, QString> iter = m_config->speedMapIterator();
|
||||||
while(iter.hasNext())
|
while (iter.hasNext()) {
|
||||||
{
|
|
||||||
iter.next();
|
iter.next();
|
||||||
options_page->speedUnitCombo->addItem(iter.value(), iter.key());
|
options_page->speedUnitCombo->addItem(iter.value(), iter.key());
|
||||||
}
|
}
|
||||||
options_page->speedUnitCombo->setCurrentIndex(options_page->speedUnitCombo->findData(m_config->speedFactor()));
|
options_page->speedUnitCombo->setCurrentIndex(options_page->speedUnitCombo->findData(m_config->speedFactor()));
|
||||||
|
|
||||||
iter = m_config->altitudeMapIterator();
|
iter = m_config->altitudeMapIterator();
|
||||||
while(iter.hasNext())
|
while (iter.hasNext()) {
|
||||||
{
|
|
||||||
iter.next();
|
iter.next();
|
||||||
options_page->altUnitCombo->addItem(iter.value(), iter.key());
|
options_page->altUnitCombo->addItem(iter.value(), iter.key());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user