mirror of
https://github.com/QIDITECH/QIDISlicer.git
synced 2026-01-30 23:48:44 +03:00
WebView
This commit is contained in:
25
resources/web/qidi/css/dark.css
Normal file
25
resources/web/qidi/css/dark.css
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
body {
|
||||||
|
background-color:#4c4c54;
|
||||||
|
font-family: Arial, sans-serif;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
height: 100vh;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
text-align: center;
|
||||||
|
padding: 30px;
|
||||||
|
border-radius: 10px;
|
||||||
|
background-color: #272727;
|
||||||
|
box-shadow: 0 4px 6px rgba(39, 39, 39, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
18
resources/web/qidi/css/home.css
Normal file
18
resources/web/qidi/css/home.css
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
body
|
||||||
|
{
|
||||||
|
background-color:#eeeeee;
|
||||||
|
font-family: Arial, sans-serif;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
height: 100vh;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
text-align: center;
|
||||||
|
padding: 30px;
|
||||||
|
border-radius: 10px;
|
||||||
|
background-color: #ffffff;
|
||||||
|
box-shadow: 0 4px 6px rgba(39, 39, 39, 0.1);
|
||||||
|
}
|
||||||
22
resources/web/qidi/missing_connection.html
Normal file
22
resources/web/qidi/missing_connection.html
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Printer Connection Required</title>
|
||||||
|
<link rel="stylesheet" type="text/css" href="css/home.css" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="css/dark.css" />
|
||||||
|
<script type="text/javascript" src="../data/text.js"></script>
|
||||||
|
<script type="text/javascript" src="../homepage/js/jquery-3.6.0.min.js"></script>
|
||||||
|
<script type="text/javascript" src="../homepage/js/json2.js"></script>
|
||||||
|
<script type="text/javascript" src="../homepage/js/globalapi.js"></script>
|
||||||
|
<script type="text/javascript" src="../homepage/js/home.js"></script>
|
||||||
|
</head>
|
||||||
|
<body onLoad="OnInit()">
|
||||||
|
<div class="container">
|
||||||
|
<h1 class="trans" tid="t93">Printer Connection</h1>
|
||||||
|
<p class="trans" tid="t94">Please set up your printer connection to view the device.</p>
|
||||||
|
<img src="setup_connection.gif" alt="Printer connection setup demonstration" style="max-width: 100%; height: auto; display: block;"/>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
BIN
resources/web/qidi/setup_connection.gif
Normal file
BIN
resources/web/qidi/setup_connection.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 738 KiB |
@@ -18,6 +18,8 @@ set(SLIC3R_GUI_SOURCES
|
|||||||
GUI/BitmapCache.hpp
|
GUI/BitmapCache.hpp
|
||||||
GUI/Widgets/StateColor.cpp
|
GUI/Widgets/StateColor.cpp
|
||||||
GUI/Widgets/StateColor.hpp
|
GUI/Widgets/StateColor.hpp
|
||||||
|
GUI/Widgets/WebView.cpp
|
||||||
|
GUI/Widgets/WebView.hpp
|
||||||
GUI/ConfigSnapshotDialog.cpp
|
GUI/ConfigSnapshotDialog.cpp
|
||||||
GUI/ConfigSnapshotDialog.hpp
|
GUI/ConfigSnapshotDialog.hpp
|
||||||
GUI/3DScene.cpp
|
GUI/3DScene.cpp
|
||||||
@@ -173,6 +175,8 @@ set(SLIC3R_GUI_SOURCES
|
|||||||
Config/Snapshot.hpp
|
Config/Snapshot.hpp
|
||||||
GUI/PrinterWebView.cpp
|
GUI/PrinterWebView.cpp
|
||||||
GUI/PrinterWebView.hpp
|
GUI/PrinterWebView.hpp
|
||||||
|
GUI/GuideWebView.cpp
|
||||||
|
GUI/GuideWebView.hpp
|
||||||
Config/Version.cpp
|
Config/Version.cpp
|
||||||
Config/Version.hpp
|
Config/Version.hpp
|
||||||
Utils/ASCIIFolding.cpp
|
Utils/ASCIIFolding.cpp
|
||||||
|
|||||||
88
src/slic3r/GUI/GuideWebView.cpp
Normal file
88
src/slic3r/GUI/GuideWebView.cpp
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
#include "GuideWebView.hpp"
|
||||||
|
|
||||||
|
#include "I18N.hpp"
|
||||||
|
#include "slic3r/GUI/wxExtensions.hpp"
|
||||||
|
#include "slic3r/GUI/GUI_App.hpp"
|
||||||
|
#include "slic3r/GUI/MainFrame.hpp"
|
||||||
|
#include "libslic3r_version.h"
|
||||||
|
|
||||||
|
#include <wx/sizer.h>
|
||||||
|
#include <wx/toolbar.h>
|
||||||
|
#include <wx/textdlg.h>
|
||||||
|
|
||||||
|
#include <slic3r/GUI/Widgets/WebView.hpp>
|
||||||
|
|
||||||
|
namespace pt = boost::property_tree;
|
||||||
|
|
||||||
|
namespace Slic3r {
|
||||||
|
namespace GUI {
|
||||||
|
|
||||||
|
GuideWebView::GuideWebView(wxWindow *parent)
|
||||||
|
: wxPanel(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize)
|
||||||
|
{
|
||||||
|
|
||||||
|
wxBoxSizer* topsizer = new wxBoxSizer(wxVERTICAL);
|
||||||
|
// Create the webview
|
||||||
|
m_browser = WebView::CreateWebView(this, "");
|
||||||
|
if (m_browser == nullptr) {
|
||||||
|
wxLogError("Could not init m_browser");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
SetSizer(topsizer);
|
||||||
|
|
||||||
|
topsizer->Add(m_browser, wxSizerFlags().Expand().Proportion(1));
|
||||||
|
|
||||||
|
//Log backend information
|
||||||
|
//if (wxGetApp().get_mode() == comDevelop) {
|
||||||
|
//wxLogMessage(wxWebView::GetBackendVersionInfo().ToString());
|
||||||
|
//wxLogMessage("Backend: %s Version: %s", m_browser->GetClassInfo()->GetClassName(),
|
||||||
|
// wxWebView::GetBackendVersionInfo().ToString());
|
||||||
|
//wxLogMessage("User Agent: %s", m_browser->GetUserAgent());
|
||||||
|
//}
|
||||||
|
|
||||||
|
//Zoom
|
||||||
|
m_zoomFactor = 100;
|
||||||
|
|
||||||
|
//Connect the idle events
|
||||||
|
Bind(wxEVT_CLOSE_WINDOW, &GuideWebView::OnClose, this);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
GuideWebView::~GuideWebView()
|
||||||
|
{
|
||||||
|
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " Start";
|
||||||
|
SetEvtHandlerEnabled(false);
|
||||||
|
|
||||||
|
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " End";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void GuideWebView::load_url(wxString& url)
|
||||||
|
{
|
||||||
|
// this->Show();
|
||||||
|
// this->Raise();
|
||||||
|
if (m_browser == nullptr)
|
||||||
|
return;
|
||||||
|
m_browser->LoadURL(url);
|
||||||
|
//m_browser->SetFocus();
|
||||||
|
UpdateState();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Method that retrieves the current state from the web control and updates the
|
||||||
|
* GUI the reflect this current state.
|
||||||
|
*/
|
||||||
|
void GuideWebView::UpdateState() {
|
||||||
|
// SetTitle(m_browser->GetCurrentTitle());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void GuideWebView::OnClose(wxCloseEvent& evt)
|
||||||
|
{
|
||||||
|
this->Hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // GUI
|
||||||
|
} // Slic3r
|
||||||
53
src/slic3r/GUI/GuideWebView.hpp
Normal file
53
src/slic3r/GUI/GuideWebView.hpp
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
#ifndef slic3r_GuideWebView_hpp_
|
||||||
|
#define slic3r_GuideWebView_hpp_
|
||||||
|
|
||||||
|
|
||||||
|
#include "wx/artprov.h"
|
||||||
|
#include "wx/cmdline.h"
|
||||||
|
#include "wx/notifmsg.h"
|
||||||
|
#include "wx/settings.h"
|
||||||
|
#include "wx/webview.h"
|
||||||
|
|
||||||
|
#if wxUSE_WEBVIEW_EDGE
|
||||||
|
#include "wx/msw/webview_edge.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "wx/webviewarchivehandler.h"
|
||||||
|
#include "wx/webviewfshandler.h"
|
||||||
|
#include "wx/numdlg.h"
|
||||||
|
#include "wx/infobar.h"
|
||||||
|
#include "wx/filesys.h"
|
||||||
|
#include "wx/fs_arc.h"
|
||||||
|
#include "wx/fs_mem.h"
|
||||||
|
#include "wx/stdpaths.h"
|
||||||
|
#include <wx/panel.h>
|
||||||
|
#include <wx/tbarbase.h>
|
||||||
|
#include "wx/textctrl.h"
|
||||||
|
#include <wx/timer.h>
|
||||||
|
|
||||||
|
|
||||||
|
namespace Slic3r {
|
||||||
|
namespace GUI {
|
||||||
|
|
||||||
|
|
||||||
|
class GuideWebView : public wxPanel {
|
||||||
|
public:
|
||||||
|
GuideWebView(wxWindow *parent);
|
||||||
|
virtual ~GuideWebView();
|
||||||
|
|
||||||
|
void load_url(wxString& url);
|
||||||
|
void UpdateState();
|
||||||
|
void OnClose(wxCloseEvent& evt);
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
wxWebView* m_browser;
|
||||||
|
long m_zoomFactor;
|
||||||
|
|
||||||
|
// DECLARE_EVENT_TABLE()
|
||||||
|
};
|
||||||
|
|
||||||
|
} // GUI
|
||||||
|
} // Slic3r
|
||||||
|
|
||||||
|
#endif /* slic3r_Tab_hpp_ */
|
||||||
Reference in New Issue
Block a user