Browse Source

fix more app name errors
- icons
- gcodeviewer name&key now include the slic3r name
- instance check now depends on hte slic3r name, and not always prusaslicer
- possible fix for 3Dmouse on macos
- error text
- CWS now output the slicer name & version separately and the slicer config in the slicer.ini field
- re-add some of the 'about' credentials from slic3r (icon, manual)

supermerill 3 years ago
parent
commit
8504793a7e

+ 7 - 4
src/CMakeLists.txt

@@ -221,14 +221,17 @@ else ()
         add_custom_command(TARGET Slic3r POST_BUILD
             COMMAND ls
             # COMMAND ln -sf Slic3r slic3r
-            COMMAND ln -sf Slic3r prusa-gcodeviewer
-            COMMAND ln -sf Slic3r PrusaGCodeViewer
+            #was: COMMAND ln -sf Slic3r prusa-gcodeviewer
+            COMMAND ln -sf Slic3r ${GCODEVIEWER_APP_CMD}
+            #was: COMMAND ln -sf Slic3r PrusaGCodeViewer
+            COMMAND ln -sf Slic3r ${GCODEVIEWER_APP_KEY}
             WORKING_DIRECTORY "$<TARGET_FILE_DIR:Slic3r>"
             COMMENT "Symlinking the G-code viewer to Slic3r, symlinking to slic3r and gcodeviewer"
             VERBATIM)
     else ()
         add_custom_command(TARGET Slic3r POST_BUILD
-            COMMAND ln -sf slic3r prusa-gcodeviewer
+            #was: COMMAND ln -sf Slic3r prusa-gcodeviewer
+            COMMAND ln -sf slic3r ${GCODEVIEWER_APP_CMD}
             WORKING_DIRECTORY "$<TARGET_FILE_DIR:Slic3r>"
             COMMENT "Symlinking the G-code viewer to Slic3r"
             VERBATIM)
@@ -257,5 +260,5 @@ else ()
     install(TARGETS Slic3r RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
 
     # Install the symlink for gcodeviewer
-    install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink slic3r slic3rgcodeviewer WORKING_DIRECTORY \$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR})")
+    install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink slic3r ${GCODEVIEWER_APP_CMD} WORKING_DIRECTORY \$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR})")
 endif ()

+ 1 - 1
src/PrusaSlicer.cpp

@@ -103,7 +103,7 @@ int CLI::run(int argc, char **argv)
             false;
 #else
             // On Unix systems, the superslicer binary may be symlinked to give the application a different meaning.
-            boost::algorithm::iends_with(boost::filesystem::path(argv[0]).filename().string(), "gcodeviewer");
+            boost::algorithm::iends_with(boost::filesystem::path(argv[0]).filename().string(), GCODEVIEWER_APP_CMD);
 #endif // _WIN32
 
     const std::vector<std::string> &load_configs		= m_config.option<ConfigOptionStrings>("load", true)->values;

+ 3 - 2
src/libslic3r/Format/CWS.cpp

@@ -47,7 +47,8 @@ void fill_iniconf(ConfMap &m, const SLAPrint &print)
     m["printerProfile"] = get_cfg_value(cfg, "printer_settings_id");
     m["printProfile"]   = get_cfg_value(cfg, "sla_print_settings_id");
     m["fileCreationTimestamp"] = Utils::utc_timestamp();
-    m["prusaSlicerVersion"]    = SLIC3R_BUILD_ID;
+    m["slicerName"]     = SLIC3R_APP_NAME;
+    m["slicerVersion"]  = SLIC3R_VERSION_FULL;
     
     SLAPrintStatistics stats = print.print_statistics();
     // Set statistics values to the printer
