Browse Source

Toolbar: Ensure initialization sequence

QGC4.4
Lorenz Meier 11 years ago
parent
commit
cf360ee96d
  1. 16
      src/ui/QGCToolBar.cc

16
src/ui/QGCToolBar.cc

@ -470,7 +470,9 @@ void QGCToolBar::updateView() @@ -470,7 +470,9 @@ void QGCToolBar::updateView()
// toolBarStateLabel->setText(QString("%1").arg(state));
toolBarModeLabel->setText(QString("%1").arg(mode));
if (mode.size() > 0) {
toolBarModeLabel->setText(QString("%1").arg(mode));
}
toolBarNameLabel->setText(systemName);
// expire after 15 seconds
@ -541,8 +543,16 @@ void QGCToolBar::updateMode(int system, QString name, QString description) @@ -541,8 +543,16 @@ void QGCToolBar::updateMode(int system, QString name, QString description)
{
Q_UNUSED(system);
Q_UNUSED(description);
if (mode != name) changed = true;
mode = name;
if (name.size() == 0) {
qDebug() << "EMPTY MODE, RETURN";
}
QString shortMode = name;
shortMode = shortMode.replace("D|", "");
shortMode = shortMode.replace("A|", "");
if (mode != shortMode) changed = true;
mode = shortMode;
/* important, immediately update */
updateView();
}

Loading…
Cancel
Save