Merge remote-tracking branch 'origin/master' into new_main_page_ui
This commit is contained in:
commit
6abfee65ce
@ -1,18 +1,22 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
This file is autogenerated by CMake
|
||||||
|
Note: In the .in template file, the $ {}-style variables are interpreted by CMake while the $()-style variables belong to MSVC
|
||||||
|
-->
|
||||||
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<ImportGroup Label="PropertySheets">
|
<ImportGroup Label="PropertySheets">
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
<PropertyGroup Label="UserMacros" />
|
<PropertyGroup Label="UserMacros" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(FxCopDir);$(PATH);c:\wperl64d\bin\;</ExecutablePath>
|
<ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(FxCopDir);$(PATH);${PROPS_PERL_BIN_PATH}\;</ExecutablePath>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemDefinitionGroup />
|
<ItemDefinitionGroup />
|
||||||
<ItemGroup />
|
<ItemGroup />
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<LocalDebuggerCommand>C:\wperl64d\bin\perl.exe</LocalDebuggerCommand>
|
<LocalDebuggerCommand>${PROPS_PERL_EXECUTABLE}</LocalDebuggerCommand>
|
||||||
<LocalDebuggerCommandArguments>slic3r.pl</LocalDebuggerCommandArguments>
|
<LocalDebuggerCommandArguments>slic3r.pl</LocalDebuggerCommandArguments>
|
||||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||||
<LocalDebuggerWorkingDirectory>..\..</LocalDebuggerWorkingDirectory>
|
<LocalDebuggerWorkingDirectory>${PROPS_CMAKE_SOURCE_DIR}</LocalDebuggerWorkingDirectory>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
@ -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;
|
||||||
}
|
}
|
||||||
@ -1809,8 +1809,7 @@ sub list_item_deselected {
|
|||||||
if ($self->{list}->GetFirstSelected == -1) {
|
if ($self->{list}->GetFirstSelected == -1) {
|
||||||
$self->select_object(undef);
|
$self->select_object(undef);
|
||||||
$self->{canvas}->Refresh;
|
$self->{canvas}->Refresh;
|
||||||
#FIXME VBOs are being refreshed just to change a selection color?
|
$self->{canvas3D}->deselect_volumes if $self->{canvas3D};
|
||||||
$self->{canvas3D}->reload_scene if $self->{canvas3D};
|
|
||||||
}
|
}
|
||||||
undef $self->{_lecursor};
|
undef $self->{_lecursor};
|
||||||
}
|
}
|
||||||
@ -1822,8 +1821,7 @@ sub list_item_selected {
|
|||||||
my $obj_idx = $event->GetIndex;
|
my $obj_idx = $event->GetIndex;
|
||||||
$self->select_object($obj_idx);
|
$self->select_object($obj_idx);
|
||||||
$self->{canvas}->Refresh;
|
$self->{canvas}->Refresh;
|
||||||
#FIXME VBOs are being refreshed just to change a selection color?
|
$self->{canvas3D}->update_volumes_selection if $self->{canvas3D};
|
||||||
$self->{canvas3D}->reload_scene if $self->{canvas3D};
|
|
||||||
undef $self->{_lecursor};
|
undef $self->{_lecursor};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2015,8 +2013,15 @@ sub selection_changed {
|
|||||||
|
|
||||||
sub select_object {
|
sub select_object {
|
||||||
my ($self, $obj_idx) = @_;
|
my ($self, $obj_idx) = @_;
|
||||||
|
|
||||||
|
# remove current selection
|
||||||
|
foreach my $o (0..$#{$self->{objects}}) {
|
||||||
|
$PreventListEvents = 1;
|
||||||
|
$self->{objects}->[$o]->selected(0);
|
||||||
|
$self->{list}->Select($o, 0);
|
||||||
|
$PreventListEvents = 0;
|
||||||
|
}
|
||||||
|
|
||||||
$_->selected(0) for @{ $self->{objects} };
|
|
||||||
if (defined $obj_idx) {
|
if (defined $obj_idx) {
|
||||||
$self->{objects}->[$obj_idx]->selected(1);
|
$self->{objects}->[$obj_idx]->selected(1);
|
||||||
# We use this flag to avoid circular event handling
|
# We use this flag to avoid circular event handling
|
||||||
|
@ -31,7 +31,9 @@ sub new {
|
|||||||
$self->{on_select_object} = sub {};
|
$self->{on_select_object} = sub {};
|
||||||
$self->{on_instances_moved} = sub {};
|
$self->{on_instances_moved} = sub {};
|
||||||
$self->{on_wipe_tower_moved} = sub {};
|
$self->{on_wipe_tower_moved} = sub {};
|
||||||
|
|
||||||
|
$self->{objects_volumes_idxs} = ();
|
||||||
|
|
||||||
$self->on_select(sub {
|
$self->on_select(sub {
|
||||||
my ($volume_idx) = @_;
|
my ($volume_idx) = @_;
|
||||||
$self->{on_select_object}->(($volume_idx == -1) ? undef : $self->volumes->[$volume_idx]->object_idx)
|
$self->{on_select_object}->(($volume_idx == -1) ? undef : $self->volumes->[$volume_idx]->object_idx)
|
||||||
@ -181,6 +183,17 @@ sub set_on_enable_action_buttons {
|
|||||||
$self->on_enable_action_buttons($cb);
|
$self->on_enable_action_buttons($cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub update_volumes_selection {
|
||||||
|
my ($self) = @_;
|
||||||
|
|
||||||
|
foreach my $obj_idx (0..$#{$self->{model}->objects}) {
|
||||||
|
if ($self->{objects}[$obj_idx]->selected) {
|
||||||
|
my @volume_idxs = @{$self->{objects_volumes_idxs}[$obj_idx]};
|
||||||
|
$self->select_volume($_) for @volume_idxs;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sub reload_scene {
|
sub reload_scene {
|
||||||
my ($self, $force) = @_;
|
my ($self, $force) = @_;
|
||||||
|
|
||||||
@ -194,12 +207,14 @@ sub reload_scene {
|
|||||||
|
|
||||||
$self->{reload_delayed} = 0;
|
$self->{reload_delayed} = 0;
|
||||||
|
|
||||||
|
$self->{objects_volumes_idxs} = ();
|
||||||
foreach my $obj_idx (0..$#{$self->{model}->objects}) {
|
foreach my $obj_idx (0..$#{$self->{model}->objects}) {
|
||||||
my @volume_idxs = $self->load_object($self->{model}, $self->{print}, $obj_idx);
|
my @volume_idxs = $self->load_object($self->{model}, $self->{print}, $obj_idx);
|
||||||
if ($self->{objects}[$obj_idx]->selected) {
|
push(@{$self->{objects_volumes_idxs}}, \@volume_idxs);
|
||||||
$self->select_volume($_) for @volume_idxs;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$self->update_volumes_selection;
|
||||||
|
|
||||||
if (defined $self->{config}->nozzle_diameter) {
|
if (defined $self->{config}->nozzle_diameter) {
|
||||||
# Should the wipe tower be visualized?
|
# Should the wipe tower be visualized?
|
||||||
my $extruders_count = scalar @{ $self->{config}->nozzle_diameter };
|
my $extruders_count = scalar @{ $self->{config}->nozzle_diameter };
|
||||||
|
@ -116,7 +116,6 @@ sub new {
|
|||||||
$canvas->set_auto_bed_shape;
|
$canvas->set_auto_bed_shape;
|
||||||
$canvas->SetSize([500,500]);
|
$canvas->SetSize([500,500]);
|
||||||
$canvas->SetMinSize($canvas->GetSize);
|
$canvas->SetMinSize($canvas->GetSize);
|
||||||
$canvas->zoom_to_volumes;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$self->{sizer} = Wx::BoxSizer->new(wxHORIZONTAL);
|
$self->{sizer} = Wx::BoxSizer->new(wxHORIZONTAL);
|
||||||
|
@ -163,7 +163,6 @@ sub new {
|
|||||||
$canvas->set_auto_bed_shape;
|
$canvas->set_auto_bed_shape;
|
||||||
$canvas->SetSize([500,700]);
|
$canvas->SetSize([500,700]);
|
||||||
$canvas->update_volumes_colors_by_extruder($self->GetParent->GetParent->GetParent->{config});
|
$canvas->update_volumes_colors_by_extruder($self->GetParent->GetParent->GetParent->{config});
|
||||||
$canvas->zoom_to_volumes;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$self->{sizer} = Wx::BoxSizer->new(wxHORIZONTAL);
|
$self->{sizer} = Wx::BoxSizer->new(wxHORIZONTAL);
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -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
|
||||||
|
@ -665,7 +665,12 @@ endif ()
|
|||||||
|
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
# Here we associate some additional properties with the MSVC project to enable compilation and debugging out of the box.
|
# Here we associate some additional properties with the MSVC project to enable compilation and debugging out of the box.
|
||||||
set_target_properties(XS PROPERTIES VS_USER_PROPS "${PROJECT_SOURCE_DIR}/cmake/msvc/xs.wperl64d.props")
|
get_filename_component(PROPS_PERL_BIN_PATH "${PERL_EXECUTABLE}" DIRECTORY)
|
||||||
|
string(REPLACE "/" "\\" PROPS_PERL_BIN_PATH "${PROPS_PERL_BIN_PATH}")
|
||||||
|
string(REPLACE "/" "\\" PROPS_PERL_EXECUTABLE "${PERL_EXECUTABLE}")
|
||||||
|
string(REPLACE "/" "\\" PROPS_CMAKE_SOURCE_DIR "${CMAKE_SOURCE_DIR}")
|
||||||
|
configure_file("${PROJECT_SOURCE_DIR}/cmake/msvc/xs.wperl.props.in" "${CMAKE_BINARY_DIR}/xs.wperl.props" NEWLINE_STYLE CRLF)
|
||||||
|
set_target_properties(XS PROPERTIES VS_USER_PROPS "${CMAKE_BINARY_DIR}/xs.wperl.props")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# l10n
|
# l10n
|
||||||
|
@ -269,6 +269,10 @@ TriangleMesh Model::mesh() const
|
|||||||
|
|
||||||
static bool _arrange(const Pointfs &sizes, coordf_t dist, const BoundingBoxf* bb, Pointfs &out)
|
static bool _arrange(const Pointfs &sizes, coordf_t dist, const BoundingBoxf* bb, Pointfs &out)
|
||||||
{
|
{
|
||||||
|
if (sizes.empty())
|
||||||
|
// return if the list is empty or the following call to BoundingBoxf constructor will lead to a crash
|
||||||
|
return true;
|
||||||
|
|
||||||
// we supply unscaled data to arrange()
|
// we supply unscaled data to arrange()
|
||||||
bool result = Slic3r::Geometry::arrange(
|
bool result = Slic3r::Geometry::arrange(
|
||||||
sizes.size(), // number of parts
|
sizes.size(), // number of parts
|
||||||
|
@ -598,10 +598,10 @@ std::string Print::validate() const
|
|||||||
return "The Wipe Tower is currently only supported with the relative extruder addressing (use_relative_e_distances=1).";
|
return "The Wipe Tower is currently only supported with the relative extruder addressing (use_relative_e_distances=1).";
|
||||||
SlicingParameters slicing_params0 = this->objects.front()->slicing_parameters();
|
SlicingParameters slicing_params0 = this->objects.front()->slicing_parameters();
|
||||||
|
|
||||||
const PrintObject* most_layered_object = this->objects.front(); // object with highest layer_height_profile.size() encountered so far
|
const PrintObject* tallest_object = this->objects.front(); // let's find the tallest object
|
||||||
for (const auto* object : objects)
|
for (const auto* object : objects)
|
||||||
if (object->layer_height_profile.size() > most_layered_object->layer_height_profile.size())
|
if (*(object->layer_height_profile.end()-2) > *(tallest_object->layer_height_profile.end()-2) )
|
||||||
most_layered_object = object;
|
tallest_object = object;
|
||||||
|
|
||||||
for (PrintObject *object : this->objects) {
|
for (PrintObject *object : this->objects) {
|
||||||
SlicingParameters slicing_params = object->slicing_parameters();
|
SlicingParameters slicing_params = object->slicing_parameters();
|
||||||
@ -618,17 +618,26 @@ std::string Print::validate() const
|
|||||||
object->update_layer_height_profile();
|
object->update_layer_height_profile();
|
||||||
object->layer_height_profile_valid = was_layer_height_profile_valid;
|
object->layer_height_profile_valid = was_layer_height_profile_valid;
|
||||||
|
|
||||||
if ( this->config.variable_layer_height ) {
|
if ( this->config.variable_layer_height ) { // comparing layer height profiles
|
||||||
int i = 0;
|
bool failed = false;
|
||||||
while ( i < object->layer_height_profile.size() ) {
|
if (tallest_object->layer_height_profile.size() >= object->layer_height_profile.size() ) {
|
||||||
if (std::abs(most_layered_object->layer_height_profile[i] - object->layer_height_profile[i]) > EPSILON)
|
int i = 0;
|
||||||
return "The Wipe tower is only supported if all objects have the same layer height profile";
|
while ( i < object->layer_height_profile.size() && i < tallest_object->layer_height_profile.size()) {
|
||||||
++i;
|
if (std::abs(tallest_object->layer_height_profile[i] - object->layer_height_profile[i])) {
|
||||||
if (i == object->layer_height_profile.size()-2) // this element contains the objects max z, if the other object is taller,
|
failed = true;
|
||||||
// it does not have to match - we will step over it
|
break;
|
||||||
if (most_layered_object->layer_height_profile[i] > object->layer_height_profile[i])
|
}
|
||||||
++i;
|
++i;
|
||||||
|
if (i == object->layer_height_profile.size()-2) // this element contains this objects max z
|
||||||
|
if (tallest_object->layer_height_profile[i] > object->layer_height_profile[i]) // the difference does not matter in this case
|
||||||
|
++i;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
failed = true;
|
||||||
|
|
||||||
|
if (failed)
|
||||||
|
return "The Wipe tower is only supported if all objects have the same layer height profile";
|
||||||
}
|
}
|
||||||
|
|
||||||
/*for (size_t i = 5; i < object->layer_height_profile.size(); i += 2)
|
/*for (size_t i = 5; i < object->layer_height_profile.size(); i += 2)
|
||||||
|
@ -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__
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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);
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
@ -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:
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
|
#include <boost/log/trivial.hpp>
|
||||||
|
|
||||||
#include <wx/settings.h>
|
#include <wx/settings.h>
|
||||||
#include <wx/stattext.h>
|
#include <wx/stattext.h>
|
||||||
#include <wx/textctrl.h>
|
#include <wx/textctrl.h>
|
||||||
@ -741,9 +743,12 @@ void ConfigWizard::priv::apply_config(AppConfig *app_config, PresetBundle *prese
|
|||||||
if (install_bundles.size() > 0) {
|
if (install_bundles.size() > 0) {
|
||||||
// Install bundles from resources.
|
// Install bundles from resources.
|
||||||
updater->install_bundles_rsrc(std::move(install_bundles), snapshot);
|
updater->install_bundles_rsrc(std::move(install_bundles), snapshot);
|
||||||
|
} else {
|
||||||
|
BOOST_LOG_TRIVIAL(info) << "No bundles need to be installed from resources";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (page_welcome->reset_user_profile()) {
|
if (page_welcome->reset_user_profile()) {
|
||||||
|
BOOST_LOG_TRIVIAL(info) << "Resetting user profiles...";
|
||||||
preset_bundle->reset(true);
|
preset_bundle->reset(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -828,10 +833,13 @@ ConfigWizard::~ConfigWizard() {}
|
|||||||
|
|
||||||
bool ConfigWizard::run(PresetBundle *preset_bundle, const PresetUpdater *updater)
|
bool ConfigWizard::run(PresetBundle *preset_bundle, const PresetUpdater *updater)
|
||||||
{
|
{
|
||||||
|
BOOST_LOG_TRIVIAL(info) << "Running ConfigWizard, reason: " << p->run_reason;
|
||||||
if (ShowModal() == wxID_OK) {
|
if (ShowModal() == wxID_OK) {
|
||||||
p->apply_config(GUI::get_app_config(), preset_bundle, updater);
|
p->apply_config(GUI::get_app_config(), preset_bundle, updater);
|
||||||
|
BOOST_LOG_TRIVIAL(info) << "ConfigWizard applied";
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
BOOST_LOG_TRIVIAL(info) << "ConfigWizard cancelled";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -205,7 +205,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);
|
||||||
@ -311,22 +311,18 @@ bool select_language(wxArrayString & names,
|
|||||||
|
|
||||||
bool load_language()
|
bool load_language()
|
||||||
{
|
{
|
||||||
long language;
|
wxString language = wxEmptyString;
|
||||||
if (!g_AppConfig->has("translation_language"))
|
if (g_AppConfig->has("translation_language"))
|
||||||
language = wxLANGUAGE_UNKNOWN;
|
language = g_AppConfig->get("translation_language");
|
||||||
else {
|
|
||||||
auto str_language = g_AppConfig->get("translation_language");
|
|
||||||
language = str_language != "" ? stol(str_language) : wxLANGUAGE_UNKNOWN;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (language == wxLANGUAGE_UNKNOWN)
|
if (language.IsEmpty())
|
||||||
return false;
|
return false;
|
||||||
wxArrayString names;
|
wxArrayString names;
|
||||||
wxArrayLong identifiers;
|
wxArrayLong identifiers;
|
||||||
get_installed_languages(names, identifiers);
|
get_installed_languages(names, identifiers);
|
||||||
for (size_t i = 0; i < identifiers.Count(); i++)
|
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 = new wxLocale;
|
||||||
g_wxLocale->Init(identifiers[i]);
|
g_wxLocale->Init(identifiers[i]);
|
||||||
@ -341,12 +337,11 @@ bool load_language()
|
|||||||
|
|
||||||
void save_language()
|
void save_language()
|
||||||
{
|
{
|
||||||
long language = wxLANGUAGE_UNKNOWN;
|
wxString language = wxEmptyString;
|
||||||
if (g_wxLocale) {
|
if (g_wxLocale)
|
||||||
language = g_wxLocale->GetLanguage();
|
language = g_wxLocale->GetCanonicalName();
|
||||||
}
|
|
||||||
std::string str_language = std::to_string(language);
|
g_AppConfig->set("translation_language", language.ToStdString());
|
||||||
g_AppConfig->set("translation_language", str_language);
|
|
||||||
g_AppConfig->save();
|
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());
|
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){
|
||||||
@ -687,7 +682,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();
|
||||||
@ -923,7 +918,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);
|
||||||
|
@ -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();
|
||||||
|
@ -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();
|
||||||
|
@ -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);
|
||||||
|
@ -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)
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
@ -1311,7 +1312,7 @@ void TabFilament::build()
|
|||||||
};
|
};
|
||||||
optgroup->append_line(line);
|
optgroup->append_line(line);
|
||||||
|
|
||||||
optgroup = page->new_optgroup(_(L("Toolchange behaviour")));
|
optgroup = page->new_optgroup(_(L("Toolchange parameters with single extruder MM printers")));
|
||||||
optgroup->append_single_option_line("filament_loading_speed");
|
optgroup->append_single_option_line("filament_loading_speed");
|
||||||
optgroup->append_single_option_line("filament_unloading_speed");
|
optgroup->append_single_option_line("filament_unloading_speed");
|
||||||
optgroup->append_single_option_line("filament_toolchange_delay");
|
optgroup->append_single_option_line("filament_toolchange_delay");
|
||||||
|
@ -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);
|
||||||
|
@ -359,6 +359,11 @@ Updates PresetUpdater::priv::get_config_updates() const
|
|||||||
const auto cached_vp = VendorProfile::from_ini(path_in_cache, false);
|
const auto cached_vp = VendorProfile::from_ini(path_in_cache, false);
|
||||||
if (cached_vp.config_version == recommended->config_version) {
|
if (cached_vp.config_version == recommended->config_version) {
|
||||||
updates.updates.emplace_back(std::move(path_in_cache), std::move(bundle_path), *recommended);
|
updates.updates.emplace_back(std::move(path_in_cache), std::move(bundle_path), *recommended);
|
||||||
|
} else {
|
||||||
|
BOOST_LOG_TRIVIAL(warning) << boost::format("Vendor: %1%: Index indicates update (%2%) but cached bundle has a different version: %3%")
|
||||||
|
% idx.vendor()
|
||||||
|
% recommended->config_version.to_string()
|
||||||
|
% cached_vp.config_version.to_string();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user