@@ -116,7 +117,7 @@ void MaskedCWSArchive::export_print(Zipper& zipper,
         zipper.add_entry("default.slicing");
         zipper << to_ini(iniconf);
 
-        zipper.add_entry("prusaslicer.ini");
+        zipper.add_entry("slicer.ini");
         zipper << to_ini(slicerconf);
         
         size_t i = 0;

+ 1 - 1
src/libslic3r/libslic3r_version.h.in

@@ -15,7 +15,7 @@
 #define GCODEVIEWER_APP_KEY "@GCODEVIEWER_APP_KEY@"
 #define GCODEVIEWER_APP_CMD "@GCODEVIEWER_APP_CMD@"
 #define GCODEVIEWER_APP_WCMD L"@GCODEVIEWER_APP_CMD@"
-#define GCODEVIEWER_BUILD_ID GCODEVIEWER_APP_NAME "-" SLIC3R_VERSION "-UNKNOWN"
+#define GCODEVIEWER_BUILD_ID GCODEVIEWER_APP_NAME "-" SLIC3R_VERSION_FULL "-UNKNOWN"
 
 #define SLIC3R_BASED_ON "@SLIC3R_BASED_ON@"
 #define SLIC3R_GITHUB "@SLIC3R_GITHUB@"

+ 6 - 6
src/platform/msw/gcodeviewer.rc.in

@@ -7,13 +7,13 @@ PRODUCTVERSION @SLIC3R_RC_VERSION@
   BLOCK "040904E4"
   {
    VALUE "CompanyName", "Prusa Research"
-   VALUE "FileDescription", "@SLIC3R_APP_NAME@ G-code Viewer"
+   VALUE "FileDescription", "@GCODEVIEWER_APP_NAME@"
    VALUE "FileVersion", "@SLIC3R_BUILD_ID@"
-   VALUE "ProductName", "@SLIC3R_APP_NAME@ G-code Viewer"
+   VALUE "ProductName", "@GCODEVIEWER_APP_NAME@"
    VALUE "ProductVersion", "@SLIC3R_BUILD_ID@"
-   VALUE "InternalName", "@SLIC3R_APP_NAME@ G-code Viewer"
-   VALUE "LegalCopyright", "Copyright \251 2016-2020 Prusa Research, \251 2011-2018 Alessandro Ranellucci"
-   VALUE "OriginalFilename", "prusa-gcodeviewer.exe"
+   VALUE "InternalName", "@GCODEVIEWER_APP_NAME@"
+   VALUE "LegalCopyright", "Copyright \251 2018-2021 Joseph Lenox, \251 2019-2021 Durand Remi, \251 2016-2021 Prusa Research, \251 2011-2018 Alessandro Ranellucci"
+   VALUE "OriginalFilename", "@GCODEVIEWER_APP_CMD@.exe"
   }
  }
  BLOCK "VarFileInfo"
@@ -21,5 +21,5 @@ PRODUCTVERSION @SLIC3R_RC_VERSION@
    VALUE "Translation", 0x409, 1252
  }
 }
-2 ICON "@SLIC3R_RESOURCES_DIR@/icons/PrusaSlicer-gcodeviewer.ico"
+2 ICON "@SLIC3R_RESOURCES_DIR@/icons/@GCODEVIEWER_APP_KEY@.ico"
 1 24 "@SLIC3R_APP_KEY@.manifest" 

+ 1 - 1
src/platform/unix/Gcodeviewer.desktop.in

@@ -2,7 +2,7 @@
 Name=@GCODEVIEWER_APP_NAME@
 Comment=G-code viewer of Slic3r
 Exec=@SLIC3R_APP_CMD@ --gcodeviewer %F
-Icon=@SLIC3R_APP_KEY@-gcodeviewer
+Icon=@GCODEVIEWER_APP_KEY@
 Terminal=false
 Type=Application
 MimeType=text/x.gcode;

+ 2 - 2
src/slic3r/Config/Snapshot.cpp

