mirror of
https://github.com/QIDITECH/QIDISlicer.git
synced 2026-01-31 16:08:43 +03:00
update to latest version
This commit is contained in:
@@ -54,6 +54,7 @@
|
||||
#include "libslic3r/Model.hpp"
|
||||
#include "libslic3r/PresetBundle.hpp"
|
||||
#include "libslic3r/Color.hpp"
|
||||
#include "libslic3r/Format/SLAArchiveFormatRegistry.hpp"
|
||||
|
||||
#include "GUI.hpp"
|
||||
#include "GUI_Utils.hpp"
|
||||
@@ -493,15 +494,13 @@ static const FileWildcards file_wildcards_by_type[FT_SIZE] = {
|
||||
|
||||
/* FT_TEX */ { "Texture"sv, { ".png"sv, ".svg"sv } },
|
||||
|
||||
/* FT_SL1 */ { "Masked SLA files"sv, { ".sl1"sv, ".sl1s"sv, ".pwmx"sv } },
|
||||
/* FT_SL1 (deprecated, overriden by sla_wildcards) */ { "Masked SLA files"sv, { ".sl1"sv, ".sl1s"sv, ".pwmx"sv } },
|
||||
|
||||
/* FT_ZIP */ { "Zip files"sv, { ".zip"sv } },
|
||||
};
|
||||
|
||||
#if ENABLE_ALTERNATIVE_FILE_WILDCARDS_GENERATOR
|
||||
wxString file_wildcards(FileType file_type)
|
||||
static wxString file_wildcards(const FileWildcards& data)
|
||||
{
|
||||
const FileWildcards& data = file_wildcards_by_type[file_type];
|
||||
std::string title;
|
||||
std::string mask;
|
||||
|
||||
@@ -535,6 +534,14 @@ wxString file_wildcards(FileType file_type)
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if ENABLE_ALTERNATIVE_FILE_WILDCARDS_GENERATOR
|
||||
wxString file_wildcards(FileType file_type)
|
||||
{
|
||||
const FileWildcards& data = file_wildcards_by_type[file_type];
|
||||
|
||||
return file_wildcards(data);
|
||||
}
|
||||
#else
|
||||
// This function produces a Win32 file dialog file template mask to be consumed by wxWidgets on all platforms.
|
||||
// The function accepts a custom extension parameter. If the parameter is provided, the custom extension
|
||||
@@ -593,6 +600,35 @@ wxString file_wildcards(FileType file_type, const std::string &custom_extension)
|
||||
}
|
||||
#endif // ENABLE_ALTERNATIVE_FILE_WILDCARDS_GENERATOR
|
||||
|
||||
wxString sla_wildcards(const char *formatid)
|
||||
{
|
||||
const ArchiveEntry *entry = get_archive_entry(formatid);
|
||||
wxString ret;
|
||||
|
||||
if (entry) {
|
||||
FileWildcards wc;
|
||||
std::string tr_title = I18N::translate_utf8(entry->desc);
|
||||
// TRN %s = type of file
|
||||
tr_title = GUI::format(_u8L("%s files"), tr_title);
|
||||
wc.title = tr_title;
|
||||
|
||||
std::vector<std::string> exts = get_extensions(*entry);
|
||||
|
||||
wc.file_extensions.reserve(exts.size());
|
||||
for (std::string &ext : exts) {
|
||||
ext.insert(ext.begin(), '.');
|
||||
wc.file_extensions.emplace_back(ext);
|
||||
}
|
||||
|
||||
ret = file_wildcards(wc);
|
||||
}
|
||||
|
||||
if (ret.empty())
|
||||
ret = file_wildcards(FT_SL1);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static std::string libslic3r_translate_callback(const char *s) { return wxGetTranslation(wxString(s, wxConvUTF8)).utf8_str().data(); }
|
||||
|
||||
#ifdef WIN32
|
||||
@@ -928,7 +964,7 @@ void GUI_App::init_app_config()
|
||||
{
|
||||
// Profiles for the alpha are stored into the QIDISlicer-alpha directory to not mix with the current release.
|
||||
|
||||
SetAppName(SLIC3R_APP_KEY);
|
||||
SetAppName(SLIC3R_APP_KEY);
|
||||
// SetAppName(SLIC3R_APP_KEY "-alpha");
|
||||
//B7
|
||||
// SetAppName(SLIC3R_APP_KEY "-beta");
|
||||
@@ -1460,8 +1496,7 @@ bool GUI_App::dark_mode()
|
||||
|
||||
const wxColour GUI_App::get_label_default_clr_system()
|
||||
{
|
||||
//B10
|
||||
return dark_mode() ? wxColour(115, 220, 103) : wxColour(26, 132, 57);
|
||||
return dark_mode() ? wxColour(115, 220, 103) : wxColour(26, 132, 57);
|
||||
}
|
||||
|
||||
const wxColour GUI_App::get_label_default_clr_modified()
|
||||
@@ -2290,14 +2325,7 @@ bool GUI_App::load_language(wxString language, bool initial)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
// ysFIXME after fix for wxWidgets issue (https://github.com/wxWidgets/wxWidgets/issues/23209)
|
||||
// Workaround for wxLANGUAGE_CHINESE(...) languages => Allow to continue even if wxLocale is not available.
|
||||
// Because of translation will works fine, just locales will set to EN
|
||||
if (! wxLocale::IsAvailable(language_info->Language) && language_info->CanonicalName.BeforeFirst('_') != "zh" ) {
|
||||
#else
|
||||
if (! wxLocale::IsAvailable(language_info->Language)) {
|
||||
#endif
|
||||
// Loading the language dictionary failed.
|
||||
wxString message = "Switching QIDISlicer to language " + language_info->CanonicalName + " failed.";
|
||||
#if !defined(_WIN32) && !defined(__APPLE__)
|
||||
@@ -2404,7 +2432,6 @@ void GUI_App::add_config_menu(wxMenuBar *menu)
|
||||
local_menu->Append(config_id_base + ConfigMenuWizard, config_wizard_name + dots, config_wizard_tooltip);
|
||||
local_menu->Append(config_id_base + ConfigMenuSnapshots, _L("&Configuration Snapshots") + dots, _L("Inspect / activate configuration snapshots"));
|
||||
local_menu->Append(config_id_base + ConfigMenuTakeSnapshot, _L("Take Configuration &Snapshot"), _L("Capture a configuration snapshot"));
|
||||
//B5
|
||||
local_menu->Append(config_id_base + ConfigMenuUpdateConf, _L("Check for Configuration Updates"), _L("Check for configuration updates"));
|
||||
local_menu->Append(config_id_base + ConfigMenuUpdateApp, _L("Check for Application Updates"), _L("Check for new version of application"));
|
||||
#if defined(__linux__) && defined(SLIC3R_DESKTOP_INTEGRATION)
|
||||
@@ -3275,9 +3302,7 @@ bool GUI_App::config_wizard_startup()
|
||||
if (!m_app_conf_exists || preset_bundle->printers.only_default_printers()) {
|
||||
run_wizard(ConfigWizard::RR_DATA_EMPTY);
|
||||
return true;
|
||||
}
|
||||
//B7
|
||||
else if (get_app_config()->legacy_datadir()) {
|
||||
} else if (get_app_config()->legacy_datadir()) {
|
||||
// Looks like user has legacy pre-vendorbundle data directory,
|
||||
// explain what this is and run the wizard
|
||||
|
||||
|
||||
Reference in New Issue
Block a user