50 #include <QMessageBox>
51 #include <QStringList>
54 #include <QVBoxLayout>
55 #include <QPushButton>
61 setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
66 QVBoxLayout *layout =
new QVBoxLayout;
67 layout->setContentsMargins(0, 0, 0, 0);
68 layout->addWidget(
ftw);
87 icon->addFile(
":/configgadget/images/hardware_normal.png", QSize(), QIcon::Normal,
89 icon->addFile(
":/configgadget/images/hardware_selected.png", QSize(), QIcon::Selected,
91 qwd =
new QLabel(tr(
"<p>No recognized board detected. Hardware tab will refresh once a "
92 "known board is detected.</p>"),
94 qobject_cast<QLabel *>(qwd)->setWordWrap(
true);
104 icon->addFile(
":/configgadget/images/vehicle_normal.png", QSize(), QIcon::Normal,
106 icon->addFile(
":/configgadget/images/vehicle_selected.png", QSize(), QIcon::Selected,
114 icon->addFile(
":/configgadget/images/input_normal.png", QSize(), QIcon::Normal, QIcon::Off);
115 icon->addFile(
":/configgadget/images/input_selected.png", QSize(), QIcon::Selected,
123 icon->addFile(
":/configgadget/images/output_normal.png", QSize(), QIcon::Normal,
125 icon->addFile(
":/configgadget/images/output_selected.png", QSize(), QIcon::Selected,
133 icon->addFile(
":/configgadget/images/ins_normal.png", QSize(), QIcon::Normal, QIcon::Off);
134 icon->addFile(
":/configgadget/images/ins_selected.png", QSize(), QIcon::Selected,
142 icon->addFile(
":/configgadget/images/stabilization_normal.png", QSize(), QIcon::Normal,
144 icon->addFile(
":/configgadget/images/stabilization_selected.png", QSize(), QIcon::Selected,
152 icon->addFile(
":/configgadget/images/modules_normal.png", QSize(), QIcon::Normal,
154 icon->addFile(
":/configgadget/images/modules_selected.png", QSize(), QIcon::Selected,
162 icon->addFile(
":/configgadget/images/autotune_normal.png", QSize(), QIcon::Normal,
164 icon->addFile(
":/configgadget/images/autotune_selected.png", QSize(), QIcon::Selected,
172 icon->addFile(
":/configgadget/images/camstab_normal.png", QSize(), QIcon::Normal,
174 icon->addFile(
":/configgadget/images/camstab_selected.png", QSize(), QIcon::Selected,
182 icon->addFile(
":/configgadget/images/txpid_normal.png", QSize(), QIcon::Normal, QIcon::Off);
183 icon->addFile(
":/configgadget/images/txpid_selected.png", QSize(), QIcon::Selected,
191 icon->addFile(
":/configgadget/images/osd_normal.png", QSize(), QIcon::Normal, QIcon::Off);
192 icon->addFile(
":/configgadget/images/osd_selected.png", QSize(), QIcon::Selected,
202 icon->addFile(
":/configgadget/images/radio_normal.png", QSize(), QIcon::Normal, QIcon::Off);
203 icon->addFile(
":/configgadget/images/radio_selected.png", QSize(), QIcon::Selected,
259 Q_ASSERT(inputWidget);
265 QWidget::resizeEvent(event);
275 QIcon *icon =
new QIcon();
276 icon->addFile(
":/configgadget/images/hardware_normal.png", QSize(), QIcon::Normal, QIcon::Off);
277 icon->addFile(
":/configgadget/images/hardware_selected.png", QSize(), QIcon::Selected,
279 QLabel *qwd =
new QLabel(tr(
"<p>No recognized board detected. Hardware tab will refresh once a "
280 "known board is detected.</p>"),
282 qwd->setWordWrap(
true);
295 bool hasRadio =
false;
300 lastTabIndex = index;
314 bool valid_board =
false;
343 QLabel *txt =
new QLabel(tr(
"<p>Board detected, but of unknown type. This could be "
344 "because either your GCS or firmware is out of date.</p>"),
346 txt->setWordWrap(
true);
351 icon->addFile(
":/configgadget/images/hardware_normal.png", QSize(), QIcon::Normal,
353 icon->addFile(
":/configgadget/images/hardware_selected.png", QSize(), QIcon::Selected,
362 icon->addFile(
":/configgadget/images/ins_normal.png", QSize(), QIcon::Normal, QIcon::Off);
363 icon->addFile(
":/configgadget/images/ins_selected.png", QSize(), QIcon::Selected, QIcon::Off);
394 int ans = QMessageBox::warning(
this, tr(
"Unsaved changes"),
395 tr(
"The tab you are leaving has unsaved changes,"
396 "if you proceed they may be lost."
397 "Do you still want to proceed?"),
398 QMessageBox::Yes, QMessageBox::No);
399 if (ans == QMessageBox::No) {
void onAutopilotConnect()
MyTabbedStackWidget * ftw
virtual QWidget * getBoardConfiguration(QWidget *=nullptr, bool=true)
Return a custom configuration widget, if one is provided.
void tabAboutToChange(int i, bool *)
Core plugin system that manages the plugins, their life cycle and their registered objects...
ConfigGadgetWidget(QWidget *parent=nullptr)
void autopilotConnected()
virtual bool queryCapabilities(BoardCapabilities capability)=0
Query capabilities of the board.
UAVObjectManager * getObjectManager()
virtual QString getHwUAVO()=0
void onAutopilotDisconnect()
void resizeEvent(QResizeEvent *event)
void paintEvent(QPaintEvent *event)
void autopilotDisconnected()
UAVObject * getObject(const QString &name, quint32 instId=0)
Core::IBoardType * getBoardType()
Get the IBoardType corresponding to the connected board.