| 42 | namespace dialogs { |
| 43 | |
| 44 | StoreProgress::StoreProgress(SigSession *session, QWidget *parent) : |
| 45 | DSDialog(parent) |
| 46 | { |
| 47 | _fileLab = NULL; |
| 48 | _ckOrigin = NULL; |
| 49 | |
| 50 | _store_session = new StoreSession(session); |
| 51 | |
| 52 | this->setMinimumSize(550, 220); |
| 53 | this->setModal(true); |
| 54 | |
| 55 | _progress.setValue(0); |
| 56 | _progress.setMaximum(100); |
| 57 | |
| 58 | _isExport = false; |
| 59 | _is_done = false; |
| 60 | _start_cursor = NULL; |
| 61 | _end_cursor = NULL; |
| 62 | _view = NULL; |
| 63 | |
| 64 | QGridLayout *grid = new QGridLayout(); |
| 65 | _grid = grid; |
| 66 | grid->setContentsMargins(10, 20, 10, 10); |
| 67 | grid->setVerticalSpacing(25); |
| 68 | |
| 69 | grid->setColumnStretch(0, 2); |
| 70 | grid->setColumnStretch(1, 2); |
| 71 | grid->setColumnStretch(2, 1); |
| 72 | grid->setColumnStretch(3, 1); |
| 73 | |
| 74 | _fileLab = new QTextEdit(); |
| 75 | _fileLab->setReadOnly(true); |
| 76 | _fileLab->setObjectName("PathLine"); |
| 77 | _fileLab->setMaximumHeight(50); |
| 78 | |
| 79 | _openButton = new QPushButton(this); |
| 80 | _openButton->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_PATH_NAME), "path")); |
| 81 | |
| 82 | _space = new QWidget(this); |
| 83 | _space->setMinimumHeight(80); |
| 84 | _space->setVisible(false); |
| 85 | |
| 86 | grid->addWidget(&_progress, 0, 0, 1, 4); |
| 87 | grid->addWidget(_fileLab, 1, 0, 1, 3); |
| 88 | grid->addWidget(_openButton, 1, 3, 1, 1); |
| 89 | grid->addWidget(_space); |
| 90 | |
| 91 | QDialogButtonBox *_button_box = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, |
| 92 | Qt::Horizontal, this); |
| 93 | grid->addWidget(_button_box, 2, 2, 1, 2, Qt::AlignRight | Qt::AlignBottom); |
| 94 | |
| 95 | layout()->addLayout(grid); |
| 96 | |
| 97 | connect(_button_box, SIGNAL(rejected()), this, SLOT(reject())); |
| 98 | connect(_button_box, SIGNAL(accepted()), this, SLOT(accept())); |
| 99 | |
| 100 | connect(_store_session, SIGNAL(progress_updated()), |
| 101 | this, SLOT(on_progress_updated()), Qt::QueuedConnection); |