OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::GUI::anonymous_namespace{NotificationManager.cpp} Namespace Reference

Functions

void push_style_color (ImGuiCol idx, const ImVec4 &col, bool fading_out, float current_fade_opacity)
void open_folder (const std::string &path)
Preset::Type resolve_validation_option_type (const std::string &opt_key)

Function Documentation

◆ open_folder()

void Slic3r::GUI::anonymous_namespace{NotificationManager.cpp}::open_folder ( const std::string & path)
97 {
98 // Code taken from desktop_open_datadir_folder()
99
100 // Execute command to open a file explorer, platform dependent.
101#ifdef _WIN32
102 const wxString widepath = from_u8(path);
103 const wchar_t* argv[] = { L"explorer", widepath.GetData(), nullptr };
104 ::wxExecute(argv, wxEXEC_ASYNC, nullptr);
105#elif __APPLE__
106 const char* argv[] = { "open", path.data(), nullptr };
107 ::wxExecute(argv, wxEXEC_ASYNC, nullptr);
108#else
109 const char* argv[] = { "xdg-open", path.data(), nullptr };
110
111 // Check if we're running in an AppImage container, if so, we need to remove AppImage's env vars,
112 // because they may mess up the environment expected by the file manager.
113 // Mostly this is about LD_LIBRARY_PATH, but we remove a few more too for good measure.
114 if (wxGetEnv("APPIMAGE", nullptr)) {
115 // We're running from AppImage
116 wxEnvVariableHashMap env_vars;
117 wxGetEnvMap(&env_vars);
118
119 env_vars.erase("APPIMAGE");
120 env_vars.erase("APPDIR");
121 env_vars.erase("LD_LIBRARY_PATH");
122 env_vars.erase("LD_PRELOAD");
123 env_vars.erase("UNION_PRELOAD");
124
125 wxExecuteEnv exec_env;
126 exec_env.env = std::move(env_vars);
127
128 wxString owd;
129 if (wxGetEnv("OWD", &owd)) {
130 // This is the original work directory from which the AppImage image was run,
131 // set it as CWD for the child process:
132 exec_env.cwd = std::move(owd);
133 }
134
135 ::wxExecute(argv, wxEXEC_ASYNC, nullptr, &exec_env);
136 }
137 else {
138 // Looks like we're NOT running from AppImage, we'll make no changes to the environment.
139 ::wxExecute(argv, wxEXEC_ASYNC, nullptr, nullptr);
140 }
141#endif
142 }
#define L(s)
Definition ExtrusionEntity.cpp:25
wxString from_u8(const std::string &str)
Definition GUI.cpp:544

References Slic3r::GUI::from_u8(), L, and open_folder().

Referenced by open_folder().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ push_style_color()

void Slic3r::GUI::anonymous_namespace{NotificationManager.cpp}::push_style_color ( ImGuiCol idx,
const ImVec4 & col,
bool fading_out,
float current_fade_opacity )
inline
89 {
90 if (fading_out)
91 ImGui::PushStyleColor(idx, ImVec4(col.x, col.y, col.z, col.w * current_fade_opacity));
92 else
93 ImGui::PushStyleColor(idx, col);
94 }

References push_style_color().

Referenced by push_style_color().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ resolve_validation_option_type()

Preset::Type Slic3r::GUI::anonymous_namespace{NotificationManager.cpp}::resolve_validation_option_type ( const std::string & opt_key)
146 {
147 if (opt_key.empty())
148 return Preset::TYPE_PRINT;
149
150 if (wxGetApp().get_tab(Preset::TYPE_PRINTER)->get_config()->def()->has(opt_key))
152
153 if (wxGetApp().get_tab(Preset::TYPE_FILAMENT)->get_config()->def()->has(opt_key))
155
156 return Preset::TYPE_PRINT;
157 }
@ TYPE_PRINTER
Definition Preset.hpp:250
@ TYPE_PRINT
Definition Preset.hpp:246
@ TYPE_FILAMENT
Definition Preset.hpp:248

References resolve_validation_option_type(), Slic3r::Preset::TYPE_FILAMENT, Slic3r::Preset::TYPE_PRINT, and Slic3r::Preset::TYPE_PRINTER.

Referenced by resolve_validation_option_type().

Here is the call graph for this function:
Here is the caller graph for this function: