mirror of
https://github.com/RGBCube/serenity
synced 2025-07-10 04:07:35 +00:00
QuickShow: Use new format functions.
This commit is contained in:
parent
0b29c5e41d
commit
97660ad46c
2 changed files with 7 additions and 7 deletions
|
@ -98,14 +98,14 @@ void QSWidget::navigate(Directions direction)
|
|||
size_t index = current_index.value();
|
||||
if (direction == Directions::Back) {
|
||||
if (index == 0) {
|
||||
GUI::MessageBox::show(window(), String::format("This is the first file.", index), "Cannot open image", GUI::MessageBox::Type::Error);
|
||||
GUI::MessageBox::show(window(), "This is the first file.", "Cannot open image", GUI::MessageBox::Type::Error);
|
||||
return;
|
||||
}
|
||||
|
||||
index--;
|
||||
} else if (direction == Directions::Forward) {
|
||||
if (index == m_files_in_same_dir.size() - 1) {
|
||||
GUI::MessageBox::show(window(), String::format("This is the last file.", index), "Cannot open image", GUI::MessageBox::Type::Error);
|
||||
GUI::MessageBox::show(window(), "This is the last file.", "Cannot open image", GUI::MessageBox::Type::Error);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -249,7 +249,7 @@ void QSWidget::load_from_file(const String& path)
|
|||
{
|
||||
auto bitmap = Gfx::Bitmap::load_from_file(path);
|
||||
if (!bitmap) {
|
||||
GUI::MessageBox::show(window(), String::format("Failed to open %s", path.characters()), "Cannot open image", GUI::MessageBox::Type::Error);
|
||||
GUI::MessageBox::show(window(), String::formatted("Failed to open {}", path), "Cannot open image", GUI::MessageBox::Type::Error);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue