ENH: support turn off liveview auto retry
Change-Id: I24b39f74e0a40a13277d6eae3830c95c5c9de333 Jira: none (cherry picked from commit f6ceb3fb8e4df3f876c50a1c4ba96b4a1be60190)
This commit is contained in:
parent
cc7ef50bd0
commit
2564c51b36
|
@ -8,6 +8,7 @@
|
||||||
#include <wx/clipbrd.h>
|
#include <wx/clipbrd.h>
|
||||||
#include <wx/dcgraph.h>
|
#include <wx/dcgraph.h>
|
||||||
#include "GUI_App.hpp"
|
#include "GUI_App.hpp"
|
||||||
|
#include <slic3r/GUI/StatusPanel.hpp>
|
||||||
|
|
||||||
namespace Slic3r {
|
namespace Slic3r {
|
||||||
namespace GUI {
|
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_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));
|
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<MediaPlayCtrl *>(GetParent()->FindWindowByLabel("MediaPlayCtrl"))->SetAutoRetry(e.IsChecked());
|
||||||
|
e.Skip();
|
||||||
|
});
|
||||||
|
#endif
|
||||||
|
|
||||||
//resolution
|
//resolution
|
||||||
m_text_resolution = new wxStaticText(m_panel, wxID_ANY, _L("Resolution"));
|
m_text_resolution = new wxStaticText(m_panel, wxID_ANY, _L("Resolution"));
|
||||||
m_text_resolution->Wrap(-1);
|
m_text_resolution->Wrap(-1);
|
||||||
|
|
|
@ -67,6 +67,8 @@ private:
|
||||||
SwitchButton* m_switch_recording;
|
SwitchButton* m_switch_recording;
|
||||||
wxStaticText* m_text_vcamera;
|
wxStaticText* m_text_vcamera;
|
||||||
SwitchButton* m_switch_vcamera;
|
SwitchButton* m_switch_vcamera;
|
||||||
|
wxStaticText* m_text_liveview_retry;
|
||||||
|
SwitchButton* m_switch_liveview_retry;
|
||||||
wxStaticText* m_text_resolution;
|
wxStaticText* m_text_resolution;
|
||||||
wxWindow* m_resolution_options[RESOLUTION_OPTIONS_NUM];
|
wxWindow* m_resolution_options[RESOLUTION_OPTIONS_NUM];
|
||||||
wxScrolledWindow *m_panel;
|
wxScrolledWindow *m_panel;
|
||||||
|
|
|
@ -31,6 +31,7 @@ MediaPlayCtrl::MediaPlayCtrl(wxWindow *parent, wxMediaCtrl2 *media_ctrl, const w
|
||||||
: wxPanel(parent, wxID_ANY, pos, size)
|
: wxPanel(parent, wxID_ANY, pos, size)
|
||||||
, m_media_ctrl(media_ctrl)
|
, m_media_ctrl(media_ctrl)
|
||||||
{
|
{
|
||||||
|
SetLabel("MediaPlayCtrl");
|
||||||
SetBackgroundColour(*wxWHITE);
|
SetBackgroundColour(*wxWHITE);
|
||||||
m_media_ctrl->Bind(wxEVT_MEDIA_STATECHANGED, &MediaPlayCtrl::onStateChanged, this);
|
m_media_ctrl->Bind(wxEVT_MEDIA_STATECHANGED, &MediaPlayCtrl::onStateChanged, this);
|
||||||
|
|
||||||
|
@ -146,6 +147,11 @@ void MediaPlayCtrl::SetMachineObject(MachineObject* obj)
|
||||||
SetStatus("", false);
|
SetStatus("", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MediaPlayCtrl::SetAutoRetry(bool b)
|
||||||
|
{
|
||||||
|
m_auto_retry = b;
|
||||||
|
}
|
||||||
|
|
||||||
wxString hide_passwd(wxString url, std::vector<wxString> const &passwords)
|
wxString hide_passwd(wxString url, std::vector<wxString> const &passwords)
|
||||||
{
|
{
|
||||||
for (auto &p : passwords) {
|
for (auto &p : passwords) {
|
||||||
|
@ -281,7 +287,7 @@ void MediaPlayCtrl::Stop(wxString const &msg)
|
||||||
SetStatus(_L("Stopped [%d]!"), true);
|
SetStatus(_L("Stopped [%d]!"), true);
|
||||||
else
|
else
|
||||||
SetStatus(_L("Stopped."), false);
|
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();
|
m_next_retry = wxDateTime();
|
||||||
} else if (!msg.IsEmpty()) {
|
} else if (!msg.IsEmpty()) {
|
||||||
SetStatus(msg, false);
|
SetStatus(msg, false);
|
||||||
|
|
|
@ -36,6 +36,8 @@ public:
|
||||||
|
|
||||||
void SetMachineObject(MachineObject * obj);
|
void SetMachineObject(MachineObject * obj);
|
||||||
|
|
||||||
|
void SetAutoRetry(bool b);
|
||||||
|
|
||||||
bool IsStreaming() const;
|
bool IsStreaming() const;
|
||||||
|
|
||||||
void ToggleStream();
|
void ToggleStream();
|
||||||
|
@ -84,6 +86,7 @@ private:
|
||||||
bool m_remote_support = false;
|
bool m_remote_support = false;
|
||||||
bool m_device_busy = false;
|
bool m_device_busy = false;
|
||||||
bool m_disable_lan = false;
|
bool m_disable_lan = false;
|
||||||
|
bool m_auto_retry = true;
|
||||||
wxString m_url;
|
wxString m_url;
|
||||||
|
|
||||||
std::deque<wxString> m_tasks;
|
std::deque<wxString> m_tasks;
|
||||||
|
|
Loading…
Reference in New Issue