diff --git a/src/slic3r/GUI/ImageGrid.cpp b/src/slic3r/GUI/ImageGrid.cpp index f8d791e58..3f4d515d9 100644 --- a/src/slic3r/GUI/ImageGrid.cpp +++ b/src/slic3r/GUI/ImageGrid.cpp @@ -46,6 +46,8 @@ ImageGrid::ImageGrid(wxWindow * parent) , m_model_time_icon(this, "model_time", 14) , m_model_weight_icon(this, "model_weight", 14) { + m_cell_size.Set(396, 228); + SetBackgroundStyle(wxBG_STYLE_PAINT); SetBackgroundColour(0xEEEEEE); SetFont(Label::Head_20); diff --git a/src/slic3r/GUI/MediaFilePanel.cpp b/src/slic3r/GUI/MediaFilePanel.cpp index 821be622c..dd3eb9dcb 100644 --- a/src/slic3r/GUI/MediaFilePanel.cpp +++ b/src/slic3r/GUI/MediaFilePanel.cpp @@ -218,7 +218,8 @@ void MediaFilePanel::SetMachineObject(MachineObject* obj) m_remote_support = false; m_model_download_support = false; } - if (machine == m_machine && m_image_grid->GetFileSystem()) { + Enable(obj && obj->is_connected() && obj->m_push_count > 0); + if (machine == m_machine && (m_image_grid->GetFileSystem() || (!m_local_support && !m_remote_support))) { if (m_waiting_enable && IsEnabled()) { auto fs = m_image_grid->GetFileSystem(); if (fs) fs->Retry(); @@ -237,6 +238,8 @@ void MediaFilePanel::SetMachineObject(MachineObject* obj) SetSelecting(false); if (m_machine.empty()) { m_image_grid->SetStatus(m_bmp_failed, _L("No printers.")); + } else if (!IsEnabled()) { + m_image_grid->SetStatus(m_bmp_failed, _L("Initialize failed (Device connection not ready)!")); } else if (!m_local_support && !m_remote_support) { m_image_grid->SetStatus(m_bmp_failed, _L("Initialize failed (Not supported on the current printer version)!")); } else { diff --git a/src/slic3r/GUI/MediaPlayCtrl.cpp b/src/slic3r/GUI/MediaPlayCtrl.cpp index 981d14dd4..74f3c5e51 100644 --- a/src/slic3r/GUI/MediaPlayCtrl.cpp +++ b/src/slic3r/GUI/MediaPlayCtrl.cpp @@ -120,6 +120,7 @@ void MediaPlayCtrl::SetMachineObject(MachineObject* obj) m_remote_support = true; m_device_busy = false; } + Enable(obj && obj->is_connected() && obj->m_push_count > 0); if (machine == m_machine) { if (m_last_state == MEDIASTATE_IDLE && IsEnabled()) Play(); diff --git a/src/slic3r/GUI/Monitor.cpp b/src/slic3r/GUI/Monitor.cpp index 0162e74ef..41b718534 100644 --- a/src/slic3r/GUI/Monitor.cpp +++ b/src/slic3r/GUI/Monitor.cpp @@ -348,8 +348,8 @@ void MonitorPanel::update_all() } m_status_info_panel->obj = obj; - m_status_info_panel->m_media_play_ctrl->SetMachineObject(obj); m_upgrade_panel->update(obj); + m_status_info_panel->m_media_play_ctrl->SetMachineObject(obj); m_media_file_panel->SetMachineObject(obj); m_side_tools->update_status(obj); @@ -476,7 +476,6 @@ Freeze(); m_status_info_panel->show_status(status); m_hms_panel->show_status(status); m_upgrade_panel->show_status(status); - m_media_file_panel->Enable(status == MonitorStatus::MONITOR_NORMAL); if ((status & (int)MonitorStatus::MONITOR_NO_PRINTER) != 0) { set_default(); diff --git a/src/slic3r/GUI/StatusPanel.cpp b/src/slic3r/GUI/StatusPanel.cpp index 84d1d5fbb..33cd58cd4 100644 --- a/src/slic3r/GUI/StatusPanel.cpp +++ b/src/slic3r/GUI/StatusPanel.cpp @@ -4022,13 +4022,11 @@ void StatusPanel::show_status(int status) m_calibration_btn->Disable(); m_options_btn->Disable(); m_panel_monitoring_title->Disable(); - m_media_play_ctrl->Disable(); } else if ((status & (int) MonitorStatus::MONITOR_NORMAL) != 0) { show_printing_status(true, true); m_calibration_btn->Disable(); m_options_btn->Enable(); m_panel_monitoring_title->Enable(); - m_media_play_ctrl->Enable(); } } diff --git a/src/slic3r/Utils/PresetUpdater.cpp b/src/slic3r/Utils/PresetUpdater.cpp index 787b797ee..d1d49b09f 100644 --- a/src/slic3r/Utils/PresetUpdater.cpp +++ b/src/slic3r/Utils/PresetUpdater.cpp @@ -1030,12 +1030,16 @@ void PresetUpdater::priv::sync_printer_config(std::string http_url) auto cache_folder = data_dir_path / "ota" / "printers"; try { - boost::filesystem::load_string_file(config_folder / "version.txt", curr_version); - boost::algorithm::trim(curr_version); + if (fs::exists(config_folder / "version.txt")) { + fs::load_string_file(config_folder / "version.txt", curr_version); + boost::algorithm::trim(curr_version); + } } catch (...) {} try { - boost::filesystem::load_string_file(cache_folder / "version.txt", cached_version); - boost::algorithm::trim(cached_version); + if (fs::exists(cache_folder / "version.txt")) { + fs::load_string_file(cache_folder / "version.txt", cached_version); + boost::algorithm::trim(cached_version); + } } catch (...) {} if (!cached_version.empty()) { bool need_delete_cache = false; @@ -1068,9 +1072,11 @@ void PresetUpdater::priv::sync_printer_config(std::string http_url) bool result = false; try { - boost::filesystem::load_string_file(cache_folder / "version.txt", cached_version); - boost::algorithm::trim(cached_version); - result = true; + if (fs::exists(cache_folder / "version.txt")) { + fs::load_string_file(cache_folder / "version.txt", cached_version); + boost::algorithm::trim(cached_version); + result = true; + } } catch (...) {} if (result) { BOOST_LOG_TRIVIAL(info) << format("[BBL Updater] found new printer config: %1%, prompt to update", cached_version); @@ -1187,12 +1193,16 @@ Updates PresetUpdater::priv::get_printer_config_updates(bool update) const std::string curr_version; std::string resc_version; try { - boost::filesystem::load_string_file(resc_folder / "version.txt", resc_version); - boost::algorithm::trim(resc_version); + if (fs::exists(resc_folder / "version.txt")) { + fs::load_string_file(resc_folder / "version.txt", resc_version); + boost::algorithm::trim(resc_version); + } } catch (...) {} try { - boost::filesystem::load_string_file(config_folder / "version.txt", curr_version); - boost::algorithm::trim(curr_version); + if (fs::exists(config_folder / "version.txt")) { + fs::load_string_file(config_folder / "version.txt", curr_version); + boost::algorithm::trim(curr_version); + } } catch (...) {} if (!curr_version.empty()) {