mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-06-11 06:23:08 +00:00
feature add bury point for webview init.
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include "I18N.hpp"
|
||||
|
||||
#include <wx/display.h>
|
||||
#include "sentry_wrapper/SentryWrapper.hpp"
|
||||
|
||||
namespace fs = boost::filesystem;
|
||||
|
||||
@@ -268,6 +269,19 @@ void MarkdownTip::OnTitleChanged(wxWebViewEvent& event)
|
||||
}
|
||||
void MarkdownTip::OnError(wxWebViewEvent& event)
|
||||
{
|
||||
auto e = "unknown error";
|
||||
switch (event.GetInt()) {
|
||||
case wxWEBVIEW_NAV_ERR_CONNECTION: e = "wxWEBVIEW_NAV_ERR_CONNECTION"; break;
|
||||
case wxWEBVIEW_NAV_ERR_CERTIFICATE: e = "wxWEBVIEW_NAV_ERR_CERTIFICATE"; break;
|
||||
case wxWEBVIEW_NAV_ERR_AUTH: e = "wxWEBVIEW_NAV_ERR_AUTH"; break;
|
||||
case wxWEBVIEW_NAV_ERR_SECURITY: e = "wxWEBVIEW_NAV_ERR_SECURITY"; break;
|
||||
case wxWEBVIEW_NAV_ERR_NOT_FOUND: e = "wxWEBVIEW_NAV_ERR_NOT_FOUND"; break;
|
||||
case wxWEBVIEW_NAV_ERR_REQUEST: e = "wxWEBVIEW_NAV_ERR_REQUEST"; break;
|
||||
case wxWEBVIEW_NAV_ERR_USER_CANCELLED: e = "wxWEBVIEW_NAV_ERR_USER_CANCELLED"; break;
|
||||
case wxWEBVIEW_NAV_ERR_OTHER: e = "wxWEBVIEW_NAV_ERR_OTHER"; break;
|
||||
}
|
||||
BOOST_LOG_TRIVIAL(fatal) << __FUNCTION__<< boost::format(":MarkdownTip error loading page %1% %2% %3% %4%") % event.GetURL() % event.GetTarget() %e % event.GetString();
|
||||
Slic3r::sentryReportLog(Slic3r::SENTRY_LOG_FATAL, "bury_point_init MarkdownTip webview fail", BP_WEB_VIEW);
|
||||
}
|
||||
|
||||
void MarkdownTip::OnTimer(wxTimerEvent& event)
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include <slic3r/GUI/Widgets/WebView.hpp>
|
||||
#include <wx/webview.h>
|
||||
#include "slic3r/GUI/SSWCP.hpp"
|
||||
#include "sentry_wrapper/SentryWrapper.hpp"
|
||||
|
||||
namespace pt = boost::property_tree;
|
||||
|
||||
@@ -184,6 +185,7 @@ void PrinterWebView::OnError(wxWebViewEvent &evt)
|
||||
break;
|
||||
}
|
||||
BOOST_LOG_TRIVIAL(fatal) << __FUNCTION__<< boost::format(":PrinterWebView error loading page %1% %2% %3% %4%") %evt.GetURL() %evt.GetTarget() %e %evt.GetString();
|
||||
Slic3r::sentryReportLog(Slic3r::SENTRY_LOG_FATAL, "bury_point_init PrinterWebView webview fail", BP_WEB_VIEW);
|
||||
}
|
||||
|
||||
void PrinterWebView::OnLoaded(wxWebViewEvent &evt)
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "Plater.hpp"
|
||||
#include "BitmapCache.hpp"
|
||||
#include "slic3r/GUI/GUI_App.hpp"
|
||||
#include "sentry_wrapper/SentryWrapper.hpp"
|
||||
|
||||
namespace Slic3r { namespace GUI {
|
||||
|
||||
@@ -457,6 +458,7 @@ void UpdateVersionDialog::OnError(wxWebViewEvent& event)
|
||||
case wxWEBVIEW_NAV_ERR_OTHER: e = "wxWEBVIEW_NAV_ERR_OTHER"; break;
|
||||
}
|
||||
BOOST_LOG_TRIVIAL(fatal) << __FUNCTION__<< boost::format(":UpdateVersionDialog error loading page %1% %2% %3% %4%") % event.GetURL() % event.GetTarget() %e %event.GetString();
|
||||
Slic3r::sentryReportLog(Slic3r::SENTRY_LOG_FATAL, "bury_point_init UpdateVersionDialog webview fail", BP_WEB_VIEW);
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "SSWCP.hpp"
|
||||
#include <wx/sizer.h>
|
||||
#include <slic3r/GUI/Widgets/WebView.hpp>
|
||||
#include "sentry_wrapper/SentryWrapper.hpp"
|
||||
|
||||
namespace Slic3r { namespace GUI {
|
||||
|
||||
@@ -117,7 +118,7 @@ void WebDeviceDialog::OnError(wxWebViewEvent &evt)
|
||||
case wxWEBVIEW_NAV_ERR_OTHER: e = "wxWEBVIEW_NAV_ERR_OTHER"; break;
|
||||
}
|
||||
BOOST_LOG_TRIVIAL(fatal) << __FUNCTION__<< boost::format(":WebDeviceDialog error loading page %1% %2% %3% %4%") % evt.GetURL() % evt.GetTarget() % e %evt.GetString();
|
||||
|
||||
Slic3r::sentryReportLog(Slic3r::SENTRY_LOG_FATAL, "bury_point_init WebDeviceDialog webview fail", BP_WEB_VIEW);
|
||||
}
|
||||
|
||||
void WebDeviceDialog::OnScriptMessage(wxWebViewEvent &evt)
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include <libslic3r/Utils.hpp>
|
||||
#include "CreatePresetsDialog.hpp"
|
||||
#include <mutex>
|
||||
#include "bury_cfg/bury_point.hpp"
|
||||
#include "sentry_wrapper/SentryWrapper.hpp"
|
||||
|
||||
using namespace nlohmann;
|
||||
|
||||
@@ -611,6 +611,7 @@ void GuideFrame::OnError(wxWebViewEvent& event)
|
||||
}
|
||||
|
||||
BOOST_LOG_TRIVIAL(fatal) << __FUNCTION__<< boost::format(":GuideFrame error loading page %1% %2% %3% %4%") % event.GetURL() % event.GetTarget() %e % event.GetString();
|
||||
Slic3r::sentryReportLog(Slic3r::SENTRY_LOG_FATAL, "bury_point_init GuideFrame webview fail", BP_WEB_VIEW);
|
||||
}
|
||||
|
||||
void GuideFrame::OnScriptResponseMessage(wxCommandEvent &WXUNUSED(evt))
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <wx/sizer.h>
|
||||
#include <slic3r/GUI/Widgets/WebView.hpp>
|
||||
#include "NotificationManager.hpp"
|
||||
#include "sentry_wrapper/SentryWrapper.hpp"
|
||||
|
||||
namespace Slic3r { namespace GUI {
|
||||
|
||||
@@ -166,6 +167,7 @@ void WebPreprintDialog::OnError(wxWebViewEvent &event)
|
||||
}
|
||||
|
||||
BOOST_LOG_TRIVIAL(fatal) << __FUNCTION__<< boost::format(":WebPreprintDialog error loading page %1% %2% %3% %4%") % event.GetURL() % event.GetTarget() %e % event.GetString();
|
||||
Slic3r::sentryReportLog(Slic3r::SENTRY_LOG_FATAL, "bury_point_init WebPreprintDialog webview fail", BP_WEB_VIEW);
|
||||
}
|
||||
|
||||
void WebPreprintDialog::OnScriptMessage(wxWebViewEvent &evt)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "libslic3r/AppConfig.hpp"
|
||||
#include "slic3r/GUI/wxExtensions.hpp"
|
||||
#include "slic3r/GUI/GUI_App.hpp"
|
||||
#include "common_func/common_func.hpp"
|
||||
#include "sentry_wrapper/SentryWrapper.hpp"
|
||||
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/toolbar.h>
|
||||
@@ -707,6 +707,7 @@ void WebPresetDialog::OnError(wxWebViewEvent& event)
|
||||
}
|
||||
|
||||
BOOST_LOG_TRIVIAL(fatal) << __FUNCTION__<< boost::format(":WebPresetDialog error loading page %1% %2% %3% %4%") % event.GetURL() % event.GetTarget() %e % event.GetString();
|
||||
Slic3r::sentryReportLog(Slic3r::SENTRY_LOG_FATAL, "bury_point_init WebPresetDialog webview fail", BP_WEB_VIEW);
|
||||
}
|
||||
|
||||
void WebPresetDialog::OnScriptResponseMessage(wxCommandEvent& WXUNUSED(evt))
|
||||
|
||||
@@ -401,6 +401,7 @@ void SMUserLogin::OnError(wxWebViewEvent &event)
|
||||
case wxWEBVIEW_NAV_ERR_OTHER: e = "wxWEBVIEW_NAV_ERR_OTHER"; break;
|
||||
}
|
||||
BOOST_LOG_TRIVIAL(fatal) << __FUNCTION__<< boost::format(":SMUserLogin error loading page %1% %2% %3% %4%") % event.GetURL() % event.GetTarget() %e % event.GetString();
|
||||
Slic3r::sentryReportLog(Slic3r::SENTRY_LOG_FATAL, "bury_point_init SMUserLogin webview fail", BP_WEB_VIEW);
|
||||
}
|
||||
|
||||
void SMUserLogin::OnScriptResponseMessage(wxCommandEvent &WXUNUSED(evt))
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "SSWCP.hpp"
|
||||
#include <wx/sizer.h>
|
||||
#include <slic3r/GUI/Widgets/WebView.hpp>
|
||||
#include "sentry_wrapper/SentryWrapper.hpp"
|
||||
|
||||
namespace Slic3r { namespace GUI {
|
||||
|
||||
@@ -129,6 +130,7 @@ void WebUrlDialog::OnError(wxWebViewEvent &event)
|
||||
}
|
||||
|
||||
BOOST_LOG_TRIVIAL(fatal) << __FUNCTION__<< boost::format(":WebUrlDialog error loading page %1% %2% %3% %4%") % event.GetURL() % event.GetTarget() %e % event.GetString();
|
||||
Slic3r::sentryReportLog(Slic3r::SENTRY_LOG_FATAL, "bury_point_init WebUrlDialog webview fail", BP_WEB_VIEW);
|
||||
}
|
||||
|
||||
void WebUrlDialog::OnScriptMessage(wxWebViewEvent &evt)
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "libslic3r/AppConfig.hpp"
|
||||
#include "slic3r/GUI/wxExtensions.hpp"
|
||||
#include "slic3r/GUI/GUI_App.hpp"
|
||||
#include "common_func/common_func.hpp"
|
||||
#include "sentry_wrapper/SentryWrapper.hpp"
|
||||
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/toolbar.h>
|
||||
@@ -375,6 +375,7 @@ void ZUserLogin::OnError(wxWebViewEvent &event)
|
||||
case wxWEBVIEW_NAV_ERR_OTHER: e = "wxWEBVIEW_NAV_ERR_OTHER"; break;
|
||||
}
|
||||
BOOST_LOG_TRIVIAL(fatal) << __FUNCTION__<< boost::format(":ZUserLogin error loading page %1% %2% %3% %4%") % event.GetURL() % event.GetTarget() %e % event.GetString();
|
||||
Slic3r::sentryReportLog(Slic3r::SENTRY_LOG_FATAL, "bury_point_init ZUserLogin webview fail", BP_WEB_VIEW);
|
||||
}
|
||||
|
||||
void ZUserLogin::OnScriptResponseMessage(wxCommandEvent &WXUNUSED(evt))
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "slic3r/GUI/wxExtensions.hpp"
|
||||
#include "slic3r/GUI/GUI_App.hpp"
|
||||
#include "slic3r/GUI/MainFrame.hpp"
|
||||
#include "common_func/common_func.hpp"
|
||||
#include "sentry_wrapper/SentryWrapper.hpp"
|
||||
#include "../Utils/Http.hpp"
|
||||
#include "SSWCP.hpp"
|
||||
|
||||
@@ -894,37 +894,21 @@ void WebViewPanel::OnSelectAll(wxCommandEvent& WXUNUSED(evt))
|
||||
/**
|
||||
* Callback invoked when a loading error occurs
|
||||
*/
|
||||
void WebViewPanel::OnError(wxWebViewEvent& evt)
|
||||
void WebViewPanel::OnError(wxWebViewEvent& event)
|
||||
{
|
||||
#define WX_ERROR_CASE(type) \
|
||||
case type: \
|
||||
category = #type; \
|
||||
break;
|
||||
|
||||
wxString category;
|
||||
switch (evt.GetInt())
|
||||
{
|
||||
WX_ERROR_CASE(wxWEBVIEW_NAV_ERR_CONNECTION);
|
||||
WX_ERROR_CASE(wxWEBVIEW_NAV_ERR_CERTIFICATE);
|
||||
WX_ERROR_CASE(wxWEBVIEW_NAV_ERR_AUTH);
|
||||
WX_ERROR_CASE(wxWEBVIEW_NAV_ERR_SECURITY);
|
||||
WX_ERROR_CASE(wxWEBVIEW_NAV_ERR_NOT_FOUND);
|
||||
WX_ERROR_CASE(wxWEBVIEW_NAV_ERR_REQUEST);
|
||||
WX_ERROR_CASE(wxWEBVIEW_NAV_ERR_USER_CANCELLED);
|
||||
WX_ERROR_CASE(wxWEBVIEW_NAV_ERR_OTHER);
|
||||
auto e = "unknown error";
|
||||
switch (event.GetInt()) {
|
||||
case wxWEBVIEW_NAV_ERR_CONNECTION: e = "wxWEBVIEW_NAV_ERR_CONNECTION"; break;
|
||||
case wxWEBVIEW_NAV_ERR_CERTIFICATE: e = "wxWEBVIEW_NAV_ERR_CERTIFICATE"; break;
|
||||
case wxWEBVIEW_NAV_ERR_AUTH: e = "wxWEBVIEW_NAV_ERR_AUTH"; break;
|
||||
case wxWEBVIEW_NAV_ERR_SECURITY: e = "wxWEBVIEW_NAV_ERR_SECURITY"; break;
|
||||
case wxWEBVIEW_NAV_ERR_NOT_FOUND: e = "wxWEBVIEW_NAV_ERR_NOT_FOUND"; break;
|
||||
case wxWEBVIEW_NAV_ERR_REQUEST: e = "wxWEBVIEW_NAV_ERR_REQUEST"; break;
|
||||
case wxWEBVIEW_NAV_ERR_USER_CANCELLED: e = "wxWEBVIEW_NAV_ERR_USER_CANCELLED"; break;
|
||||
case wxWEBVIEW_NAV_ERR_OTHER: e = "wxWEBVIEW_NAV_ERR_OTHER"; break;
|
||||
}
|
||||
|
||||
BOOST_LOG_TRIVIAL(trace) << __FUNCTION__ << ": [" << category << "] " << evt.GetString().ToUTF8().data();
|
||||
|
||||
if (wxGetApp().get_mode() == comDevelop)
|
||||
{
|
||||
wxLogMessage("%s", "Error; url='" + evt.GetURL() + "', error='" + category + " (" + evt.GetString() + ")'");
|
||||
|
||||
// Show the info bar with an error
|
||||
m_info->ShowMessage(_L("An error occurred loading ") + evt.GetURL() + "\n" + "'" + category + "'", wxICON_ERROR);
|
||||
}
|
||||
|
||||
UpdateState();
|
||||
BOOST_LOG_TRIVIAL(fatal) << __FUNCTION__<< boost::format(":PrinterWebView error loading page %1% %2% %3% %4%") % event.GetURL() % event.GetTarget() %e % event.GetString();
|
||||
Slic3r::sentryReportLog(Slic3r::SENTRY_LOG_FATAL, "bury_point_init WebViewPanel webview fail", BP_WEB_VIEW);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user