| 45 | const QString WaitingDialog::TIPS_FINISHED = "Finished!"; |
| 46 | |
| 47 | WaitingDialog::WaitingDialog(QWidget *parent, SigSession *session, int key) : |
| 48 | DSDialog(parent), |
| 49 | _key(key), |
| 50 | _session(session), |
| 51 | _button_box(QDialogButtonBox::Abort, |
| 52 | Qt::Horizontal, this) |
| 53 | { |
| 54 | _device_agent = _session->get_device(); |
| 55 | |
| 56 | this->setFixedSize((GIF_WIDTH+2*TIP_WIDTH)*1.2, (GIF_HEIGHT+2*TIP_HEIGHT)*4); |
| 57 | this->setWindowOpacity(0.7); |
| 58 | |
| 59 | QFont font; |
| 60 | font.setPointSizeF(AppConfig::Instance().appOptions.fontSize); |
| 61 | font.setBold(true); |
| 62 | |
| 63 | QLabel *warning_tips = new QLabel(this); |
| 64 | warning_tips->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_DONT_CONNECT_PROBES), "Don't connect any probes!")); |
| 65 | warning_tips->setFont(font); |
| 66 | warning_tips->setAlignment(Qt::AlignCenter); |
| 67 | |
| 68 | QString iconPath = GetIconPath(); |
| 69 | label = new QLabel(this); |
| 70 | movie = new QMovie(iconPath+"/wait.gif"); |
| 71 | label->setMovie(movie); |
| 72 | label->setAlignment(Qt::AlignCenter); |
| 73 | |
| 74 | tips = new QLabel(this); |
| 75 | tips->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_WAITING), "Waiting")); |
| 76 | tips->setFont(font); |
| 77 | tips->setAlignment(Qt::AlignCenter); |
| 78 | |
| 79 | index = 0; |
| 80 | timer = new QTimer(); |
| 81 | connect(timer, SIGNAL(timeout()), this, SLOT(changeText())); |
| 82 | connect(&_button_box, SIGNAL(accepted()), this, SLOT(accept())); |
| 83 | connect(&_button_box, SIGNAL(rejected()), this, SLOT(reject())); |
| 84 | connect(_session->device_event_object(), SIGNAL(device_updated()), this, SLOT(stop())); |
| 85 | |
| 86 | QVBoxLayout *mlayout = new QVBoxLayout(); |
| 87 | mlayout->addWidget(warning_tips, Qt::AlignHCenter); |
| 88 | mlayout->addWidget(label, Qt::AlignHCenter); |
| 89 | mlayout->addWidget(tips, Qt::AlignHCenter); |
| 90 | mlayout->addWidget(&_button_box); |
| 91 | |
| 92 | layout()->addLayout(mlayout); |
| 93 | setTitle(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_AUTO_CALIBRATION), "Auto Calibration")); |
| 94 | } |
| 95 | |
| 96 | WaitingDialog::~WaitingDialog() |
| 97 | { |
nothing calls this directly
no test coverage detected