mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-28 23:39:02 +00:00
LibGUI: Add input types to GMessageBox.
Currently the two available input types are: - GMessageBox::InputType::OK (default) - GMessageBox::InputType::OKCancel Based on your choice, GMessageBox::exec() will return ExecOK or ExecCancel.
This commit is contained in:
parent
62335c5f0c
commit
a17fbd98e7
Notes:
sideshowbarker
2024-07-19 13:13:55 +09:00
Author: https://github.com/awesomekling
Commit: a17fbd98e7
8 changed files with 63 additions and 26 deletions
|
@ -40,7 +40,7 @@ Optional<String> GFilePicker::get_save_filepath()
|
|||
|
||||
if (GFilePicker::file_exists(file_path)) {
|
||||
//TODO: Add Yes, No Messagebox to give the user a proper option
|
||||
GMessageBox::show("File already exists: Overwrite?\n", "Warning", GMessageBox::Type::Warning, &picker);
|
||||
GMessageBox::show("File already exists: Overwrite?\n", "Warning", GMessageBox::Type::Warning, GMessageBox::InputType::OK, &picker);
|
||||
return file_path;
|
||||
}
|
||||
|
||||
|
@ -110,7 +110,7 @@ GFilePicker::GFilePicker(Mode mode, const StringView& path, CObject* parent)
|
|||
.string();
|
||||
int rc = mkdir(new_dir_path.characters(), 0777);
|
||||
if (rc < 0) {
|
||||
GMessageBox::show(String::format("mkdir(\"%s\") failed: %s", new_dir_path.characters(), strerror(errno)), "Error", GMessageBox::Type::Error, this);
|
||||
GMessageBox::show(String::format("mkdir(\"%s\") failed: %s", new_dir_path.characters(), strerror(errno)), "Error", GMessageBox::Type::Error, GMessageBox::InputType::OK, this);
|
||||
} else {
|
||||
m_model->update();
|
||||
}
|
||||
|
@ -244,4 +244,4 @@ bool GFilePicker::file_exists(const StringView& path)
|
|||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue