mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-07 23:17:35 -06:00
Implement ParamsViewCtrl
+ GUI_App : Fixed update of the dark mode, when DataViewCtrl doesn't have header -Orca: currently doesn't seem to display dataview labels properly. TBD if it continues to be an issue. Original Commit: prusa3d/PrusaSlicer@c577b7f Co-authored-by: YuSanka <yusanka@gmail.com>
This commit is contained in:
parent
dd802764b9
commit
bdac496130
5 changed files with 684 additions and 74 deletions
|
@ -2869,12 +2869,39 @@ static void validate_custom_gcode_cb(Tab* tab, ConfigOptionsGroupShp opt_group,
|
|||
|
||||
void Tab::edit_custom_gcode(const t_config_option_key& opt_key)
|
||||
{
|
||||
EditGCodeDialog(this, opt_key, m_config->opt_string(opt_key)).ShowModal();
|
||||
EditGCodeDialog dlg = EditGCodeDialog(this, opt_key, get_custom_gcode(opt_key));
|
||||
if (dlg.ShowModal() == wxID_OK) {
|
||||
set_custom_gcode(opt_key, dlg.get_edited_gcode());
|
||||
update_dirty();
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
void TabFilament::edit_custom_gcode(const t_config_option_key& opt_key)
|
||||
const std::string& Tab::get_custom_gcode(const t_config_option_key& opt_key)
|
||||
{
|
||||
EditGCodeDialog(this, opt_key, m_config->opt_string(opt_key, unsigned(m_presets_choice->GetSelection()))).ShowModal();
|
||||
return m_config->opt_string(opt_key);
|
||||
}
|
||||
|
||||
void Tab::set_custom_gcode(const t_config_option_key& opt_key, const std::string& value)
|
||||
{
|
||||
DynamicPrintConfig new_conf = *m_config;
|
||||
new_conf.set_key_value(opt_key, new ConfigOptionString(value));
|
||||
load_config(new_conf);
|
||||
}
|
||||
|
||||
const std::string& TabFilament::get_custom_gcode(const t_config_option_key& opt_key)
|
||||
{
|
||||
return m_config->opt_string(opt_key, unsigned(0));
|
||||
}
|
||||
|
||||
void TabFilament::set_custom_gcode(const t_config_option_key& opt_key, const std::string& value)
|
||||
{
|
||||
std::vector<std::string> gcodes = static_cast<const ConfigOptionStrings*>(m_config->option(opt_key))->values;
|
||||
gcodes[0] = value;
|
||||
|
||||
DynamicPrintConfig new_conf = *m_config;
|
||||
new_conf.set_key_value(opt_key, new ConfigOptionStrings(gcodes));
|
||||
load_config(new_conf);
|
||||
}
|
||||
|
||||
void TabFilament::add_filament_overrides_page()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue