mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 16:57:53 -06:00
Merge remote-tracking branch 'origin/master' into new_main_page_ui
This commit is contained in:
commit
6abfee65ce
25 changed files with 1955 additions and 1029 deletions
|
@ -205,7 +205,7 @@ static void init_label_colours()
|
|||
{
|
||||
auto luma = get_colour_approx_luma(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
|
||||
if (luma >= 128) {
|
||||
g_color_label_modified = wxColour(253, 88, 0);
|
||||
g_color_label_modified = wxColour(252, 77, 1);
|
||||
g_color_label_sys = wxColour(26, 132, 57);
|
||||
} else {
|
||||
g_color_label_modified = wxColour(253, 111, 40);
|
||||
|
@ -311,22 +311,18 @@ bool select_language(wxArrayString & names,
|
|||
|
||||
bool load_language()
|
||||
{
|
||||
long language;
|
||||
if (!g_AppConfig->has("translation_language"))
|
||||
language = wxLANGUAGE_UNKNOWN;
|
||||
else {
|
||||
auto str_language = g_AppConfig->get("translation_language");
|
||||
language = str_language != "" ? stol(str_language) : wxLANGUAGE_UNKNOWN;
|
||||
}
|
||||
wxString language = wxEmptyString;
|
||||
if (g_AppConfig->has("translation_language"))
|
||||
language = g_AppConfig->get("translation_language");
|
||||
|
||||
if (language == wxLANGUAGE_UNKNOWN)
|
||||
if (language.IsEmpty())
|
||||
return false;
|
||||
wxArrayString names;
|
||||
wxArrayLong identifiers;
|
||||
get_installed_languages(names, identifiers);
|
||||
for (size_t i = 0; i < identifiers.Count(); i++)
|
||||
{
|
||||
if (identifiers[i] == language)
|
||||
if (wxLocale::GetLanguageCanonicalName(identifiers[i]) == language)
|
||||
{
|
||||
g_wxLocale = new wxLocale;
|
||||
g_wxLocale->Init(identifiers[i]);
|
||||
|
@ -341,12 +337,11 @@ bool load_language()
|
|||
|
||||
void save_language()
|
||||
{
|
||||
long language = wxLANGUAGE_UNKNOWN;
|
||||
if (g_wxLocale) {
|
||||
language = g_wxLocale->GetLanguage();
|
||||
}
|
||||
std::string str_language = std::to_string(language);
|
||||
g_AppConfig->set("translation_language", str_language);
|
||||
wxString language = wxEmptyString;
|
||||
if (g_wxLocale)
|
||||
language = g_wxLocale->GetCanonicalName();
|
||||
|
||||
g_AppConfig->set("translation_language", language.ToStdString());
|
||||
g_AppConfig->save();
|
||||
}
|
||||
|
||||
|
@ -400,12 +395,12 @@ void add_config_menu(wxMenuBar *menu, int event_preferences_changed, int event_l
|
|||
|
||||
const auto config_wizard_tooltip = wxString::Format(_(L("Run %s")), ConfigWizard::name());
|
||||
// Cmd+, is standard on OS X - what about other operating systems?
|
||||
local_menu->Append(config_id_base + ConfigMenuWizard, ConfigWizard::name() + "\u2026", config_wizard_tooltip);
|
||||
local_menu->Append(config_id_base + ConfigMenuSnapshots, _(L("Configuration Snapshots\u2026")), _(L("Inspect / activate configuration snapshots")));
|
||||
local_menu->Append(config_id_base + ConfigMenuTakeSnapshot, _(L("Take Configuration Snapshot")), _(L("Capture a configuration snapshot")));
|
||||
local_menu->Append(config_id_base + ConfigMenuUpdate, _(L("Check for updates")), _(L("Check for configuration updates")));
|
||||
local_menu->Append(config_id_base + ConfigMenuWizard, ConfigWizard::name() + "\u2026", config_wizard_tooltip);
|
||||
local_menu->Append(config_id_base + ConfigMenuSnapshots, _(L("Configuration Snapshots"))+"\u2026", _(L("Inspect / activate configuration snapshots")));
|
||||
local_menu->Append(config_id_base + ConfigMenuTakeSnapshot, _(L("Take Configuration Snapshot")), _(L("Capture a configuration snapshot")));
|
||||
local_menu->Append(config_id_base + ConfigMenuUpdate, _(L("Check for updates")), _(L("Check for configuration updates")));
|
||||
local_menu->AppendSeparator();
|
||||
local_menu->Append(config_id_base + ConfigMenuPreferences, _(L("Preferences\u2026\tCtrl+,")), _(L("Application preferences")));
|
||||
local_menu->Append(config_id_base + ConfigMenuPreferences, _(L("Preferences"))+"\u2026\tCtrl+,", _(L("Application preferences")));
|
||||
local_menu->AppendSeparator();
|
||||
local_menu->Append(config_id_base + ConfigMenuLanguage, _(L("Change Application Language")));
|
||||
local_menu->Bind(wxEVT_MENU, [config_id_base, event_language_change, event_preferences_changed](wxEvent &event){
|
||||
|
@ -687,7 +682,7 @@ void show_info(wxWindow* parent, const wxString& message, const wxString& title)
|
|||
}
|
||||
|
||||
void warning_catcher(wxWindow* parent, const wxString& message){
|
||||
if (message == _(L("GLUquadricObjPtr | Attempt to free unreferenced scalar")) )
|
||||
if (message == "GLUquadricObjPtr | " + _(L("Attempt to free unreferenced scalar")) )
|
||||
return;
|
||||
wxMessageDialog msg(parent, message, _(L("Warning")), wxOK | wxICON_WARNING);
|
||||
msg.ShowModal();
|
||||
|
@ -923,7 +918,7 @@ void add_frequently_changed_parameters(wxWindow* parent, wxBoxSizer* sizer, wxFl
|
|||
m_optgroup->append_single_option_line(option);
|
||||
|
||||
|
||||
Line line = { _(L("")), "" };
|
||||
Line line = { "", "" };
|
||||
line.widget = [config](wxWindow* parent){
|
||||
g_wiping_dialog_button = new wxButton(parent, wxID_ANY, _(L("Purging volumes")) + "\u2026", wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT);
|
||||
auto sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue