mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 16:57:53 -06:00
ENABLE_GCODE_VIEWER set as default in libslic3r
This commit is contained in:
parent
28b4ad92ea
commit
f1d10f3c90
17 changed files with 28 additions and 542 deletions
|
@ -38,9 +38,7 @@ void AppConfig::reset()
|
|||
// Override missing or keys with their defaults.
|
||||
void AppConfig::set_defaults()
|
||||
{
|
||||
#if ENABLE_GCODE_VIEWER
|
||||
if (m_mode == EAppMode::Editor) {
|
||||
#endif // ENABLE_GCODE_VIEWER
|
||||
// Reset the empty fields to defaults.
|
||||
if (get("autocenter").empty())
|
||||
set("autocenter", "0");
|
||||
|
@ -98,17 +96,6 @@ void AppConfig::set_defaults()
|
|||
if (get("auto_toolbar_size").empty())
|
||||
set("auto_toolbar_size", "100");
|
||||
|
||||
#if !ENABLE_GCODE_VIEWER
|
||||
if (get("use_perspective_camera").empty())
|
||||
set("use_perspective_camera", "1");
|
||||
|
||||
if (get("use_free_camera").empty())
|
||||
set("use_free_camera", "0");
|
||||
|
||||
if (get("reverse_mouse_wheel_zoom").empty())
|
||||
set("reverse_mouse_wheel_zoom", "0");
|
||||
#endif // !ENABLE_GCODE_VIEWER
|
||||
|
||||
#if ENABLE_ENVIRONMENT_MAP
|
||||
if (get("use_environment_map").empty())
|
||||
set("use_environment_map", "0");
|
||||
|
@ -116,7 +103,6 @@ void AppConfig::set_defaults()
|
|||
|
||||
if (get("use_inches").empty())
|
||||
set("use_inches", "0");
|
||||
#if ENABLE_GCODE_VIEWER
|
||||
}
|
||||
|
||||
if (get("seq_top_layer_only").empty())
|
||||
|
@ -130,7 +116,6 @@ void AppConfig::set_defaults()
|
|||
|
||||
if (get("reverse_mouse_wheel_zoom").empty())
|
||||
set("reverse_mouse_wheel_zoom", "0");
|
||||
#endif // ENABLE_GCODE_VIEWER
|
||||
|
||||
if (get("show_splash_screen").empty())
|
||||
set("show_splash_screen", "1");
|
||||
|
@ -247,14 +232,10 @@ void AppConfig::save()
|
|||
|
||||
boost::nowide::ofstream c;
|
||||
c.open(path_pid, std::ios::out | std::ios::trunc);
|
||||
#if ENABLE_GCODE_VIEWER
|
||||
if (m_mode == EAppMode::Editor)
|
||||
c << "# " << Slic3r::header_slic3r_generated() << std::endl;
|
||||
else
|
||||
c << "# " << Slic3r::header_gcodeviewer_generated() << std::endl;
|
||||
#else
|
||||
c << "# " << Slic3r::header_slic3r_generated() << std::endl;
|
||||
#endif // ENABLE_GCODE_VIEWER
|
||||
// Make sure the "no" category is written first.
|
||||
for (const std::pair<std::string, std::string> &kvp : m_storage[""])
|
||||
c << kvp.first << " = " << kvp.second << std::endl;
|
||||
|
@ -455,15 +436,11 @@ void AppConfig::reset_selections()
|
|||
|
||||
std::string AppConfig::config_path()
|
||||
{
|
||||
#if ENABLE_GCODE_VIEWER
|
||||
std::string path = (m_mode == EAppMode::Editor) ?
|
||||
(boost::filesystem::path(Slic3r::data_dir()) / (SLIC3R_APP_KEY ".ini")).make_preferred().string() :
|
||||
(boost::filesystem::path(Slic3r::data_dir()) / (GCODEVIEWER_APP_KEY ".ini")).make_preferred().string();
|
||||
|
||||
return path;
|
||||
#else
|
||||
return (boost::filesystem::path(Slic3r::data_dir()) / (SLIC3R_APP_KEY ".ini")).make_preferred().string();
|
||||
#endif // ENABLE_GCODE_VIEWER
|
||||
}
|
||||
|
||||
std::string AppConfig::version_check_url() const
|
||||
|
@ -474,11 +451,7 @@ std::string AppConfig::version_check_url() const
|
|||
|
||||
bool AppConfig::exists()
|
||||
{
|
||||
#if ENABLE_GCODE_VIEWER
|
||||
return boost::filesystem::exists(config_path());
|
||||
#else
|
||||
return boost::filesystem::exists(AppConfig::config_path());
|
||||
#endif // ENABLE_GCODE_VIEWER
|
||||
}
|
||||
|
||||
}; // namespace Slic3r
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue