src/extprogs.cpp

changeset 302
08bd2c185b25
parent 301
ef51681bb978
child 303
8899806d382d
equal deleted inserted replaced
301:ef51681bb978 302:08bd2c185b25
32 #include "gui.h" 32 #include "gui.h"
33 #include "file.h" 33 #include "file.h"
34 #include "widgets.h" 34 #include "widgets.h"
35 #include "history.h" 35 #include "history.h"
36 #include "labeledwidget.h" 36 #include "labeledwidget.h"
37
38 #include "ui_isecalc.h"
37 #include "ui_edger2.h" 39 #include "ui_edger2.h"
38 40
39 // ============================================================================= 41 // =============================================================================
40 cfg (str, prog_isecalc, ""); 42 cfg (str, prog_isecalc, "");
41 cfg (str, prog_intersector, ""); 43 cfg (str, prog_intersector, "");
584 setlocale (LC_ALL, "C"); 586 setlocale (LC_ALL, "C");
585 587
586 if (!checkProgPath (prog_isecalc, Isecalc)) 588 if (!checkProgPath (prog_isecalc, Isecalc))
587 return; 589 return;
588 590
589 QDialog dlg; 591 Ui::IsecalcUI ui;
590 592 QDialog* dlg = new QDialog;
591 LabeledWidget<QComboBox>* cmb_col1 = buildColorSelector ("Shape 1"), 593 ui.setupUi( dlg );
592 *cmb_col2 = buildColorSelector ("Shape 2"); 594
593 595 makeColorSelector( ui.cmb_col1 );
594 QVBoxLayout* layout = new QVBoxLayout (&dlg); 596 makeColorSelector( ui.cmb_col2 );
595 layout->addWidget (cmb_col1); 597
596 layout->addWidget (cmb_col2); 598 short in1Col, in2Col;
597 layout->addWidget (makeButtonBox (dlg)); 599
598 600 // Run the dialog and validate input
599 exec: 601 for( ;; )
600 if (!dlg.exec ()) 602 {
601 return; 603 if (!dlg->exec ())
602 604 return;
603 const short in1Col = cmb_col1->w ()->itemData (cmb_col1->w ()->currentIndex ()).toInt (), 605
604 in2Col = cmb_col1->w ()->itemData (cmb_col2->w ()->currentIndex ()).toInt (); 606 in1Col = ui.cmb_col1->itemData (ui.cmb_col1->currentIndex ()).toInt (),
605 607 in2Col = ui.cmb_col1->itemData (ui.cmb_col2->currentIndex ()).toInt ();
606 if (in1Col == in2Col) { 608
607 critical ("Cannot use the same color group for both input and cutter!"); 609 if (in1Col == in2Col) {
608 goto exec; 610 critical ("Cannot use the same color group for both input and cutter!");
611 continue;
612 }
613
614 break;
609 } 615 }
610 616
611 QTemporaryFile in1dat, in2dat, outdat; 617 QTemporaryFile in1dat, in2dat, outdat;
612 str in1DATName, in2DATName, outDATName; 618 str in1DATName, in2DATName, outDATName;
613 619

mercurial