Skip to content

Commit 8f8305a

Browse files
committed
Fix macos launch, calibration, prevent missclick on slider
2 parents c62503c + 640e3ce commit 8f8305a

File tree

117 files changed

+39908
-1237
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+39908
-1237
lines changed

resources/localization/it/Slic3r.po

Lines changed: 597 additions & 60 deletions
Large diffs are not rendered by default.

resources/localization/it/TODO.po

Lines changed: 4 additions & 576 deletions
Large diffs are not rendered by default.

resources/localization/it/it_database.po

Lines changed: 876 additions & 132 deletions
Large diffs are not rendered by default.

resources/profiles

src/PrusaSlicer.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,10 @@ int CLI::run(int argc, char **argv)
142142
if (! config_substitutions.empty()) {
143143
boost::nowide::cout << "The following configuration values were substituted when loading \" << file << \":\n";
144144
for (const ConfigSubstitution &subst : config_substitutions)
145-
boost::nowide::cout << "\tkey = \"" << subst.opt_def->opt_key << "\"\t loaded = \"" << subst.old_value << "\tsubstituted = \"" << subst.new_value->serialize() << "\"\n";
145+
if(subst.opt_def)
146+
boost::nowide::cout << "\tkey = \"" << subst.opt_def->opt_key << "\"\t loaded = \"" << subst.old_value << "\tsubstituted = \"" << subst.new_value->serialize() << "\"\n";
147+
else
148+
boost::nowide::cout << "\tkey = \"" << subst.old_name << "\"\t can't be loaded (value = \"" << subst.old_value <<"\")\n";
146149
}
147150
config.normalize_fdm();
148151
PrinterTechnology other_printer_technology = get_printer_technology(config);
@@ -192,10 +195,13 @@ int CLI::run(int argc, char **argv)
192195
boost::nowide::cerr << "Mixing configurations for FFF and SLA technologies" << std::endl;
193196
return 1;
194197
}
195-
if (! config_substitutions.substitutions.empty()) {
198+
if (! config_substitutions.empty()) {
196199
boost::nowide::cout << "The following configuration values were substituted when loading \" << file << \":\n";
197-
for (const ConfigSubstitution& subst : config_substitutions.substitutions)
198-
boost::nowide::cout << "\tkey = \"" << subst.opt_def->opt_key << "\"\t loaded = \"" << subst.old_value << "\tsubstituted = \"" << subst.new_value->serialize() << "\"\n";
200+
for (const ConfigSubstitution& subst : config_substitutions.get())
201+
if(subst.opt_def)
202+
boost::nowide::cout << "\tkey = \"" << subst.opt_def->opt_key << "\"\t loaded = \"" << subst.old_value << "\tsubstituted = \"" << subst.new_value->serialize() << "\"\n";
203+
else
204+
boost::nowide::cout << "\tkey = \"" << subst.old_name << "\"\t can't be loaded (value = \"" << subst.old_value <<"\")\n";
199205
}
200206
// config is applied to m_print_config before the current m_config values.
201207
config += std::move(m_print_config);

src/libslic3r/AppConfig.cpp

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -360,9 +360,9 @@ void AppConfig::set_defaults()
360360
if (get("check_blacklisted_library").empty())
361361
set("check_blacklisted_library", "1");
362362
#endif // _WIN32
363-
364-
if (get("compress_png_texture").empty())
365-
set("compress_png_texture", "1");
363+
//disable by default if amd graphic card detected, but can't know before the opengl is launched
364+
//if (get("compress_png_texture").empty())
365+
//set("compress_png_texture", (m_hardware&hGpuAmd) == hGpuAmd ? "0" : "1");
366366

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

398+
if (get("show_unknown_setting").empty())
399+
set("show_unknown_setting", "1");
400+
398401
if (get("use_custom_toolbar_size").empty())
399402
set("use_custom_toolbar_size", "0");
400403

@@ -458,7 +461,11 @@ void AppConfig::set_defaults()
458461
set("use_rich_tooltip", "0");
459462

460463
if (get("hide_slice_tooltip").empty())
464+
#ifdef _WIN32
465+
set("hide_slice_tooltip", "1");
466+
#else
461467
set("hide_slice_tooltip", "0");
468+
#endif // _WIN32
462469

463470
if (get("show_layer_height_doubleslider").empty())
464471
set("show_layer_height_doubleslider", "1");
@@ -500,9 +507,6 @@ void AppConfig::set_defaults()
500507
if (get("show_splash_screen").empty())
501508
set("show_splash_screen", "1");
502509

503-
if (get("show_splash_screen").empty())
504-
set("show_splash_screen", "1");
505-
506510
if (get("restore_win_position").empty())
507511
set("restore_win_position", "1"); // allowed values - "1", "0", "crashed_at_..."
508512

@@ -515,7 +519,7 @@ void AppConfig::set_defaults()
515519
{
516520

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

546-
if (!get("show_splash_screen_random").empty() && get("show_splash_screen_random") == "1") {
550+
bool switch_to_random = get("show_splash_screen_random") == "1";
551+
if (switch_to_random || key2splashscreen["splash_screen_editor"].empty())
547552
set("splash_screen_editor", "random");
553+
if (switch_to_random || key2splashscreen["splash_screen_gcodeviewer"].empty())
554+
set("splash_screen_gcodeviewer", "random");
555+
if (switch_to_random)
548556
set("show_splash_screen_random", "0");
549-
}
550557
}
551558

552559
#ifdef _WIN32
@@ -614,6 +621,15 @@ void AppConfig::set_defaults()
614621
erase("", "object_settings_size");
615622
}
616623

