#pragma once

#include <QObject>
#include <QPointer>
#include <QVector>
#include "../MessageDialog/message-dialog.h"

class DialogManager : public QObject {
    Q_OBJECT
public:
    static DialogManager& instance();

    void showError(const QString& title, const QString& message, QWidget* parent = nullptr);
    void showInfo(const QString& title, const QString& message, QWidget* parent = nullptr);

    bool hasActiveDialog() const;

private:
    DialogManager() = default;
    Q_DISABLE_COPY(DialogManager)

    void show(MessageDialog::Type type, const QString& title, const QString& message, QWidget* parent, bool applicationModal);

    QPointer<MessageDialog> m_activeDialog;
    QVector<QPointer<QWidget>> m_disabledDialogs; // track disabled dialogs to re-enable
};
