From 1f8b134a77002c2b0fce4db2fbc755bca4d1b3eb Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Mon, 23 Aug 2021 12:40:28 +0200 Subject: [PATCH 1/2] Changed app title when the current project is modified and non yet named --- src/slic3r/GUI/MainFrame.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index ddf8e6acba..b9aefcc76b 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -618,8 +618,11 @@ void MainFrame::update_title() // Don't try to remove the extension, it would remove part of the file name after the last dot! wxString project = from_path(into_path(m_plater->get_project_filename()).filename()); wxString dirty_marker = (!m_plater->model().objects.empty() && m_plater->is_project_dirty()) ? "*" : ""; - if (!dirty_marker.empty() || !project.empty()) - title = dirty_marker + project + " - "; + if (!dirty_marker.empty() || !project.empty()) { + if (!dirty_marker.empty() && project.empty()) + project = _("Untitled"); + title = dirty_marker + project + " - "; + } } std::string build_id = wxGetApp().is_editor() ? SLIC3R_BUILD_ID : GCODEVIEWER_BUILD_ID; From e5f0099ded26a225f3eecd27b540d448748f8454 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Mon, 23 Aug 2021 15:34:53 +0200 Subject: [PATCH 2/2] Fixed ProjectDropDialog: it sometimes did something else than selected --- src/slic3r/GUI/Plater.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index ecace34e6e..29368312a3 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -4877,8 +4877,8 @@ ProjectDropDialog::ProjectDropDialog(const std::string& filename) main_sizer->Add(new wxStaticText(this, wxID_ANY, _L("Select an action to apply to the file") + ": " + from_u8(filename)), 0, wxEXPAND | wxALL, 10); - int action = std::clamp(std::stoi(wxGetApp().app_config->get("drop_project_action")), - static_cast(LoadType::OpenProject), static_cast(LoadType::LoadConfig)) - 1; + m_action = std::clamp(std::stoi(wxGetApp().app_config->get("drop_project_action")), + static_cast(LoadType::OpenProject) - 1, static_cast(LoadType::LoadConfig)) - 1; wxStaticBox* action_stb = new wxStaticBox(this, wxID_ANY, _L("Action")); if (!wxOSX) action_stb->SetBackgroundStyle(wxBG_STYLE_PAINT); @@ -4888,7 +4888,7 @@ ProjectDropDialog::ProjectDropDialog(const std::string& filename) int id = 0; for (const wxString& label : choices) { wxRadioButton* btn = new wxRadioButton(this, wxID_ANY, label, wxDefaultPosition, wxDefaultSize, id == 0 ? wxRB_GROUP : 0); - btn->SetValue(id == action); + btn->SetValue(id == m_action); btn->Bind(wxEVT_RADIOBUTTON, [this, id](wxCommandEvent&) { m_action = id; }); stb_sizer->Add(btn, 0, wxEXPAND | wxTOP, 5); id++;