From 8f60ea4470b0a160ffb6d071723b3013c4a3d624 Mon Sep 17 00:00:00 2001 From: thankyouverycool <66646555+thankyouverycool@users.noreply.github.com> Date: Sun, 16 Jan 2022 09:36:43 -0500 Subject: [PATCH] FontEditor: Disambiguate save function from save-as action --- Userland/Applications/FontEditor/FontEditor.cpp | 7 ++++--- Userland/Applications/FontEditor/FontEditor.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Userland/Applications/FontEditor/FontEditor.cpp b/Userland/Applications/FontEditor/FontEditor.cpp index f0845e6382..291ee4f0f8 100644 --- a/Userland/Applications/FontEditor/FontEditor.cpp +++ b/Userland/Applications/FontEditor/FontEditor.cpp @@ -169,14 +169,14 @@ FontEditorWidget::FontEditorWidget() if (m_path.is_empty()) m_save_as_action->activate(); else - save_as(m_path); + save_file(m_path); }); m_save_as_action = GUI::CommonActions::make_save_as_action([&](auto&) { LexicalPath lexical_path(m_path.is_empty() ? "Untitled.font" : m_path); Optional save_path = GUI::FilePicker::get_save_filepath(window(), lexical_path.title(), lexical_path.extension()); if (!save_path.has_value()) return; - save_as(save_path.value()); + save_file(save_path.value()); }); m_cut_action = GUI::CommonActions::make_cut_action([&](auto&) { cut_selected_glyphs(); @@ -558,7 +558,7 @@ void FontEditorWidget::initialize_menubar(GUI::Window& window) help_menu.add_action(GUI::CommonActions::make_about_action("Font Editor", GUI::Icon::default_icon("app-font-editor"), &window)); } -bool FontEditorWidget::save_as(String const& path) +bool FontEditorWidget::save_file(String const& path) { auto saved_font = m_edited_font->masked_character_set(); auto ret_val = saved_font->write_to_file(path); @@ -757,6 +757,7 @@ void FontEditorWidget::set_scale_and_save(i32 scale) Config::write_i32("FontEditor", "GlyphEditor", "Scale", scale); did_resize_glyph_editor(); } + void FontEditorWidget::copy_selected_glyphs() { ByteBuffer buffer; diff --git a/Userland/Applications/FontEditor/FontEditor.h b/Userland/Applications/FontEditor/FontEditor.h index 8b6af595b8..94caae424a 100644 --- a/Userland/Applications/FontEditor/FontEditor.h +++ b/Userland/Applications/FontEditor/FontEditor.h @@ -24,7 +24,7 @@ public: virtual ~FontEditorWidget() override; bool open_file(String const&); - bool save_as(String const&); + bool save_file(String const&); bool request_close(); void update_title();