Move showMessage to RoomManager and merge warning in. A new Message type enum is created aligned with the Kirgami.MessageType used by Kirigami.Banner to avoid needing to translate from 2 enums. showMessage is also sent as a signal from NeoChatRoom (and via the room from ActionsModel), this removes the need for them to have a dependency on Controller (and RoomManager). While not necessarily the cause of Windows crashes the spaghetti dependencies of RoomManager and Controller throughout the code base has made debugging that harder so this aims to simplify that as well.
32 lines
781 B
C++
32 lines
781 B
C++
// SPDX-FileCopyrightText: 2024 James Graham <james.h.graham@protonmail.com>
|
|
// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
|
|
|
#pragma once
|
|
|
|
#include <QObject>
|
|
#include <QQmlEngine>
|
|
|
|
/**
|
|
* @class MessageType
|
|
*
|
|
* This class is designed to define the MessageType enumeration.
|
|
*/
|
|
class MessageType : public QObject
|
|
{
|
|
Q_OBJECT
|
|
QML_ELEMENT
|
|
QML_UNCREATABLE("")
|
|
|
|
public:
|
|
/**
|
|
* @brief The types of messages that can be shown.
|
|
*/
|
|
enum Type {
|
|
Information = 0, /**< Info message, typically highlight color. */
|
|
Positive, /**< Positive message, typically green. */
|
|
Warning, /**< Warning message, typically amber. */
|
|
Error, /**< Error message, typically red. */
|
|
};
|
|
Q_ENUM(Type);
|
|
};
|