Skip to content

Commit

Permalink
GCS: Refresh widgets/dirtiness after uavo import
Browse files Browse the repository at this point in the history
  • Loading branch information
tracernz committed Jan 1, 2018
1 parent be3307d commit df0f763
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ ConfigTaskWidget::ConfigTaskWidget(QWidget *parent)
UAVSettingsImportExportManager *importexportplugin =
pm->getObject<UAVSettingsImportExportManager>();
connect(importexportplugin, SIGNAL(importAboutToBegin()), this, SLOT(invalidateObjects()));
connect(importexportplugin, &UAVSettingsImportExportManager::importEnded,
[this]() { refreshWidgetsValues(); });
}

/**
Expand Down Expand Up @@ -376,7 +378,8 @@ void ConfigTaskWidget::refreshWidgetsValues(UAVObject *obj)
setWidgetFromField(ow->widget, ow->field, ow->index, ow->scale, ow->isLimited,
ow->useUnits);
}
setDirty(dirtyBack);
// it doesn't make sense to keep the dirty state if all widgets were overwritten...
setDirty(obj && dirtyBack);
}
/**
* SLOT function used to update the uavobject fields from widgets with relation to
Expand Down

0 comments on commit df0f763

Please sign in to comment.