diff --git a/.github/workflows/ccpp_ubuntu.yml b/.github/workflows/ccpp_ubuntu.yml index cd5aa6684..f1d2858b0 100644 --- a/.github/workflows/ccpp_ubuntu.yml +++ b/.github/workflows/ccpp_ubuntu.yml @@ -72,8 +72,8 @@ jobs: - name: build appimage working-directory: ./build/package run: | - chmod +x ../../src/platform/unix/build_appimage.sh - ../../src/platform/unix/build_appimage.sh Slic3r_ubu64.AppImage + chmod +x ../build_appimage.sh + ../build_appimage.sh Slic3r_ubu64.AppImage - name: Upload appimage uses: actions/upload-artifact@v1.0.0 with: diff --git a/resources/icons/Slic3r_32px.png b/resources/icons/Slic3r_32px.png index a13c27a3e..6f3229e6a 100644 Binary files a/resources/icons/Slic3r_32px.png and b/resources/icons/Slic3r_32px.png differ diff --git a/resources/ui_layout/colors.ini b/resources/ui_layout/colors.ini index 56c2b5f2c..ab889d5a3 100644 --- a/resources/ui_layout/colors.ini +++ b/resources/ui_layout/colors.ini @@ -17,3 +17,8 @@ Wipe tower = B3E3AB Mill = B3B3B3 Custom = 28CC94 Mixed = 000000 +Gui_color_very_dark = ada230 +Gui_color_dark = cabe39 +Gui_color = eddc21 +Gui_color_light = ffee38 +Gui_color_very_light = fef48b \ No newline at end of file diff --git a/resources/ui_layout/printer_fff.ui b/resources/ui_layout/printer_fff.ui index 0c3844e46..9621af511 100644 --- a/resources/ui_layout/printer_fff.ui +++ b/resources/ui_layout/printer_fff.ui @@ -22,6 +22,7 @@ group:Cooling fan setting:label$Only for overhangs:fan_speedup_overhangs end_line setting:label$Kickstart duration:fan_kickstart + setting:fan_percentage group:Thumbnails line:Size for Gcode setting:id$0:label$Small:thumbnails diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index dece0a6e0..0e37ef7d3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -91,9 +91,9 @@ endif() # Create a Slic3r executable # Process mainfests for various platforms. -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/platform/msw/Slic3r.rc.in ${CMAKE_CURRENT_BINARY_DIR}/${SLIC3R_APP_NAME}.rc @ONLY) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/platform/msw/gcodeviewer.rc.in ${CMAKE_CURRENT_BINARY_DIR}/${SLIC3R_APP_NAME}-gcodeviewer.rc @ONLY) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/platform/msw/PrusaSlicer.manifest.in ${CMAKE_CURRENT_BINARY_DIR}/${SLIC3R_APP_NAME}.manifest @ONLY) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/platform/msw/Slic3r.rc.in ${CMAKE_CURRENT_BINARY_DIR}/${SLIC3R_APP_KEY}.rc @ONLY) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/platform/msw/gcodeviewer.rc.in ${CMAKE_CURRENT_BINARY_DIR}/${SLIC3R_APP_KEY}-gcodeviewer.rc @ONLY) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/platform/msw/PrusaSlicer.manifest.in ${CMAKE_CURRENT_BINARY_DIR}/${SLIC3R_APP_KEY}.manifest @ONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/platform/osx/Info.plist.in ${CMAKE_CURRENT_BINARY_DIR}/Info.plist @ONLY) if (WIN32) add_library(Slic3r SHARED PrusaSlicer.cpp PrusaSlicer.hpp) @@ -152,7 +152,7 @@ if (WIN32) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libslic3r/libslic3r_version.h.in ${CMAKE_CURRENT_BINARY_DIR}/libslic3r_version.h @ONLY) - add_executable(Slic3r_app_gui WIN32 PrusaSlicer_app_msvc.cpp ${CMAKE_CURRENT_BINARY_DIR}/${SLIC3R_APP_NAME}.rc) + add_executable(Slic3r_app_gui WIN32 PrusaSlicer_app_msvc.cpp ${CMAKE_CURRENT_BINARY_DIR}/${SLIC3R_APP_KEY}.rc) target_include_directories(Slic3r_app_gui PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) # Generate debug symbols even in release mode. if(MSVC) @@ -163,7 +163,7 @@ if (WIN32) set_target_properties(Slic3r_app_gui PROPERTIES OUTPUT_NAME "slic3r") target_link_libraries(Slic3r_app_gui PRIVATE boost_headeronly) - add_executable(Slic3r_app_console PrusaSlicer_app_msvc.cpp ${CMAKE_CURRENT_BINARY_DIR}/${SLIC3R_APP_NAME}.rc) + add_executable(Slic3r_app_console PrusaSlicer_app_msvc.cpp ${CMAKE_CURRENT_BINARY_DIR}/${SLIC3R_APP_KEY}.rc) target_include_directories(Slic3r_app_console PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) # Generate debug symbols even in release mode. if (MSVC) @@ -174,7 +174,7 @@ if (WIN32) set_target_properties(Slic3r_app_console PROPERTIES OUTPUT_NAME "${SLIC3R_APP_CMD}_console") target_link_libraries(Slic3r_app_console PRIVATE boost_headeronly) - add_executable(PrusaSlicer_app_gcodeviewer WIN32 PrusaSlicer_app_msvc.cpp ${CMAKE_CURRENT_BINARY_DIR}/${SLIC3R_APP_NAME}-gcodeviewer.rc ${CMAKE_CURRENT_BINARY_DIR}/libslic3r_version.h) + add_executable(PrusaSlicer_app_gcodeviewer WIN32 PrusaSlicer_app_msvc.cpp ${CMAKE_CURRENT_BINARY_DIR}/${SLIC3R_APP_KEY}-gcodeviewer.rc ${CMAKE_CURRENT_BINARY_DIR}/libslic3r_version.h) target_include_directories(PrusaSlicer_app_gcodeviewer PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) # Generate debug symbols even in release mode. if (MSVC) diff --git a/src/PrusaSlicer_app_msvc.cpp b/src/PrusaSlicer_app_msvc.cpp index 336503587..972f47d16 100644 --- a/src/PrusaSlicer_app_msvc.cpp +++ b/src/PrusaSlicer_app_msvc.cpp @@ -283,11 +283,12 @@ int wmain(int argc, wchar_t **argv) wchar_t path_to_slic3r[MAX_PATH + 1] = { 0 }; wcscpy(path_to_slic3r, path_to_exe); - wcscat(path_to_slic3r, L"Slic3r.dll"); + wcscat(path_to_slic3r, SLIC3R_APP_WKEY); + wcscat(path_to_slic3r, L".dll"); // printf("Loading Slic3r library: %S\n", path_to_slic3r); HINSTANCE hInstance_Slic3r = LoadLibraryExW(path_to_slic3r, nullptr, 0); if (hInstance_Slic3r == nullptr) { - printf(SLIC3R_APP_NAME ".dll was not loaded, error code: %d\n", GetLastError()); + printf(SLIC3R_APP_KEY ".dll was not loaded, error code: %d\n", GetLastError()); return -1; } diff --git a/src/libslic3r/AppConfig.cpp b/src/libslic3r/AppConfig.cpp index d97f44176..63e17a7af 100644 --- a/src/libslic3r/AppConfig.cpp +++ b/src/libslic3r/AppConfig.cpp @@ -66,20 +66,45 @@ void AppConfig::set_defaults() if (get("tab_icon_size").empty()) set("tab_icon_size", "32"); + //get default color from the ini file + + //try to load colors from ui file + std::map key2color = { {"Gui_color_very_dark", "ada230"}, {"Gui_color_dark", "cabe39"}, {"Gui_color", "eddc21"}, {"Gui_color_light", "ffee38"}, {"Gui_color_very_light", "fef48b"} }; + boost::property_tree::ptree tree_colors; + boost::filesystem::path path_colors = boost::filesystem::path(resources_dir()) / "ui_layout" / "colors.ini"; + try { + boost::nowide::ifstream ifs; + ifs.imbue(boost::locale::generator()("en_US.UTF-8")); + ifs.open(path_colors.string()); + boost::property_tree::read_ini(ifs, tree_colors); + + for(std::map::iterator it = key2color.begin(); it != key2color.end() ; ++it) { + std::string color_code = tree_colors.get(it->first); + if (color_code.length() == 6) + it->second = color_code; + } + } + catch (const std::ifstream::failure& err) { + trace(1, (std::string("The color file cannot be loaded. Reason: ") + err.what(), path_colors.string()).c_str()); + } + catch (const std::runtime_error& err) { + trace(1, (std::string("Failed loading the color file. Reason: ") + err.what(), path_colors.string()).c_str()); + } + if (get("color_very_dark").empty()) - set("color_very_dark", "0047c7"); - + set("color_very_dark", key2color["Gui_color_very_dark"]); + if (get("color_dark").empty()) - set("color_dark", "2172eb"); - + set("color_dark", key2color["Gui_color_dark"]); + if (get("color").empty()) - set("color", "428dfd"); - + set("color", key2color["Gui_color"]); + if (get("color_light").empty()) - set("color_light", "8bb9fe"); - + set("color_light", key2color["Gui_color_light"]); + if (get("color_very_light").empty()) - set("color_very_light", "428cff"); + set("color_very_light", key2color["Gui_color_very_light"]); if (get("version_check").empty()) set("version_check", "1"); diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index 9e002c69b..095069a3e 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -540,7 +540,7 @@ void GCodeProcessor::apply_config(const PrintConfig& config) m_extruder_names.resize(extruders_count); for (size_t i = 0; i < extruders_count; ++i) { - m_extruder_names[i] = config.tool_name.values[i]; + m_extruder_names[i] = config.tool_name.get_at(i); } m_extruder_colors.resize(extruders_count); diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index bf1aa5f6b..3d7fcd441 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -669,6 +669,7 @@ const std::vector& Preset::printer_options() "fan_kickstart", "fan_speedup_overhangs", "fan_speedup_time", + "fan_percentage", "gcode_flavor", "gcode_precision_xyz", "use_relative_e_distances", diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index e1902bd97..b65ed1c47 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -105,6 +105,7 @@ bool Print::invalidate_state_by_config_options(const std::vector Slic3r.desktop [Desktop Entry] -Name=Slic3r +Name=@SLIC3R_APP_NAME@ Exec=AppRun %F -Icon=Slic3r +Icon=@SLIC3R_APP_KEY@ Type=Application Categories=Utility; MimeType=model/stl;application/vnd.ms-3mfdocument;application/prs.wavefront-obj;application/x-amf; diff --git a/src/slic3r/GUI/AboutDialog.cpp b/src/slic3r/GUI/AboutDialog.cpp index 0b003af4e..d5e1fab90 100644 --- a/src/slic3r/GUI/AboutDialog.cpp +++ b/src/slic3r/GUI/AboutDialog.cpp @@ -61,7 +61,7 @@ CopyrightsDialog::CopyrightsDialog() std::array size = { fs, fs, fs, fs, fs2, fs2, fs2 }; m_html->SetFonts(font.GetFaceName(), font.GetFaceName(), size.data()); - m_html->SetBorders(2); + m_html->SetBorders(2); m_html->SetPage(get_html_text()); sizer->Add(m_html, 1, wxEXPAND | wxALL, 15); diff --git a/src/slic3r/GUI/ConfigWizard.cpp b/src/slic3r/GUI/ConfigWizard.cpp index 110bdfa1d..b158c5f8e 100644 --- a/src/slic3r/GUI/ConfigWizard.cpp +++ b/src/slic3r/GUI/ConfigWizard.cpp @@ -91,17 +91,18 @@ BundleMap BundleMap::load() const auto vendor_dir = (boost::filesystem::path(Slic3r::data_dir()) / "vendor").make_preferred(); const auto rsrc_vendor_dir = (boost::filesystem::path(resources_dir()) / "profiles").make_preferred(); - auto prusa_bundle_path = (vendor_dir / PresetBundle::PRUSA_BUNDLE).replace_extension(".ini"); - auto prusa_bundle_rsrc = false; - if (! boost::filesystem::exists(prusa_bundle_path)) { - prusa_bundle_path = (rsrc_vendor_dir / PresetBundle::PRUSA_BUNDLE).replace_extension(".ini"); - prusa_bundle_rsrc = true; - } - { - Bundle prusa_bundle; - if (prusa_bundle.load(std::move(prusa_bundle_path), prusa_bundle_rsrc, true)) - res.emplace(PresetBundle::PRUSA_BUNDLE, std::move(prusa_bundle)); - } + // commented prusa bundle mandatory check at startup + //auto prusa_bundle_path = (vendor_dir / PresetBundle::PRUSA_BUNDLE).replace_extension(".ini"); + //auto prusa_bundle_rsrc = false; + //if (! boost::filesystem::exists(prusa_bundle_path)) { + // prusa_bundle_path = (rsrc_vendor_dir / PresetBundle::PRUSA_BUNDLE).replace_extension(".ini"); + // prusa_bundle_rsrc = true; + //} + //{ + // Bundle prusa_bundle; + // if (prusa_bundle.load(std::move(prusa_bundle_path), prusa_bundle_rsrc, true)) + // res.emplace(PresetBundle::PRUSA_BUNDLE, std::move(prusa_bundle)); + //} // Load the other bundles in the datadir/vendor directory // and then additionally from resources/profiles. diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index e1ece8ad9..028201ef2 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -191,7 +191,9 @@ public: BitmapCache bmp_cache; int logo_size = lround(width * 0.25); //uint32_t color = color_from_hex(Slic3r::GUI::wxGetApp().app_config->get("color_dark")); //uncomment if you also want to modify the icon color - wxBitmap logo_bmp = *bmp_cache.load_svg(wxGetApp().is_editor() ? SLIC3R_APP_KEY "_logo" : "add_gcode", logo_size, logo_size/*, color*/); + wxBitmap* logo_bmp = bmp_cache.load_svg(wxGetApp().is_editor() ? SLIC3R_APP_KEY "_logo" : "add_gcode", logo_size, logo_size/*, color*/); + if(logo_bmp == nullptr) logo_bmp = bmp_cache.load_png(wxGetApp().is_editor() ? SLIC3R_APP_KEY "_logo" : "add_gcode", logo_size, logo_size/*, color*/); + if (logo_bmp == nullptr) return; wxCoord margin = int(m_scale * 20); @@ -202,7 +204,7 @@ public: wxMemoryDC memDc(bmp); // draw logo - memDc.DrawBitmap(logo_bmp, margin, margin, true); + memDc.DrawBitmap(*logo_bmp, margin, margin, true); // draw the (white) labels inside of our black box (at the left of the splashscreen) memDc.SetTextForeground(wxColour(255, 255, 255)); @@ -702,11 +704,11 @@ void GUI_App::init_app_config() { #ifdef SLIC3R_ALPHA // Profiles for the alpha are stored into the PrusaSlicer-alpha directory to not mix with the current release. - SetAppName(SLIC3R_APP_KEY "-alpha"); + SetAppName(SLIC3R_APP_KEY "-alpha"); #else - SetAppName(SLIC3R_APP_KEY); + SetAppName(SLIC3R_APP_KEY); #endif -// SetAppDisplayName(SLIC3R_APP_NAME); +// SetAppDisplayName(SLIC3R_APP_NAME); // Set the Slic3r data directory at the Slic3r XS module. // Unix: ~/ .Slic3r diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index 9d03456f4..64d1016b1 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -131,7 +131,7 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_S default: case GUI_App::EAppMode::Editor: m_taskbar_icon = std::make_unique(wxTBI_DOCK); - m_taskbar_icon->SetIcon(wxIcon(Slic3r::var("Slic3r_128px.png"), wxBITMAP_TYPE_PNG), SLIC3R_APP_NAME); + m_taskbar_icon->SetIcon(wxIcon(Slic3r::var("Slic3r_128px.png"), wxBITMAP_TYPE_PNG), SLIC3R_APP_KEY); break; case GUI_App::EAppMode::GCodeViewer: m_taskbar_icon = std::make_unique(wxTBI_DOCK); @@ -149,8 +149,8 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_S if (wxGetApp().is_editor()) m_statusbar->embed(this); m_statusbar->set_status_text(_L("Version") + " " + - SLIC3R_VERSION + - _L("Remember to check for updates at https://github.com/" SLIC3R_GITHUB "/releases")); + SLIC3R_VERSION + " " + + _L("Remember to check for updates at " SLIC3R_DOWNLOAD)); // initialize tabpanel and menubar init_tabpanel(); @@ -268,10 +268,6 @@ void MainFrame::update_layout() if (plater_page_id != wxNOT_FOUND) m_tabpanel->RemovePage(plater_page_id); - for (size_t i = 0; i < m_tabpanel->GetPageCount(); i++) - if (m_tabpanel->GetPage(i)->GetChildren().size() == 1 && m_tabpanel->GetPage(i)->GetChildren().front() == m_plater) - m_tabpanel->GetPage(i)->GetSizer()->Clear(); - if (m_plater->GetParent() != this) m_plater->Reparent(this); @@ -1054,10 +1050,10 @@ static const wxString sep_space = ""; static wxMenu* generate_help_menu() { wxMenu* helpMenu = new wxMenu(); - append_menu_item(helpMenu, wxID_ANY, _L(SLIC3R_APP_NAME " Releases"), _L("Open the Slic3r releases page in your browser"), - [](wxCommandEvent&) { wxLaunchDefaultBrowser("https://slic3r.org/download/"); }); - append_menu_item(helpMenu, wxID_ANY, _L(SLIC3R_APP_NAME " wiki"), _L("Open the Slic3r wiki in your browser"), - [](wxCommandEvent&) { wxLaunchDefaultBrowser("http://github.com/slic3r/Slic3r/wiki"); }); + append_menu_item(helpMenu, wxID_ANY, _L(SLIC3R_APP_NAME " Releases"), _L("Open the " SLIC3R_APP_NAME " releases page in your browser"), + [](wxCommandEvent&) { wxLaunchDefaultBrowser(SLIC3R_DOWNLOAD); }); + append_menu_item(helpMenu, wxID_ANY, _L(SLIC3R_APP_NAME " wiki"), _L("Open the " SLIC3R_APP_NAME " wiki in your browser"), + [](wxCommandEvent&) { wxLaunchDefaultBrowser("http://github.com/" SLIC3R_GITHUB "/wiki"); }); append_menu_item(helpMenu, wxID_ANY, _L(SLIC3R_APP_NAME " website"), _L("Open the Slic3r website in your browser"), [](wxCommandEvent&) { wxLaunchDefaultBrowser("http://slic3r.org"); }); //# my $versioncheck = $self->_append_menu_item($helpMenu, "Check for &Updates...", "Check for new Slic3r versions", sub{ @@ -1433,7 +1429,7 @@ void MainFrame::init_menubar_as_editor() append_menu_item(generationMenu, wxID_ANY, _(L("FreeCad python script")), _(L("Create an object by writing little easy script.")), [this](wxCommandEvent&) { wxGetApp().freecad_script_dialog(); }); append_menu_item(generationMenu, wxID_ANY, _(L("Script help page")), _(L("How to use the FreeCad python script window.")), - [this](wxCommandEvent&) { wxLaunchDefaultBrowser("https://github.com/supermerill/Slic3r/wiki/FreePySCAD-script-window"); }); + [this](wxCommandEvent&) { wxLaunchDefaultBrowser("https://github.com/supermerill/SuperSlicer/wiki/FreePySCAD-script-window"); }); } diff --git a/src/slic3r/GUI/Preferences.cpp b/src/slic3r/GUI/Preferences.cpp index 56df9be00..bae29f5b3 100644 --- a/src/slic3r/GUI/Preferences.cpp +++ b/src/slic3r/GUI/Preferences.cpp @@ -586,6 +586,7 @@ void PreferencesDialog::create_icon_size_slider() void PreferencesDialog::create_settings_mode_widget() { wxString choices[] = { _L("Regular layout with the tab bar"), + _L("Old PrusaSlicer layout"), _L("Access via settings button in the top menu"), _L("Settings in non-modal window") }; diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 9b4bd0fc7..bb2c6f20c 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -2,9 +2,10 @@ #include "slic3r/Utils/Serial.hpp" #include "Tab.hpp" #include "PresetHints.hpp" +#include "libslic3r/Log.hpp" +#include "libslic3r/Model.hpp" #include "libslic3r/PresetBundle.hpp" #include "libslic3r/Utils.hpp" -#include "libslic3r/Model.hpp" #include "slic3r/Utils/Http.hpp" #include "slic3r/Utils/PrintHost.hpp" @@ -1421,8 +1422,8 @@ bool Tab::create_pages(std::string setting_type_name, int idx_page) if (!boost::filesystem::exists(ui_layout_file)) { std::cerr << "Error: cannot create " << setting_type_name << "settings, cannot find file " << ui_layout_file << "\n"; return false; - }else - std::cout << "create settings " << setting_type_name << "\n"; + } else + Slic3r::slic3r_log->info("settings gui") << "create settings " << setting_type_name << "\n"; bool no_page_yet = true; #ifdef __WXMSW__ @@ -1465,7 +1466,7 @@ bool Tab::create_pages(std::string setting_type_name, int idx_page) no_page_yet = false; if (in_line) { current_group->append_line(current_line); - if (logs) std::cout << "add line\n"; + if (logs) Slic3r::slic3r_log->info("settings gui") << "add line\n"; in_line = false; } std::vector params; @@ -1487,14 +1488,14 @@ bool Tab::create_pages(std::string setting_type_name, int idx_page) } } - if(logs) std::cout << "create page " << label.c_str() <<" : "<< params[params.size() - 1] << "\n"; + if(logs) Slic3r::slic3r_log->info("settings gui") << "create page " << label.c_str() <<" : "<< params[params.size() - 1] << "\n"; current_page = add_options_page(L(label), params[params.size() - 1]); } else if (boost::starts_with(full_line, "end_page")) { if (in_line) { current_group->append_line(current_line); - if (logs) std::cout << "add line\n"; + if (logs) Slic3r::slic3r_log->info("settings gui") << "add line\n"; in_line = false; } current_page.reset(); @@ -1503,7 +1504,7 @@ bool Tab::create_pages(std::string setting_type_name, int idx_page) { if (in_line) { current_group->append_line(current_line); - if (logs) std::cout << "add line\n"; + if (logs) Slic3r::slic3r_log->info("settings gui") << "add line\n"; in_line = false; } std::vector params; @@ -1637,13 +1638,13 @@ bool Tab::create_pages(std::string setting_type_name, int idx_page) }); } } - if (logs) std::cout << "create group " << params.back() << "\n"; + if (logs) Slic3r::slic3r_log->info("settings gui") << "create group " << params.back() << "\n"; } else if (boost::starts_with(full_line, "end_group")) { if (in_line) { current_group->append_line(current_line); - if (logs) std::cout << "add line\n"; + if (logs) Slic3r::slic3r_log->info("settings gui") << "add line\n"; in_line = false; } current_group.reset(); @@ -1652,7 +1653,7 @@ bool Tab::create_pages(std::string setting_type_name, int idx_page) { if (in_line) { current_group->append_line(current_line); - if (logs) std::cout << "add line\n"; + if (logs) Slic3r::slic3r_log->info("settings gui") << "add line\n"; in_line = false; } std::vector params; @@ -1669,12 +1670,12 @@ bool Tab::create_pages(std::string setting_type_name, int idx_page) } } in_line = true; - if (logs) std::cout << "create line " << (params.empty() ? "" : params.back()) << "\n"; + if (logs) Slic3r::slic3r_log->info("settings gui") << "create line " << (params.empty() ? "" : params.back()) << "\n"; } else if (boost::starts_with(full_line, "end_line")) { current_group->append_line(current_line); - if (logs) std::cout << "add line\n"; + if (logs) Slic3r::slic3r_log->info("settings gui") << "add line\n"; in_line = false; } else if (boost::starts_with(full_line, "setting")) @@ -1787,7 +1788,7 @@ bool Tab::create_pages(std::string setting_type_name, int idx_page) } else { current_line.append_option(option); } - if (logs) std::cout << "create setting " << setting_id <<" with label "<< option.opt.label << "and height "<< option.opt.height<<" fw:"<< option.opt.full_width << "\n"; + if (logs) Slic3r::slic3r_log->info("settings gui") << "create setting " << setting_id <<" with label "<< option.opt.label << "and height "<< option.opt.height<<" fw:"<< option.opt.full_width << "\n"; } else if (boost::starts_with(full_line, "height")) { std::string arg = ""; @@ -2008,7 +2009,7 @@ bool Tab::create_pages(std::string setting_type_name, int idx_page) // layout_page(current_page); #endif - if(logs) std::cout << "END create settings " << setting_type_name << "\n"; + if(logs) Slic3r::slic3r_log->info("settings gui") << "END create settings " << setting_type_name << "\n"; return !no_page_yet; } diff --git a/src/slic3r/Utils/PresetUpdater.cpp b/src/slic3r/Utils/PresetUpdater.cpp index 722d330c2..643355f37 100644 --- a/src/slic3r/Utils/PresetUpdater.cpp +++ b/src/slic3r/Utils/PresetUpdater.cpp @@ -390,7 +390,8 @@ void PresetUpdater::priv::sync_config(const VendorMap vendors) void PresetUpdater::priv::check_install_indices() const { BOOST_LOG_TRIVIAL(info) << "Checking if indices need to be installed from resources..."; - + if (!fs::exists(rsrc_path)) + return; for (auto &dir_entry : boost::filesystem::directory_iterator(rsrc_path)) if (is_idx_file(dir_entry)) { const auto &path = dir_entry.path(); diff --git a/src/slic3r/Utils/Process.cpp b/src/slic3r/Utils/Process.cpp index 31f32e30e..ab7cf2122 100644 --- a/src/slic3r/Utils/Process.cpp +++ b/src/slic3r/Utils/Process.cpp @@ -62,9 +62,9 @@ static void start_new_slicer_or_gcodeviewer(const NewSlicerInstanceType instance { // Maybe one day we will be able to run PrusaGCodeViewer, but for now the Apple notarization // process refuses Apps with multiple binaries and Vojtech does not know any workaround. - // ((instance_type == NewSlicerInstanceType::Slicer) ? SLIC3R_APP_NAME : GCODEVIEWER_APP_NAME); + // ((instance_type == NewSlicerInstanceType::Slicer) ? SLIC3R_APP_CMD : GCODEVIEWER_APP_CMD); // Just run the slicer and give it a --gcodeviewer parameter. - bin_path = bin_path.parent_path() / SLIC3R_APP_NAME; + bin_path = bin_path.parent_path() / SLIC3R_APP_CMD; // On Apple the wxExecute fails, thus we use boost::process instead. BOOST_LOG_TRIVIAL(info) << "Trying to spawn a new slicer \"" << bin_path.string() << "\""; try { diff --git a/version.inc b/version.inc index 221303f62..41667c68f 100644 --- a/version.inc +++ b/version.inc @@ -1,19 +1,29 @@ # Included by CMakeLists, edited by the build script # (the version numbers are generated by the build script from the git current label) +# name of the slicer set(SLIC3R_APP_NAME "Slic3r") +# Key fo the slicer, must only contains ascii chars and no spaces set(SLIC3R_APP_KEY "Slic3r") +# exe name of the slicer, should be lowercase and valid in all os +set(SLIC3R_APP_CMD "Slic3r") +# versions set(SLIC3R_VERSION "2.0") set(SLIC3R_VERSION_FULL "2.0.00.0") set(SLIC3R_BUILD_ID "Slic3r_${SLIC3R_VERSION_FULL}") set(SLIC3R_RC_VERSION "2,0,00,0") set(SLIC3R_RC_VERSION_DOTS "${SLIC3R_VERSION_FULL}") - +# Same as the slicer name but for gcodeviewer set(GCODEVIEWER_APP_NAME "G-code Viewer") set(GCODEVIEWER_APP_KEY "GCodeViewer") set(GCODEVIEWER_APP_CMD "gcodeviewer") +# string to be added after the SLIC3R_APP_NAME on some places set(SLIC3R_BASED_ON "") +# to get he github repo set(SLIC3R_GITHUB "slic3r/Slic3r") +# download url +set(SLIC3R_DOWNLOAD "https://slic3r.org/download") +# string to display in the spalshscreen set(SLIC3R_INTRO "Slic3r contains sizable contributions from Prusa Research. Original work by Alessandro Ranellucci and the RepRap community.")