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.
86 lines
2.3 KiB
C++
86 lines
2.3 KiB
C++
#ifndef slic3r_GUI_NetworkPluginDialog_hpp_
|
|
#define slic3r_GUI_NetworkPluginDialog_hpp_
|
|
|
|
#include "GUI_Utils.hpp"
|
|
#include "MsgDialog.hpp"
|
|
#include "Widgets/ComboBox.hpp"
|
|
#include "Widgets/Button.hpp"
|
|
#include "slic3r/Utils/bambu_networking.hpp"
|
|
#include <string>
|
|
#include <vector>
|
|
#include <wx/collpane.h>
|
|
#include <wx/string.h>
|
|
#include <wx/event.h>
|
|
|
|
namespace Slic3r {
|
|
namespace GUI {
|
|
|
|
// Dropdown label for one network plug-in version: tree glyph for a dev build, then
|
|
// "(Latest)" for the highest listed version and "(installed)" for the build currently
|
|
// loaded. Shared by the Preferences selector and the download dialog so both stay
|
|
// consistent.
|
|
wxString network_version_label(const NetworkLibraryVersionInfo& ver);
|
|
|
|
class NetworkPluginDownloadDialog : public DPIDialog
|
|
{
|
|
public:
|
|
enum class Mode {
|
|
MissingPlugin,
|
|
UpdateAvailable,
|
|
CorruptedPlugin
|
|
};
|
|
|
|
NetworkPluginDownloadDialog(wxWindow* parent, Mode mode,
|
|
const std::string& current_version = "",
|
|
const std::string& error_message = "",
|
|
const std::string& error_details = "");
|
|
|
|
std::string get_selected_version() const;
|
|
|
|
enum ResultCode {
|
|
RESULT_DOWNLOAD = wxID_OK,
|
|
RESULT_SKIP = wxID_CANCEL,
|
|
RESULT_REMIND_LATER = wxID_APPLY,
|
|
RESULT_SKIP_VERSION = wxID_IGNORE,
|
|
RESULT_DONT_ASK = wxID_ABORT
|
|
};
|
|
|
|
protected:
|
|
void on_dpi_changed(const wxRect& suggested_rect) override;
|
|
|
|
private:
|
|
void create_missing_plugin_ui();
|
|
void create_update_available_ui(const std::string& current_version);
|
|
void setup_version_selector();
|
|
void on_download(wxCommandEvent& evt);
|
|
void on_skip(wxCommandEvent& evt);
|
|
void on_remind_later(wxCommandEvent& evt);
|
|
void on_skip_version(wxCommandEvent& evt);
|
|
void on_dont_ask(wxCommandEvent& evt);
|
|
|
|
Mode m_mode;
|
|
ComboBox* m_version_combo{nullptr};
|
|
std::string m_error_message;
|
|
std::string m_error_details;
|
|
std::vector<NetworkLibraryVersionInfo> m_available_versions;
|
|
};
|
|
|
|
class NetworkPluginRestartDialog : public DPIDialog
|
|
{
|
|
public:
|
|
NetworkPluginRestartDialog(wxWindow* parent);
|
|
|
|
bool should_restart_now() const { return m_restart_now; }
|
|
|
|
protected:
|
|
void on_dpi_changed(const wxRect& suggested_rect) override;
|
|
|
|
private:
|
|
bool m_restart_now{false};
|
|
};
|
|
|
|
} // namespace GUI
|
|
} // namespace Slic3r
|
|
|
|
#endif // slic3r_GUI_NetworkPluginDialog_hpp_
|