Skip to content

Commit

Permalink
Revert dialog usage from SDL3 (deadlocks) to GTK3 (#993)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamkewley committed Jan 28, 2025
1 parent 36c1684 commit c440ca4
Showing 1 changed file with 3 additions and 23 deletions.
26 changes: 3 additions & 23 deletions libopensimcreator/Documents/Model/UndoableModelActions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,29 +84,9 @@ namespace

void DoOpenFileViaDialog(Widget& api)
{
App::upd().prompt_user_to_select_file_async(
[widget_ptr = api.weak_ref()](FileDialogResponse response)
{
if (not widget_ptr) {
return; // widget was deleted at some point
}

if (response.has_error()) {
log_error("Error opening dialog: %s", response.error().c_str());
return;
}

for (const auto& path : response) {
OpenOsimInLoadingTab(*widget_ptr, path);
}
},
{
FileDialogFilter{"OpenSim Model (osim)", "osim"},
FileDialogFilter{"All Files", "*"},
},
std::nullopt, // initial directory
true // allow many
);
for (const auto& path : prompt_user_to_select_files({"osim"})) {
OpenOsimInLoadingTab(api, path);
}
}

std::optional<std::filesystem::path> PromptSaveOneFile()
Expand Down

0 comments on commit c440ca4

Please sign in to comment.