478 } |
478 } |
479 |
479 |
480 // ============================================================================= |
480 // ============================================================================= |
481 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
481 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
482 // ============================================================================= |
482 // ============================================================================= |
483 OpenFileDialog::OpenFileDialog (QWidget* parent, Qt::WindowFlags f) : QDialog (parent, f) { |
483 OpenProgressDialog::OpenProgressDialog (QWidget* parent, Qt::WindowFlags f) : QDialog (parent, f) { |
484 progressBar = new QProgressBar; |
484 progressBar = new QProgressBar; |
485 progressText = new QLabel; |
485 progressText = new QLabel; |
486 setNumLines (0); |
486 setNumLines (0); |
487 m_progress = 0; |
487 m_progress = 0; |
488 |
488 |
494 layout->addWidget (progressText); |
494 layout->addWidget (progressText); |
495 layout->addWidget (progressBar); |
495 layout->addWidget (progressBar); |
496 layout->addWidget (dbb_buttons); |
496 layout->addWidget (dbb_buttons); |
497 } |
497 } |
498 |
498 |
499 void OpenFileDialog::callback_setNumLines () { |
499 void OpenProgressDialog::callback_setNumLines () { |
500 progressBar->setRange (0, numLines ()); |
500 progressBar->setRange (0, numLines ()); |
501 updateValues (); |
501 updateValues (); |
502 } |
502 } |
503 |
503 |
504 void OpenFileDialog::updateValues () { |
504 void OpenProgressDialog::updateValues () { |
505 progressBar->setValue (progress ()); |
505 progressBar->setValue (progress ()); |
506 progressText->setText (fmt ("%s: %lu/%lu lines parsed", fileName ().c (), progress (), numLines ())); |
506 progressText->setText (fmt ("%lu/%lu lines parsed", progress (), numLines ())); |
507 } |
507 } |
508 |
508 |
509 void OpenFileDialog::updateProgress (int progress) { |
509 void OpenProgressDialog::updateProgress (int progress) { |
510 m_progress = progress; |
510 m_progress = progress; |
511 updateValues (); |
511 updateValues (); |
512 } |
512 } |