2020-11-11 02:16:16 +08:00
# ifndef INFORMATIONBOX_H
# define INFORMATIONBOX_H
# include <QMessageBox>
class InformationBox : public QMessageBox
{
Q_OBJECT
public :
2021-05-24 18:02:31 +08:00
static void ShowMessage ( QString title , QString message , QString messageID = QString ( ) , bool block = false ) ;
static void ShowMessageBlocking ( QString title , QString message , QString messageID = QString ( ) ) ;
2021-05-13 04:05:50 +08:00
static void ShowError ( QString title , QString message ) ;
2020-12-08 03:21:24 +08:00
// Display a dialog with yes/no buttons. Returns true if yes is clicked, false otherwise. If the user has selected to never see this message again, defaultAnswer is returned instead
static bool AskQuestion ( QString title , QString question , bool defaultAnswer , QString messageID = QString ( ) ) ;
2020-11-11 02:16:16 +08:00
private :
2021-05-13 04:05:50 +08:00
InformationBox ( QString title , QString message , QMessageBox : : Icon icon , unsigned int hash , QWidget * parent ) ;
2020-11-11 02:16:16 +08:00
~ InformationBox ( ) ;
static QString hashToSettingsKey ( unsigned int hash ) ;
unsigned int hash ;
} ;
# endif // INFORMATIONBOX_H