New erase() method for DynamicConfig objects
This commit is contained in:
parent
b5b8fb606f
commit
42519174cd
@ -132,7 +132,7 @@ sub update_optgroup {
|
|||||||
my ($opt_key) = @{$line->{options}}; # we assume that we have one option per line
|
my ($opt_key) = @{$line->{options}}; # we assume that we have one option per line
|
||||||
my $btn = Wx::BitmapButton->new($self, -1, Wx::Bitmap->new("$Slic3r::var/delete.png", wxBITMAP_TYPE_PNG));
|
my $btn = Wx::BitmapButton->new($self, -1, Wx::Bitmap->new("$Slic3r::var/delete.png", wxBITMAP_TYPE_PNG));
|
||||||
EVT_BUTTON($self, $btn, sub {
|
EVT_BUTTON($self, $btn, sub {
|
||||||
delete $self->model_object->config->{$opt_key};
|
$self->model_object->config->erase($opt_key);
|
||||||
Slic3r::GUI->CallAfter(sub { $self->update_optgroup });
|
Slic3r::GUI->CallAfter(sub { $self->update_optgroup });
|
||||||
});
|
});
|
||||||
return $btn;
|
return $btn;
|
||||||
|
@ -289,6 +289,11 @@ DynamicConfig::keys(t_config_option_keys *keys) {
|
|||||||
keys->push_back(it->first);
|
keys->push_back(it->first);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
DynamicConfig::erase(const t_config_option_key opt_key) {
|
||||||
|
this->options.erase(opt_key);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
StaticConfig::keys(t_config_option_keys *keys) {
|
StaticConfig::keys(t_config_option_keys *keys) {
|
||||||
for (t_optiondef_map::const_iterator it = this->def->begin(); it != this->def->end(); ++it) {
|
for (t_optiondef_map::const_iterator it = this->def->begin(); it != this->def->end(); ++it) {
|
||||||
|
@ -430,6 +430,7 @@ class DynamicConfig : public ConfigBase
|
|||||||
~DynamicConfig();
|
~DynamicConfig();
|
||||||
ConfigOption* option(const t_config_option_key opt_key, bool create = false);
|
ConfigOption* option(const t_config_option_key opt_key, bool create = false);
|
||||||
void keys(t_config_option_keys *keys);
|
void keys(t_config_option_keys *keys);
|
||||||
|
void erase(const t_config_option_key opt_key);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DynamicConfig(const DynamicConfig& other); // we disable this by making it private and unimplemented
|
DynamicConfig(const DynamicConfig& other); // we disable this by making it private and unimplemented
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
%code{% THIS->apply(*other, true); %};
|
%code{% THIS->apply(*other, true); %};
|
||||||
std::vector<std::string> get_keys()
|
std::vector<std::string> get_keys()
|
||||||
%code{% THIS->keys(&RETVAL); %};
|
%code{% THIS->keys(&RETVAL); %};
|
||||||
|
void erase(t_config_option_key opt_key);
|
||||||
};
|
};
|
||||||
|
|
||||||
%name{Slic3r::Config::Print} class PrintConfig {
|
%name{Slic3r::Config::Print} class PrintConfig {
|
||||||
|
Loading…
Reference in New Issue
Block a user