mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-15 01:16:01 +08:00
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)
This commit is contained in:
parent
ded2736c31
commit
8504793a7e
@ -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 ()
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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@"
|
||||
|
@ -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"
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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"))
|
||||
|
@ -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";
|
||||
|
@ -186,10 +186,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.prusa3d.prusaslicer.InstanceCheck.Object" + version;
|
||||
std::string interface_name = "org.slic3r." SLIC3R_APP_CMD ".InstanceCheck.Object" + version;
|
||||
std::string method_name = "AnotherInstance";
|
||||
//std::string object_name = "/com/prusa3d/prusaslicer/InstanceCheck";
|
||||
std::string object_name = "/com/prusa3d/prusaslicer/InstanceCheck/Object" + version;
|
||||
std::string object_name = "/org/slic3r/" SLIC3R_APP_CMD "/InstanceCheck/Object" + version;
|
||||
|
||||
|
||||
// initialise the error value
|
||||
@ -490,7 +490,8 @@ namespace MessageHandlerDBusInternal
|
||||
" <arg name=\"data\" direction=\"out\" type=\"s\" />"
|
||||
" </method>"
|
||||
" </interface>"
|
||||
" <interface name=\"com.prusa3d.prusaslicer.InstanceCheck\">"
|
||||
// " <interface name=\"com.prusa3d.prusaslicer.InstanceCheck\">"
|
||||
" <interface name=\"org.slic3r." SLIC3R_APP_CMD ".InstanceCheck\">"
|
||||
" <method name=\"AnotherInstance\">"
|
||||
" <arg name=\"data\" direction=\"in\" type=\"s\" />"
|
||||
" </method>"
|
||||
@ -528,7 +529,8 @@ 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.prusa3d.prusaslicer.InstanceCheck.Object" + wxGetApp().get_instance_hash_string();
|
||||
// std::string our_interface = "com.prusa3d.prusaslicer.InstanceCheck.Object" + wxGetApp().get_instance_hash_string();
|
||||
std::string our_interface = "org.slic3r." SLIC3R_APP_CMD ".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);
|
||||
@ -548,8 +550,9 @@ void OtherInstanceMessageHandler::listen()
|
||||
int name_req_val;
|
||||
DBusObjectPathVTable vtable;
|
||||
std::string instance_hash = wxGetApp().get_instance_hash_string();
|
||||
std::string interface_name = "com.prusa3d.prusaslicer.InstanceCheck.Object" + instance_hash;
|
||||
std::string object_name = "/com/prusa3d/prusaslicer/InstanceCheck/Object" + instance_hash;
|
||||
// std::string interface_name = "com.prusa3d.prusaslicer.InstanceCheck.Object" + instance_hash;
|
||||
std::string interface_name = "org.slic3r." SLIC3R_APP_CMD ".InstanceCheck.Object" + instance_hash;
|
||||
std::string object_name = "/org/slic3r/" SLIC3R_APP_CMD "/InstanceCheck/Object" + instance_hash;
|
||||
|
||||
//BOOST_LOG_TRIVIAL(debug) << "init dbus listen " << interface_name << " " << object_name;
|
||||
dbus_error_init(&err);
|
||||
@ -577,7 +580,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 PrusaSlicer instance is running.";
|
||||
BOOST_LOG_TRIVIAL(error) << "Not primary owner of DBus name - probably another " SLIC3R_APP_KEY " instance is running.";
|
||||
BOOST_LOG_TRIVIAL(error) << "Dbus Messages listening terminating.";
|
||||
dbus_connection_unref(conn);
|
||||
return;
|
||||
|
@ -13,7 +13,7 @@
|
||||
{
|
||||
//NSLog(@"adding observer");
|
||||
//NSString *nsver = @"OtherPrusaSlicerInstanceMessage" + version_hash;
|
||||
NSString *nsver = [NSString stringWithFormat: @"%@%@", @"OtherPrusaSlicerInstanceMessage", version_hash];
|
||||
NSString *nsver = [NSString stringWithFormat: @"%@%@", @"Other" SLIC3R_APP_KEY "InstanceMessage", version_hash];
|
||||
[[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(message_update:) name:nsver object:nil suspensionBehavior:NSNotificationSuspensionBehaviorDeliverImmediately];
|
||||
}
|
||||
|
||||
@ -47,7 +47,7 @@ void send_message_mac(const std::string &msg, const std::string &version)
|
||||
NSString *nsmsg = [NSString stringWithCString:msg.c_str() encoding:[NSString defaultCStringEncoding]];
|
||||
//NSString *nsver = @"OtherPrusaSlicerInstanceMessage" + [NSString stringWithCString:version.c_str() encoding:[NSString defaultCStringEncoding]];
|
||||
NSString *nsver = [NSString stringWithCString:version.c_str() encoding:[NSString defaultCStringEncoding]];
|
||||
NSString *notifname = [NSString stringWithFormat: @"%@%@", @"OtherPrusaSlicerInstanceMessage", nsver];
|
||||
NSString *notifname = [NSString stringWithFormat: @"%@%@", @"Other" SLIC3R_APP_KEY "InstanceMessage", nsver];
|
||||
[[NSDistributedNotificationCenter defaultCenter] postNotificationName:notifname object:nil userInfo:[NSDictionary dictionaryWithObject:nsmsg forKey:@"data"] deliverImmediately:YES];
|
||||
}
|
||||
|
||||
|
@ -268,7 +268,7 @@ wxPanel* KBShortcutsDialog::create_header(wxWindow* parent, const wxFont& bold_f
|
||||
sizer->AddStretchSpacer();
|
||||
|
||||
// logo
|
||||
m_logo_bmp = ScalableBitmap(this, wxGetApp().is_editor() ? "Slic3r_32px.png" : "PrusaSlicer-gcodeviewer_32px.png", 32);
|
||||
m_logo_bmp = ScalableBitmap(this, wxGetApp().is_editor() ? SLIC3R_APP_KEY "_32px.png" : GCODEVIEWER_APP_KEY "_32px.png", 32);
|
||||
m_header_bitmap = new wxStaticBitmap(panel, wxID_ANY, m_logo_bmp.bmp());
|
||||
sizer->Add(m_header_bitmap, 0, wxEXPAND | wxLEFT | wxRIGHT, 10);
|
||||
|
||||
|
@ -106,7 +106,7 @@ static wxIcon main_frame_icon(GUI_App::EAppMode app_mode)
|
||||
}
|
||||
return wxIcon(path, wxBITMAP_TYPE_ICO);
|
||||
#else // _WIN32
|
||||
return wxIcon(Slic3r::var(app_mode == GUI_App::EAppMode::Editor ? "Slic3r_128px.png" : "PrusaSlicer-gcodeviewer_128px.png"), wxBITMAP_TYPE_PNG);
|
||||
return wxIcon(Slic3r::var(app_mode == GUI_App::EAppMode::Editor ? SLIC3R_APP_KEY "_128px.png" : GCODEVIEWER_APP_KEY "_128px.png"), wxBITMAP_TYPE_PNG);
|
||||
#endif // _WIN32
|
||||
}
|
||||
|
||||
@ -131,11 +131,11 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_S
|
||||
default:
|
||||
case GUI_App::EAppMode::Editor:
|
||||
m_taskbar_icon = std::make_unique<PrusaSlicerTaskBarIcon>(wxTBI_DOCK);
|
||||
m_taskbar_icon->SetIcon(wxIcon(Slic3r::var("Slic3r_128px.png"), wxBITMAP_TYPE_PNG), SLIC3R_APP_KEY);
|
||||
m_taskbar_icon->SetIcon(wxIcon(Slic3r::var(SLIC3R_APP_KEY "_128px.png"), wxBITMAP_TYPE_PNG), SLIC3R_APP_KEY);
|
||||
break;
|
||||
case GUI_App::EAppMode::GCodeViewer:
|
||||
m_taskbar_icon = std::make_unique<GCodeViewerTaskBarIcon>(wxTBI_DOCK);
|
||||
m_taskbar_icon->SetIcon(wxIcon(Slic3r::var("PrusaSlicer-gcodeviewer_128px.png"), wxBITMAP_TYPE_PNG), GCODEVIEWER_APP_NAME);
|
||||
m_taskbar_icon->SetIcon(wxIcon(Slic3r::var(GCODEVIEWER_APP_KEY "_128px.png"), wxBITMAP_TYPE_PNG), GCODEVIEWER_APP_NAME);
|
||||
break;
|
||||
}
|
||||
#endif // __APPLE__
|
||||
@ -1399,7 +1399,7 @@ void MainFrame::init_menubar_as_editor()
|
||||
[this](wxCommandEvent&) { m_printhost_queue_dlg->Show(); }, "upload_queue", nullptr, []() {return true; }, this);
|
||||
|
||||
windowMenu->AppendSeparator();
|
||||
append_menu_item(windowMenu, wxID_ANY, _L("Open new instance") + "\tCtrl+Shift+I", _L("Open a new PrusaSlicer instance"),
|
||||
append_menu_item(windowMenu, wxID_ANY, _L("Open new instance") + "\tCtrl+Shift+I", _L("Open a new " SLIC3R_APP_NAME " instance"),
|
||||
[this](wxCommandEvent&) { start_new_slicer(); }, "", nullptr, [this]() {return m_plater != nullptr && wxGetApp().app_config->get("single_instance") != "1"; }, this);
|
||||
}
|
||||
|
||||
@ -2149,7 +2149,7 @@ SettingsDialog::SettingsDialog(MainFrame* mainframe)
|
||||
SetIcon(wxIcon(szExeFileName, wxBITMAP_TYPE_ICO));
|
||||
}
|
||||
#else
|
||||
SetIcon(wxIcon(var("Slic3r_128px.png"), wxBITMAP_TYPE_PNG));
|
||||
SetIcon(wxIcon(var(SLIC3R_APP_KEY "_128px.png"), wxBITMAP_TYPE_PNG));
|
||||
#endif // _WIN32
|
||||
|
||||
this->Bind(wxEVT_SHOW, [this](wxShowEvent& evt) {
|
||||
|
@ -204,7 +204,7 @@ void Mouse3DController::init()
|
||||
//If no packets are recieved the name might be different - check cmake. If debugging try commenting
|
||||
// set_target_properties(PrusaSlicer PROPERTIES OUTPUT_NAME "prusa-slicer")
|
||||
clientID = RegisterConnexionClient(
|
||||
0, "\013PrusaSlicer", kConnexionClientModeTakeOver, kConnexionMaskAxis);
|
||||
0, "\013" SLIC3R_APP_CMD, kConnexionClientModeTakeOver, kConnexionMaskAxis);
|
||||
BOOST_LOG_TRIVIAL(info) << "3dx mac handler registered";
|
||||
}
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ MsgDialog::MsgDialog(wxWindow *parent, const wxString &title, const wxString &he
|
||||
rightsizer->Add(btn_sizer, 0, wxALIGN_RIGHT);
|
||||
|
||||
if (! bitmap.IsOk()) {
|
||||
bitmap = create_scaled_bitmap("Slic3r_192px.png", this, 192);
|
||||
bitmap = create_scaled_bitmap(SLIC3R_APP_KEY "_192px.png", this, 192);
|
||||
}
|
||||
|
||||
logo = new wxStaticBitmap(this, wxID_ANY, wxNullBitmap);
|
||||
@ -101,7 +101,7 @@ ErrorDialog::ErrorDialog(wxWindow *parent, const wxString &msg, bool monospaced_
|
||||
btn_sizer->Add(btn_ok, 0, wxRIGHT, HORIZ_SPACING);
|
||||
|
||||
// Use a small bitmap with monospaced font, as the error text will not be wrapped.
|
||||
logo->SetBitmap(create_scaled_bitmap("Slic3r_192px.png", this, monospaced_font ? 48 : 192));
|
||||
logo->SetBitmap(create_scaled_bitmap(SLIC3R_APP_KEY "_192px.png", this, monospaced_font ? 48 : 192));
|
||||
|
||||
SetMaxSize(wxSize(-1, CONTENT_MAX_HEIGHT*wxGetApp().em_unit()));
|
||||
Fit();
|
||||
|
@ -778,7 +778,7 @@ bool OG_CustomCtrl::CtrlLine::launch_browser() const
|
||||
bool launch = true;
|
||||
|
||||
if (get_app_config()->get("suppress_hyperlinks").empty()) {
|
||||
RememberChoiceDialog dialog(nullptr, _L("Should we open this hyperlink in your default browser?"), _L("PrusaSlicer: Open hyperlink"));
|
||||
RememberChoiceDialog dialog(nullptr, _L("Should we open this hyperlink in your default browser?"), _L(SLIC3R_APP_NAME ": Open hyperlink"));
|
||||
int answer = dialog.ShowModal();
|
||||
launch = answer == wxID_YES;
|
||||
|
||||
@ -807,11 +807,11 @@ RememberChoiceDialog::RememberChoiceDialog(wxWindow* parent, const wxString& msg
|
||||
return;
|
||||
wxString preferences_item = _L("Suppress to open hyperlink in browser");
|
||||
wxString msg =
|
||||
_L("PrusaSlicer will remember your choice.") + "\n\n" +
|
||||
_L(SLIC3R_APP_NAME " will remember your choice.") + "\n\n" +
|
||||
_L("You will not be asked about it again on label hovering.") + "\n\n" +
|
||||
format_wxstr(_L("Visit \"Preferences\" and check \"%1%\"\nto changes your choice."), preferences_item);
|
||||
|
||||
wxMessageDialog dialog(nullptr, msg, _L("PrusaSlicer: Don't ask me again"), wxOK | wxCANCEL | wxICON_INFORMATION);
|
||||
wxMessageDialog dialog(nullptr, msg, _L(SLIC3R_APP_NAME ": Don't ask me again"), wxOK | wxCANCEL | wxICON_INFORMATION);
|
||||
if (dialog.ShowModal() == wxID_CANCEL)
|
||||
m_remember_choice->SetValue(false);
|
||||
});
|
||||
|
@ -256,15 +256,15 @@ bool OpenGLManager::init_gl()
|
||||
if (!valid_version) {
|
||||
// Complain about the OpenGL version.
|
||||
wxString message = from_u8((boost::format(
|
||||
_utf8(L("PrusaSlicer requires OpenGL 2.0 capable graphics driver to run correctly, \n"
|
||||
_utf8(L(SLIC3R_APP_NAME " requires OpenGL 2.0 capable graphics driver to run correctly, \n"
|
||||
"while OpenGL version %s, render %s, vendor %s was detected."))) % s_gl_info.get_version() % s_gl_info.get_renderer() % s_gl_info.get_vendor()).str());
|
||||
message += "\n";
|
||||
message += _L("You may need to update your graphics card driver.");
|
||||
#ifdef _WIN32
|
||||
message += "\n";
|
||||
message += _L("As a workaround, you may run PrusaSlicer with a software rendered 3D graphics by running prusa-slicer.exe with the --sw_renderer parameter.");
|
||||
message += _L("As a workaround, you may run " SLIC3R_APP_NAME " with a software rendered 3D graphics by running prusa-slicer.exe with the --sw_renderer parameter.");
|
||||
#endif
|
||||
wxMessageBox(message, wxString("PrusaSlicer - ") + _L("Unsupported OpenGL version"), wxOK | wxICON_ERROR);
|
||||
wxMessageBox(message, wxString(SLIC3R_APP_NAME " - ") + _L("Unsupported OpenGL version"), wxOK | wxICON_ERROR);
|
||||
}
|
||||
|
||||
if (valid_version) {
|
||||
@ -273,7 +273,7 @@ bool OpenGLManager::init_gl()
|
||||
if (!result) {
|
||||
wxString message = from_u8((boost::format(
|
||||
_utf8(L("Unable to load the following shaders:\n%s"))) % error).str());
|
||||
wxMessageBox(message, wxString("PrusaSlicer - ") + _L("Error loading shaders"), wxOK | wxICON_ERROR);
|
||||
wxMessageBox(message, wxString(SLIC3R_APP_NAME " - ") + _L("Error loading shaders"), wxOK | wxICON_ERROR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4789,7 +4789,7 @@ void Plater::priv::bring_instance_forward() const
|
||||
BOOST_LOG_TRIVIAL(debug) << "Couldnt bring instance forward - mainframe is null";
|
||||
return;
|
||||
}
|
||||
BOOST_LOG_TRIVIAL(debug) << "prusaslicer window going forward";
|
||||
BOOST_LOG_TRIVIAL(debug) << SLIC3R_APP_CMD " window going forward";
|
||||
//this code maximize app window on Fedora
|
||||
{
|
||||
main_frame->Iconize(false);
|
||||
|
@ -92,7 +92,7 @@ SysInfoDialog::SysInfoDialog()
|
||||
main_sizer->Add(hsizer, 1, wxEXPAND | wxALL, 10);
|
||||
|
||||
// logo
|
||||
m_logo_bmp = ScalableBitmap(this, wxGetApp().is_editor() ? "Slic3r_192px.png" : "PrusaSlicer-gcodeviewer_192px.png", 192);
|
||||
m_logo_bmp = 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_bmp.bmp());
|
||||
hsizer->Add(m_logo, 0, wxALIGN_CENTER_VERTICAL);
|
||||
|
||||
|
@ -534,7 +534,7 @@ void UnsavedChangesModel::Rescale()
|
||||
//------------------------------------------
|
||||
|
||||
UnsavedChangesDialog::UnsavedChangesDialog(const wxString& header)
|
||||
: DPIDialog(static_cast<wxWindow*>(wxGetApp().mainframe), wxID_ANY, _L("PrusaSlicer is closing: Unsaved Changes"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
|
||||
: DPIDialog(static_cast<wxWindow*>(wxGetApp().mainframe), wxID_ANY, _L(SLIC3R_APP_NAME " is closing: Unsaved Changes"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
|
||||
{
|
||||
m_app_config_key = "default_action_on_close_application";
|
||||
|
||||
@ -671,13 +671,13 @@ void UnsavedChangesDialog::build(Preset::Type type, PresetCollection* dependent_
|
||||
wxString preferences_item = type == Preset::TYPE_INVALID ? _L("Ask for unsaved changes when closing application") :
|
||||
_L("Ask for unsaved changes when selecting new preset");
|
||||
wxString msg =
|
||||
_L("PrusaSlicer will remember your action.") + "\n\n" +
|
||||
_L(SLIC3R_APP_NAME " will remember your action.") + "\n\n" +
|
||||
(type == Preset::TYPE_INVALID ?
|
||||
_L("You will not be asked about the unsaved changes the next time you close PrusaSlicer.") :
|
||||
_L("You will not be asked about the unsaved changes the next time you close " SLIC3R_APP_NAME ".") :
|
||||
_L("You will not be asked about the unsaved changes the next time you switch a preset.")) + "\n\n" +
|
||||
format_wxstr(_L("Visit \"Preferences\" and check \"%1%\"\nto be asked about unsaved changes again."), preferences_item);
|
||||
|
||||
wxMessageDialog dialog(nullptr, msg, _L("PrusaSlicer: Don't ask me again"), wxOK | wxCANCEL | wxICON_INFORMATION);
|
||||
wxMessageDialog dialog(nullptr, msg, _L(SLIC3R_APP_NAME ": Don't ask me again"), wxOK | wxCANCEL | wxICON_INFORMATION);
|
||||
if (dialog.ShowModal() == wxID_CANCEL)
|
||||
m_remember_choice->SetValue(false);
|
||||
});
|
||||
|
@ -154,7 +154,7 @@ MsgUpdateForced::MsgUpdateForced(const std::vector<Update>& updates) :
|
||||
"Updated configuration bundles:"
|
||||
)), SLIC3R_APP_NAME));
|
||||
|
||||
logo->SetBitmap(create_scaled_bitmap("Slic3r_192px.png", this, 192));
|
||||
logo->SetBitmap(create_scaled_bitmap(SLIC3R_APP_KEY "_192px.png", this, 192));
|
||||
|
||||
text->Wrap(CONTENT_WIDTH * wxGetApp().em_unit());
|
||||
content_sizer->Add(text);
|
||||
@ -210,7 +210,7 @@ MsgDataIncompatible::MsgDataIncompatible(const std::unordered_map<std::string, w
|
||||
MsgDialog(nullptr, wxString::Format(_(L("%s incompatibility")), SLIC3R_APP_NAME),
|
||||
wxString::Format(_(L("%s configuration is incompatible")), SLIC3R_APP_NAME), wxID_NONE)
|
||||
{
|
||||
logo->SetBitmap(create_scaled_bitmap("Slic3r_192px.png", this, 192));
|
||||
logo->SetBitmap(create_scaled_bitmap(SLIC3R_APP_KEY "_192px.png", this, 192));
|
||||
|
||||
auto *text = new wxStaticText(this, wxID_ANY, wxString::Format(_(L(
|
||||
"This version of %s is not compatible with currently installed configuration bundles.\n"
|
||||
@ -313,7 +313,7 @@ MsgNoUpdates::MsgNoUpdates() :
|
||||
content_sizer->Add(text);
|
||||
content_sizer->AddSpacer(VERT_SPACING);
|
||||
|
||||
logo->SetBitmap(create_scaled_bitmap("Slic3r_192px.png", this, 192));
|
||||
logo->SetBitmap(create_scaled_bitmap(SLIC3R_APP_KEY "_192px.png", this, 192));
|
||||
|
||||
Fit();
|
||||
}
|
||||
|
@ -384,7 +384,7 @@ void wxDataViewTreeCtrlComboPopup::OnDataViewTreeCtrlSelection(wxCommandEvent& e
|
||||
// Temporary workaround for localization
|
||||
void edit_tooltip(wxString& tooltip)
|
||||
{
|
||||
tooltip.Replace("Slic3r", SLIC3R_APP_KEY, true);
|
||||
tooltip.Replace("Slic3r", SLIC3R_APP_NAME, true);
|
||||
}
|
||||
|
||||
/* Function for rescale of buttons in Dialog under MSW if dpi is changed.
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
# name of the slicer
|
||||
set(SLIC3R_APP_NAME "Slic3r")
|
||||
# Key fo the slicer, must only contains ascii chars and no spaces
|
||||
# Key fo the slicer, must only contains ascii chars and no spaces (be valid in all filesystems)
|
||||
set(SLIC3R_APP_KEY "Slic3r")
|
||||
# exe name of the slicer, should be lowercase and valid in all os
|
||||
set(SLIC3R_APP_CMD "Slic3r")
|
||||
@ -15,9 +15,9 @@ set(SLIC3R_RC_VERSION "2,4,00,0")
|
||||
set(SLIC3R_RC_VERSION_DOTS "${SLIC3R_VERSION_FULL}")
|
||||
|
||||
# Same as the slicer name but for gcodeviewer
|
||||
set(GCODEVIEWER_APP_NAME "G-code Viewer")
|
||||
set(GCODEVIEWER_APP_KEY "GCodeViewer")
|
||||
set(GCODEVIEWER_APP_CMD "gcodeviewer")
|
||||
set(GCODEVIEWER_APP_NAME "${SLIC3R_APP_NAME} G-code Viewer")
|
||||
set(GCODEVIEWER_APP_KEY "${SLIC3R_APP_KEY}-gcodeviewer")
|
||||
set(GCODEVIEWER_APP_CMD "${SLIC3R_APP_CMD}-gcodeviewer")
|
||||
|
||||
# string to be added after the SLIC3R_APP_NAME on some places
|
||||
set(SLIC3R_BASED_ON "")
|
||||
|
Loading…
x
Reference in New Issue
Block a user