NEW:support show print history
Change-Id: I28acf421ec0a21d14e89a498012029ee7a32f00b
This commit is contained in:
parent
7813b52fe9
commit
8f0a6fa996
|
@ -806,6 +806,15 @@ wxBoxSizer *PreferencesDialog::create_item_checkbox(wxString title, wxWindow *pa
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (param == "show_print_history") {
|
||||||
|
auto show_history = app_config->get("show_print_history");
|
||||||
|
if (show_history == "true") {
|
||||||
|
if (wxGetApp().mainframe && wxGetApp().mainframe->m_webview) { wxGetApp().mainframe->m_webview->ShowUserPrintTask(true); }
|
||||||
|
} else {
|
||||||
|
if (wxGetApp().mainframe && wxGetApp().mainframe->m_webview) { wxGetApp().mainframe->m_webview->ShowUserPrintTask(false); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (param == "enable_lod") {
|
if (param == "enable_lod") {
|
||||||
if (wxGetApp().plater()->is_project_dirty()) {
|
if (wxGetApp().plater()->is_project_dirty()) {
|
||||||
auto result = MessageDialog(static_cast<wxWindow *>(this), _L("The current project has unsaved changes, save it before continuing?"),
|
auto result = MessageDialog(static_cast<wxWindow *>(this), _L("The current project has unsaved changes, save it before continuing?"),
|
||||||
|
@ -1171,6 +1180,8 @@ wxWindow* PreferencesDialog::create_general_page()
|
||||||
// auto item_backup = create_item_switch(_L("Backup switch"), page, _L("Backup switch"), "units");
|
// auto item_backup = create_item_switch(_L("Backup switch"), page, _L("Backup switch"), "units");
|
||||||
auto item_modelmall = create_item_checkbox(_L("Show online staff-picked models on the home page"), page, _L("Show online staff-picked models on the home page"), 50, "staff_pick_switch");
|
auto item_modelmall = create_item_checkbox(_L("Show online staff-picked models on the home page"), page, _L("Show online staff-picked models on the home page"), 50, "staff_pick_switch");
|
||||||
|
|
||||||
|
auto item_show_history = create_item_checkbox(_L("Show history on the home page"), page, _L("Show history on the home page"), 50, "show_print_history");
|
||||||
|
|
||||||
auto title_project = create_item_title(_L("Project"), page, "");
|
auto title_project = create_item_title(_L("Project"), page, "");
|
||||||
auto item_max_recent_count = create_item_input(_L("Maximum recent projects"), "", page, _L("Maximum count of recent projects"), "max_recent_count", [](wxString value) {
|
auto item_max_recent_count = create_item_input(_L("Maximum recent projects"), "", page, _L("Maximum count of recent projects"), "max_recent_count", [](wxString value) {
|
||||||
long max = 0;
|
long max = 0;
|
||||||
|
@ -1234,10 +1245,13 @@ wxWindow* PreferencesDialog::create_general_page()
|
||||||
#endif // _WIN32
|
#endif // _WIN32
|
||||||
auto item_title_modelmall = sizer_page->Add(title_modelmall, 0, wxTOP | wxEXPAND, FromDIP(20));
|
auto item_title_modelmall = sizer_page->Add(title_modelmall, 0, wxTOP | wxEXPAND, FromDIP(20));
|
||||||
auto item_item_modelmall = sizer_page->Add(item_modelmall, 0, wxTOP, FromDIP(3));
|
auto item_item_modelmall = sizer_page->Add(item_modelmall, 0, wxTOP, FromDIP(3));
|
||||||
auto update_modelmall = [this, item_title_modelmall, item_item_modelmall] (wxEvent & e) {
|
auto item_item_show_history = sizer_page->Add(item_show_history, 0, wxTOP, FromDIP(3));
|
||||||
|
|
||||||
|
auto update_modelmall = [this, item_title_modelmall, item_item_modelmall, item_item_show_history] (wxEvent & e) {
|
||||||
bool has_model_mall = wxGetApp().has_model_mall();
|
bool has_model_mall = wxGetApp().has_model_mall();
|
||||||
item_title_modelmall->Show(has_model_mall);
|
item_title_modelmall->Show(has_model_mall);
|
||||||
item_item_modelmall->Show(has_model_mall);
|
item_item_modelmall->Show(has_model_mall);
|
||||||
|
item_item_show_history->Show(has_model_mall);
|
||||||
Layout();
|
Layout();
|
||||||
Fit();
|
Fit();
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue