Preparations to the localization update & new Slic3rPE.pot

This commit is contained in:
YuSanka 2018-05-02 13:20:36 +02:00
parent 4758b68e55
commit 16d5faac20
16 changed files with 1864 additions and 985 deletions

View file

@ -549,8 +549,8 @@ sub _on_select_preset {
return if ($selected_item == $self->{"selected_item_$group"}); return if ($selected_item == $self->{"selected_item_$group"});
my $selected_string = $choice->GetString($selected_item); my $selected_string = $choice->GetString($selected_item);
if ($selected_string eq "------- System presets -------" || if ($selected_string eq ("------- ".L("System presets")." -------") ||
$selected_string eq "------- User presets -------"){ $selected_string eq ("------- ".L("User presets")." -------") ){
$choice->SetSelection($self->{"selected_item_$group"}); $choice->SetSelection($self->{"selected_item_$group"});
return; return;
} }

File diff suppressed because it is too large Load diff

View file

@ -1,15 +1,23 @@
xs/src/slic3r/GUI/AboutDialog.cpp
xs/src/slic3r/GUI/BedShapeDialog.cpp xs/src/slic3r/GUI/BedShapeDialog.cpp
xs/src/slic3r/GUI/BedShapeDialog.hpp xs/src/slic3r/GUI/BedShapeDialog.hpp
xs/src/slic3r/GUI/BonjourDialog.cpp
xs/src/slic3r/GUI/ButtonsDescription.cpp
xs/src/slic3r/GUI/ConfigSnapshotDialog.cpp
xs/src/slic3r/GUI/ConfigWizard.cpp
xs/src/slic3r/GUI/GUI.cpp xs/src/slic3r/GUI/GUI.cpp
xs/src/slic3r/GUI/MsgDialog.cpp
xs/src/slic3r/GUI/Tab.cpp xs/src/slic3r/GUI/Tab.cpp
xs/src/slic3r/GUI/Tab.hpp xs/src/slic3r/GUI/Tab.hpp
xs/src/slic3r/GUI/Field.cpp xs/src/slic3r/GUI/Field.cpp
xs/src/slic3r/GUI/OptionsGroup.cpp xs/src/slic3r/GUI/OptionsGroup.cpp
xs/src/slic3r/GUI/2DBed.cpp xs/src/slic3r/GUI/Preset.cpp
xs/src/slic3r/GUI/PresetBundle.cpp
xs/src/slic3r/GUI/PresetHints.cpp xs/src/slic3r/GUI/PresetHints.cpp
xs/src/slic3r/GUI/Preferences.hpp
xs/src/slic3r/GUI/Preferences.cpp xs/src/slic3r/GUI/Preferences.cpp
xs/src/slic3r/GUI/BonjourDialog.cpp xs/src/slic3r/GUI/RammingChart.cpp
xs/src/slic3r/GUI/UpdateDialogs.cpp
xs/src/slic3r/GUI/WipeTowerDialog.cpp
xs/src/slic3r/Utils/OctoPrint.cpp xs/src/slic3r/Utils/OctoPrint.cpp
xs/src/libslic3r/PrintConfig.cpp xs/src/libslic3r/PrintConfig.cpp
xs/src/libslic3r/GCode/PreviewData.cpp xs/src/libslic3r/GCode/PreviewData.cpp

View file

@ -57,7 +57,7 @@ AboutDialog::AboutDialog()
// version // version
{ {
auto version_string = _(L("Version ")) + std::string(SLIC3R_VERSION); auto version_string = _(L("Version"))+ " " + std::string(SLIC3R_VERSION);
wxStaticText* version = new wxStaticText(this, wxID_ANY, version_string.c_str(), wxDefaultPosition, wxDefaultSize); wxStaticText* version = new wxStaticText(this, wxID_ANY, version_string.c_str(), wxDefaultPosition, wxDefaultSize);
wxFont version_font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); wxFont version_font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
#ifdef __WXMSW__ #ifdef __WXMSW__

View file

@ -191,7 +191,7 @@ void BonjourDialog::on_timer(wxTimerEvent &)
label->SetLabel(wxString::Format("%s %s", search_str, dots)); label->SetLabel(wxString::Format("%s %s", search_str, dots));
timer_state = (timer_state) % 3 + 1; timer_state = (timer_state) % 3 + 1;
} else { } else {
label->SetLabel(wxString::Format("%s: %s", search_str, _(L("Finished.")))); label->SetLabel(wxString::Format("%s: %s", search_str, _(L("Finished"))+"."));
timer->Stop(); timer->Stop();
} }
} }

View file

@ -10,7 +10,7 @@ namespace Slic3r {
namespace GUI { namespace GUI {
ButtonsDescription::ButtonsDescription(wxWindow* parent, t_icon_descriptions* icon_descriptions) : ButtonsDescription::ButtonsDescription(wxWindow* parent, t_icon_descriptions* icon_descriptions) :
wxDialog(parent, wxID_ANY, "Buttons And Text Colors Description", wxDefaultPosition, wxDefaultSize), wxDialog(parent, wxID_ANY, _(L("Buttons And Text Colors Description")), wxDefaultPosition, wxDefaultSize),
m_icon_descriptions(icon_descriptions) m_icon_descriptions(icon_descriptions)
{ {
auto grid_sizer = new wxFlexGridSizer(3, 20, 20); auto grid_sizer = new wxFlexGridSizer(3, 20, 20);

View file

@ -8,32 +8,32 @@
namespace Slic3r { namespace Slic3r {
namespace GUI { namespace GUI {
static std::string format_reason(const Config::Snapshot::Reason reason) static wxString format_reason(const Config::Snapshot::Reason reason)
{ {
switch (reason) { switch (reason) {
case Config::Snapshot::SNAPSHOT_UPGRADE: case Config::Snapshot::SNAPSHOT_UPGRADE:
return std::string(_(L("Upgrade"))); return wxString(_(L("Upgrade")));
case Config::Snapshot::SNAPSHOT_DOWNGRADE: case Config::Snapshot::SNAPSHOT_DOWNGRADE:
return std::string(_(L("Downgrade"))); return wxString(_(L("Downgrade")));
case Config::Snapshot::SNAPSHOT_BEFORE_ROLLBACK: case Config::Snapshot::SNAPSHOT_BEFORE_ROLLBACK:
return std::string(_(L("Before roll back"))); return wxString(_(L("Before roll back")));
case Config::Snapshot::SNAPSHOT_USER: case Config::Snapshot::SNAPSHOT_USER:
return std::string(_(L("User"))); return wxString(_(L("User")));
case Config::Snapshot::SNAPSHOT_UNKNOWN: case Config::Snapshot::SNAPSHOT_UNKNOWN:
default: default:
return std::string(_(L("Unknown"))); return wxString(_(L("Unknown")));
} }
} }
static std::string generate_html_row(const Config::Snapshot &snapshot, bool row_even, bool snapshot_active) static wxString generate_html_row(const Config::Snapshot &snapshot, bool row_even, bool snapshot_active)
{ {
// Start by declaring a row with an alternating background color. // Start by declaring a row with an alternating background color.
std::string text = "<tr bgcolor=\""; wxString text = "<tr bgcolor=\"";
text += snapshot_active ? "#B3FFCB" : (row_even ? "#FFFFFF" : "#D5D5D5"); text += snapshot_active ? "#B3FFCB" : (row_even ? "#FFFFFF" : "#D5D5D5");
text += "\">"; text += "\">";
text += "<td>"; text += "<td>";
// Format the row header. // Format the row header.
text += std::string("<font size=\"5\"><b>") + (snapshot_active ? _(L("Active: ")) : "") + text += wxString("<font size=\"5\"><b>") + (snapshot_active ? _(L("Active: ")) : "") +
Utils::format_local_date_time(snapshot.time_captured) + ": " + format_reason(snapshot.reason); Utils::format_local_date_time(snapshot.time_captured) + ": " + format_reason(snapshot.reason);
if (! snapshot.comment.empty()) if (! snapshot.comment.empty())
text += " (" + snapshot.comment + ")"; text += " (" + snapshot.comment + ")";
@ -46,9 +46,10 @@ static std::string generate_html_row(const Config::Snapshot &snapshot, bool row_
bool compatible = true; bool compatible = true;
for (const Config::Snapshot::VendorConfig &vc : snapshot.vendor_configs) { for (const Config::Snapshot::VendorConfig &vc : snapshot.vendor_configs) {
text += _(L("vendor")) + ": " + vc.name + ", ver: " + vc.version.config_version.to_string() + ", min slic3r ver: " + vc.version.min_slic3r_version.to_string(); text += _(L("vendor")) + ": " + vc.name +", " + _(L("version")) + ": " + vc.version.config_version.to_string() +
", " + _(L("min slic3r version")) + ": " + vc.version.min_slic3r_version.to_string();
if (vc.version.max_slic3r_version != Semver::inf()) if (vc.version.max_slic3r_version != Semver::inf())
text += ", max slic3r ver: " + vc.version.max_slic3r_version.to_string(); text += ", " + _(L("max slic3r version")) + ": " + vc.version.max_slic3r_version.to_string();
text += "<br>"; text += "<br>";
for (const std::pair<std::string, std::set<std::string>> &model : vc.models_variants_installed) { for (const std::pair<std::string, std::set<std::string>> &model : vc.models_variants_installed) {
text += _(L("model")) + ": " + model.first + ", " + _(L("variants")) + ": "; text += _(L("model")) + ": " + model.first + ", " + _(L("variants")) + ": ";
@ -72,9 +73,9 @@ static std::string generate_html_row(const Config::Snapshot &snapshot, bool row_
return text; return text;
} }
static std::string generate_html_page(const Config::SnapshotDB &snapshot_db, const std::string &on_snapshot) static wxString generate_html_page(const Config::SnapshotDB &snapshot_db, const wxString &on_snapshot)
{ {
std::string text = wxString text =
"<html>" "<html>"
"<body bgcolor=\"#ffffff\" cellspacing=\"2\" cellpadding=\"0\" border=\"0\" link=\"#800000\">" "<body bgcolor=\"#ffffff\" cellspacing=\"2\" cellpadding=\"0\" border=\"0\" link=\"#800000\">"
"<font color=\"#000000\">"; "<font color=\"#000000\">";
@ -91,7 +92,7 @@ static std::string generate_html_page(const Config::SnapshotDB &snapshot_db, con
return text; return text;
} }
ConfigSnapshotDialog::ConfigSnapshotDialog(const Config::SnapshotDB &snapshot_db, const std::string &on_snapshot) ConfigSnapshotDialog::ConfigSnapshotDialog(const Config::SnapshotDB &snapshot_db, const wxString &on_snapshot)
: wxDialog(NULL, wxID_ANY, _(L("Configuration Snapshots")), wxDefaultPosition, wxSize(600, 500), wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxMAXIMIZE_BOX) : wxDialog(NULL, wxID_ANY, _(L("Configuration Snapshots")), wxDefaultPosition, wxSize(600, 500), wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxMAXIMIZE_BOX)
{ {
this->SetBackgroundColour(*wxWHITE); this->SetBackgroundColour(*wxWHITE);
@ -110,8 +111,8 @@ ConfigSnapshotDialog::ConfigSnapshotDialog(const Config::SnapshotDB &snapshot_db
#endif #endif
html->SetFonts(font.GetFaceName(), font.GetFaceName(), size); html->SetFonts(font.GetFaceName(), font.GetFaceName(), size);
html->SetBorders(2); html->SetBorders(2);
std::string text = generate_html_page(snapshot_db, on_snapshot); wxString text = generate_html_page(snapshot_db, on_snapshot);
html->SetPage(text.c_str()); html->SetPage(text);
vsizer->Add(html, 1, wxEXPAND | wxALIGN_LEFT | wxRIGHT | wxBOTTOM, 0); vsizer->Add(html, 1, wxEXPAND | wxALIGN_LEFT | wxRIGHT | wxBOTTOM, 0);
html->Bind(wxEVT_HTML_LINK_CLICKED, &ConfigSnapshotDialog::onLinkClicked, this); html->Bind(wxEVT_HTML_LINK_CLICKED, &ConfigSnapshotDialog::onLinkClicked, this);
} }

View file

@ -17,7 +17,7 @@ namespace Config {
class ConfigSnapshotDialog : public wxDialog class ConfigSnapshotDialog : public wxDialog
{ {
public: public:
ConfigSnapshotDialog(const Config::SnapshotDB &snapshot_db, const std::string &id); ConfigSnapshotDialog(const Config::SnapshotDB &snapshot_db, const wxString &id);
const std::string& snapshot_to_activate() const { return m_snapshot_to_activate; } const std::string& snapshot_to_activate() const { return m_snapshot_to_activate; }
private: private:

View file

@ -203,7 +203,7 @@ static void init_label_colours()
{ {
auto luma = get_colour_approx_luma(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); auto luma = get_colour_approx_luma(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
if (luma >= 128) { 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); g_color_label_sys = wxColour(26, 132, 57);
} else { } else {
g_color_label_modified = wxColour(253, 111, 40); g_color_label_modified = wxColour(253, 111, 40);
@ -339,6 +339,7 @@ bool load_language()
void save_language() void save_language()
{ {
//! TO DO !! use GetCanonicalName;
long language = wxLANGUAGE_UNKNOWN; long language = wxLANGUAGE_UNKNOWN;
if (g_wxLocale) { if (g_wxLocale) {
language = g_wxLocale->GetLanguage(); language = g_wxLocale->GetLanguage();
@ -398,12 +399,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()); const auto config_wizard_tooltip = wxString::Format(_(L("Run %s")), ConfigWizard::name());
// Cmd+, is standard on OS X - what about other operating systems? // 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 + 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 + 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 + 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 + ConfigMenuUpdate, _(L("Check for updates")), _(L("Check for configuration updates")));
local_menu->AppendSeparator(); 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->AppendSeparator();
local_menu->Append(config_id_base + ConfigMenuLanguage, _(L("Change Application Language"))); 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){ local_menu->Bind(wxEVT_MENU, [config_id_base, event_language_change, event_preferences_changed](wxEvent &event){
@ -685,7 +686,7 @@ void show_info(wxWindow* parent, const wxString& message, const wxString& title)
} }
void warning_catcher(wxWindow* parent, const wxString& message){ 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; return;
wxMessageDialog msg(parent, message, _(L("Warning")), wxOK | wxICON_WARNING); wxMessageDialog msg(parent, message, _(L("Warning")), wxOK | wxICON_WARNING);
msg.ShowModal(); msg.ShowModal();
@ -903,7 +904,7 @@ void add_frequently_changed_parameters(wxWindow* parent, wxBoxSizer* sizer, wxFl
m_optgroup->append_single_option_line(option); m_optgroup->append_single_option_line(option);
Line line = { _(L("")), "" }; Line line = { "", "" };
line.widget = [config](wxWindow* parent){ line.widget = [config](wxWindow* parent){
g_wiping_dialog_button = new wxButton(parent, wxID_ANY, _(L("Purging volumes")) + "\u2026", wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT); g_wiping_dialog_button = new wxButton(parent, wxID_ANY, _(L("Purging volumes")) + "\u2026", wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT);
auto sizer = new wxBoxSizer(wxHORIZONTAL); auto sizer = new wxBoxSizer(wxHORIZONTAL);

View file

@ -5,6 +5,12 @@
namespace Slic3r { namespace Slic3r {
namespace GUI { namespace GUI {
PreferencesDialog::PreferencesDialog(wxWindow* parent, int event_preferences) :
wxDialog(parent, wxID_ANY, _(L("Preferences")), wxDefaultPosition, wxDefaultSize),
m_event_preferences(event_preferences) {
build();
}
void PreferencesDialog::build() void PreferencesDialog::build()
{ {
auto app_config = get_app_config(); auto app_config = get_app_config();

View file

@ -17,8 +17,7 @@ class PreferencesDialog : public wxDialog
std::shared_ptr<ConfigOptionsGroup> m_optgroup; std::shared_ptr<ConfigOptionsGroup> m_optgroup;
int m_event_preferences; int m_event_preferences;
public: public:
PreferencesDialog(wxWindow* parent, int event_preferences) : wxDialog(parent, wxID_ANY, _(L("Preferences")), PreferencesDialog(wxWindow* parent, int event_preferences);
wxDefaultPosition, wxDefaultSize), m_event_preferences(event_preferences) { build(); }
~PreferencesDialog(){ } ~PreferencesDialog(){ }
void build(); void build();

View file

@ -602,7 +602,7 @@ void PresetCollection::update_platter_ui(wxBitmapComboBox *ui)
std::map<wxString, wxBitmap*> nonsys_presets; std::map<wxString, wxBitmap*> nonsys_presets;
wxString selected = ""; wxString selected = "";
if (!this->m_presets.front().is_visible) if (!this->m_presets.front().is_visible)
ui->Append("------- System presets -------", wxNullBitmap); ui->Append("------- " +_(L("System presets")) + " -------", wxNullBitmap);
for (size_t i = this->m_presets.front().is_visible ? 0 : 1; i < this->m_presets.size(); ++i) { for (size_t i = this->m_presets.front().is_visible ? 0 : 1; i < this->m_presets.size(); ++i) {
const Preset &preset = this->m_presets[i]; const Preset &preset = this->m_presets[i];
if (! preset.is_visible || (! preset.is_compatible && i != m_idx_selected)) if (! preset.is_visible || (! preset.is_compatible && i != m_idx_selected))
@ -642,11 +642,11 @@ void PresetCollection::update_platter_ui(wxBitmapComboBox *ui)
selected = wxString::FromUTF8((preset.name + (preset.is_dirty ? g_suffix_modified : "")).c_str()); selected = wxString::FromUTF8((preset.name + (preset.is_dirty ? g_suffix_modified : "")).c_str());
} }
if (preset.is_default) if (preset.is_default)
ui->Append("------- System presets -------", wxNullBitmap); ui->Append("------- " + _(L("System presets")) + " -------", wxNullBitmap);
} }
if (!nonsys_presets.empty()) if (!nonsys_presets.empty())
{ {
ui->Append("------- User presets -------", wxNullBitmap); ui->Append("------- " + _(L("User presets")) + " -------", wxNullBitmap);
for (std::map<wxString, wxBitmap*>::iterator it = nonsys_presets.begin(); it != nonsys_presets.end(); ++it) { for (std::map<wxString, wxBitmap*>::iterator it = nonsys_presets.begin(); it != nonsys_presets.end(); ++it) {
ui->Append(it->first, *it->second); ui->Append(it->first, *it->second);
if (it->first == selected) if (it->first == selected)
@ -667,7 +667,7 @@ size_t PresetCollection::update_tab_ui(wxBitmapComboBox *ui, bool show_incompati
std::map<wxString, wxBitmap*> nonsys_presets; std::map<wxString, wxBitmap*> nonsys_presets;
wxString selected = ""; wxString selected = "";
if (!this->m_presets.front().is_visible) if (!this->m_presets.front().is_visible)
ui->Append("------- System presets -------", wxNullBitmap); ui->Append("------- " + _(L("System presets")) + " -------", wxNullBitmap);
for (size_t i = this->m_presets.front().is_visible ? 0 : 1; i < this->m_presets.size(); ++i) { for (size_t i = this->m_presets.front().is_visible ? 0 : 1; i < this->m_presets.size(); ++i) {
const Preset &preset = this->m_presets[i]; const Preset &preset = this->m_presets[i];
if (! preset.is_visible || (! show_incompatible && ! preset.is_compatible && i != m_idx_selected)) if (! preset.is_visible || (! show_incompatible && ! preset.is_compatible && i != m_idx_selected))
@ -699,11 +699,11 @@ size_t PresetCollection::update_tab_ui(wxBitmapComboBox *ui, bool show_incompati
selected = wxString::FromUTF8((preset.name + (preset.is_dirty ? g_suffix_modified : "")).c_str()); selected = wxString::FromUTF8((preset.name + (preset.is_dirty ? g_suffix_modified : "")).c_str());
} }
if (preset.is_default) if (preset.is_default)
ui->Append("------- System presets -------", wxNullBitmap); ui->Append("------- " + _(L("System presets")) + " -------", wxNullBitmap);
} }
if (!nonsys_presets.empty()) if (!nonsys_presets.empty())
{ {
ui->Append("------- User presets -------", wxNullBitmap); ui->Append("------- " + _(L("User presets")) + " -------", wxNullBitmap);
for (std::map<wxString, wxBitmap*>::iterator it = nonsys_presets.begin(); it != nonsys_presets.end(); ++it) { for (std::map<wxString, wxBitmap*>::iterator it = nonsys_presets.begin(); it != nonsys_presets.end(); ++it) {
ui->Append(it->first, *it->second); ui->Append(it->first, *it->second);
if (it->first == selected) if (it->first == selected)
@ -808,11 +808,6 @@ bool PresetCollection::select_preset_by_name(const std::string &name_w_suffix, b
// If the first visible preset was not found, return the 0th element, which is the default preset. // If the first visible preset was not found, return the 0th element, which is the default preset.
} }
// Temporary decision
if (name_w_suffix == "------- System presets -------" ||
name_w_suffix == "------- User presets -------")
return true;
// 2) Select the new preset. // 2) Select the new preset.
if (m_idx_selected != idx || force) { if (m_idx_selected != idx || force) {
this->select_preset(idx); this->select_preset(idx);

View file

@ -1011,8 +1011,7 @@ void PresetBundle::export_configbundle(const std::string &path) //, const Dynami
// an optional "(modified)" suffix will be removed from the filament name. // an optional "(modified)" suffix will be removed from the filament name.
void PresetBundle::set_filament_preset(size_t idx, const std::string &name) void PresetBundle::set_filament_preset(size_t idx, const std::string &name)
{ {
if (name == "------- System presets -------" || if (name.find_first_of("-------") == 0)
name == "------- User presets -------")
return; return;
if (idx >= filament_presets.size()) if (idx >= filament_presets.size())
@ -1066,7 +1065,7 @@ void PresetBundle::update_platter_filament_ui(unsigned int idx_extruder, wxBitma
std::map<wxString, wxBitmap*> nonsys_presets; std::map<wxString, wxBitmap*> nonsys_presets;
wxString selected_str = ""; wxString selected_str = "";
if (!this->filaments().front().is_visible) if (!this->filaments().front().is_visible)
ui->Append("------- System presets -------", wxNullBitmap); ui->Append("------- " + _(L("System presets")) + " -------", wxNullBitmap);
for (int i = this->filaments().front().is_visible ? 0 : 1; i < int(this->filaments().size()); ++i) { for (int i = this->filaments().front().is_visible ? 0 : 1; i < int(this->filaments().size()); ++i) {
const Preset &preset = this->filaments.preset(i); const Preset &preset = this->filaments.preset(i);
bool selected = this->filament_presets[idx_extruder] == preset.name; bool selected = this->filament_presets[idx_extruder] == preset.name;
@ -1119,12 +1118,12 @@ void PresetBundle::update_platter_filament_ui(unsigned int idx_extruder, wxBitma
selected_str = wxString::FromUTF8((preset.name + (preset.is_dirty ? Preset::suffix_modified() : "")).c_str()); selected_str = wxString::FromUTF8((preset.name + (preset.is_dirty ? Preset::suffix_modified() : "")).c_str());
} }
if (preset.is_default) if (preset.is_default)
ui->Append("------- System presets -------", wxNullBitmap); ui->Append("------- " + _(L("System presets")) + " -------", wxNullBitmap);
} }
if (!nonsys_presets.empty()) if (!nonsys_presets.empty())
{ {
ui->Append("------- User presets -------", wxNullBitmap); ui->Append("------- " + _(L("User presets")) + " -------", wxNullBitmap);
for (std::map<wxString, wxBitmap*>::iterator it = nonsys_presets.begin(); it != nonsys_presets.end(); ++it) { for (std::map<wxString, wxBitmap*>::iterator it = nonsys_presets.begin(); it != nonsys_presets.end(); ++it) {
ui->Append(it->first, *it->second); ui->Append(it->first, *it->second);
if (it->first == selected_str) if (it->first == selected_str)

View file

@ -25,7 +25,7 @@ void Chart::draw() {
dc.DrawRectangle(m_rect); dc.DrawRectangle(m_rect);
if (visible_area.m_width < 0.499) { if (visible_area.m_width < 0.499) {
dc.DrawText("NO RAMMING AT ALL",wxPoint(m_rect.GetLeft()+m_rect.GetWidth()/2-50,m_rect.GetBottom()-m_rect.GetHeight()/2)); dc.DrawText(_(L("NO RAMMING AT ALL")),wxPoint(m_rect.GetLeft()+m_rect.GetWidth()/2-50,m_rect.GetBottom()-m_rect.GetHeight()/2));
return; return;
} }
@ -78,12 +78,12 @@ void Chart::draw() {
} }
// axis labels: // axis labels:
wxString label = L("Time (s)"); wxString label = _(L("Time")) + " ("+_(L("s"))+")";
int text_width = 0; int text_width = 0;
int text_height = 0; int text_height = 0;
dc.GetTextExtent(label,&text_width,&text_height); dc.GetTextExtent(label,&text_width,&text_height);
dc.DrawText(label,wxPoint(0.5*(m_rect.GetRight()+m_rect.GetLeft())-text_width/2.f, m_rect.GetBottom()+25)); dc.DrawText(label,wxPoint(0.5*(m_rect.GetRight()+m_rect.GetLeft())-text_width/2.f, m_rect.GetBottom()+25));
label = L("Volumetric speed (mm\u00B3/s)"); label = _(L("Volumetric speed")) + " (" + _(L("mm")) + "\u00B3/" + _(L("s")) + ")";
dc.GetTextExtent(label,&text_width,&text_height); dc.GetTextExtent(label,&text_width,&text_height);
dc.DrawRotatedText(label,wxPoint(0,0.5*(m_rect.GetBottom()+m_rect.GetTop())+text_width/2.f),90); dc.DrawRotatedText(label,wxPoint(0,0.5*(m_rect.GetBottom()+m_rect.GetTop())+text_width/2.f),90);
} }

View file

@ -230,8 +230,9 @@ void Tab::create_preset_tab(PresetBundle *preset_bundle)
return; return;
if (selected_item >= 0){ if (selected_item >= 0){
std::string selected_string = m_presets_choice->GetString(selected_item).ToUTF8().data(); std::string selected_string = m_presets_choice->GetString(selected_item).ToUTF8().data();
if (selected_string == "------- System presets -------" || if (selected_string.find_first_of("-------") == 0
selected_string == "------- User presets -------"){ /*selected_string == "------- System presets -------" ||
selected_string == "------- User presets -------"*/){
m_presets_choice->SetSelection(m_selected_preset_item); m_presets_choice->SetSelection(m_selected_preset_item);
return; return;
} }

View file

@ -79,15 +79,15 @@ RammingPanel::RammingPanel(wxWindow* parent, const std::string& parameters)
m_widget_ramming_step_multiplicator = new wxSpinCtrl(this,wxID_ANY,wxEmptyString,wxDefaultPosition,wxSize(75, -1),wxSP_ARROW_KEYS,10,200,100); m_widget_ramming_step_multiplicator = new wxSpinCtrl(this,wxID_ANY,wxEmptyString,wxDefaultPosition,wxSize(75, -1),wxSP_ARROW_KEYS,10,200,100);
auto gsizer_param = new wxFlexGridSizer(2, 5, 15); auto gsizer_param = new wxFlexGridSizer(2, 5, 15);
gsizer_param->Add(new wxStaticText(this, wxID_ANY, wxString(_(L("Total ramming time (s):")))), 0, wxALIGN_CENTER_VERTICAL); gsizer_param->Add(new wxStaticText(this, wxID_ANY, wxString(_(L("Total ramming time")) + " (" + _(L("s")) + "):")), 0, wxALIGN_CENTER_VERTICAL);
gsizer_param->Add(m_widget_time); gsizer_param->Add(m_widget_time);
gsizer_param->Add(new wxStaticText(this, wxID_ANY, wxString(_(L("Total rammed volume (mm"))+"\u00B3):")), 0, wxALIGN_CENTER_VERTICAL); gsizer_param->Add(new wxStaticText(this, wxID_ANY, wxString(_(L("Total rammed volume")) + " (" + _(L("mm")) + "\u00B3):")), 0, wxALIGN_CENTER_VERTICAL);
gsizer_param->Add(m_widget_volume); gsizer_param->Add(m_widget_volume);
gsizer_param->AddSpacer(20); gsizer_param->AddSpacer(20);
gsizer_param->AddSpacer(20); gsizer_param->AddSpacer(20);
gsizer_param->Add(new wxStaticText(this, wxID_ANY, wxString(_(L("Ramming line width (%):")))), 0, wxALIGN_CENTER_VERTICAL); gsizer_param->Add(new wxStaticText(this, wxID_ANY, wxString(_(L("Ramming line width")) + " (%):")), 0, wxALIGN_CENTER_VERTICAL);
gsizer_param->Add(m_widget_ramming_line_width_multiplicator); gsizer_param->Add(m_widget_ramming_line_width_multiplicator);
gsizer_param->Add(new wxStaticText(this, wxID_ANY, wxString(_(L("Ramming line spacing (%):")))), 0, wxALIGN_CENTER_VERTICAL); gsizer_param->Add(new wxStaticText(this, wxID_ANY, wxString(_(L("Ramming line spacing")) + " (%):")), 0, wxALIGN_CENTER_VERTICAL);
gsizer_param->Add(m_widget_ramming_step_multiplicator); gsizer_param->Add(m_widget_ramming_step_multiplicator);
sizer_param->Add(gsizer_param, 0, wxTOP, 100); sizer_param->Add(gsizer_param, 0, wxTOP, 100);
@ -220,7 +220,7 @@ WipingPanel::WipingPanel(wxWindow* parent, const std::vector<float>& matrix, con
// collect and format sizer // collect and format sizer
format_sizer(m_sizer_advanced, m_page_advanced, m_gridsizer_advanced, format_sizer(m_sizer_advanced, m_page_advanced, m_gridsizer_advanced,
_(L("Here you can adjust required purging volume (mm\u00B3) for any given pair of tools.")), wxString::Format(_(L("Here you can adjust required purging volume (mm%s) for any given pair of tools.")), "\u00B3"),
_(L("Extruder changed to"))); _(L("Extruder changed to")));
// Hide preview page before new page creating // Hide preview page before new page creating
@ -243,7 +243,7 @@ WipingPanel::WipingPanel(wxWindow* parent, const std::vector<float>& matrix, con
// collect and format sizer // collect and format sizer
format_sizer(m_sizer_simple, m_page_simple, gridsizer_simple, format_sizer(m_sizer_simple, m_page_simple, gridsizer_simple,
_(L("Total purging volume is calculated by summing two values below, depending on which tools are loaded/unloaded.")), _(L("Total purging volume is calculated by summing two values below, depending on which tools are loaded/unloaded.")),
_(L("Volume to purge (mm\u00B3) when the filament is being")), 50); wxString::Format(_(L("Volume to purge (mm%s) when the filament is being")), "\u00B3"), 50);
m_sizer = new wxBoxSizer(wxVERTICAL); m_sizer = new wxBoxSizer(wxVERTICAL);
m_sizer->Add(m_page_simple, 0, wxEXPAND | wxALL, 25); m_sizer->Add(m_page_simple, 0, wxEXPAND | wxALL, 25);