ENH:rry again after subscription failure
Change-Id: Ieedc4059834561ed77f2e66dbf93be21a2d62b61
This commit is contained in:
parent
7ffeb1a432
commit
6c8f82334e
3 changed files with 23 additions and 1 deletions
|
@ -570,7 +570,8 @@ wxString get_fail_reason(int code)
|
|||
{
|
||||
EndModal(wxID_OK);
|
||||
MessageDialog msg_wingow(nullptr, _L("Log in successful."), "", wxAPPLY | wxOK);
|
||||
if (msg_wingow.ShowModal() == wxOK) { return; }
|
||||
msg_wingow.ShowModal();
|
||||
if(m_machine_info) wxGetApp().on_start_subscribe_again(m_machine_info->dev_id);
|
||||
}
|
||||
|
||||
void BindMachineDialog::on_bind_printer(wxCommandEvent &event)
|
||||
|
|
|
@ -2221,6 +2221,25 @@ void GUI_App::update_http_extra_header()
|
|||
m_agent->set_extra_http_header(extra_headers);
|
||||
}
|
||||
|
||||
void GUI_App::on_start_subscribe_again(std::string dev_id)
|
||||
{
|
||||
auto start_subscribe_timer = new wxTimer(this, wxID_ANY);
|
||||
Bind(wxEVT_TIMER, [this, start_subscribe_timer, dev_id](auto& e) {
|
||||
Slic3r::DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager();
|
||||
if (!dev) return;
|
||||
MachineObject* obj = dev->get_selected_machine();
|
||||
if (!obj) return;
|
||||
|
||||
if ( (dev_id == obj->dev_id) && obj->is_connecting() ) {
|
||||
if(wxGetApp().getAgent()) wxGetApp().getAgent()->set_user_selected_machine(dev_id);
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ": dev_id=" << obj->dev_id;
|
||||
}
|
||||
|
||||
start_subscribe_timer->Stop();
|
||||
});
|
||||
start_subscribe_timer->Start(4000, wxTIMER_ONE_SHOT);
|
||||
}
|
||||
|
||||
std::string GUI_App::get_local_models_path()
|
||||
{
|
||||
std::string local_path = "";
|
||||
|
|
|
@ -297,6 +297,8 @@ private:
|
|||
|
||||
boost::thread m_check_network_thread;
|
||||
public:
|
||||
//try again when subscription fails
|
||||
void on_start_subscribe_again(std::string dev_id);
|
||||
void check_filaments_in_blacklist(std::string tag_supplier, std::string tag_material, bool& in_blacklist, std::string& action, std::string& info);
|
||||
std::string get_local_models_path();
|
||||
bool OnInit() override;
|
||||
|
|
Loading…
Reference in a new issue