504{
505 BOOST_LOG_TRIVIAL(info) << "message from other instance: " << message;
506
507 std::vector<std::string> args;
509 assert(parsed);
510 if (! parsed) {
511 BOOST_LOG_TRIVIAL(error) << "message from other instance is incorrectly formatted: " << message;
512 return;
513 }
514
515 std::vector<boost::filesystem::path> paths;
516 std::vector<std::string> downloads;
517 boost::regex re(R"(^(orcaslicer|prusaslicer|cura|bambustudio):\/\/open[\/]?\?file=)", boost::regbase::icase);
518 boost::regex re2(R"(^(bambustudioopen):\/\/)", boost::regex::icase);
519 boost::smatch results;
520
521
522 auto it = args.begin();
523 for (++ it; it != args.end(); ++ it) {
525 if (! p.string().empty())
526 paths.emplace_back(p);
527 else if (boost::regex_search(*it, results, re) || boost::regex_search(*it, results, re2))
528 downloads.emplace_back(*it);
529 }
530 if (! paths.empty()) {
531
532
534
535 }
536 if (!downloads.empty())
537 {
539 }
540}
wxEvtHandler * m_callback_evt_handler
Definition InstanceCheck.hpp:87
static boost::filesystem::path get_path(const std::string &possible_path)
Definition InstanceCheck.cpp:481
Event< std::vector< std::string > > StartDownloadOtherInstanceEvent
Definition InstanceCheck.hpp:51
Event< std::vector< boost::filesystem::path > > LoadFromOtherInstanceEvent
Definition InstanceCheck.hpp:50
bool unescape_strings_cstyle(const std::string &str, std::vector< std::string > &out)
Definition Config.cpp:173