Skip to content

Commit

Permalink
Show dialog when opening 3mf files to choose whether to import settin…
Browse files Browse the repository at this point in the history
…gs. (#4110)

* Show dialog when opening 3mf files to choose whether to import settings.

* Merge branch 'main' into main
  • Loading branch information
markleaf131313 authored Feb 18, 2024
1 parent 1f835e0 commit 8ce07d3
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions src/slic3r/GUI/Plater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10136,23 +10136,21 @@ bool Plater::open_3mf_file(const fs::path &file_path)
}

LoadType load_type = LoadType::Unknown;
if (!model().objects.empty()) {
bool show_drop_project_dialog = true;
if (show_drop_project_dialog) {
ProjectDropDialog dlg(filename);
if (dlg.ShowModal() == wxID_OK) {
int choice = dlg.get_action();
load_type = static_cast<LoadType>(choice);
wxGetApp().app_config->set("import_project_action", std::to_string(choice));

bool show_drop_project_dialog = true;
if (show_drop_project_dialog) {
ProjectDropDialog dlg(filename);
if (dlg.ShowModal() == wxID_OK) {
int choice = dlg.get_action();
load_type = static_cast<LoadType>(choice);
wxGetApp().app_config->set("import_project_action", std::to_string(choice));

// BBS: jump to plater panel
wxGetApp().mainframe->select_tab(MainFrame::tp3DEditor);
}
} else
load_type = static_cast<LoadType>(
std::clamp(std::stoi(wxGetApp().app_config->get("import_project_action")), static_cast<int>(LoadType::OpenProject), static_cast<int>(LoadType::LoadConfig)));
// BBS: jump to plater panel
wxGetApp().mainframe->select_tab(MainFrame::tp3DEditor);
}
} else
load_type = LoadType::OpenProject;
load_type = static_cast<LoadType>(
std::clamp(std::stoi(wxGetApp().app_config->get("import_project_action")), static_cast<int>(LoadType::OpenProject), static_cast<int>(LoadType::LoadConfig)));

if (load_type == LoadType::Unknown) return false;

Expand Down

0 comments on commit 8ce07d3

Please sign in to comment.