Minor change "save_as_preset" -> "saveAsPreset"

This new camelCase style is prefered since the introduction of the Lua
scripting API.
This commit is contained in:
David Capello 2021-01-05 11:05:40 -03:00
parent de22d69678
commit d3f3858859
2 changed files with 5 additions and 5 deletions

View File

@ -1085,7 +1085,7 @@
</item>
<item command="SavePalette" text="@.save_palette" />
<item command="SavePalette" text="@.save_palette_as_preset">
<param name="save_as_preset" value="true" />
<param name="saveAsPreset" value="true" />
</item>
<item command="SavePalette" text="@.save_as_default_palette" group="palette_files">
<param name="preset" value="default" />

View File

@ -36,7 +36,7 @@ protected:
private:
std::string m_preset;
bool m_save_as_preset;
bool m_saveAsPreset = false;
};
SavePaletteCommand::SavePaletteCommand()
@ -47,7 +47,7 @@ SavePaletteCommand::SavePaletteCommand()
void SavePaletteCommand::onLoadParams(const Params& params)
{
m_preset = params.get("preset");
m_save_as_preset = params.get("save_as_preset") == "true";
m_saveAsPreset = (params.get("saveAsPreset") == "true");
}
void SavePaletteCommand::onExecute(Context* context)
@ -61,7 +61,7 @@ void SavePaletteCommand::onExecute(Context* context)
else {
base::paths exts = get_writable_palette_extensions();
base::paths selFilename;
std::string initialPath = m_save_as_preset ? get_preset_palettes_dir() : "";
std::string initialPath = (m_saveAsPreset ? get_preset_palettes_dir(): "");
if (!app::show_file_selector(
"Save Palette", initialPath, exts,
FileSelectorType::Save, selFilename))
@ -78,7 +78,7 @@ void SavePaletteCommand::onExecute(Context* context)
if (!context->activeDocument())
set_current_palette(palette, false);
}
if (m_save_as_preset) {
if (m_saveAsPreset) {
App::instance()->PalettePresetsChange();
}
}