From c731a1aceb38d4255372106b950eaae70287443b Mon Sep 17 00:00:00 2001 From: Stone Li Date: Mon, 22 May 2023 11:33:33 +0800 Subject: [PATCH] NEW: auto logout when mqtt return code = 5 Change-Id: I75f7d0939d8483ad612408df9fe817ed652f9634 Signed-off-by: Stone Li --- src/slic3r/GUI/GUI_App.cpp | 12 +++++++++++- version.inc | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index b1510337c4..0f0ef83542 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -1830,8 +1830,18 @@ void GUI_App::init_networking_callbacks() // GUI::wxGetApp().request_user_handle(online_login); // }); - m_agent->set_on_server_connected_fn([this]() { + m_agent->set_on_server_connected_fn([this](int return_code, int reason_code) { if (m_is_closing) { + return; + } + if (return_code == 5) { + GUI::wxGetApp().CallAfter([this] { + this->request_user_logout(); + MessageDialog msg_dlg(nullptr, _L("Login information expired. Please login again."), "", wxAPPLY | wxOK); + if (msg_dlg.ShowModal() == wxOK) { + return; + } + }); return; } GUI::wxGetApp().CallAfter([this] { diff --git a/version.inc b/version.inc index 03c6ee698f..3b7fd5148b 100644 --- a/version.inc +++ b/version.inc @@ -12,4 +12,4 @@ set(BBL_INTERNAL_TESTING "1") endif() # The build_version should start from 50 in master branch -set(SLIC3R_VERSION "01.06.05.01") +set(SLIC3R_VERSION "01.06.07.51")