mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-19 10:58:51 +00:00
Reorder starting AnalTask and showing Dialog
This commit is contained in:
parent
df61dcdc55
commit
9ecca8fe38
@ -43,7 +43,7 @@ void AsyncTaskDialog::updateLog(const QString &log)
|
|||||||
|
|
||||||
void AsyncTaskDialog::updateProgressTimer()
|
void AsyncTaskDialog::updateProgressTimer()
|
||||||
{
|
{
|
||||||
int secondsElapsed = (task->getTimer().elapsed() + 500) / 1000;
|
int secondsElapsed = (task->getElapsedTime() + 500) / 1000;
|
||||||
int minutesElapsed = secondsElapsed / 60;
|
int minutesElapsed = secondsElapsed / 60;
|
||||||
int hoursElapsed = minutesElapsed / 60;
|
int hoursElapsed = minutesElapsed / 60;
|
||||||
|
|
||||||
@ -57,6 +57,7 @@ void AsyncTaskDialog::updateProgressTimer()
|
|||||||
label += " ";
|
label += " ";
|
||||||
}
|
}
|
||||||
label += tr("%n seconds", "%n second", secondsElapsed % 60);
|
label += tr("%n seconds", "%n second", secondsElapsed % 60);
|
||||||
|
printf("setText %s\n", label.toLocal8Bit().constData());
|
||||||
ui->timeLabel->setText(label);
|
ui->timeLabel->setText(label);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -242,13 +242,13 @@ void OptionsDialog::setupAndStartAnalysis(int level, QList<QString> advanced)
|
|||||||
|
|
||||||
AsyncTask::Ptr analTaskPtr(analTask);
|
AsyncTask::Ptr analTaskPtr(analTask);
|
||||||
|
|
||||||
Core()->getAsyncTaskManager()->start(analTaskPtr);
|
|
||||||
|
|
||||||
AsyncTaskDialog *taskDialog = new AsyncTaskDialog(analTaskPtr);
|
AsyncTaskDialog *taskDialog = new AsyncTaskDialog(analTaskPtr);
|
||||||
taskDialog->setInterruptOnClose(true);
|
taskDialog->setInterruptOnClose(true);
|
||||||
taskDialog->setAttribute(Qt::WA_DeleteOnClose);
|
taskDialog->setAttribute(Qt::WA_DeleteOnClose);
|
||||||
taskDialog->show();
|
taskDialog->show();
|
||||||
|
|
||||||
|
Core()->getAsyncTaskManager()->start(analTaskPtr);
|
||||||
|
|
||||||
done(0);
|
done(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,6 +33,7 @@ public:
|
|||||||
|
|
||||||
const QString &getLog() { return logBuffer; }
|
const QString &getLog() { return logBuffer; }
|
||||||
const QElapsedTimer &getTimer() { return timer; }
|
const QElapsedTimer &getTimer() { return timer; }
|
||||||
|
qint64 getElapsedTime() { return timer.isValid() ? timer.elapsed() : 0; }
|
||||||
|
|
||||||
virtual QString getTitle() { return QString(); }
|
virtual QString getTitle() { return QString(); }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user