LogDoctor/logdoctor/modules/dialogs/message_dialog.h

58 lines
1.1 KiB
C
Raw Normal View History

#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
enum class MsgType {
Info = 0,
Warning = 1,
Error = 2
};
2022-10-05 21:19:39 +02:00
namespace Ui {
class DialogMsg;
}
//! DialogMsg
/*!
A dialog message to provide informations to the user
*/
class DialogMsg final : public QDialog
2022-10-05 21:19:39 +02:00
{
Q_OBJECT
public:
/*!
\param title The title
\param text The message
\param additional Additional informations, usually an error message
\param parent The parent Widget
*/
explicit DialogMsg( const QString& title, const QString& text, const QString& additional, const MsgType type, QWidget *parent=nullptr );
Q_DISABLE_COPY_MOVE(DialogMsg)
2022-10-05 21:19:39 +02:00
private slots:
//! Shows the additional informations
2022-10-05 21:19:39 +02:00
void on_button_ShowAdditional_clicked();
//! Called when the OK button gets clicked
2022-10-05 21:19:39 +02:00
void on_button_Ok_clicked();
private:
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
};
#endif // LOGDOCTOR__DIALOGS__MESSAGE_DIALOG_H