From 3992e25c93bcd9fd75f4530f47b34f56aacaff80 Mon Sep 17 00:00:00 2001 From: tao wang Date: Mon, 17 Oct 2022 16:31:58 +0800 Subject: [PATCH] FIX:disable the send button if not on same LAN Change-Id: I730fc3b14ab048b4336c0164f775f870a9b171b8 --- src/slic3r/GUI/SelectMachine.hpp | 3 ++- src/slic3r/GUI/SendToPrinter.cpp | 14 +++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/SelectMachine.hpp b/src/slic3r/GUI/SelectMachine.hpp index fbbb03a64..853429213 100644 --- a/src/slic3r/GUI/SelectMachine.hpp +++ b/src/slic3r/GUI/SelectMachine.hpp @@ -253,7 +253,8 @@ enum PrintDialogStatus { PrintStatusSendingCanceled, PrintStatusLanModeNoSdcard, PrintStatusNoSdcard, - PrintStatusTimelapseNoSdcard + PrintStatusTimelapseNoSdcard, + PrintStatusNotOnTheSameLAN }; std::string get_print_status_info(PrintDialogStatus status); diff --git a/src/slic3r/GUI/SendToPrinter.cpp b/src/slic3r/GUI/SendToPrinter.cpp index d4ca09787..8f619058c 100644 --- a/src/slic3r/GUI/SendToPrinter.cpp +++ b/src/slic3r/GUI/SendToPrinter.cpp @@ -655,7 +655,7 @@ void SendToPrinterDialog::on_timer(wxTimerEvent &event) void SendToPrinterDialog::on_selection_changed(wxCommandEvent &event) { /* reset timeout and reading printer info */ - m_status_bar->reset(); + //m_status_bar->reset(); timeout_count = 0; auto selection = m_comboBox_printer->GetSelection(); @@ -745,6 +745,12 @@ void SendToPrinterDialog::update_show_status() return; } + if (obj_->dev_ip.empty()) { + show_status(PrintDialogStatus::PrintStatusNotOnTheSameLAN); + return; + } + + show_status(PrintDialogStatus::PrintStatusReadingFinished); } @@ -847,6 +853,12 @@ void SendToPrinterDialog::show_status(PrintDialogStatus status, std::vector