624+
void AppConfig::set_hardware_type(HardwareType hard) {
625+
this->m_hardware = hard;
626+
// Set default that depends on hardware type
627+
628+
//disable by default if amd graphic card detected, but can't know before the opengl is launched
629+
if (get("compress_png_texture").empty() && (m_hardware&hHasGpu) != 0)
630+
set("compress_png_texture", (m_hardware&hGpuAmd) == hGpuAmd ? "0" : "1");
631+
}
632+
617633
void AppConfig::init_ui_layout() {
618634
boost::filesystem::path resources_dir_path = boost::filesystem::path(resources_dir()) / "ui_layout";
619635
if (!boost::filesystem::is_directory(resources_dir_path)) {

src/libslic3r/AppConfig.hpp

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,25 @@ class AppConfig
2727
Highlight,
2828
};
2929

30+
enum HardwareType : uint8_t
31+
{
32+
//first 4 bits for cpu
33+
hHasCpu = uint8_t(0x0F),
34+
hCpuIntel = 1,
35+
hCpuAmd = 2,
36+
hCpuApple = 3,
37+
hCpuArmGeneric = 4,
38+
hCpuOther = 5,
39+
//last 4 bits for gpu
40+
hHasGpu = uint8_t(0xF0),
41+
hGpuIntel = 1 << 4,
42+
hGpuAmd = 2 << 4,
43+
hGpuApple = 3 << 4,
44+
hGpuArmGeneric = 4 << 4,
45+
hGpuOther = 5 << 4,
46+
hGpuNvidia = 6 << 4,
47+
};
48+
3049
struct ConfigFileInfo {
3150
bool correct_checksum{ false };
3251
bool contains_null{ false };
@@ -190,12 +209,16 @@ class AppConfig
190209
LayoutEntry get_ui_layout();
191210
std::vector<LayoutEntry> get_ui_layouts() { return m_ui_layout; }
192211

193-
//tags
212+
// Tags
194213
std::vector<Tag> tags() { return m_tags; }
195214

196215
// splashscreen
197216
std::string splashscreen(bool is_editor);
198217

218+
// Hardware
219+
HardwareType hardware() { return m_hardware; }
220+
void set_hardware_type(HardwareType hard);
221+
199222
// Returns true if the user's data directory comes from before Slic3r 1.40.0 (no updating)
200223
bool legacy_datadir() const { return m_legacy_datadir; }
201224
void set_legacy_datadir(bool value) { m_legacy_datadir = value; }
@@ -281,6 +304,8 @@ class AppConfig
281304
std::vector<Tag> m_tags;
282305
//splashscreen
283306
std::pair<std::string,std::string> m_default_splashscreen;
307+
// hardware type
308+
HardwareType m_hardware;
284309
};
285310

286311
} // namespace Slic3r

src/libslic3r/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ add_library(libslic3r STATIC
9595
Format/3mf.hpp
9696
Format/AMF.cpp
9797
Format/AMF.hpp
98+
Format/BBConfig.cpp
99+
Format/BBConfig.hpp
100+
Format/bbs_3mf.hpp
101+
Format/bbs_3mf.cpp
98102
Format/OBJ.cpp
99103
Format/OBJ.hpp
100104
Format/objparser.cpp

0 commit comments

Comments
 (0)