mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-05 23:01:17 +00:00
* Add Missing Includes Across src/slic3r/GUI Every GUI source and header now directly includes the headers declaring what it uses, rather than relying on the precompiled header or transitive includes. Generated with clang-tidy misc-include-cleaner, plus one hand edit making CalibrationPanel.hpp self-contained. * Drop the OS-Specific Includes Added Outside Their Platform Guards GLib, GTK, D-Bus and POSIX headers are only used inside platform #if blocks, which already include them. Added unconditionally at the top of the file they broke the Windows build. * Add the clang-tidy Configuration That Generated These Includes Only misc-include-cleaner's missing-include check, with the headers it must never suggest: per-platform, internal and OS-specific ones that would break other platforms or are not meant to be included directly. * Match Windows Paths in the clang-tidy Ignore List Header paths use backslashes on Windows, so every / in a pattern is now [/\\]. The Windows SDK headers are ignored alongside the other OS-specific ones, and the list is one pattern per line. Suggested by @raistlin7447 from a Windows clang-cl run.
100 lines
2.9 KiB
C++
100 lines
2.9 KiB
C++
#ifndef slic3r_PresetBundleDialog_hpp_
|
|
#define slic3r_PresetBundleDialog_hpp_
|
|
|
|
#include "GUI.hpp"
|
|
#include "GUI_Utils.hpp"
|
|
#include "Widgets/WebViewHostDialog.hpp"
|
|
#include "libslic3r/AppConfig.hpp"
|
|
#include <atomic>
|
|
#include <boost/thread/detail/thread.hpp>
|
|
#include <libslic3r/PresetBundle.hpp>
|
|
#include <memory>
|
|
#include <slic3r/GUI/GUI.hpp>
|
|
#include <string>
|
|
#include <unordered_map>
|
|
#include <wx/chartype.h>
|
|
#include <wx/dataview.h>
|
|
#include <wx/event.h>
|
|
#include <wx/gdicmn.h>
|
|
#include <wx/language.h>
|
|
#include <wx/string.h>
|
|
#include <wx/fswatcher.h>
|
|
#include <wx/toplevel.h>
|
|
namespace Slic3r { namespace GUI {
|
|
|
|
#define DESIGN_GRAY900_COLOR wxColour("#363636") // Label color
|
|
#define DESIGN_GRAY600_COLOR wxColour("#ACACAC") // Dimmed text color
|
|
|
|
#define DESIGN_WINDOW_SIZE wxSize(FromDIP(640), FromDIP(640))
|
|
#define DESIGN_TITLE_SIZE wxSize(FromDIP(280), -1)
|
|
#define DESIGN_COMBOBOX_SIZE wxSize(FromDIP(120), -1)
|
|
#define DESIGN_LARGE_COMBOBOX_SIZE wxSize(FromDIP(120), -1)
|
|
#define DESIGN_INPUT_SIZE wxSize(FromDIP(120), -1)
|
|
#define DESIGN_LEFT_MARGIN 25
|
|
#define VERTICAL_GAP_SIZE FromDIP(4)
|
|
class PresetBundleDialog : public Slic3r::GUI::WebViewHostDialog
|
|
{
|
|
public:
|
|
PresetBundleDialog(wxWindow* parent,
|
|
wxWindowID id = wxID_ANY,
|
|
const wxString& title = wxT(""),
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
const wxSize& size = wxDefaultSize,
|
|
long style = wxSYSTEM_MENU | wxCAPTION | wxCLOSE_BOX | wxMAXIMIZE_BOX);
|
|
|
|
~PresetBundleDialog();
|
|
|
|
void create();
|
|
|
|
bool DeleteBundleById(const wxString& id);
|
|
bool UnsubscribeBundleById(const std::string& id);
|
|
|
|
bool seq_top_layer_only_changed() const { return m_seq_top_layer_only_changed; }
|
|
bool recreate_GUI() const { return m_recreate_GUI; }
|
|
|
|
// webview utilities
|
|
void ListBundles();
|
|
void OpenFolder(const std::string& id);
|
|
void DeleteBundle(const std::string& id);
|
|
void UnsubscribeBundle(const std::string& id);
|
|
void OpenBundleOnCloud(const std::string& id);
|
|
|
|
void OnPresetBundlePage();
|
|
|
|
// webview events
|
|
void on_script_message(const nlohmann::json& payload) override;
|
|
|
|
void StartDialogWorker();
|
|
void StopDialogWorker();
|
|
|
|
void RefreshBundleMap();
|
|
|
|
bool CheckUpdateCloud();
|
|
|
|
void OnBundleUpdate(wxCommandEvent& evt);
|
|
|
|
// true if b>a
|
|
bool CompareVer(const std::string& a, const std::string& b);
|
|
|
|
protected:
|
|
wxFileSystemWatcher* m_watcher = nullptr;
|
|
|
|
void OnFSWatch(wxFileSystemWatcherEvent& e);
|
|
|
|
bool m_seq_top_layer_only_changed{false};
|
|
bool m_recreate_GUI{false};
|
|
|
|
// Webview
|
|
std::unordered_map<std::string, BundleMetadata> bundle_copy;
|
|
|
|
boost::thread m_dialog_worker_thread;
|
|
std::shared_ptr<int> m_dialog_worker_token;
|
|
std::atomic<bool> m_check_update_pending{false};
|
|
std::atomic<bool> m_update_bundles{false};
|
|
|
|
private:
|
|
Slic3r::AppConfig* app_config;
|
|
};
|
|
|
|
}} // namespace Slic3r::GUI
|
|
#endif |