2022-07-15 15:37:19 +00:00
|
|
|
#ifndef slic3r_GUI_ReleaseNote_hpp_
|
|
|
|
#define slic3r_GUI_ReleaseNote_hpp_
|
|
|
|
|
|
|
|
#include <wx/wx.h>
|
|
|
|
#include <wx/intl.h>
|
|
|
|
#include <wx/collpane.h>
|
|
|
|
#include <wx/dataview.h>
|
|
|
|
#include <wx/artprov.h>
|
|
|
|
#include <wx/xrc/xmlres.h>
|
|
|
|
#include <wx/dataview.h>
|
|
|
|
#include <wx/gdicmn.h>
|
|
|
|
#include <wx/font.h>
|
|
|
|
#include <wx/colour.h>
|
|
|
|
#include <wx/settings.h>
|
|
|
|
#include <wx/string.h>
|
|
|
|
#include <wx/sizer.h>
|
|
|
|
#include <wx/stattext.h>
|
|
|
|
#include <wx/hyperlink.h>
|
|
|
|
#include <wx/button.h>
|
|
|
|
#include <wx/dialog.h>
|
|
|
|
#include <wx/popupwin.h>
|
|
|
|
#include <wx/spinctrl.h>
|
|
|
|
#include <wx/artprov.h>
|
|
|
|
#include <wx/wrapsizer.h>
|
|
|
|
|
|
|
|
#include "AmsMappingPopup.hpp"
|
|
|
|
#include "GUI_Utils.hpp"
|
|
|
|
#include "wxExtensions.hpp"
|
|
|
|
#include "DeviceManager.hpp"
|
|
|
|
#include "Widgets/Label.hpp"
|
|
|
|
#include "Widgets/Button.hpp"
|
|
|
|
#include "Widgets/CheckBox.hpp"
|
|
|
|
#include "Widgets/ComboBox.hpp"
|
|
|
|
#include "Widgets/ScrolledWindow.hpp"
|
|
|
|
#include <wx/hashmap.h>
|
2022-09-15 06:48:39 +00:00
|
|
|
#include <wx/webview.h>
|
2022-07-15 15:37:19 +00:00
|
|
|
|
|
|
|
namespace Slic3r { namespace GUI {
|
|
|
|
|
2022-10-19 08:10:19 +00:00
|
|
|
wxDECLARE_EVENT(EVT_SECONDARY_CHECK_CONFIRM, wxCommandEvent);
|
2022-11-28 13:24:05 +00:00
|
|
|
wxDECLARE_EVENT(EVT_SECONDARY_CHECK_CANCEL, wxCommandEvent);
|
2022-10-19 08:10:19 +00:00
|
|
|
|
2022-07-15 15:37:19 +00:00
|
|
|
class ReleaseNoteDialog : public DPIDialog
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ReleaseNoteDialog(Plater *plater = nullptr);
|
|
|
|
~ReleaseNoteDialog();
|
|
|
|
|
|
|
|
void on_dpi_changed(const wxRect &suggested_rect) override;
|
2022-08-11 08:08:29 +00:00
|
|
|
void update_release_note(wxString release_note, std::string version);
|
2022-07-15 15:37:19 +00:00
|
|
|
|
|
|
|
wxStaticText * m_text_up_info{nullptr};
|
2022-10-12 04:28:50 +00:00
|
|
|
wxScrolledWindow *m_vebview_release_note {nullptr};
|
2022-07-15 15:37:19 +00:00
|
|
|
};
|
|
|
|
|
2022-12-22 06:40:34 +00:00
|
|
|
class UpdatePluginDialog : public DPIDialog
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
UpdatePluginDialog(wxWindow* parent = nullptr);
|
|
|
|
~UpdatePluginDialog();
|
|
|
|
|
|
|
|
void on_dpi_changed(const wxRect& suggested_rect) override;
|
|
|
|
void update_info(std::string json_path);
|
|
|
|
|
|
|
|
wxStaticText* m_text_up_info{ nullptr };
|
|
|
|
Label* operation_tips{ nullptr };
|
|
|
|
wxScrolledWindow* m_vebview_release_note{ nullptr };
|
|
|
|
};
|
|
|
|
|
2022-07-22 09:46:10 +00:00
|
|
|
class UpdateVersionDialog : public DPIDialog
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
UpdateVersionDialog(wxWindow *parent = nullptr);
|
|
|
|
~UpdateVersionDialog();
|
|
|
|
|
2022-09-15 06:48:39 +00:00
|
|
|
wxWebView* CreateTipView(wxWindow* parent);
|
|
|
|
void OnLoaded(wxWebViewEvent& event);
|
|
|
|
void OnTitleChanged(wxWebViewEvent& event);
|
|
|
|
void OnError(wxWebViewEvent& event);
|
|
|
|
bool ShowReleaseNote(std::string content);
|
|
|
|
void RunScript(std::string script);
|
|
|
|
void on_dpi_changed(const wxRect& suggested_rect) override;
|
2022-10-12 04:28:50 +00:00
|
|
|
void update_version_info(wxString release_note, wxString version);
|
2022-09-06 07:57:20 +00:00
|
|
|
void alter_choice(wxCommandEvent& event);
|
2022-10-12 04:28:50 +00:00
|
|
|
std::vector<std::string> splitWithStl(std::string str, std::string pattern);
|
2022-07-22 09:46:10 +00:00
|
|
|
|
2022-12-23 02:53:01 +00:00
|
|
|
wxStaticBitmap* m_brand{nullptr};
|
2022-07-22 09:46:10 +00:00
|
|
|
wxStaticText * m_text_up_info{nullptr};
|
2022-10-12 04:28:50 +00:00
|
|
|
wxWebView* m_vebview_release_note{nullptr};
|
|
|
|
wxSimplebook* m_simplebook_release_note{nullptr};
|
|
|
|
wxScrolledWindow* m_scrollwindows_release_note{nullptr};
|
2022-07-22 09:46:10 +00:00
|
|
|
wxBoxSizer * sizer_text_release_note{nullptr};
|
|
|
|
wxStaticText * m_staticText_release_note{nullptr};
|
2022-09-06 07:57:20 +00:00
|
|
|
wxCheckBox* m_remind_choice;
|
|
|
|
Button* m_button_ok;
|
|
|
|
Button* m_button_cancel;
|
2022-07-22 09:46:10 +00:00
|
|
|
};
|
|
|
|
|
2022-11-26 02:49:42 +00:00
|
|
|
class SecondaryCheckDialog : public DPIFrame
|
2022-10-18 12:33:35 +00:00
|
|
|
{
|
|
|
|
public:
|
2022-10-19 08:10:19 +00:00
|
|
|
enum ButtonStyle {
|
|
|
|
ONLY_CONFIRM = 0,
|
|
|
|
CONFIRM_AND_CANCEL = 1,
|
|
|
|
MAX_STYLE_NUM = 2
|
|
|
|
};
|
|
|
|
SecondaryCheckDialog(
|
|
|
|
wxWindow* parent,
|
|
|
|
wxWindowID id = wxID_ANY,
|
|
|
|
const wxString& title = wxEmptyString,
|
|
|
|
enum ButtonStyle btn_style = CONFIRM_AND_CANCEL,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
2022-11-28 13:24:05 +00:00
|
|
|
long style = wxCLOSE_BOX | wxCAPTION,
|
|
|
|
bool not_show_again_check = false
|
2022-10-19 08:10:19 +00:00
|
|
|
);
|
2022-10-18 12:33:35 +00:00
|
|
|
void update_text(wxString text);
|
2022-11-26 02:49:42 +00:00
|
|
|
void on_show();
|
2022-11-28 13:24:05 +00:00
|
|
|
void on_hide();
|
|
|
|
void update_btn_label(wxString ok_btn_text, wxString cancel_btn_text);
|
|
|
|
void rescale();
|
2022-10-18 12:33:35 +00:00
|
|
|
~SecondaryCheckDialog();
|
2022-11-26 02:49:42 +00:00
|
|
|
void on_dpi_changed(const wxRect& suggested_rect);
|
2022-10-18 12:33:35 +00:00
|
|
|
|
2023-01-13 07:47:33 +00:00
|
|
|
Label* m_staticText_release_note {nullptr};
|
2022-11-14 07:13:26 +00:00
|
|
|
wxBoxSizer* m_sizer_main;
|
2022-10-18 12:33:35 +00:00
|
|
|
wxScrolledWindow *m_vebview_release_note {nullptr};
|
|
|
|
Button* m_button_ok;
|
|
|
|
Button* m_button_cancel;
|
2022-11-28 13:24:05 +00:00
|
|
|
wxCheckBox* m_show_again_checkbox;
|
|
|
|
bool not_show_again = false;
|
|
|
|
std::string show_again_config_text = "";
|
2022-10-18 12:33:35 +00:00
|
|
|
};
|
|
|
|
|
2022-12-06 10:08:29 +00:00
|
|
|
class ConfirmBeforeSendDialog : public DPIDialog
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
enum ButtonStyle {
|
|
|
|
ONLY_CONFIRM = 0,
|
|
|
|
CONFIRM_AND_CANCEL = 1,
|
|
|
|
MAX_STYLE_NUM = 2
|
|
|
|
};
|
|
|
|
ConfirmBeforeSendDialog(
|
|
|
|
wxWindow* parent,
|
|
|
|
wxWindowID id = wxID_ANY,
|
|
|
|
const wxString& title = wxEmptyString,
|
|
|
|
enum ButtonStyle btn_style = CONFIRM_AND_CANCEL,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxCLOSE_BOX | wxCAPTION,
|
|
|
|
bool not_show_again_check = false
|
|
|
|
);
|
|
|
|
void update_text(wxString text);
|
|
|
|
void on_show();
|
|
|
|
void on_hide();
|
|
|
|
void update_btn_label(wxString ok_btn_text, wxString cancel_btn_text);
|
2022-12-10 09:00:55 +00:00
|
|
|
wxString format_text(wxString str, int warp);
|
2022-12-06 10:08:29 +00:00
|
|
|
void rescale();
|
|
|
|
~ConfirmBeforeSendDialog();
|
|
|
|
void on_dpi_changed(const wxRect& suggested_rect);
|
|
|
|
|
|
|
|
wxBoxSizer* m_sizer_main;
|
|
|
|
wxScrolledWindow* m_vebview_release_note{ nullptr };
|
2023-01-16 08:30:58 +00:00
|
|
|
wxStaticText* m_staticText_release_note{ nullptr };
|
2022-12-06 10:08:29 +00:00
|
|
|
Button* m_button_ok;
|
|
|
|
Button* m_button_cancel;
|
|
|
|
wxCheckBox* m_show_again_checkbox;
|
|
|
|
bool not_show_again = false;
|
|
|
|
std::string show_again_config_text = "";
|
|
|
|
};
|
|
|
|
|
2022-07-15 15:37:19 +00:00
|
|
|
}} // namespace Slic3r::GUI
|
|
|
|
|
|
|
|
#endif
|