421 objs.push_back (new LDEmpty); |
422 objs.push_back (new LDEmpty); |
422 |
423 |
423 g_win->fullRefresh (); |
424 g_win->fullRefresh (); |
424 } |
425 } |
425 |
426 |
|
427 // ============================================================================= |
|
428 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
|
429 // ============================================================================= |
426 RotationPointDialog::RotationPointDialog (QWidget* parent, Qt::WindowFlags f) : QDialog (parent, f) { |
430 RotationPointDialog::RotationPointDialog (QWidget* parent, Qt::WindowFlags f) : QDialog (parent, f) { |
427 rb_rotpoint = new RadioBox ("Rotation Point", { "Object center", "Custom" }, 0, Qt::Vertical, this); |
431 rb_rotpoint = new RadioBox ("Rotation Point", { "Object center", "Custom" }, 0, Qt::Vertical, this); |
428 connect (rb_rotpoint, SIGNAL (valueChanged (int)), this, SLOT (radioBoxChanged ())); |
432 connect (rb_rotpoint, SIGNAL (valueChanged (int)), this, SLOT (radioBoxChanged ())); |
429 |
433 |
430 gb_customPos = new QGroupBox ("Custom point", this); |
434 gb_customPos = new QGroupBox ("Custom point", this); |
470 } |
474 } |
471 |
475 |
472 void RotationPointDialog::radioBoxChanged () { |
476 void RotationPointDialog::radioBoxChanged () { |
473 setCustom (rb_rotpoint->value ()); |
477 setCustom (rb_rotpoint->value ()); |
474 } |
478 } |
|
479 |
|
480 // ============================================================================= |
|
481 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
|
482 // ============================================================================= |
|
483 OpenFileDialog::OpenFileDialog (QWidget* parent, Qt::WindowFlags f) : QDialog (parent, f) { |
|
484 progressBar = new QProgressBar; |
|
485 progressText = new QLabel; |
|
486 setNumLines (0); |
|
487 m_progress = 0; |
|
488 |
|
489 QDialogButtonBox* dbb_buttons = new QDialogButtonBox; |
|
490 dbb_buttons->addButton (QDialogButtonBox::Cancel); |
|
491 connect (dbb_buttons, SIGNAL (rejected ()), this, SLOT (reject ())); |
|
492 |
|
493 QVBoxLayout* layout = new QVBoxLayout (this); |
|
494 layout->addWidget (progressText); |
|
495 layout->addWidget (progressBar); |
|
496 layout->addWidget (dbb_buttons); |
|
497 } |
|
498 |
|
499 void OpenFileDialog::callback_setNumLines () { |
|
500 progressBar->setRange (0, numLines ()); |
|
501 updateValues (); |
|
502 } |
|
503 |
|
504 void OpenFileDialog::updateValues () { |
|
505 progressBar->setValue (progress ()); |
|
506 progressText->setText (fmt ("%s: %lu/%lu lines parsed", fileName ().c (), progress (), numLines ())); |
|
507 } |
|
508 |
|
509 void OpenFileDialog::updateProgress (int progress) { |
|
510 m_progress = progress; |
|
511 updateValues (); |
|
512 } |