From 4858f1d4049d514cc99792c7ff13518dfe95398c Mon Sep 17 00:00:00 2001 From: Osmium Sorcerer Date: Sun, 22 Mar 2026 17:59:37 +0000 Subject: Move image plugin status to "About" page Remove the error dialog that pops up if an image format is missing. Check AVIF, WebP, and APNG support, and report their status. As it stands, WebP should be supported by Qt itself, and AVIF has yet to be added. The rest (like PNG and JPEG) are on by default. --- src/lobby.cpp | 10 ++++++++-- src/main.cpp | 14 -------------- 2 files changed, 8 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/lobby.cpp b/src/lobby.cpp index 1acad6f..a283d4e 100644 --- a/src/lobby.cpp +++ b/src/lobby.cpp @@ -270,6 +270,8 @@ void Lobby::on_remove_from_fav_released() void Lobby::on_about_clicked() { + const bool hasAvif = QImageReader::supportedImageFormats().contains("avif"); + const bool hasWebp = QImageReader::supportedImageFormats().contains("webp"); const bool hasApng = QImageReader::supportedImageFormats().contains("apng"); QString msg = tr("

Attorney Online %1

" "The courtroom drama simulator." @@ -306,10 +308,14 @@ void Lobby::on_about_clicked() "licenses apply. All other assets are the property of their " "respective owners." "

Running on Qt version %2 with the miniaudio audio engine.
" - "APNG plugin loaded: %3" - "

Built on %4") + "

AVIF supported: %3
" + "WebP supported: %4
" + "APNG supported: %5" + "

Built on %6") .arg(ao_app->get_version_string()) .arg(QLatin1String(QT_VERSION_STR)) + .arg(hasAvif ? tr("Yes") : tr("No")) + .arg(hasWebp ? tr("Yes") : tr("No")) .arg(hasApng ? tr("Yes") : tr("No")) .arg(QLatin1String(__DATE__)); QMessageBox::about(this, tr("About"), msg); diff --git a/src/main.cpp b/src/main.cpp index 0bc4e80..4141fc0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -54,20 +54,6 @@ int main(int argc, char *argv[]) } } - QStringList expected_formats{"webp", "apng", "gif"}; - for (const QByteArray &i_format : QImageReader::supportedImageFormats()) - { - if (expected_formats.contains(i_format, Qt::CaseInsensitive)) - { - expected_formats.removeAll(i_format.toLower()); - } - } - - if (!expected_formats.isEmpty()) - { - call_error("Missing image formats: " + expected_formats.join(", ") + ".

Please make sure you have installed the application properly."); - } - QString p_language = Options::getInstance().language(); if (p_language.trimmed().isEmpty()) { -- cgit