28 #include "ui_uavgadgetoptionspage.h"
32 #include <QtCore/QDebug>
38 bool isSingleConfigurationGadget,
43 , m_isSingleConfigurationGadget(isSingleConfigurationGadget)
44 , m_id(config->name())
45 , m_category(config->classId())
47 m_optionsPage->setParent(
this);
49 m_categoryTr = m_instanceManager->
gadgetName(m_category);
54 m_page =
new Ui_TopOptionsPage();
55 QWidget *w =
new QWidget(parent);
58 m_page->deleteButton->hide();
59 m_page->lockCheckBox->hide();
60 m_page->nameLineEdit->setDisabled(
true);
63 m_page->deleteButton->setDisabled(
true);
64 m_page->lockCheckBox->hide();
65 m_page->nameLineEdit->setText(m_id);
68 wi->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
69 m_page->verticalLayout_4->addWidget(wi);
72 if (m_isSingleConfigurationGadget) {
73 m_page->configurationBox->hide();
76 connect(m_page->cloneButton, SIGNAL(clicked()),
this, SLOT(cloneConfiguration()));
77 connect(m_page->deleteButton, SIGNAL(clicked()),
this, SLOT(deleteConfiguration()));
78 connect(m_page->nameLineEdit, SIGNAL(textEdited(QString)),
this, SLOT(textEdited(QString)));
86 m_optionsPage->
apply();
95 void UAVGadgetOptionsPageDecorator::cloneConfiguration()
100 void UAVGadgetOptionsPageDecorator::deleteConfiguration()
105 void UAVGadgetOptionsPageDecorator::textEdited(QString name)
QString provisionalName()
void setProvisionalName(QString name)
UAVGadgetOptionsPageDecorator(IOptionsPage *page, IUAVGadgetConfiguration *config, bool isSingleConfigurationGadget=false, QObject *parent=nullptr)
void configurationNameEdited(QString text, bool hasText=true)
void applyChanges(IUAVGadgetConfiguration *config)
static ICore * instance()
virtual QWidget * createPage(QWidget *parent)=0
QWidget * createPage(QWidget *parent)
void deleteConfiguration(IUAVGadgetConfiguration *config)
bool canDeleteConfiguration(IUAVGadgetConfiguration *config)
void cloneConfiguration(IUAVGadgetConfiguration *config)
The IOptionsPage is an interface for providing options pages.
QString gadgetName(QString classId) const
virtual UAVGadgetInstanceManager * uavGadgetInstanceManager() const =0