Ubuntu12.04.4_lts
2023-08-01 961efe36f62f7eba688d504ec0cdf3e1daa4dd74
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#ifndef _MESSAGEBOX_H
#define _MESSAGEBOX_H
 
#include <QMessageBox>
#include <QDialogButtonBox>
#include <QGridLayout>
#include <QToolButton>
#include <QLabel>
#include <QPushButton>
#include <QCheckBox>
#include <QHBoxLayout>
#include <QEvent>
#include <QApplication>
#include <QStyle>
#include <QtGui/QMouseEvent>
#include "work_thread.h"
#include "custom.h"
 
class MessageBox : public customDialog
{
    Q_OBJECT
 
public:
     explicit MessageBox(QWidget *parent = 0,
                        QMessageBox::Icon icon = QMessageBox::NoIcon,
                        const QString &title = tr("Tip"),
                        const QString &text = "",
                        QMessageBox::StandardButtons buttons = QMessageBox::Ok,
                        QMessageBox::StandardButton defaultButton = QMessageBox::Cancel,
                        Work_Thread *thread = 0);
    ~MessageBox();
    QAbstractButton *clickedButton() const;
    QMessageBox::StandardButton standardButton(QAbstractButton *button) const;
 
    void setDefaultButton(QPushButton *button);
    void setDefaultButton(QMessageBox::StandardButton button);
    void setText(const QString & str);
    void set_yes_btn_text(bool,QString);
 
protected:
    void changeEvent(QEvent *event);
 
private slots:
    void onButtonClicked(QAbstractButton *button);
    void btn_beep(void);
 
    void UpdateInterface(int interface);
 
private:
    void translateUI();
    void setQlabelMinimumWidth(QLabel *Label, QString &text);
    int execReturnCode(QAbstractButton *button);
    //virtual void mousePressEvent(QMouseEvent *event);
    //virtual void mouseMoveEvent(QMouseEvent *event);
    //virtual void mouseReleaseEvent(QMouseEvent *event);
    //virtual void resizeEvent(QResizeEvent * pe);
 
private:
    QLabel *m_pIconLabel;
    QLabel *m_pLabel;
 
    Work_Thread *work_thread;
 
    QGridLayout *m_pGridLayout;
    QDialogButtonBox *m_pButtonBox;
    QAbstractButton *m_pClickedButton;
    QAbstractButton *m_pDefaultButton;
    QLabel *titleLabel;
    QToolButton *closeButton;
 
    bool        mMoveing;
    QPoint        mMovePosition;
};
 
#endif // MESSAGEBOX_H