mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-06-12 06:52:57 +00:00
Merge: Snapmaker Orca 2.1.2
This commit is contained in:
@@ -105,7 +105,7 @@ namespace instance_check_internal
|
||||
return true;
|
||||
std::wstring classNameString(className);
|
||||
std::wstring wndTextString(wndText);
|
||||
if (wndTextString.find(L"OrcaSlicer") != std::wstring::npos && classNameString == L"wxWindowNR") {
|
||||
if (wndTextString.find(L"Snapmaker_Orca") != std::wstring::npos && classNameString == L"wxWindowNR") {
|
||||
//check if other instances has same instance hash
|
||||
//if not it is not same version(binary) as this version
|
||||
HANDLE handle = GetProp(hwnd, L"Instance_Hash_Minor");
|
||||
@@ -237,10 +237,10 @@ namespace instance_check_internal
|
||||
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.snapmaker.snapmaker-orca.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/softfever3d/Snapmaker_Orca/InstanceCheck/Object" + version;
|
||||
|
||||
|
||||
// initialise the error value
|
||||
@@ -501,7 +501,7 @@ void OtherInstanceMessageHandler::handle_message(const std::string& message)
|
||||
|
||||
std::vector<boost::filesystem::path> paths;
|
||||
std::vector<std::string> downloads;
|
||||
boost::regex re(R"(^(orcaslicer|prusaslicer|cura|bambustudio):\/\/open[\/]?\?file=)", boost::regbase::icase);
|
||||
boost::regex re(R"(^(Snapmaker_Orca|prusaslicer|cura|bambustudio):\/\/open[\/]?\?file=)", boost::regbase::icase);
|
||||
boost::regex re2(R"(^(bambustudioopen):\/\/)", boost::regex::icase);
|
||||
boost::smatch results;
|
||||
|
||||
@@ -551,7 +551,7 @@ namespace MessageHandlerDBusInternal
|
||||
" <arg name=\"data\" direction=\"out\" type=\"s\" />"
|
||||
" </method>"
|
||||
" </interface>"
|
||||
" <interface name=\"com.softfever3d.orca-slicer.InstanceCheck\">"
|
||||
" <interface name=\"com.snapmaker.snapmaker-orca.InstanceCheck\">"
|
||||
" <method name=\"AnotherInstance\">"
|
||||
" <arg name=\"data\" direction=\"in\" type=\"s\" />"
|
||||
" </method>"
|
||||
@@ -563,7 +563,7 @@ namespace MessageHandlerDBusInternal
|
||||
dbus_connection_send(connection, reply, NULL);
|
||||
dbus_message_unref(reply);
|
||||
}
|
||||
//method AnotherInstance receives message from another OrcaSlicer instance
|
||||
//method AnotherInstance receives message from another Snapmaker_Orca instance
|
||||
static void handle_method_another_instance(DBusConnection *connection, DBusMessage *request)
|
||||
{
|
||||
DBusError err;
|
||||
@@ -589,7 +589,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.snapmaker.snapmaker-orca.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 +609,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.snapmaker.snapmaker-orca.InstanceCheck.Object" + instance_hash;
|
||||
std::string object_name = "/com/softfever3d/Snapmaker_Orca/InstanceCheck/Object" + instance_hash;
|
||||
|
||||
//BOOST_LOG_TRIVIAL(debug) << "init dbus listen " << interface_name << " " << object_name;
|
||||
dbus_error_init(&err);
|
||||
@@ -638,7 +638,7 @@ void OtherInstanceMessageHandler::listen()
|
||||
return;
|
||||
}
|
||||
if (DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER != name_req_val) {
|
||||
BOOST_LOG_TRIVIAL(error) << "Not primary owner of DBus name - probably another OrcaSlicer instance is running.";
|
||||
BOOST_LOG_TRIVIAL(error) << "Not primary owner of DBus name - probably another Snapmaker_Orca instance is running.";
|
||||
BOOST_LOG_TRIVIAL(error) << "Dbus Messages listening terminating.";
|
||||
dbus_connection_unref(conn);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user