diff --git a/src/ui/designer/QGCTextLabel.cc b/src/ui/designer/QGCTextLabel.cc
index dd2bbf940ce97afeaeee45e1859ab56e1d7bfee8..b1b1731c7b2e8906be21ba30a7bb8cadca52df1d 100644
--- a/src/ui/designer/QGCTextLabel.cc
+++ b/src/ui/designer/QGCTextLabel.cc
@@ -19,13 +19,7 @@ QGCTextLabel::QGCTextLabel(QWidget *parent) :
// Hide all edit items
ui->editFinishButton->hide();
ui->editNameLabel->hide();
- ui->editTextParam->hide();
- ui->editComponentSpinBox->hide();
ui->editLine1->hide();
- ui->editLine2->hide();
-
- // Add commands to combo box
-
}
QGCTextLabel::~QGCTextLabel()
@@ -37,13 +31,9 @@ void QGCTextLabel::startEditMode()
{
// Hide elements
ui->nameLabel->hide();
-
- ui->editTextParam->show();
ui->editFinishButton->show();
ui->editNameLabel->show();
- ui->editComponentSpinBox->show();
ui->editLine1->show();
- ui->editLine2->show();
// Attempt to undock the dock widget
QWidget* p = this;
@@ -66,12 +56,8 @@ void QGCTextLabel::startEditMode()
void QGCTextLabel::endEditMode()
{
ui->editFinishButton->hide();
- ui->editTextParam->hide();
ui->editNameLabel->hide();
- ui->editComponentSpinBox->hide();
ui->editLine1->hide();
- ui->editLine2->hide();
-
ui->nameLabel->show();
// Write to settings
@@ -105,23 +91,17 @@ void QGCTextLabel::writeSettings(QSettings& settings)
}
void QGCTextLabel::readSettings(const QString& pre,const QVariantMap& settings)
{
- ui->editTextParam->setText(settings.value(pre + "QGC_TEXT_SOURCE", "UNKNOWN").toString());
- //ui->editCommandComboBox->setCurrentIndex(settings.value(pre + "QGC_COMMAND_BUTTON_COMMANDID", 0).toInt());
- if (ui->editTextParam->text() == "NONE")
+ ui->isMavCommand->setChecked(settings.value(pre + "QGC_TEXT_SOURCE", "NONE").toString() == "MAV");
+ if (!ui->isMavCommand->isChecked())
{
ui->editNameLabel->setText(settings.value(pre + "QGC_TEXT_TEXT","").toString());
ui->nameLabel->setText(ui->editNameLabel->text());
}
- else if (ui->editTextParam->text() == "MAV")
+ else
{
//MAV command text
connect(uas,SIGNAL(textMessageReceived(int,int,int,QString)),this,SLOT(textMessageReceived(int,int,int,QString)));
}
-
- //int commandId = settings.value(pre + "QGC_COMMAND_BUTTON_COMMANDID", 0).toInt();
-
- //ui->editNameLabel->setText(settings.value(pre + "QGC_COMMAND_BUTTON_DESCRIPTION", "ERROR LOADING BUTTON").toString());
- //ui->nameLabel->setText(settings.value(pre + "QGC_COMMAND_BUTTON_DESCRIPTION", "ERROR LOADING BUTTON").toString());
}
void QGCTextLabel::textMessageReceived(int uasid, int component, int severity, QString message)
{
@@ -148,17 +128,14 @@ void QGCTextLabel::textMessageReceived(int uasid, int component, int severity, Q
void QGCTextLabel::readSettings(const QSettings& settings)
{
- //ui->editNameLabel->setText(settings.value("QGC_COMMAND_BUTTON_DESCRIPTION", "ERROR LOADING BUTTON").toString());
- //ui->nameLabel->setText(settings.value("QGC_COMMAND_BUTTON_DESCRIPTION", "ERROR LOADING BUTTON").toString());
- ui->editTextParam->setText(settings.value("QGC_TEXT_SOURCE", "UNKNOWN").toString());
+ ui->isMavCommand->setChecked(settings.value("QGC_TEXT_SOURCE", "NONE").toString() == "MAV");
ui->editNameLabel->setText(settings.value("QGC_TEXT_TEXT","").toString());
- //ui->editCommandComboBox->setCurrentIndex(settings.value(pre + "QGC_COMMAND_BUTTON_COMMANDID", 0).toInt());
- if (ui->editTextParam->text() == "NONE")
+ if (!ui->isMavCommand->isChecked())
{
ui->textLabel->setText(ui->editNameLabel->text());
ui->nameLabel->setText("");
}
- else if (ui->editTextParam->text() == "MAV")
+ else
{
//MAV command text
ui->nameLabel->setText(ui->editNameLabel->text());
diff --git a/src/ui/designer/QGCTextLabel.h b/src/ui/designer/QGCTextLabel.h
index 3828d734fc7fd9a0462e7766fc65199ce768e073..f4c23d2c785cf8429be9f5409fe39851a15a0405 100644
--- a/src/ui/designer/QGCTextLabel.h
+++ b/src/ui/designer/QGCTextLabel.h
@@ -26,6 +26,7 @@ public slots:
void readSettings(const QSettings& settings);
void readSettings(const QString& pre,const QVariantMap& settings);
void textMessageReceived(int uasid, int componentId, int severity, QString message);
+
private:
int enabledNum;
Ui::QGCTextLabel *ui;
diff --git a/src/ui/designer/QGCTextLabel.ui b/src/ui/designer/QGCTextLabel.ui
index 78ba1dda55884e0df0c0dca04935d8808d11b4fb..24d446ed46817d4991b259f5bcde72c94e3c293b 100644
--- a/src/ui/designer/QGCTextLabel.ui
+++ b/src/ui/designer/QGCTextLabel.ui
@@ -6,34 +6,36 @@
0
0
- 1183
- 166
+ 554
+ 107
Form
-
-
- 6
-
-
- 3
-
-
- 6
-
-
- 3
-
- -
-
-
- <Label Description Label (in front of text)>
-
-
+
+
-
+
+
-
+
+
+
+
+
+ Label Description
+
+
+
+ -
+
+
+ Mav Command
+
+
+
+
- -
+
-
@@ -46,68 +48,56 @@
- -
-
-
-
- 50
- 0
-
-
-
- Description
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
-
- <Text Param>
-
-
+
-
+
+
-
+
+
+
+ 50
+ 0
+
+
+
+ Description
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+ TextLabel
+
+
+
+
- -
-
-
- Done
-
-
-
- -
-
-
- Component ID:
-
-
- 0
-
-
- 255
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- Qt::Horizontal
-
-
-
- -
-
-
- TextLabel
-
-
+
-
+
+
-
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+ Done
+
+
+
+
@@ -120,8 +110,8 @@
setText(QString)
- 114
- 22
+ 280
+ 32
114