From 1f54d2a5697b38c630dc045d4bdf97dfc251a46c Mon Sep 17 00:00:00 2001 From: Arnaud Date: Fri, 16 Jan 2026 11:20:20 +0400 Subject: [PATCH] Add debug dialog --- app/DebugDialog.cpp | 49 +++++++++++++++++++++++++++++++++++++++++++++ app/DebugDialog.h | 8 ++++++++ 2 files changed, 57 insertions(+) create mode 100644 app/DebugDialog.cpp create mode 100644 app/DebugDialog.h diff --git a/app/DebugDialog.cpp b/app/DebugDialog.cpp new file mode 100644 index 0000000..0cc6d71 --- /dev/null +++ b/app/DebugDialog.cpp @@ -0,0 +1,49 @@ +#include "DebugDialog.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +DebugDialog::DebugDialog(QWidget* parent, const QString& json) : QDialog(parent) { + setWindowTitle("Debug Logos Storage UI"); + setFixedSize(300, 220); + + QJsonParseError err; + QJsonDocument doc = QJsonDocument::fromJson(json.toUtf8(), &err); + + if (err.error != QJsonParseError::NoError) { + qWarning() << "JSON parse error:" << err.errorString(); + return; + } + + if (!doc.isObject()) { + qWarning() << "Expected JSON object"; + return; + } + + QJsonObject obj = doc.object(); + QString id = obj.value("id").toString(); + + qDebug() << "DebugDialog: Plugin name from JSON:" << id; + + auto* layout = new QVBoxLayout(this); + + // auto* logo = new QLabel(this); + // logo->setPixmap( + // QPixmap(":/images/assets/logos.png").scaled(128, 128, Qt::KeepAspectRatio, Qt::SmoothTransformation)); + // logo->setAlignment(Qt::AlignCenter); + + // auto* text = new QLabel(this); + // text->setAlignment(Qt::AlignCenter); + // text->setText("Logos Storage UI\nUI version: 1.0.0\nStorage version " + version); + // text->setTextFormat(Qt::PlainText); + + // layout->addWidget(logo); + // layout->addWidget(text); +} diff --git a/app/DebugDialog.h b/app/DebugDialog.h new file mode 100644 index 0000000..6756831 --- /dev/null +++ b/app/DebugDialog.h @@ -0,0 +1,8 @@ +#pragma once +#include + +class DebugDialog : public QDialog { + Q_OBJECT + public: + explicit DebugDialog(QWidget* parent = nullptr, const QString& debug = ""); +}; \ No newline at end of file