From 5e2141f5190199a7df030976a1ca5e5abc8be5dd Mon Sep 17 00:00:00 2001 From: "hu.wang" Date: Wed, 23 Aug 2023 12:01:49 +0800 Subject: [PATCH] FIX:unit is English,sent to printer is still in grams Under the preference settings, if the unit is selected in English, the displayed value in the send to printer pop-up will still be in grams Jira:STUDIO-3726 Change-Id: Ida97f9f47caccd43d44e5310f9a55af60ad75822 --- src/slic3r/GUI/SelectMachine.cpp | 7 ++++++- src/slic3r/GUI/SendToPrinter.cpp | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/SelectMachine.cpp b/src/slic3r/GUI/SelectMachine.cpp index 549c9263e..aa0bcbb14 100644 --- a/src/slic3r/GUI/SelectMachine.cpp +++ b/src/slic3r/GUI/SelectMachine.cpp @@ -3691,7 +3691,12 @@ void SelectMachineDialog::set_default_normal() } char weight[64]; - ::sprintf(weight, " %.2f g", aprint_stats.total_weight); + if (wxGetApp().app_config->get("use_inches") == "1") { + ::sprintf(weight, " %.2f oz", aprint_stats.total_weight * 0.035274); + } + else { + ::sprintf(weight, " %.2f g", aprint_stats.total_weight); + } m_stext_time->SetLabel(time); m_stext_weight->SetLabel(weight); diff --git a/src/slic3r/GUI/SendToPrinter.cpp b/src/slic3r/GUI/SendToPrinter.cpp index f63294145..df3b0ee72 100644 --- a/src/slic3r/GUI/SendToPrinter.cpp +++ b/src/slic3r/GUI/SendToPrinter.cpp @@ -1317,7 +1317,11 @@ void SendToPrinterDialog::set_default() } char weight[64]; - ::sprintf(weight, " %.2f g", aprint_stats.total_weight); + if (wxGetApp().app_config->get("use_inches") == "1") { + ::sprintf(weight, " %.2f oz", aprint_stats.total_weight*0.035274); + }else{ + ::sprintf(weight, " %.2f g", aprint_stats.total_weight); + } m_stext_time->SetLabel(time); m_stext_weight->SetLabel(weight);