@@ -358,7 +358,7 @@ static void copy_config_dir_single_level(const boost::filesystem::path &path_src
 {
     if (! boost::filesystem::is_directory(path_dst) && 
         ! boost::filesystem::create_directory(path_dst))
-        throw Slic3r::RuntimeError(std::string("Slic3r was unable to create a directory at ") + path_dst.string());
+        throw Slic3r::RuntimeError(std::string(SLIC3R_APP_NAME " was unable to create a directory at ") + path_dst.string());
 
     for (auto &dir_entry : boost::filesystem::directory_iterator(path_src))
         if (Slic3r::is_ini_file(dir_entry))
@@ -526,7 +526,7 @@ boost::filesystem::path SnapshotDB::create_db_dir()
         subdir.make_preferred();
         if (! boost::filesystem::is_directory(subdir) && 
             ! boost::filesystem::create_directory(subdir))
-            throw Slic3r::RuntimeError(std::string("Slic3r was unable to create a directory at ") + subdir.string());
+            throw Slic3r::RuntimeError(std::string(SLIC3R_APP_NAME " was unable to create a directory at ") + subdir.string());
     }
     return snapshots_dir;
 }

+ 10 - 4
src/slic3r/GUI/AboutDialog.cpp

@@ -16,7 +16,7 @@ AboutDialogLogo::AboutDialogLogo(wxWindow* parent)
     : wxPanel(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize)
 {
     this->SetBackgroundColour(*wxWHITE);
-    this->logo = wxBitmap(from_u8(Slic3r::var("Slic3r_192px.png")), wxBITMAP_TYPE_PNG);
+    this->logo = wxBitmap(from_u8(Slic3r::var(SLIC3R_APP_KEY"_192px.png")), wxBITMAP_TYPE_PNG);
     this->SetMinSize(this->logo.GetSize());
     
     this->Bind(wxEVT_PAINT, &AboutDialogLogo::onRepaint, this);
@@ -220,7 +220,7 @@ AboutDialog::AboutDialog()
 	main_sizer->Add(hsizer, 0, wxEXPAND | wxALL, 20);
 
     // logo
-    m_logo_bitmap = ScalableBitmap(this, wxGetApp().is_editor() ? "Slic3r_192px.png" : "PrusaSlicer-gcodeviewer_192px.png", 192);
+    m_logo_bitmap = ScalableBitmap(this, wxGetApp().is_editor() ? SLIC3R_APP_KEY "_192px.png" : GCODEVIEWER_APP_KEY "_192px.png", 192);
     m_logo = new wxStaticBitmap(this, wxID_ANY, m_logo_bitmap.bmp());
 	hsizer->Add(m_logo, 1, wxALIGN_CENTER_VERTICAL);
     
@@ -270,6 +270,8 @@ AboutDialog::AboutDialog()
         const std::string license_str = _utf8(L("GNU Affero General Public License, version 3"));
         const std::string based_on_str = _utf8(L(SLIC3R_INTRO));
         const std::string contributors_str = _utf8(L("Contributions by Henrik Brix Andersen, Nicolas Dandrimont, Mark Hindess, Petr Ledvina, Joseph Lenox, Y. Sapir, Mike Sheldrake, Vojtech Bubnik, Durand Rémi and numerous others."));
+        const std::string manual_str = _utf8(L("Manual by Gary Hodgson. Inspired by the RepRap community."));
+        const std::string icon_str = _utf8(L("Slic3r logo designed by Corey Daniels."));
         const auto text = from_u8(
             (boost::format(
             "<html>"
@@ -283,7 +285,9 @@ AboutDialog::AboutDialog()
             "<br /><br />"
             "%8%"
             "<br /><br />"
-            "%9%"
+            "%9%<br />"
+            "%10%<br />"
+            "%11%"
             "</font>"
             "</body>"
             "</html>") % bgr_clr_str % text_clr_str % text_clr_str
@@ -291,7 +295,9 @@ AboutDialog::AboutDialog()
             % is_lecensed_str
             % license_str
             % based_on_str
-            % contributors_str).str());
+            % contributors_str
+            % manual_str
+            % icon_str).str());
         m_html->SetPage(text);
         vsizer->Add(m_html, 1, wxEXPAND | wxBOTTOM, 10);
         m_html->Bind(wxEVT_HTML_LINK_CLICKED, &AboutDialog::onLinkClicked, this);

+ 1 - 1
src/slic3r/GUI/ConfigWizard.cpp

