| 23 | #include <QFileInfo> |
| 24 | |
| 25 | ImportProgressDialog::ImportProgressDialog(PgnImporter* pgnImporter, |
| 26 | QWidget* parent) |
| 27 | : QDialog(parent), |
| 28 | m_lastUpdateSecs(0), |
| 29 | m_importError(false), |
| 30 | ui(new Ui::ImportProgressDialog) |
| 31 | { |
| 32 | ui->setupUi(this); |
| 33 | |
| 34 | setAttribute(Qt::WA_DeleteOnClose, true); |
| 35 | |
| 36 | QFileInfo info(pgnImporter->fileName()); |
| 37 | |
| 38 | ui->m_fileNameLabel->setText( |
| 39 | QString(tr("Importing \"%1\"").arg(info.fileName()))); |
| 40 | |
| 41 | m_totalFileSize = info.size(); |
| 42 | |
| 43 | connect(ui->m_buttonBox, SIGNAL(rejected()), pgnImporter, |
| 44 | SLOT(cancel())); |
| 45 | connect(pgnImporter, SIGNAL(finished()), this, |
| 46 | SLOT(onImporterFinished())); |
| 47 | connect(pgnImporter, SIGNAL(error(int)), this, |
| 48 | SLOT(onImportError(int))); |
| 49 | connect(pgnImporter, SIGNAL(databaseReadStatus(const QTime&, int, qint64)), |
| 50 | this, SLOT(updateImportStatus(const QTime&, int, qint64))); |
| 51 | } |
| 52 | |
| 53 | ImportProgressDialog::~ImportProgressDialog() |
| 54 | { |