void FormatWidget::loadFormat() { FormatsDialog fd(this->_hexedit->data()->length(), (this->_hexedit->selectionLength() ? this->_hexedit->cursorPos() : 0), this->topLevelWidget()); int res = fd.exec(); if(res == FormatsDialog::Accepted) { this->_formatview = nullptr; this->_logwidget->clear(); this->_formatdefinition = fd.selectedFormat(); Logger* logger = new Logger(this->_logwidget); bool validated = this->_formatdefinition->callValidate(this->_hexedit->data(), logger, fd.offset()); if(!validated) { emit parsingFailed(); logger->deleteLater(); return; } this->_worker = new FormatWorker(this->_formatdefinition, logger, this->_hexedit->data(), fd.offset(), this); connect(this->_worker, SIGNAL(started()), this, SIGNAL(workStarted())); connect(this->_worker, SIGNAL(started()), this, SIGNAL(parsingStarted())); connect(this->_worker, SIGNAL(finished()), this, SIGNAL(workFinished())); connect(this->_worker, SIGNAL(finished()), this, SIGNAL(parsingCompleted())); connect(this->_worker, SIGNAL(parsingFailed()), this, SIGNAL(parsingFailed())); connect(this->_worker, SIGNAL(parsingCompleted()), this, SLOT(onParseCompleted())); this->_worker->start(); } }
void UpdateWindow::startUpdate() { // try to download new update mUpdateDownloader = new UpdateDownloader(this); connect(mUpdateDownloader, SIGNAL(downloadProgress(qint64, qint64)), this, SLOT(workProgress(qint64, qint64))); connect(mUpdateDownloader, SIGNAL(started()), this, SLOT(workStarted())); connect(mUpdateDownloader, SIGNAL(failed()), this, SLOT(workFailed())); connect(mUpdateDownloader, SIGNAL(finished()), this, SLOT(workFinished())); mLabel->setText(tr("Download updates list")); mUpdateDownloader->doDownload(UPDATE_LIST, "_updates.xml"); }
ChartWidget::ChartWidget(QWidget *parent): WorkerTab(parent), ui(new Ui::ChartWidget), _histogrammodel(nullptr), _hexeditdata(nullptr) { this->_xycharticon = QIcon(":/misc_icons/res/xychart.png"); this->_histogramicon = QIcon(":/misc_icons/res/histogram.png"); ui->setupUi(this); ui->splitter->setStretchFactor(0, 1); ui->tbSwitchChart->setIcon(this->_xycharticon); connect(&this->_worker, SIGNAL(started()), this, SIGNAL(workStarted())); connect(&this->_worker, SIGNAL(occurrencesListCompleted()), this, SLOT(onOccurrencesListCompleted())); connect(&this->_worker, SIGNAL(dataEntropyCompleted()), this, SLOT(onDataEntropyCompleted())); connect(&this->_worker, SIGNAL(finished()), this, SIGNAL(workFinished())); }
void UpdateWindow::readUpdate() { mCurrentWork = WT_READCONTENT; mLabel->setText(tr("Reading update...")); workStarted(); // TODO: compare checksum // unpack UpdateExtractor extractor; if (!extractor.extract(UPDATE_FILE_PATH, "_update_files")) workFailed(); workFinished(); }