mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-21 12:15:21 +00:00
update flatpak app id and add migration code (#12879)
* update flatpak app id and add migration code * tweak some text
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>@SLIC3R_APP_KEY@</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>@SLIC3R_APP_NAME@ Copyright(C) 2021-2023 Lunkuo All Rights Reserved</string>
|
||||
<string>@SLIC3R_APP_NAME@ Copyright(C) 2026 OrcaSlicer Pte Ltd All Rights Reserved</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>images/OrcaSlicer.icns</string>
|
||||
<key>CFBundleName</key>
|
||||
@@ -13,7 +13,7 @@
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>@SLIC3R_APP_NAME@ @SLIC3R_BUILD_ID@</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.softfever3d.orca-slic3r/</string>
|
||||
<string>com.orcaslicer.OrcaSlicer</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
|
||||
@@ -271,10 +271,9 @@ AboutDialog::AboutDialog()
|
||||
text_sizer_horiz->Add( 0, 0, 0, wxLEFT, FromDIP(20));
|
||||
|
||||
std::vector<wxString> 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(
|
||||
"<html>"
|
||||
"<body>"
|
||||
"<p style=\"text-align:left\"><a style=\"color:#009789\" href=\"https://github.com/OrcaSlicer/OrcaSlicer\">https://github.com/OrcaSlicer/OrcaSlicer</ a></p>"
|
||||
"<p style=\"text-align:left\"><a style=\"color:#009789\" href=\"https://www.orcaslicer.com\">https://www.orcaslicer.com</ a></p>"
|
||||
"</body>"
|
||||
"</html>")
|
||||
).str());
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
" <arg name=\"data\" direction=\"out\" type=\"s\" />"
|
||||
" </method>"
|
||||
" </interface>"
|
||||
" <interface name=\"com.softfever3d.orca-slicer.InstanceCheck\">"
|
||||
" <interface name=\"com.orcaslicer.OrcaSlicer.InstanceCheck\">"
|
||||
" <method name=\"AnotherInstance\">"
|
||||
" <arg name=\"data\" direction=\"in\" type=\"s\" />"
|
||||
" </method>"
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user