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
This commit is contained in:
hu.wang 2023-08-23 12:01:49 +08:00 committed by Lane.Wei
parent e95b1b6ea7
commit 5e2141f519
2 changed files with 11 additions and 2 deletions

View File

@ -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);

View File

@ -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);