Skip to content

Commit

Permalink
disable export button if emsdkPath is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
dromer committed Jan 21, 2025
1 parent 467727d commit ada2f1a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Source/Heavy/WASMExporter.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class WASMExporter : public ExporterBase {
property->setPreferredHeight(28);
}

emsdkPathValue.addListener(this);

panel.addSection("WASM", properties);
}

Expand All @@ -43,6 +45,19 @@ class WASMExporter : public ExporterBase {
emsdkPathValue = tree.getProperty("emsdkPathValue");
}

void valueChanged(Value& v) override
{
ExporterBase::valueChanged(v);

String const emsdkPath = getValue<String>(emsdkPathValue);

if (emsdkPath.isNotEmpty()) {
exportButton.setEnabled(true);
} else {
exportButton.setEnabled(false);
}
}

bool performExport(String pdPatch, String outdir, String name, String copyright, StringArray searchPaths) override
{
exportingView->showState(ExportingProgressView::Exporting);
Expand Down

0 comments on commit ada2f1a

Please sign in to comment.