Fix of OctoPrint upload dialog persistance:
Directory always stays remembered in the "Send G-code to printer host" dialog #2234
This commit is contained in:
parent
3f08d9f30d
commit
6c3f2609e4
1 changed files with 6 additions and 5 deletions
|
@ -92,12 +92,13 @@ void PrintHostSendDialog::EndModal(int ret)
|
||||||
// Persist path and print settings
|
// Persist path and print settings
|
||||||
wxString path = txt_filename->GetValue();
|
wxString path = txt_filename->GetValue();
|
||||||
int last_slash = path.Find('/', true);
|
int last_slash = path.Find('/', true);
|
||||||
if (last_slash != wxNOT_FOUND) {
|
if (last_slash == wxNOT_FOUND)
|
||||||
|
path.clear();
|
||||||
|
else
|
||||||
path = path.SubString(0, last_slash);
|
path = path.SubString(0, last_slash);
|
||||||
wxGetApp().app_config->set("recent", CONFIG_KEY_PATH, into_u8(path));
|
AppConfig *app_config = wxGetApp().app_config;
|
||||||
}
|
app_config->set("recent", CONFIG_KEY_PATH, into_u8(path));
|
||||||
|
app_config->set("recent", CONFIG_KEY_PRINT, start_print() ? "1" : "0");
|
||||||
GUI::get_app_config()->set("recent", CONFIG_KEY_PRINT, start_print() ? "1" : "0");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MsgDialog::EndModal(ret);
|
MsgDialog::EndModal(ret);
|
||||||
|
|
Loading…
Reference in a new issue