mirror of
https://git.mirrors.martin98.com/https://github.com/bambulab/BambuStudio.git
synced 2025-09-28 18:23:14 +08:00
ENH: More UserLogin Log
JIRA: none Change-Id: I9f9b8c86ab470f224138f3e6d91b9a454515b02e
This commit is contained in:
parent
1d9819174d
commit
7e26594631
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
#include <boost/cast.hpp>
|
#include <boost/cast.hpp>
|
||||||
#include <boost/lexical_cast.hpp>
|
#include <boost/lexical_cast.hpp>
|
||||||
|
#include <boost/algorithm/string.hpp>
|
||||||
|
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
#include "MainFrame.hpp"
|
#include "MainFrame.hpp"
|
||||||
@ -201,6 +202,7 @@ void ZUserLogin::OnIdle(wxIdleEvent &WXUNUSED(evt))
|
|||||||
void ZUserLogin::OnNavigationRequest(wxWebViewEvent &evt)
|
void ZUserLogin::OnNavigationRequest(wxWebViewEvent &evt)
|
||||||
{
|
{
|
||||||
//wxLogMessage("%s", "Navigation request to '" + evt.GetURL() + "'(target='" + evt.GetTarget() + "')");
|
//wxLogMessage("%s", "Navigation request to '" + evt.GetURL() + "'(target='" + evt.GetTarget() + "')");
|
||||||
|
BOOST_LOG_TRIVIAL(trace) << __FUNCTION__ << ": " << evt.GetURL().ToUTF8().data();
|
||||||
|
|
||||||
UpdateState();
|
UpdateState();
|
||||||
}
|
}
|
||||||
@ -211,6 +213,8 @@ void ZUserLogin::OnNavigationRequest(wxWebViewEvent &evt)
|
|||||||
void ZUserLogin::OnNavigationComplete(wxWebViewEvent &evt)
|
void ZUserLogin::OnNavigationComplete(wxWebViewEvent &evt)
|
||||||
{
|
{
|
||||||
// wxLogMessage("%s", "Navigation complete; url='" + evt.GetURL() + "'");
|
// wxLogMessage("%s", "Navigation complete; url='" + evt.GetURL() + "'");
|
||||||
|
BOOST_LOG_TRIVIAL(trace) << __FUNCTION__ << ": " << evt.GetURL().ToUTF8().data();
|
||||||
|
|
||||||
m_browser->Show();
|
m_browser->Show();
|
||||||
Layout();
|
Layout();
|
||||||
UpdateState();
|
UpdateState();
|
||||||
@ -221,6 +225,8 @@ void ZUserLogin::OnNavigationComplete(wxWebViewEvent &evt)
|
|||||||
*/
|
*/
|
||||||
void ZUserLogin::OnDocumentLoaded(wxWebViewEvent &evt)
|
void ZUserLogin::OnDocumentLoaded(wxWebViewEvent &evt)
|
||||||
{
|
{
|
||||||
|
BOOST_LOG_TRIVIAL(trace) << __FUNCTION__ << ": " << evt.GetURL().ToUTF8().data();
|
||||||
|
|
||||||
// Only notify if the document is the main frame, not a subframe
|
// Only notify if the document is the main frame, not a subframe
|
||||||
wxString tmpUrl = evt.GetURL();
|
wxString tmpUrl = evt.GetURL();
|
||||||
NetworkAgent* agent = wxGetApp().getAgent();
|
NetworkAgent* agent = wxGetApp().getAgent();
|
||||||
@ -239,6 +245,8 @@ void ZUserLogin::OnDocumentLoaded(wxWebViewEvent &evt)
|
|||||||
*/
|
*/
|
||||||
void ZUserLogin::OnNewWindow(wxWebViewEvent &evt)
|
void ZUserLogin::OnNewWindow(wxWebViewEvent &evt)
|
||||||
{
|
{
|
||||||
|
BOOST_LOG_TRIVIAL(trace) << __FUNCTION__ << ": " << evt.GetURL().ToUTF8().data();
|
||||||
|
|
||||||
wxString flag = " (other)";
|
wxString flag = " (other)";
|
||||||
|
|
||||||
if (evt.GetNavigationAction() == wxWEBVIEW_NAV_ACTION_USER) { flag = " (user)"; }
|
if (evt.GetNavigationAction() == wxWEBVIEW_NAV_ACTION_USER) { flag = " (user)"; }
|
||||||
@ -380,6 +388,7 @@ void ZUserLogin::OnError(wxWebViewEvent &evt)
|
|||||||
ShowErrorPage();
|
ShowErrorPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOST_LOG_TRIVIAL(trace) << __FUNCTION__ << ": " << evt.GetURL().ToUTF8().data();
|
||||||
// wxLogMessage("%s", "Error; url='" + evt.GetURL() + "', error='" +
|
// wxLogMessage("%s", "Error; url='" + evt.GetURL() + "', error='" +
|
||||||
// category + " (" + evt.GetString() + ")'");
|
// category + " (" + evt.GetString() + ")'");
|
||||||
|
|
||||||
@ -413,6 +422,7 @@ bool ZUserLogin::ShowErrorPage()
|
|||||||
std::string ZUserLogin::GetStudioLanguage()
|
std::string ZUserLogin::GetStudioLanguage()
|
||||||
{
|
{
|
||||||
std::string strLanguage = wxGetApp().app_config->get("language");
|
std::string strLanguage = wxGetApp().app_config->get("language");
|
||||||
|
boost::trim(strLanguage);
|
||||||
if (strLanguage.empty()) strLanguage = "en";
|
if (strLanguage.empty()) strLanguage = "en";
|
||||||
|
|
||||||
return strLanguage;
|
return strLanguage;
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
#include <boost/property_tree/json_parser.hpp>
|
#include <boost/property_tree/json_parser.hpp>
|
||||||
#include <boost/chrono.hpp>
|
#include <boost/chrono.hpp>
|
||||||
#include <boost/beast/core/detail/base64.hpp>
|
#include <boost/beast/core/detail/base64.hpp>
|
||||||
|
#include <boost/algorithm/string.hpp>
|
||||||
|
|
||||||
#include <wx/sizer.h>
|
#include <wx/sizer.h>
|
||||||
#include <wx/toolbar.h>
|
#include <wx/toolbar.h>
|
||||||
@ -1931,7 +1932,8 @@ void WebViewPanel::SetWebviewShow(wxString name, bool show)
|
|||||||
|
|
||||||
std::string WebViewPanel::GetStudioLanguage()
|
std::string WebViewPanel::GetStudioLanguage()
|
||||||
{
|
{
|
||||||
std::string strLanguage=wxGetApp().app_config->get("language");
|
std::string strLanguage = wxGetApp().app_config->get("language");
|
||||||
|
boost::trim(strLanguage);
|
||||||
if (strLanguage.empty()) strLanguage = "en";
|
if (strLanguage.empty()) strLanguage = "en";
|
||||||
|
|
||||||
return strLanguage;
|
return strLanguage;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user