2022-10-01 23:10:44 +08:00
# ifndef INFORMATIONBOX_H
# define INFORMATIONBOX_H
# include <QMessageBox>
class InformationBox : public QMessageBox
{
Q_OBJECT
public :
2022-11-14 01:44:19 +08:00
static void ShowMessage ( QString title , QString message , QString messageID = QString ( ) , bool block = false , QWidget * parent = nullptr ) ;
static void ShowMessageBlocking ( QString title , QString message , QString messageID = QString ( ) , QWidget * parent = nullptr ) ;
static void ShowError ( QString title , QString message , QWidget * parent = nullptr ) ;
2022-10-01 23:10:44 +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
2022-11-14 01:44:19 +08:00
static bool AskQuestion ( QString title , QString question , bool defaultAnswer , QString messageID = QString ( ) , QWidget * parent = nullptr ) ;
2022-10-01 23:10:44 +08:00
static void setGUI ( bool enable ) ;
private :
InformationBox ( QString title , QString message , QMessageBox : : Icon icon , unsigned int hash , QWidget * parent ) ;
~ InformationBox ( ) ;
static QString hashToSettingsKey ( unsigned int hash ) ;
unsigned int hash ;
static bool has_gui ;
} ;
# endif // INFORMATIONBOX_H