From 73be083ac511532d8ff98ed5d1afbe1366a50a36 Mon Sep 17 00:00:00 2001 From: SoftFever Date: Sun, 22 Mar 2026 23:49:23 +0800 Subject: [PATCH] update flatpak app id and add migration code (#12879) * update flatpak app id and add migration code * tweak some text --- .github/workflows/build_all.yml | 6 +-- CMakeLists.txt | 2 +- README.md | 16 +++---- build_flatpak.sh | 20 ++++---- cmake/modules/MacOSXBundleInfo.plist.in | 2 +- scripts/build_flatpak_with_docker.sh | 14 ++++-- ...=> com.orcaslicer.OrcaSlicer.metainfo.xml} | 8 ++-- ...icer.yml => com.orcaslicer.OrcaSlicer.yml} | 10 ++-- scripts/flatpak/setup_env_ubuntu24.04.sh | 4 +- src/CMakeLists.txt | 6 +-- src/dev-utils/platform/osx/Info.plist.in | 4 +- src/slic3r/GUI/AboutDialog.cpp | 11 ++--- src/slic3r/GUI/GUI_App.cpp | 46 ++++++++++++++----- src/slic3r/GUI/InstanceCheck.cpp | 14 +++--- 14 files changed, 93 insertions(+), 70 deletions(-) rename scripts/flatpak/{io.github.orcaslicer.OrcaSlicer.metainfo.xml => com.orcaslicer.OrcaSlicer.metainfo.xml} (92%) rename scripts/flatpak/{io.github.orcaslicer.OrcaSlicer.yml => com.orcaslicer.OrcaSlicer.yml} (97%) diff --git a/.github/workflows/build_all.yml b/.github/workflows/build_all.yml index 66ee9af643..8812fbd174 100644 --- a/.github/workflows/build_all.yml +++ b/.github/workflows/build_all.yml @@ -203,17 +203,17 @@ jobs: - name: Disable debug info for faster CI builds run: | sed -i '/^build-options:/a\ no-debuginfo: true\n strip: true' \ - scripts/flatpak/io.github.orcaslicer.OrcaSlicer.yml + scripts/flatpak/com.orcaslicer.OrcaSlicer.yml shell: bash - name: Inject git commit hash into Flatpak manifest run: | sed -i "/name: OrcaSlicer/{n;s|buildsystem: simple|buildsystem: simple\n build-options:\n env:\n git_commit_hash: \"$git_commit_hash\"|}" \ - scripts/flatpak/io.github.orcaslicer.OrcaSlicer.yml + scripts/flatpak/com.orcaslicer.OrcaSlicer.yml shell: bash - uses: flatpak/flatpak-github-actions/flatpak-builder@master with: bundle: OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak - manifest-path: scripts/flatpak/io.github.orcaslicer.OrcaSlicer.yml + manifest-path: scripts/flatpak/com.orcaslicer.OrcaSlicer.yml cache: false arch: ${{ matrix.variant.arch }} upload-artifact: false diff --git a/CMakeLists.txt b/CMakeLists.txt index 008f9e9563..af78323a15 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -162,7 +162,7 @@ if (APPLE) if (CMAKE_MACOSX_BUNDLE) set(CMAKE_INSTALL_RPATH @executable_path/../Frameworks) endif() - SET(CMAKE_XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "com.softfever3d.orca-slicer") + SET(CMAKE_XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "com.orcaslicer.OrcaSlicer") message(STATUS "Orca: IS_CROSS_COMPILE: ${IS_CROSS_COMPILE}") endif () diff --git a/README.md b/README.md index 96a8b13d33..f082515377 100644 --- a/README.md +++ b/README.md @@ -194,20 +194,16 @@ Thank you! :) -## Some background +## Some Background -OrcaSlicer was originally forked from Bambu Studio, it was previously known as BambuStudio-SoftFever. +Open-source slicing has always been built on a tradition of collaboration and attribution. [Slic3r](https://github.com/Slic3r/Slic3r), created by Alessandro Ranellucci and the RepRap community, laid the foundation. [PrusaSlicer](https://github.com/prusa3d/PrusaSlicer) by Prusa Research built on Slic3r and acknowledged that heritage. [Bambu Studio](https://github.com/bambulab/BambuStudio) in turn forked from PrusaSlicer, and [SuperSlicer](https://github.com/supermerill/SuperSlicer) by @supermerill extended PrusaSlicer with community-driven enhancements. Each project carried the work of its predecessors forward, crediting those who came before. -[Bambu Studio](https://github.com/bambulab/BambuStudio) is forked from [PrusaSlicer](https://github.com/prusa3d/PrusaSlicer) by Prusa Research, which is from [Slic3r](https://github.com/Slic3r/Slic3r) by Alessandro Ranellucci and the RepRap community. -OrcaSlicer incorporates a lot of features from [SuperSlicer](https://github.com/supermerill/SuperSlicer) by @supermerill -OrcaSlicer's logo is designed by community member Justin Levine (@freejstnalxndr). +OrcaSlicer began in that same spirit, drawing from BambuStudio, PrusaSlicer, and ideas inspired by CuraSlicer and SuperSlicer. But it has since grown far beyond its origins. Through relentless innovation — introducing advanced calibration tools, precise wall and seam control, tree supports, adaptive slicing, and hundreds of other features — OrcaSlicer has become the most widely used and actively developed open-source slicer in the 3D printing community. Many of its innovations have been adopted by other slicers, making it a driving force for the entire industry. + +The OrcaSlicer logo was designed by community member Justin Levine (@freejstnalxndr). # License - -- **OrcaSlicer** is licensed under the GNU Affero General Public License, version 3. OrcaSlicer is based on Bambu Studio by BambuLab. -- **Bambu Studio** is licensed under the GNU Affero General Public License, version 3. Bambu Studio is based on PrusaSlicer by PrusaResearch. -- **PrusaSlicer** is licensed under the GNU Affero General Public License, version 3. PrusaSlicer is owned by Prusa Research. PrusaSlicer is originally based on Slic3r by Alessandro Ranellucci. -- **Slic3r** is licensed under the GNU Affero General Public License, version 3. Slic3r was created by Alessandro Ranellucci with the help of many other contributors. +- **OrcaSlicer** is licensed under the GNU Affero General Public License, version 3. - The **GNU Affero General Public License**, version 3 ensures that if you use any part of this software in any way (even behind a web server), your software must be released under the same license. - OrcaSlicer includes a **pressure advance calibration pattern test** adapted from Andrew Ellis' generator, which is licensed under GNU General Public License, version 3. Ellis' generator is itself adapted from a generator developed by Sineos for Marlin, which is licensed under GNU General Public License, version 3. - The **Bambu networking plugin** is based on non-free libraries from BambuLab. It is optional to the OrcaSlicer and provides extended functionalities for Bambulab printer users. diff --git a/build_flatpak.sh b/build_flatpak.sh index 94b79b1465..0dd07041be 100755 --- a/build_flatpak.sh +++ b/build_flatpak.sh @@ -255,8 +255,8 @@ mkdir -p "$BUILD_DIR" rm -rf "$BUILD_DIR/build-dir" # Check if flatpak manifest exists -if [[ ! -f "./scripts/flatpak/io.github.orcaslicer.OrcaSlicer.yml" ]]; then - echo -e "${RED}Error: Flatpak manifest not found at scripts/flatpak/io.github.orcaslicer.OrcaSlicer.yml${NC}" +if [[ ! -f "./scripts/flatpak/com.orcaslicer.OrcaSlicer.yml" ]]; then + echo -e "${RED}Error: Flatpak manifest not found at scripts/flatpak/com.orcaslicer.OrcaSlicer.yml${NC}" exit 1 fi @@ -316,11 +316,11 @@ if [[ "$DISABLE_ROFILES_FUSE" == true ]]; then fi # Use a temp manifest with no-debuginfo if requested -MANIFEST="scripts/flatpak/io.github.orcaslicer.OrcaSlicer.yml" +MANIFEST="scripts/flatpak/com.orcaslicer.OrcaSlicer.yml" if [[ "$NO_DEBUGINFO" == true ]]; then - MANIFEST="scripts/flatpak/io.github.orcaslicer.OrcaSlicer.no-debug.yml" + MANIFEST="scripts/flatpak/com.orcaslicer.OrcaSlicer.no-debug.yml" sed '/^build-options:/a\ no-debuginfo: true\n strip: true' \ - scripts/flatpak/io.github.orcaslicer.OrcaSlicer.yml > "$MANIFEST" + scripts/flatpak/com.orcaslicer.OrcaSlicer.yml > "$MANIFEST" echo -e "${YELLOW}Debug info disabled (using temp manifest)${NC}" fi @@ -330,19 +330,19 @@ if ! flatpak-builder \ "$MANIFEST"; then echo -e "${RED}Error: flatpak-builder failed${NC}" echo -e "${YELLOW}Check the build log above for details${NC}" - rm -f "scripts/flatpak/io.github.orcaslicer.OrcaSlicer.no-debug.yml" + rm -f "scripts/flatpak/com.orcaslicer.OrcaSlicer.no-debug.yml" exit 1 fi # Clean up temp manifest -rm -f "scripts/flatpak/io.github.orcaslicer.OrcaSlicer.no-debug.yml" +rm -f "scripts/flatpak/com.orcaslicer.OrcaSlicer.no-debug.yml" # Create bundle echo -e "${YELLOW}Creating Flatpak bundle...${NC}" if ! flatpak build-bundle \ "$BUILD_DIR/repo" \ "$BUNDLE_NAME" \ - io.github.orcaslicer.OrcaSlicer \ + com.orcaslicer.OrcaSlicer \ --arch="$ARCH"; then echo -e "${RED}Error: Failed to create Flatpak bundle${NC}" exit 1 @@ -361,10 +361,10 @@ echo -e "${BLUE}To install the Flatpak:${NC}" echo -e "flatpak install --user $BUNDLE_NAME" echo "" echo -e "${BLUE}To run OrcaSlicer:${NC}" -echo -e "flatpak run io.github.orcaslicer.OrcaSlicer" +echo -e "flatpak run com.orcaslicer.OrcaSlicer" echo "" echo -e "${BLUE}To uninstall:${NC}" -echo -e "flatpak uninstall --user io.github.orcaslicer.OrcaSlicer" +echo -e "flatpak uninstall --user com.orcaslicer.OrcaSlicer" echo "" if [[ "$FORCE_CLEAN" != true ]]; then echo -e "${BLUE}Cache Management:${NC}" diff --git a/cmake/modules/MacOSXBundleInfo.plist.in b/cmake/modules/MacOSXBundleInfo.plist.in index 15979c4822..937f29694b 100644 --- a/cmake/modules/MacOSXBundleInfo.plist.in +++ b/cmake/modules/MacOSXBundleInfo.plist.in @@ -11,7 +11,7 @@ CFBundleIconFile ${MACOSX_BUNDLE_ICON_FILE} CFBundleIdentifier - com.softfever3d.orca-slicer + com.orcaslicer.OrcaSlicer CFBundleInfoDictionaryVersion 6.0 CFBundleLongVersionString diff --git a/scripts/build_flatpak_with_docker.sh b/scripts/build_flatpak_with_docker.sh index d3eeaab6df..898ec2c56a 100755 --- a/scripts/build_flatpak_with_docker.sh +++ b/scripts/build_flatpak_with_docker.sh @@ -98,8 +98,8 @@ echo " ccache: enabled" echo "" # ---------- prepare manifest ---------- -MANIFEST_SRC="scripts/flatpak/io.github.orcaslicer.OrcaSlicer.yml" -MANIFEST_DOCKER="scripts/flatpak/io.github.orcaslicer.OrcaSlicer.docker.yml" +MANIFEST_SRC="scripts/flatpak/com.orcaslicer.OrcaSlicer.yml" +MANIFEST_DOCKER="scripts/flatpak/com.orcaslicer.OrcaSlicer.docker.yml" # Ensure cleanup on exit (success or failure) trap 'rm -f "$PROJECT_ROOT/$MANIFEST_DOCKER"' EXIT @@ -167,6 +167,12 @@ format_duration() { overall_start=$(date +%s) install_start=$overall_start +# The workspace and .flatpak-builder cache are bind-mounted from the host. +# Git inside the container may reject cached source repos as unsafe due to +# ownership mismatch, which breaks flatpak-builder when it reuses git sources. +git config --global --add safe.directory /src +git config --global --add safe.directory '/src/.flatpak-builder/git/*' + # Install required SDK extensions (not pre-installed in the container image) flatpak install -y --noninteractive --arch="$BUILD_ARCH" flathub \ org.gnome.Platform//49 \ @@ -185,7 +191,7 @@ flatpak-builder $FORCE_CLEAN_FLAG \ --arch="$BUILD_ARCH" \ --repo=flatpak-repo \ flatpak-build \ - scripts/flatpak/io.github.orcaslicer.OrcaSlicer.docker.yml + scripts/flatpak/com.orcaslicer.OrcaSlicer.docker.yml builder_end=$(date +%s) builder_duration=$((builder_end - builder_start)) @@ -194,7 +200,7 @@ flatpak build-bundle \ --arch="$BUILD_ARCH" \ flatpak-repo \ "$BUNDLE_NAME" \ - io.github.orcaslicer.OrcaSlicer + com.orcaslicer.OrcaSlicer bundle_end=$(date +%s) bundle_duration=$((bundle_end - bundle_start)) diff --git a/scripts/flatpak/io.github.orcaslicer.OrcaSlicer.metainfo.xml b/scripts/flatpak/com.orcaslicer.OrcaSlicer.metainfo.xml similarity index 92% rename from scripts/flatpak/io.github.orcaslicer.OrcaSlicer.metainfo.xml rename to scripts/flatpak/com.orcaslicer.OrcaSlicer.metainfo.xml index 04335b6761..79bbabc42d 100644 --- a/scripts/flatpak/io.github.orcaslicer.OrcaSlicer.metainfo.xml +++ b/scripts/flatpak/com.orcaslicer.OrcaSlicer.metainfo.xml @@ -1,13 +1,13 @@ - io.github.orcaslicer.OrcaSlicer - io.github.orcaslicer.OrcaSlicer.desktop + com.orcaslicer.OrcaSlicer + com.orcaslicer.OrcaSlicer.desktop - io.github.orcaslicer.OrcaSlicer.desktop + com.orcaslicer.OrcaSlicer.desktop OrcaSlicer Get even more perfect prints! - + SoftFever https://www.orcaslicer.com diff --git a/scripts/flatpak/io.github.orcaslicer.OrcaSlicer.yml b/scripts/flatpak/com.orcaslicer.OrcaSlicer.yml similarity index 97% rename from scripts/flatpak/io.github.orcaslicer.OrcaSlicer.yml rename to scripts/flatpak/com.orcaslicer.OrcaSlicer.yml index 814636e142..ba856cae2c 100644 --- a/scripts/flatpak/io.github.orcaslicer.OrcaSlicer.yml +++ b/scripts/flatpak/com.orcaslicer.OrcaSlicer.yml @@ -1,4 +1,4 @@ -app-id: io.github.orcaslicer.OrcaSlicer +app-id: com.orcaslicer.OrcaSlicer runtime: org.gnome.Platform runtime-version: "49" sdk: org.gnome.Sdk @@ -24,9 +24,11 @@ finish-args: - --filesystem=/run/media - --filesystem=/media - --filesystem=/run/spnav.sock:ro + # Allow read-only access to OrcaSlicer's legacy config and cache directories (if they exist) for migration purposes. + - --filesystem=~/.var/app/io.github.orcaslicer.OrcaSlicer:ro # Allow OrcaSlicer to own and talk to instance-check D-Bus names (InstanceCheck.cpp) - - --talk-name=com.softfever3d.orca-slicer.InstanceCheck.* - - --own-name=com.softfever3d.orca-slicer.InstanceCheck.* + - --talk-name=com.orcaslicer.OrcaSlicer.InstanceCheck.* + - --own-name=com.orcaslicer.OrcaSlicer.InstanceCheck.* - --system-talk-name=org.freedesktop.UDisks2 - --env=SPNAV_SOCKET=/run/spnav.sock @@ -367,7 +369,7 @@ modules: # AppData metainfo for GNOME Software & Co. - type: file - path: io.github.orcaslicer.OrcaSlicer.metainfo.xml + path: com.orcaslicer.OrcaSlicer.metainfo.xml # Startup script - type: file diff --git a/scripts/flatpak/setup_env_ubuntu24.04.sh b/scripts/flatpak/setup_env_ubuntu24.04.sh index 5c5fedf6b3..68bf325497 100755 --- a/scripts/flatpak/setup_env_ubuntu24.04.sh +++ b/scripts/flatpak/setup_env_ubuntu24.04.sh @@ -9,7 +9,7 @@ flatpak install flathub org.gnome.Platform//48 org.gnome.Sdk//48 ## # in OrcaSlicer folder, run following command to build Orca # # First time build -# flatpak-builder --state-dir=.flatpak-builder --keep-build-dirs --user --force-clean build-dir scripts/flatpak/io.github.orcaslicer.OrcaSlicer.yml +# flatpak-builder --state-dir=.flatpak-builder --keep-build-dirs --user --force-clean build-dir scripts/flatpak/com.orcaslicer.OrcaSlicer.yml # # Subsequent builds (only rebuilding OrcaSlicer) -# flatpak-builder --state-dir=.flatpak-builder --keep-build-dirs --user build-dir scripts/flatpak/io.github.orcaslicer.OrcaSlicer.yml --build-only=OrcaSlicer \ No newline at end of file +# flatpak-builder --state-dir=.flatpak-builder --keep-build-dirs --user build-dir scripts/flatpak/com.orcaslicer.OrcaSlicer.yml --build-only=OrcaSlicer \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3c7c75f8e4..268d60d2df 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -91,9 +91,9 @@ if(ORCA_TOOLS) MACOSX_BUNDLE_BUNDLE_NAME "OrcaSlicer Profile Validator" MACOSX_BUNDLE_BUNDLE_VERSION "${SLIC3R_VERSION}" MACOSX_BUNDLE_SHORT_VERSION_STRING "${SLIC3R_VERSION}" - MACOSX_BUNDLE_IDENTIFIER "com.softfever.orcaslicer.profile-validator" - MACOSX_BUNDLE_COPYRIGHT "© 2024 SoftFever" - MACOSX_BUNDLE_GUI_IDENTIFIER "com.softfever.orcaslicer.profile-validator" + MACOSX_BUNDLE_IDENTIFIER "com.orcaslicer.OrcaSlicer.profile-validator" + MACOSX_BUNDLE_COPYRIGHT "© 2026 OrcaSlicer Pte Ltd All Rights Reserved" + MACOSX_BUNDLE_GUI_IDENTIFIER "com.orcaslicer.OrcaSlicer.profile-validator" ) else() add_executable(OrcaSlicer_profile_validator dev-utils/OrcaSlicer_profile_validator.cpp) diff --git a/src/dev-utils/platform/osx/Info.plist.in b/src/dev-utils/platform/osx/Info.plist.in index a2621d2521..93c9ea2db9 100644 --- a/src/dev-utils/platform/osx/Info.plist.in +++ b/src/dev-utils/platform/osx/Info.plist.in @@ -5,7 +5,7 @@ CFBundleExecutable @SLIC3R_APP_KEY@ CFBundleGetInfoString - @SLIC3R_APP_NAME@ Copyright(C) 2021-2023 Lunkuo All Rights Reserved + @SLIC3R_APP_NAME@ Copyright(C) 2026 OrcaSlicer Pte Ltd All Rights Reserved CFBundleIconFile images/OrcaSlicer.icns CFBundleName @@ -13,7 +13,7 @@ CFBundleShortVersionString @SLIC3R_APP_NAME@ @SLIC3R_BUILD_ID@ CFBundleIdentifier - com.softfever3d.orca-slic3r/ + com.orcaslicer.OrcaSlicer CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType diff --git a/src/slic3r/GUI/AboutDialog.cpp b/src/slic3r/GUI/AboutDialog.cpp index 17a6f958ca..f4482ee6bd 100644 --- a/src/slic3r/GUI/AboutDialog.cpp +++ b/src/slic3r/GUI/AboutDialog.cpp @@ -271,10 +271,9 @@ AboutDialog::AboutDialog() text_sizer_horiz->Add( 0, 0, 0, wxLEFT, FromDIP(20)); std::vector text_list; - text_list.push_back(_L("OrcaSlicer is based on BambuStudio, PrusaSlicer, and SuperSlicer.")); - text_list.push_back(_L("BambuStudio is originally based on PrusaSlicer by PrusaResearch.")); - text_list.push_back(_L("PrusaSlicer is originally based on Slic3r by Alessandro Ranellucci.")); - text_list.push_back(_L("Slic3r was created by Alessandro Ranellucci with the help of many other contributors.")); + text_list.push_back(_L("Open-source slicing stands on a tradition of collaboration and attribution. Slic3r, created by Alessandro Ranellucci and the RepRap community, laid the foundation. PrusaSlicer by Prusa Research built on that work, Bambu Studio forked from PrusaSlicer, and SuperSlicer extended it with community-driven enhancements. Each project carried the work of its predecessors forward, crediting those who came before.")); + text_list.push_back(_L("OrcaSlicer began in that same spirit, drawing from PrusaSlicer, BambuStudio, SuperSlicer, and CuraSlicer. But it has since grown far beyond its origins — introducing advanced calibration tools, precise wall and seam control and hundreds of other features.")); + text_list.push_back(_L("Today, OrcaSlicer is the most widely used and actively developed open-source slicer in the 3D printing community. Many of its innovations have been adopted by other slicers, making it a driving force for the entire industry.")); text_sizer->Add( 0, 0, 0, wxTOP, FromDIP(33)); bool is_zh = wxGetApp().app_config->get("language") == "zh_CN"; @@ -316,7 +315,7 @@ AboutDialog::AboutDialog() copyright_hor_sizer->Add(copyright_ver_sizer, 0, wxLEFT, FromDIP(20)); - wxStaticText *html_text = new wxStaticText(this, wxID_ANY, "Copyright(C) 2022-2025 Li Jiang All Rights Reserved", wxDefaultPosition, wxDefaultSize); + wxStaticText *html_text = new wxStaticText(this, wxID_ANY, "Copyright(C) 2026 OrcaSlicer Pte Ltd All Rights Reserved", wxDefaultPosition, wxDefaultSize); html_text->SetForegroundColour(wxColour(107, 107, 107)); copyright_ver_sizer->Add(html_text, 0, wxALL , 0); @@ -333,7 +332,7 @@ AboutDialog::AboutDialog() (boost::format( "" "" - "

https://github.com/OrcaSlicer/OrcaSlicer

" + "

https://www.orcaslicer.com

" "" "") ).str()); diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 04334c73c5..fe7cfbd255 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -372,16 +372,6 @@ public: // Dynamic Text m_action_line_y_position = int(height * 0.83); - - // Based on Text - memDc.SetFont(m_constant_text.based_on_font); - auto bs_version = wxString::Format(_L("Based on PrusaSlicer and BambuStudio")).ToStdString(); - wxSize based_on_ext = memDc.GetTextExtent(bs_version); - wxRect based_on_rect( - wxPoint(0, height - based_on_ext.GetHeight() * 2), - wxPoint(width, height - based_on_ext.GetHeight()) - ); - memDc.DrawLabel(bs_version, based_on_rect, wxALIGN_CENTER); } static wxBitmap MakeBitmap() @@ -484,6 +474,37 @@ private: }; #ifdef __linux__ +static void migrate_flatpak_legacy_datadir(const boost::filesystem::path &data_dir_path) +{ + if(!boost::filesystem::exists("/.flatpak-info")) + return; // Not running as a Flatpak, nothing to migrate. + + namespace fs = boost::filesystem; + + if (fs::exists(data_dir_path)){ + std::cerr << "New Flatpak data dir: " << data_dir_path << std::endl; + return; + } + std::cerr << "Migrating Flatpak data dir: " << data_dir_path << std::endl; + + std::string legacy_data_dir_str = data_dir_path.string(); + boost::replace_first(legacy_data_dir_str, "com.orcaslicer.OrcaSlicer", "io.github.orcaslicer.OrcaSlicer"); + const fs::path legacy_data_dir(legacy_data_dir_str); + + std::cerr << "Legacy Flatpak data dir: " << legacy_data_dir << std::endl; + + if ( ! fs::exists(legacy_data_dir) || ! fs::is_directory(legacy_data_dir)) + return; + std::cerr << "Legacy Flatpak data dir exists: " << legacy_data_dir << std::endl; + + try { + std::cerr << "Migrating Flatpak data dir from " << legacy_data_dir << " to " << data_dir_path << std::endl; + copy_directory_recursively(legacy_data_dir, data_dir_path); + } catch (const std::exception &ex) { + std::cerr << "Failed to migrate Flatpak data dir from " << legacy_data_dir << " to " << data_dir_path << ": " << ex.what() << std::endl; + } +} + bool static check_old_linux_datadir(const wxString& app_name) { // If we are on Linux and the datadir does not exist yet, look into the old // location where the datadir was before version 2.3. If we find it there, @@ -2401,8 +2422,9 @@ void GUI_App::init_app_config() wxString dir; if (! wxGetEnv(wxS("XDG_CONFIG_HOME"), &dir) || dir.empty() ) dir = wxFileName::GetHomeDir() + wxS("/.config"); - set_data_dir((dir + "/" + GetAppName()).ToUTF8().data()); - data_dir_path = boost::filesystem::path(data_dir()); + data_dir_path = boost::filesystem::path((dir + "/" + GetAppName()).ToUTF8().data()); + migrate_flatpak_legacy_datadir(data_dir_path); + set_data_dir(data_dir_path.string()); #endif if (!boost::filesystem::exists(data_dir_path)){ boost::filesystem::create_directory(data_dir_path); diff --git a/src/slic3r/GUI/InstanceCheck.cpp b/src/slic3r/GUI/InstanceCheck.cpp index 09d4da31c5..fcdd1a9c88 100644 --- a/src/slic3r/GUI/InstanceCheck.cpp +++ b/src/slic3r/GUI/InstanceCheck.cpp @@ -236,11 +236,9 @@ namespace instance_check_internal DBusError err; dbus_uint32_t serial = 0; const char* sigval = message_text.c_str(); - //std::string interface_name = "com.prusa3d.prusaslicer.InstanceCheck"; - std::string interface_name = "com.softfever3d.orca-slicer.InstanceCheck.Object" + version; + std::string interface_name = "com.orcaslicer.OrcaSlicer.InstanceCheck.Object" + version; std::string method_name = "AnotherInstance"; - //std::string object_name = "/com/prusa3d/prusaslicer/InstanceCheck"; - std::string object_name = "/com/softfever3d/OrcaSlicer/InstanceCheck/Object" + version; + std::string object_name = "/com/orcaslicer/OrcaSlicer/InstanceCheck/Object" + version; // initialise the error value @@ -551,7 +549,7 @@ namespace MessageHandlerDBusInternal " " " " " " - " " + " " " " " " " " @@ -589,7 +587,7 @@ namespace MessageHandlerDBusInternal { const char* interface_name = dbus_message_get_interface(message); const char* member_name = dbus_message_get_member(message); - std::string our_interface = "com.softfever3d.orca-slicer.InstanceCheck.Object" + wxGetApp().get_instance_hash_string(); + std::string our_interface = "com.orcaslicer.OrcaSlicer.InstanceCheck.Object" + wxGetApp().get_instance_hash_string(); BOOST_LOG_TRIVIAL(trace) << "DBus message received: interface: " << interface_name << ", member: " << member_name; if (0 == strcmp("org.freedesktop.DBus.Introspectable", interface_name) && 0 == strcmp("Introspect", member_name)) { respond_to_introspect(connection, message); @@ -609,8 +607,8 @@ void OtherInstanceMessageHandler::listen() int name_req_val; DBusObjectPathVTable vtable; std::string instance_hash = wxGetApp().get_instance_hash_string(); - std::string interface_name = "com.softfever3d.orca-slicer.InstanceCheck.Object" + instance_hash; - std::string object_name = "/com/softfever3d/OrcaSlicer/InstanceCheck/Object" + instance_hash; + std::string interface_name = "com.orcaslicer.OrcaSlicer.InstanceCheck.Object" + instance_hash; + std::string object_name = "/com/orcaslicer/OrcaSlicer/InstanceCheck/Object" + instance_hash; //BOOST_LOG_TRIVIAL(debug) << "init dbus listen " << interface_name << " " << object_name; dbus_error_init(&err);