| 2934 | { |
| 2935 | public: |
| 2936 | RDProgressDialog(const QString &labelText, QWidget *parent) |
| 2937 | // we add 1 so that the progress value never hits maximum until we are actually finished |
| 2938 | : QProgressDialog(labelText, QString(), 0, maxProgress + 1, parent), m_Label(this) |
| 2939 | { |
| 2940 | setWindowTitle(tr("Please Wait")); |
| 2941 | setWindowFlags(Qt::CustomizeWindowHint | Qt::Dialog | Qt::WindowTitleHint); |
| 2942 | setWindowIcon(QIcon()); |
| 2943 | setMinimumSize(QSize(250, 0)); |
| 2944 | setMaximumSize(QSize(500, 200)); |
| 2945 | setCancelButton(NULL); |
| 2946 | setMinimumDuration(0); |
| 2947 | setWindowModality(Qt::ApplicationModal); |
| 2948 | setValue(0); |
| 2949 | |
| 2950 | m_Label.setText(labelText); |
| 2951 | m_Label.setAlignment(Qt::AlignCenter); |
| 2952 | m_Label.setWordWrap(true); |
| 2953 | |
| 2954 | setLabel(&m_Label); |
| 2955 | } |
| 2956 | |
| 2957 | void enableCancel() { setCancelButtonText(tr("Cancel")); } |
| 2958 | void setPercentage(float percent) { setValue(int(maxProgress * percent)); } |