mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-02 05:40:39 +08:00
Store dialog decline in app config
This commit is contained in:
parent
0e889eae09
commit
ac2545fede
@ -210,6 +210,9 @@ void AppConfig::set_defaults()
|
||||
if (get("allow_ip_resolve").empty())
|
||||
set("allow_ip_resolve", "1");
|
||||
|
||||
if (get("wifi_config_dialog_declined").empty())
|
||||
set("wifi_config_dialog_declined", "0");
|
||||
|
||||
#ifdef _WIN32
|
||||
if (get("use_legacy_3DConnexion").empty())
|
||||
set("use_legacy_3DConnexion", "0");
|
||||
|
@ -3579,7 +3579,9 @@ void GUI_App::open_wifi_config_dialog(bool forced, const wxString& drive_path/*
|
||||
if(m_wifi_config_dialog_shown)
|
||||
return;
|
||||
|
||||
if (!forced && m_wifi_config_dialog_was_declined) {
|
||||
bool dialog_was_declined = app_config->get_bool("wifi_config_dialog_declined");
|
||||
|
||||
if (!forced && dialog_was_declined) {
|
||||
|
||||
// dialog was already declined this run, show only notification
|
||||
notification_manager()->push_notification(NotificationType::WifiConfigFileDetected
|
||||
@ -3597,12 +3599,11 @@ void GUI_App::open_wifi_config_dialog(bool forced, const wxString& drive_path/*
|
||||
std::string file_path;
|
||||
WifiConfigDialog dialog(mainframe, file_path, removable_drive_manager(), drive_path);
|
||||
if (dialog.ShowModal() == wxID_OK) {
|
||||
//wxString used_path = dialog.get_used_path();
|
||||
//if(std::find(m_wifi_config_dialog_used_paths.begin(), m_wifi_config_dialog_used_paths.end(), used_path) == m_wifi_config_dialog_used_paths.end())
|
||||
// m_wifi_config_dialog_used_paths.emplace_back(std::move(used_path));
|
||||
plater_->get_notification_manager()->push_exporting_finished_notification(file_path, boost::filesystem::path(file_path).parent_path().string(), true);
|
||||
} else
|
||||
m_wifi_config_dialog_was_declined = true;
|
||||
app_config->set("wifi_config_dialog_declined", "0");
|
||||
} else {
|
||||
app_config->set("wifi_config_dialog_declined", "1");
|
||||
}
|
||||
m_wifi_config_dialog_shown = false;
|
||||
}
|
||||
|
||||
|
@ -2286,9 +2286,9 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
|
||||
});
|
||||
|
||||
this->q->Bind(EVT_REMOVABLE_DRIVE_ADDED, [this](wxCommandEvent& evt) {
|
||||
const std::string CONFIG_FILE_NAME = "prusa_printer_settings.ini";
|
||||
if (!fs::exists(fs::path(evt.GetString().utf8_string()) / "prusa_printer_settings.ini"))
|
||||
return;
|
||||
if (evt.GetInt() == 0) { // not at startup, show dialog
|
||||
if (fs::exists(fs::path(evt.GetString().utf8_string()) / CONFIG_FILE_NAME))
|
||||
wxGetApp().open_wifi_config_dialog(false, evt.GetString());
|
||||
} else { // at startup, show only notification
|
||||
notification_manager->push_notification(NotificationType::WifiConfigFileDetected
|
||||
@ -2296,8 +2296,7 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
|
||||
// TRN Text of notification when Slicer starts and usb stick with printer settings ini file is present
|
||||
, _u8L("Printer configuration file detected on removable media.")
|
||||
// TRN Text of hypertext of notification when Slicer starts and usb stick with printer settings ini file is present
|
||||
, _u8L("Write Wi-Fi credetials."), [evt, CONFIG_FILE_NAME](wxEvtHandler* evt_hndlr){
|
||||
//if (fs::exists(fs::path(evt.GetString().utf8_string()) / CONFIG_FILE_NAME))
|
||||
, _u8L("Write Wi-Fi credetials."), [evt/*, CONFIG_FILE_NAME*/](wxEvtHandler* evt_hndlr){
|
||||
wxGetApp().open_wifi_config_dialog(true, evt.GetString());
|
||||
return true;});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user