Browse Source

Toolbar: Ensure initialization sequence

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

14
src/ui/QGCToolBar.cc

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

Loading…
Cancel
Save