mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 18:20:43 +09:00
HexEditor: Created has_selection() method.
Created has_selection() method and fixed a few small issues.
This commit is contained in:
parent
c77fe5161c
commit
98e556fee9
Notes:
sideshowbarker
2024-07-19 11:31:36 +09:00
Author: https://github.com/xeons
Commit: 98e556fee9
Pull-request: https://github.com/SerenityOS/serenity/pull/689
Reviewed-by: https://github.com/awesomekling
3 changed files with 7 additions and 6 deletions
|
@ -56,13 +56,13 @@ HexEditorWidget::HexEditorWidget()
|
|||
if (input_box->exec() == GInputBox::ExecOK && !input_box->text_value().is_empty()) {
|
||||
auto valid = false;
|
||||
auto file_size = input_box->text_value().to_int(valid);
|
||||
if (valid) {
|
||||
if (valid && file_size > 0) {
|
||||
m_document_dirty = false;
|
||||
m_editor->set_buffer(ByteBuffer::create_zeroed(file_size));
|
||||
set_path(FileSystemPath());
|
||||
update_title();
|
||||
} else {
|
||||
GMessageBox::show(String::format("Invalid file size entered.", strerror(errno)), "Error", GMessageBox::Type::Error, GMessageBox::InputType::OK, window());
|
||||
GMessageBox::show("Invalid file size entered.", "Error", GMessageBox::Type::Error, GMessageBox::InputType::OK, window());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue