diff --git a/src/slic3r/GUI/CameraPopup.cpp b/src/slic3r/GUI/CameraPopup.cpp index 393540d45..9639bb8d3 100644 --- a/src/slic3r/GUI/CameraPopup.cpp +++ b/src/slic3r/GUI/CameraPopup.cpp @@ -8,6 +8,7 @@ #include #include #include "GUI_App.hpp" +#include namespace Slic3r { namespace GUI { @@ -64,6 +65,23 @@ CameraPopup::CameraPopup(wxWindow *parent) top_sizer->Add(m_text_vcamera, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT | wxALL, FromDIP(5)); top_sizer->Add(m_switch_vcamera, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, FromDIP(5)); +#if !BBL_RELEASE_TO_PUBLIC + m_text_liveview_retry = new wxStaticText(m_panel, wxID_ANY, _L("Liveview Retry")); + m_text_liveview_retry->Wrap(-1); + m_text_liveview_retry->SetFont(Label::Head_14); + m_text_liveview_retry->SetForegroundColour(TEXT_COL); + m_switch_liveview_retry = new SwitchButton(m_panel); + m_switch_liveview_retry->SetValue(true); + + top_sizer->Add(m_text_liveview_retry, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT | wxALL, FromDIP(5)); + top_sizer->Add(m_switch_liveview_retry, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, FromDIP(5)); + + m_switch_liveview_retry->Bind(wxEVT_TOGGLEBUTTON, [this](wxCommandEvent &e) { + dynamic_cast(GetParent()->FindWindowByLabel("MediaPlayCtrl"))->SetAutoRetry(e.IsChecked()); + e.Skip(); + }); +#endif + //resolution m_text_resolution = new wxStaticText(m_panel, wxID_ANY, _L("Resolution")); m_text_resolution->Wrap(-1); diff --git a/src/slic3r/GUI/CameraPopup.hpp b/src/slic3r/GUI/CameraPopup.hpp index f76d7bc61..31bc98f10 100644 --- a/src/slic3r/GUI/CameraPopup.hpp +++ b/src/slic3r/GUI/CameraPopup.hpp @@ -67,6 +67,8 @@ private: SwitchButton* m_switch_recording; wxStaticText* m_text_vcamera; SwitchButton* m_switch_vcamera; + wxStaticText* m_text_liveview_retry; + SwitchButton* m_switch_liveview_retry; wxStaticText* m_text_resolution; wxWindow* m_resolution_options[RESOLUTION_OPTIONS_NUM]; wxScrolledWindow *m_panel; diff --git a/src/slic3r/GUI/MediaPlayCtrl.cpp b/src/slic3r/GUI/MediaPlayCtrl.cpp index 74f3c5e51..afed708fa 100644 --- a/src/slic3r/GUI/MediaPlayCtrl.cpp +++ b/src/slic3r/GUI/MediaPlayCtrl.cpp @@ -31,6 +31,7 @@ MediaPlayCtrl::MediaPlayCtrl(wxWindow *parent, wxMediaCtrl2 *media_ctrl, const w : wxPanel(parent, wxID_ANY, pos, size) , m_media_ctrl(media_ctrl) { + SetLabel("MediaPlayCtrl"); SetBackgroundColour(*wxWHITE); m_media_ctrl->Bind(wxEVT_MEDIA_STATECHANGED, &MediaPlayCtrl::onStateChanged, this); @@ -146,6 +147,11 @@ void MediaPlayCtrl::SetMachineObject(MachineObject* obj) SetStatus("", false); } +void MediaPlayCtrl::SetAutoRetry(bool b) +{ + m_auto_retry = b; +} + wxString hide_passwd(wxString url, std::vector const &passwords) { for (auto &p : passwords) { @@ -281,7 +287,7 @@ void MediaPlayCtrl::Stop(wxString const &msg) SetStatus(_L("Stopped [%d]!"), true); else SetStatus(_L("Stopped."), false); - if (m_failed_code >= 100) // not keep retry on local error + if (!m_auto_retry || m_failed_code >= 100) // not keep retry on local error m_next_retry = wxDateTime(); } else if (!msg.IsEmpty()) { SetStatus(msg, false); diff --git a/src/slic3r/GUI/MediaPlayCtrl.h b/src/slic3r/GUI/MediaPlayCtrl.h index 79ce3a4b9..1508150ff 100644 --- a/src/slic3r/GUI/MediaPlayCtrl.h +++ b/src/slic3r/GUI/MediaPlayCtrl.h @@ -36,6 +36,8 @@ public: void SetMachineObject(MachineObject * obj); + void SetAutoRetry(bool b); + bool IsStreaming() const; void ToggleStream(); @@ -84,6 +86,7 @@ private: bool m_remote_support = false; bool m_device_busy = false; bool m_disable_lan = false; + bool m_auto_retry = true; wxString m_url; std::deque m_tasks;