Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports-kde
Path: blob/main/cad/OrcaSlicer/files/patch-src_slic3r_GUI_GUI__App.cpp
34610 views
1
--- src/slic3r/GUI/GUI_App.cpp.orig 2025-10-02 17:32:12 UTC
2
+++ src/slic3r/GUI/GUI_App.cpp
3
@@ -468,7 +468,7 @@ class SplashScreen : public wxSplashScreen (private)
4
m_constant_text;
5
};
6
7
-#ifdef __linux__
8
+#if defined(__linux__) || defined(__FreeBSD__)
9
bool static check_old_linux_datadir(const wxString& app_name) {
10
// If we are on Linux and the datadir does not exist yet, look into the old
11
// location where the datadir was before version 2.3. If we find it there,
12
@@ -886,6 +886,7 @@ void GUI_App::post_init()
13
}
14
else {
15
BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << "Found glcontext not ready, postpone the init";
16
+ plater_->canvas3D()->enable_render(true);
17
}
18
//#endif
19
if (is_editor())
20
@@ -1905,7 +1906,7 @@ bool GUI_App::init_opengl()
21
22
bool GUI_App::init_opengl()
23
{
24
-#ifdef __linux__
25
+#if defined(__linux__) || defined(__FreeBSD__)
26
bool status = m_opengl_mgr.init_gl();
27
m_opengl_initialized = true;
28
return status;
29
@@ -1997,7 +1998,7 @@ void GUI_App::init_app_config()
30
}
31
else{
32
boost::filesystem::path data_dir_path;
33
- #ifndef __linux__
34
+ #if !defined(__linux__) && !defined(__FreeBSD__)
35
std::string data_dir = wxStandardPaths::Get().GetUserDataDir().ToUTF8().data();
36
//BBS create folder if not exists
37
data_dir_path = boost::filesystem::path(data_dir);
38
@@ -2097,7 +2098,7 @@ std::map<std::string, std::string> GUI_App::get_extra_
39
#endif
40
#elif defined(__APPLE__)
41
extra_headers.insert(std::make_pair("X-BBL-OS-Type", "macos"));
42
-#elif defined(__LINUX__)
43
+#elif defined(__LINUX__) || defined(__FreeBSD__)
44
extra_headers.insert(std::make_pair("X-BBL-OS-Type", "linux"));
45
#endif
46
int major = 0, minor = 0, micro = 0;
47
@@ -2298,7 +2299,7 @@ bool GUI_App::on_init_inner()
48
wxCHECK_MSG(wxDirExists(resources_dir), false,
49
wxString::Format(_L("Resources path does not exist or is not a directory: %s"), resources_dir));
50
51
-#ifdef __linux__
52
+#if defined(__linux__) || defined(__FreeBSD__)
53
if (! check_old_linux_datadir(GetAppName())) {
54
std::cerr << "Quitting, user chose to move their data to new location." << std::endl;
55
return false;
56
@@ -2443,7 +2444,7 @@ bool GUI_App::on_init_inner()
57
58
BOOST_LOG_TRIVIAL(info) << "begin to show the splash screen...";
59
//BBS use BBL splashScreen
60
- scrn = new SplashScreen(bmp, wxSPLASH_CENTRE_ON_SCREEN | wxSPLASH_TIMEOUT, 1500, splashscreen_pos);
61
+ scrn = new SplashScreen(bmp, wxSPLASH_CENTRE_ON_SCREEN, 0, splashscreen_pos);
62
wxYield();
63
scrn->SetText(_L("Loading configuration")+ dots);
64
}
65
@@ -2676,6 +2677,11 @@ bool GUI_App::on_init_inner()
66
mainframe->Show(true);
67
BOOST_LOG_TRIVIAL(info) << "main frame firstly shown";
68
69
+ if (scrn) {
70
+ scrn->Close();
71
+ scrn = nullptr;
72
+ }
73
+
74
//#if BBL_HAS_FIRST_PAGE
75
//BBS: set tp3DEditor firstly
76
/*plater_->canvas3D()->enable_render(false);
77
@@ -3014,7 +3020,7 @@ void GUI_App::init_label_colours()
78
m_color_label_modified = is_dark_mode ? wxColour("#F1754E") : wxColour("#F1754E");
79
m_color_label_sys = is_dark_mode ? wxColour("#B2B3B5") : wxColour("#363636");
80
81
-#if defined(_WIN32) || defined(__linux__) || defined(__APPLE__)
82
+#if defined(_WIN32) || defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
83
m_color_label_default = is_dark_mode ? wxColour(250, 250, 250) : m_color_label_sys; // wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
84
m_color_highlight_label_default = is_dark_mode ? wxColour(230, 230, 230): wxSystemSettings::GetColour(/*wxSYS_COLOUR_HIGHLIGHTTEXT*/wxSYS_COLOUR_WINDOWTEXT);
85
m_color_highlight_default = is_dark_mode ? wxColour("#36363B") : wxColour("#F1F1F1"); // ORCA row highlighting
86
@@ -4322,7 +4328,7 @@ void GUI_App::check_new_version(bool show_tips, int by
87
#ifdef __APPLE__
88
platform = "macos";
89
#endif
90
-#ifdef __LINUX__
91
+#if defined(__LINUX__) || defined(__FreeBSD__)
92
platform = "linux";
93
#endif
94
std::string query_params = (boost::format("?name=slicer&version=%1%&guide_version=%2%")
95
@@ -4405,7 +4411,7 @@ std::string detect_updater_os()
96
return "win";
97
#elif defined(__APPLE__)
98
return "macos";
99
-#elif defined(__linux__) || defined(__LINUX__)
100
+#elif defined(__linux__) || defined(__LINUX__) || defined(__FreeBSD__)
101
return "linux";
102
#else
103
return "unknown";
104
@@ -5337,7 +5343,7 @@ bool GUI_App::switch_language()
105
}
106
}
107
108
-#ifdef __linux__
109
+#if defined(__linux__) || defined(__FreeBSD__)
110
static const wxLanguageInfo* linux_get_existing_locale_language(const wxLanguageInfo* language,
111
const wxLanguageInfo* system_language)
112
{
113
@@ -5542,7 +5548,7 @@ bool GUI_App::load_language(wxString language, bool in
114
m_language_info_best->CanonicalName.ToUTF8().data();
115
app_config->set("language", m_language_info_best->CanonicalName.ToUTF8().data());
116
}
117
-#ifdef __linux__
118
+#if defined(__linux__) || defined(__FreeBSD__)
119
wxString lc_all;
120
if (wxGetEnv("LC_ALL", &lc_all) && !lc_all.IsEmpty()) {
121
// Best language returned by wxWidgets on Linux apparently does not respect LC_ALL.
122
@@ -5597,7 +5603,7 @@ bool GUI_App::load_language(wxString language, bool in
123
BOOST_LOG_TRIVIAL(info) << "Using Czech dictionaries for Slovak language";
124
}
125
126
-#ifdef __linux__
127
+#if defined(__linux__) || defined(__FreeBSD__)
128
// If we can't find this locale , try to use different one for the language
129
// instead of just reporting that it is impossible to switch.
130
if (! wxLocale::IsAvailable(language_info->Language) && m_language_info_system) {
131
@@ -6725,7 +6731,7 @@ void GUI_App::show_desktop_integration_dialog()
132
133
void GUI_App::show_desktop_integration_dialog()
134
{
135
-#ifdef __linux__
136
+#if defined(__linux__) || defined(__FreeBSD__)
137
//wxCHECK_MSG(mainframe != nullptr, false, "Internal error: Main frame not created / null");
138
DesktopIntegrationDialog dialog(mainframe);
139
dialog.ShowModal();
140
@@ -7100,7 +7106,7 @@ void GUI_App::associate_url(std::wstring url_prefix)
141
key_full.Create(false);
142
}
143
key_full = key_string;
144
-#elif defined(__linux__) && defined(SLIC3R_DESKTOP_INTEGRATION)
145
+#elif (defined(__linux__) || defined(__FreeBSD__)) && defined(SLIC3R_DESKTOP_INTEGRATION)
146
DesktopIntegrationDialog::perform_downloader_desktop_integration(into_u8(url_prefix));
147
#endif // WIN32
148
}
149
150