LibGUI+Userland: Make Dialog::ExecResult an enum class

This commit is contained in:
Sam Atkins 2022-05-13 13:10:27 +01:00 committed by Linus Groh
parent 1f82beded3
commit cdffe556c8
Notes: sideshowbarker 2024-07-17 10:55:07 +09:00
90 changed files with 232 additions and 232 deletions

View file

@ -502,7 +502,7 @@ NonnullRefPtr<GUI::Action> HackStudioWidget::create_new_file_action(String const
{
return GUI::Action::create(label, Gfx::Bitmap::try_load_from_file(icon).release_value_but_fixme_should_propagate_errors(), [this, extension](const GUI::Action&) {
String filename;
if (GUI::InputBox::show(window(), filename, "Enter name of new file:", "Add new file to project") != GUI::InputBox::ExecOK)
if (GUI::InputBox::show(window(), filename, "Enter name of new file:", "Add new file to project") != GUI::InputBox::ExecResult::OK)
return;
if (!extension.is_empty() && !filename.ends_with(String::formatted(".{}", extension))) {
@ -543,7 +543,7 @@ NonnullRefPtr<GUI::Action> HackStudioWidget::create_new_directory_action()
{
return GUI::Action::create("&Directory...", { Mod_Ctrl | Mod_Shift, Key_N }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/mkdir.png").release_value_but_fixme_should_propagate_errors(), [this](const GUI::Action&) {
String directory_name;
if (GUI::InputBox::show(window(), directory_name, "Enter name of new directory:", "Add new folder to project") != GUI::InputBox::ExecOK)
if (GUI::InputBox::show(window(), directory_name, "Enter name of new directory:", "Add new folder to project") != GUI::InputBox::ExecResult::OK)
return;
auto path_to_selected = selected_file_paths();
@ -615,7 +615,7 @@ NonnullRefPtr<GUI::Action> HackStudioWidget::create_delete_action()
"Confirm deletion",
GUI::MessageBox::Type::Warning,
GUI::MessageBox::InputType::OKCancel);
if (result == GUI::MessageBox::ExecCancel)
if (result == GUI::MessageBox::ExecResult::Cancel)
return;
for (auto& file : files) {
@ -657,7 +657,7 @@ NonnullRefPtr<GUI::Action> HackStudioWidget::create_new_project_action()
dialog->set_icon(window()->icon());
auto result = dialog->exec();
if (result == GUI::Dialog::ExecResult::ExecOK && dialog->created_project_path().has_value())
if (result == GUI::Dialog::ExecResult::OK && dialog->created_project_path().has_value())
open_project(dialog->created_project_path().value());
});
}
@ -1436,7 +1436,7 @@ void HackStudioWidget::create_view_menu(GUI::Window& window)
m_editor_font_action = GUI::Action::create("Editor &Font...", Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-font-editor.png").release_value_but_fixme_should_propagate_errors(),
[&](auto&) {
auto picker = GUI::FontPicker::construct(&window, m_editor_font, false);
if (picker->exec() == GUI::Dialog::ExecOK) {
if (picker->exec() == GUI::Dialog::ExecResult::OK) {
change_editor_font(picker->font());
}
});
@ -1550,10 +1550,10 @@ HackStudioWidget::ContinueDecision HackStudioWidget::warn_unsaved_changes(String
auto result = GUI::MessageBox::show(window(), prompt, "Unsaved changes", GUI::MessageBox::Type::Warning, GUI::MessageBox::InputType::YesNoCancel);
if (result == GUI::MessageBox::ExecCancel)
if (result == GUI::MessageBox::ExecResult::Cancel)
return ContinueDecision::No;
if (result == GUI::MessageBox::ExecYes) {
if (result == GUI::MessageBox::ExecResult::Yes) {
for (auto& editor_wrapper : m_all_editor_wrappers) {
if (editor_wrapper.editor().document().is_modified()) {
editor_wrapper.save();