Skip to content

Commit

Permalink
Fix macos launch, calibration, prevent missclick on slider
Browse files Browse the repository at this point in the history
  • Loading branch information
supermerill committed Feb 1, 2024
2 parents c62503c + 640e3ce commit 8f8305a
Show file tree
Hide file tree
Showing 117 changed files with 39,908 additions and 1,237 deletions.
657 changes: 597 additions & 60 deletions resources/localization/it/Slic3r.po

Large diffs are not rendered by default.

580 changes: 4 additions & 576 deletions resources/localization/it/TODO.po

Large diffs are not rendered by default.

1,008 changes: 876 additions & 132 deletions resources/localization/it/it_database.po

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/profiles
Submodule profiles updated 2 files
+2 −0 Basic.idx
+11 −14 Basic.ini
14 changes: 10 additions & 4 deletions src/PrusaSlicer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@ int CLI::run(int argc, char **argv)
if (! config_substitutions.empty()) {
boost::nowide::cout << "The following configuration values were substituted when loading \" << file << \":\n";
for (const ConfigSubstitution &subst : config_substitutions)
boost::nowide::cout << "\tkey = \"" << subst.opt_def->opt_key << "\"\t loaded = \"" << subst.old_value << "\tsubstituted = \"" << subst.new_value->serialize() << "\"\n";
if(subst.opt_def)
boost::nowide::cout << "\tkey = \"" << subst.opt_def->opt_key << "\"\t loaded = \"" << subst.old_value << "\tsubstituted = \"" << subst.new_value->serialize() << "\"\n";
else
boost::nowide::cout << "\tkey = \"" << subst.old_name << "\"\t can't be loaded (value = \"" << subst.old_value <<"\")\n";
}
config.normalize_fdm();
PrinterTechnology other_printer_technology = get_printer_technology(config);
Expand Down Expand Up @@ -192,10 +195,13 @@ int CLI::run(int argc, char **argv)
boost::nowide::cerr << "Mixing configurations for FFF and SLA technologies" << std::endl;
return 1;
}
if (! config_substitutions.substitutions.empty()) {
if (! config_substitutions.empty()) {
boost::nowide::cout << "The following configuration values were substituted when loading \" << file << \":\n";
for (const ConfigSubstitution& subst : config_substitutions.substitutions)
boost::nowide::cout << "\tkey = \"" << subst.opt_def->opt_key << "\"\t loaded = \"" << subst.old_value << "\tsubstituted = \"" << subst.new_value->serialize() << "\"\n";
for (const ConfigSubstitution& subst : config_substitutions.get())
if(subst.opt_def)
boost::nowide::cout << "\tkey = \"" << subst.opt_def->opt_key << "\"\t loaded = \"" << subst.old_value << "\tsubstituted = \"" << subst.new_value->serialize() << "\"\n";
else
boost::nowide::cout << "\tkey = \"" << subst.old_name << "\"\t can't be loaded (value = \"" << subst.old_value <<"\")\n";
}
// config is applied to m_print_config before the current m_config values.
config += std::move(m_print_config);
Expand Down
34 changes: 25 additions & 9 deletions src/libslic3r/AppConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,9 @@ void AppConfig::set_defaults()
if (get("check_blacklisted_library").empty())
set("check_blacklisted_library", "1");
#endif // _WIN32

if (get("compress_png_texture").empty())
set("compress_png_texture", "1");
//disable by default if amd graphic card detected, but can't know before the opengl is launched
//if (get("compress_png_texture").empty())
//set("compress_png_texture", (m_hardware&hGpuAmd) == hGpuAmd ? "0" : "1");

// remove old 'use_legacy_opengl' parameter from this config, if present
if (!get("use_legacy_opengl").empty())
Expand Down Expand Up @@ -395,6 +395,9 @@ void AppConfig::set_defaults()
if (get("check_material_export").empty())
set("check_material_export", "0");

if (get("show_unknown_setting").empty())
set("show_unknown_setting", "1");

if (get("use_custom_toolbar_size").empty())
set("use_custom_toolbar_size", "0");

Expand Down Expand Up @@ -458,7 +461,11 @@ void AppConfig::set_defaults()
set("use_rich_tooltip", "0");

if (get("hide_slice_tooltip").empty())
#ifdef _WIN32
set("hide_slice_tooltip", "1");
#else
set("hide_slice_tooltip", "0");
#endif // _WIN32

if (get("show_layer_height_doubleslider").empty())
set("show_layer_height_doubleslider", "1");
Expand Down Expand Up @@ -500,9 +507,6 @@ void AppConfig::set_defaults()
if (get("show_splash_screen").empty())
set("show_splash_screen", "1");

if (get("show_splash_screen").empty())
set("show_splash_screen", "1");

if (get("restore_win_position").empty())
set("restore_win_position", "1"); // allowed values - "1", "0", "crashed_at_..."

Expand All @@ -515,7 +519,7 @@ void AppConfig::set_defaults()
{

//try to load splashscreen from ui file
std::map<std::string, std::string> key2splashscreen = {{"splash_screen_editor", "benchy-splashscreen.jpg"}, {"splash_screen_gcodeviewer", "prusa-gcodepreview.jpg"} };
std::map<std::string, std::string> key2splashscreen = {{"splash_screen_editor", ""}, {"splash_screen_gcodeviewer", ""} };
boost::property_tree::ptree tree_splashscreen;
boost::filesystem::path path_colors = boost::filesystem::path(layout_config_path()) / "colors.ini";
try {
Expand Down Expand Up @@ -543,10 +547,13 @@ void AppConfig::set_defaults()
if (get("splash_screen_gcodeviewer").empty())
set("splash_screen_gcodeviewer", "default");

if (!get("show_splash_screen_random").empty() && get("show_splash_screen_random") == "1") {
bool switch_to_random = get("show_splash_screen_random") == "1";
if (switch_to_random || key2splashscreen["splash_screen_editor"].empty())
set("splash_screen_editor", "random");
if (switch_to_random || key2splashscreen["splash_screen_gcodeviewer"].empty())
set("splash_screen_gcodeviewer", "random");
if (switch_to_random)
set("show_splash_screen_random", "0");
}
}

#ifdef _WIN32
Expand Down Expand Up @@ -614,6 +621,15 @@ void AppConfig::set_defaults()
erase("", "object_settings_size");
}

void AppConfig::set_hardware_type(HardwareType hard) {
this->m_hardware = hard;
// Set default that depends on hardware type

//disable by default if amd graphic card detected, but can't know before the opengl is launched
if (get("compress_png_texture").empty() && (m_hardware&hHasGpu) != 0)
set("compress_png_texture", (m_hardware&hGpuAmd) == hGpuAmd ? "0" : "1");
}

void AppConfig::init_ui_layout() {
boost::filesystem::path resources_dir_path = boost::filesystem::path(resources_dir()) / "ui_layout";
if (!boost::filesystem::is_directory(resources_dir_path)) {
Expand Down
27 changes: 26 additions & 1 deletion src/libslic3r/AppConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,25 @@ class AppConfig
Highlight,
};

enum HardwareType : uint8_t
{
//first 4 bits for cpu
hHasCpu = uint8_t(0x0F),
hCpuIntel = 1,
hCpuAmd = 2,
hCpuApple = 3,
hCpuArmGeneric = 4,
hCpuOther = 5,
//last 4 bits for gpu
hHasGpu = uint8_t(0xF0),
hGpuIntel = 1 << 4,
hGpuAmd = 2 << 4,
hGpuApple = 3 << 4,
hGpuArmGeneric = 4 << 4,
hGpuOther = 5 << 4,
hGpuNvidia = 6 << 4,
};

struct ConfigFileInfo {
bool correct_checksum{ false };
bool contains_null{ false };
Expand Down Expand Up @@ -190,12 +209,16 @@ class AppConfig
LayoutEntry get_ui_layout();
std::vector<LayoutEntry> get_ui_layouts() { return m_ui_layout; }

//tags
// Tags
std::vector<Tag> tags() { return m_tags; }

// splashscreen
std::string splashscreen(bool is_editor);

// Hardware
HardwareType hardware() { return m_hardware; }
void set_hardware_type(HardwareType hard);

// Returns true if the user's data directory comes from before Slic3r 1.40.0 (no updating)
bool legacy_datadir() const { return m_legacy_datadir; }
void set_legacy_datadir(bool value) { m_legacy_datadir = value; }
Expand Down Expand Up @@ -281,6 +304,8 @@ class AppConfig
std::vector<Tag> m_tags;
//splashscreen
std::pair<std::string,std::string> m_default_splashscreen;
// hardware type
HardwareType m_hardware;
};

} // namespace Slic3r
Expand Down
4 changes: 4 additions & 0 deletions src/libslic3r/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ add_library(libslic3r STATIC
Format/3mf.hpp
Format/AMF.cpp
Format/AMF.hpp
Format/BBConfig.cpp
Format/BBConfig.hpp
Format/bbs_3mf.hpp
Format/bbs_3mf.cpp
Format/OBJ.cpp
Format/OBJ.hpp
Format/objparser.cpp
Expand Down
Loading

0 comments on commit 8f8305a

Please sign in to comment.