2023-09-16 14:09:21 +02:00
|
|
|
#ifndef LOGDOCTOR__DIALOGS__MESSAGE_DIALOG_H
|
|
|
|
#define LOGDOCTOR__DIALOGS__MESSAGE_DIALOG_H
|
|
|
|
|
2022-10-05 21:19:39 +02:00
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
|
2022-10-23 16:41:36 +02:00
|
|
|
|
2023-09-09 19:40:12 +02:00
|
|
|
enum class MsgType {
|
|
|
|
Info = 0,
|
|
|
|
Warning = 1,
|
2023-09-10 16:22:27 +02:00
|
|
|
Error = 2
|
2023-09-09 19:40:12 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2022-10-05 21:19:39 +02:00
|
|
|
namespace Ui {
|
|
|
|
class DialogMsg;
|
|
|
|
}
|
|
|
|
|
2023-09-16 14:09:21 +02:00
|
|
|
|
2022-11-19 00:07:56 +01:00
|
|
|
//! DialogMsg
|
|
|
|
/*!
|
|
|
|
A dialog message to provide informations to the user
|
|
|
|
*/
|
2024-01-21 16:35:00 +01:00
|
|
|
class DialogMsg final : public QDialog
|
2022-10-05 21:19:39 +02:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2022-11-19 00:07:56 +01:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\param title The title
|
|
|
|
\param text The message
|
|
|
|
\param additional Additional informations, usually an error message
|
|
|
|
\param parent The parent Widget
|
|
|
|
*/
|
2023-09-09 19:40:12 +02:00
|
|
|
explicit DialogMsg( const QString& title, const QString& text, const QString& additional, const MsgType type, QWidget *parent=nullptr );
|
2024-02-12 20:36:43 +01:00
|
|
|
Q_DISABLE_COPY_MOVE(DialogMsg)
|
2022-10-05 21:19:39 +02:00
|
|
|
|
|
|
|
private slots:
|
2022-11-19 00:07:56 +01:00
|
|
|
|
|
|
|
//! Shows the additional informations
|
2022-10-05 21:19:39 +02:00
|
|
|
void on_button_ShowAdditional_clicked();
|
|
|
|
|
2022-11-19 00:07:56 +01:00
|
|
|
//! Called when the OK button gets clicked
|
2022-10-05 21:19:39 +02:00
|
|
|
void on_button_Ok_clicked();
|
|
|
|
|
|
|
|
private:
|
2023-08-27 18:49:34 +02:00
|
|
|
QSharedPointer<Ui::DialogMsg> ui;
|
2022-10-05 21:19:39 +02:00
|
|
|
|
2023-04-11 23:14:24 +02:00
|
|
|
bool additional_shown{ false };
|
2022-10-05 21:19:39 +02:00
|
|
|
|
2023-04-11 23:14:24 +02:00
|
|
|
int initial_height { 0 };
|
|
|
|
int additional_height { 0 };
|
2022-10-05 21:19:39 +02:00
|
|
|
};
|
|
|
|
|
2023-09-16 14:09:21 +02:00
|
|
|
|
|
|
|
#endif // LOGDOCTOR__DIALOGS__MESSAGE_DIALOG_H
|