@@ -1480,7 +1480,7 @@ void PageTemperatures::apply_custom_config(DynamicPrintConfig &config)
 
 ConfigWizardIndex::ConfigWizardIndex(wxWindow *parent)
     : wxPanel(parent)
-    , bg(ScalableBitmap(parent, "Slic3r_192px_transparent.png", 192))
+    , bg(ScalableBitmap(parent, SLIC3R_APP_KEY "_192px_transparent.png", 192))
     , bullet_black(ScalableBitmap(parent, "bullet_black.png"))
     , bullet_blue(ScalableBitmap(parent, "bullet_blue.png"))
     , bullet_white(ScalableBitmap(parent, "bullet_white.png"))

+ 7 - 7
src/slic3r/GUI/GUI_App.cpp

@@ -604,8 +604,8 @@ static void generic_exception_handle()
         BOOST_LOG_TRIVIAL(error) << boost::format("std::bad_alloc exception: %1%") % ex.what();
         std::terminate();
     } catch (const boost::io::bad_format_string& ex) {
-        wxString errmsg = _L("PrusaSlicer has encountered a localization error. "
-                             "Please report to PrusaSlicer team, what language was active and in which scenario "
+        wxString errmsg = _L(SLIC3R_APP_NAME " has encountered a localization error. "
+                             "Please report to " SLIC3R_APP_NAME " team, what language was active and in which scenario "
                              "this issue happened. Thank you.\n\nThe application will now terminate.");
         wxMessageBox(errmsg + "\n\n" + wxString(ex.what()), _L("Critical error"), wxOK | wxICON_ERROR);
         BOOST_LOG_TRIVIAL(error) << boost::format("Uncaught exception: %1%") % ex.what();
@@ -739,13 +739,13 @@ void GUI_App::init_app_config()
             // Error while parsing config file. We'll customize the error message and rethrow to be displayed.
             if (is_editor()) {
                 throw Slic3r::RuntimeError(
-                    _u8L("Error parsing PrusaSlicer config file, it is probably corrupted. "
+                    _u8L("Error parsing " SLIC3R_APP_NAME " config file, it is probably corrupted. "
                         "Try to manually delete the file to recover from the error. Your user profiles will not be affected.") +
                     "\n\n" + app_config->config_path() + "\n\n" + error);
             }
             else {
                 throw Slic3r::RuntimeError(
-                    _u8L("Error parsing PrusaGCodeViewer config file, it is probably corrupted. "
+                    _u8L("Error parsing " GCODEVIEWER_APP_NAME " config file, it is probably corrupted. "
                         "Try to manually delete the file to recover from the error.") +
                     "\n\n" + app_config->config_path() + "\n\n" + error);
             }
@@ -800,7 +800,7 @@ bool GUI_App::on_init_inner()
             wxRichMessageDialog
                 dlg(nullptr,
                     wxString::Format(_L("%s\nDo you want to continue?"), msg),
-                    "PrusaSlicer", wxICON_QUESTION | wxYES_NO);
+                    SLIC3R_APP_NAME, wxICON_QUESTION | wxYES_NO);
             dlg.ShowCheckBox(_L("Remember my choice"));
             if (dlg.ShowModal() != wxID_YES) return false;
 
@@ -2438,8 +2438,8 @@ void GUI_App::associate_gcode_files()
     ::GetModuleFileNameW(nullptr, app_path, sizeof(app_path));
 
     std::wstring prog_path = L"\"" + std::wstring(app_path) + L"\"";
-    std::wstring prog_id = L"PrusaSlicer.GCodeViewer.1";
-    std::wstring prog_desc = L"PrusaSlicerGCodeViewer";
+    std::wstring prog_id = SLIC3R_APP_WKEY L".GCodeViewer.1";
+    std::wstring prog_desc = L"" GCODEVIEWER_APP_NAME;
     std::wstring prog_command = prog_path + L" \"%1\"";
     std::wstring reg_base = L"Software\\Classes";
     std::wstring reg_extension = reg_base + L"\\.gcode";

Some files were not shown because too many files changed in this diff