forked from qt-creator/qt-creator
WebAssembly: Self-register aspects in runconfiguration
No real benefit in this particular case, but the general pattern now. Change-Id: Ia06d3221a2ccd4b7ab429f6e045c11fffffe99ad Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -69,25 +69,28 @@ class EmrunRunConfiguration : public ProjectExplorer::RunConfiguration
|
||||
{
|
||||
public:
|
||||
EmrunRunConfiguration(Target *target, Utils::Id id)
|
||||
: RunConfiguration(target, id)
|
||||
: RunConfiguration(target, id)
|
||||
{
|
||||
auto webBrowserAspect = addAspect<WebBrowserSelectionAspect>(target);
|
||||
webBrowser.setTarget(target);
|
||||
|
||||
auto effectiveEmrunCall = addAspect<StringAspect>();
|
||||
effectiveEmrunCall->setLabelText(Tr::tr("Effective emrun call:"));
|
||||
effectiveEmrunCall->setDisplayStyle(StringAspect::TextEditDisplay);
|
||||
effectiveEmrunCall->setReadOnly(true);
|
||||
effectiveEmrunCall.setLabelText(Tr::tr("Effective emrun call:"));
|
||||
effectiveEmrunCall.setDisplayStyle(StringAspect::TextEditDisplay);
|
||||
effectiveEmrunCall.setReadOnly(true);
|
||||
|
||||
setUpdater([this, target, effectiveEmrunCall, webBrowserAspect] {
|
||||
effectiveEmrunCall->setValue(emrunCommand(target,
|
||||
buildKey(),
|
||||
webBrowserAspect->currentBrowser(),
|
||||
"<port>").toUserOutput());
|
||||
setUpdater([this, target] {
|
||||
effectiveEmrunCall.setValue(emrunCommand(target,
|
||||
buildKey(),
|
||||
webBrowser.currentBrowser(),
|
||||
"<port>").toUserOutput());
|
||||
});
|
||||
|
||||
connect(webBrowserAspect, &BaseAspect::changed, this, &RunConfiguration::update);
|
||||
connect(&webBrowser, &BaseAspect::changed, this, &RunConfiguration::update);
|
||||
connect(target, &Target::buildSystemUpdated, this, &RunConfiguration::update);
|
||||
}
|
||||
|
||||
private:
|
||||
WebBrowserSelectionAspect webBrowser{this};
|
||||
StringAspect effectiveEmrunCall{this};
|
||||
};
|
||||
|
||||
class EmrunRunWorker : public SimpleTargetRunner
|
||||
|
||||
Reference in New Issue
Block a user