Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbubnikv <bubnikv@gmail.com>2019-05-15 11:24:03 +0300
committerbubnikv <bubnikv@gmail.com>2019-05-15 11:24:03 +0300
commit6c3f2609e43f47437064855c7000f4dca262b3b6 (patch)
tree2523e551f5891a6543ea185630b881424369c782 /src/slic3r/GUI/PrintHostDialogs.cpp
parent3f08d9f30d7c742504bee38adb74cabbdb73caed (diff)
Fix of OctoPrint upload dialog persistance:
Directory always stays remembered in the "Send G-code to printer host" dialog #2234
Diffstat (limited to 'src/slic3r/GUI/PrintHostDialogs.cpp')
-rw-r--r--src/slic3r/GUI/PrintHostDialogs.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/slic3r/GUI/PrintHostDialogs.cpp b/src/slic3r/GUI/PrintHostDialogs.cpp
index 82795efc4..09bd65682 100644
--- a/src/slic3r/GUI/PrintHostDialogs.cpp
+++ b/src/slic3r/GUI/PrintHostDialogs.cpp
@@ -92,12 +92,13 @@ void PrintHostSendDialog::EndModal(int ret)
// Persist path and print settings
wxString path = txt_filename->GetValue();
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);
- wxGetApp().app_config->set("recent", CONFIG_KEY_PATH, into_u8(path));
- }
-
- GUI::get_app_config()->set("recent", CONFIG_KEY_PRINT, start_print() ? "1" : "0");
+ 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");
}
MsgDialog::EndModal(ret);