src/extPrograms.cc

changeset 840
d077dd19bf9a
parent 806
4240f47aa2d4
child 844
11587d419d2f
equal deleted inserted replaced
839:5f822ad61875 840:d077dd19bf9a
118 if (path.length() > 0) 118 if (path.length() > 0)
119 return true; 119 return true;
120 120
121 ExtProgPathPrompt* dlg = new ExtProgPathPrompt (g_extProgNames[prog]); 121 ExtProgPathPrompt* dlg = new ExtProgPathPrompt (g_extProgNames[prog]);
122 122
123 if (dlg->exec() && not dlg->getPath().isEmpty()) 123 if (dlg->exec() and not dlg->getPath().isEmpty())
124 { 124 {
125 path = dlg->getPath(); 125 path = dlg->getPath();
126 return true; 126 return true;
127 } 127 }
128 128
219 { 219 {
220 LDObjectList objects; 220 LDObjectList objects;
221 221
222 for (LDObjectPtr obj : getCurrentDocument()->objects()) 222 for (LDObjectPtr obj : getCurrentDocument()->objects())
223 { 223 {
224 if (not obj->isColored() || obj->color() != color) 224 if (not obj->isColored() or obj->color() != color)
225 continue; 225 continue;
226 226
227 objects << obj; 227 objects << obj;
228 } 228 }
229 229
362 362
363 QTemporaryFile indat, outdat; 363 QTemporaryFile indat, outdat;
364 QString inDATName, outDATName; 364 QString inDATName, outDATName;
365 365
366 // Make temp files for the input and output files 366 // Make temp files for the input and output files
367 if (not mkTempFile (indat, inDATName) || not mkTempFile (outdat, outDATName)) 367 if (not mkTempFile (indat, inDATName) or not mkTempFile (outdat, outDATName))
368 return; 368 return;
369 369
370 // Compose the command-line arguments 370 // Compose the command-line arguments
371 QString argv = join ( 371 QString argv = join (
372 { 372 {
406 406
407 QTemporaryFile indat, outdat; 407 QTemporaryFile indat, outdat;
408 QString inDATName, outDATName; 408 QString inDATName, outDATName;
409 409
410 // Make temp files for the input and output files 410 // Make temp files for the input and output files
411 if (not mkTempFile (indat, inDATName) || not mkTempFile (outdat, outDATName)) 411 if (not mkTempFile (indat, inDATName) or not mkTempFile (outdat, outDATName))
412 return; 412 return;
413 413
414 // Compose arguments 414 // Compose arguments
415 QString argv = join ( 415 QString argv = join (
416 { 416 {
479 // outdat2 = inverse output 479 // outdat2 = inverse output
480 // edgesdat = edges output (isecalc) 480 // edgesdat = edges output (isecalc)
481 QTemporaryFile indat, cutdat, outdat, outdat2, edgesdat; 481 QTemporaryFile indat, cutdat, outdat, outdat2, edgesdat;
482 QString inDATName, cutDATName, outDATName, outDAT2Name, edgesDATName; 482 QString inDATName, cutDATName, outDATName, outDAT2Name, edgesDATName;
483 483
484 if (not mkTempFile (indat, inDATName) || 484 if (not mkTempFile (indat, inDATName) or
485 not mkTempFile (cutdat, cutDATName) || 485 not mkTempFile (cutdat, cutDATName) or
486 not mkTempFile (outdat, outDATName) || 486 not mkTempFile (outdat, outDATName) or
487 not mkTempFile (outdat2, outDAT2Name) || 487 not mkTempFile (outdat2, outDAT2Name) or
488 not mkTempFile (edgesdat, edgesDATName)) 488 not mkTempFile (edgesdat, edgesDATName))
489 { 489 {
490 return; 490 return;
491 } 491 }
492 492
520 if (not runUtilityProcess (Intersector, cfg::intersectorPath, argv_normal)) 520 if (not runUtilityProcess (Intersector, cfg::intersectorPath, argv_normal))
521 return; 521 return;
522 522
523 insertOutput (outDATName, false, {inCol}); 523 insertOutput (outDATName, false, {inCol});
524 524
525 if (repeatInverse && runUtilityProcess (Intersector, cfg::intersectorPath, argv_inverse)) 525 if (repeatInverse and runUtilityProcess (Intersector, cfg::intersectorPath, argv_inverse))
526 insertOutput (outDAT2Name, false, {cutCol}); 526 insertOutput (outDAT2Name, false, {cutCol});
527 527
528 if (ui.cb_edges->isChecked() && checkProgPath (Isecalc) && 528 if (ui.cb_edges->isChecked() and checkProgPath (Isecalc) and
529 runUtilityProcess (Isecalc, cfg::isecalcPath, join ( {inDATName, cutDATName, edgesDATName}))) 529 runUtilityProcess (Isecalc, cfg::isecalcPath, join ( {inDATName, cutDATName, edgesDATName})))
530 { 530 {
531 insertOutput (edgesDATName, false, {}); 531 insertOutput (edgesDATName, false, {});
532 } 532 }
533 } 533 }
567 } 567 }
568 568
569 QTemporaryFile in1dat, in2dat, outdat; 569 QTemporaryFile in1dat, in2dat, outdat;
570 QString in1DATName, in2DATName, outDATName; 570 QString in1DATName, in2DATName, outDATName;
571 571
572 if (not mkTempFile (in1dat, in1DATName) || 572 if (not mkTempFile (in1dat, in1DATName) or
573 not mkTempFile (in2dat, in2DATName) || 573 not mkTempFile (in2dat, in2DATName) or
574 not mkTempFile (outdat, outDATName)) 574 not mkTempFile (outdat, outDATName))
575 { 575 {
576 return; 576 return;
577 } 577 }
578 578
633 } 633 }
634 634
635 QTemporaryFile in1dat, in2dat, outdat; 635 QTemporaryFile in1dat, in2dat, outdat;
636 QString in1DATName, in2DATName, outDATName; 636 QString in1DATName, in2DATName, outDATName;
637 637
638 if (not mkTempFile (in1dat, in1DATName) || 638 if (not mkTempFile (in1dat, in1DATName) or
639 not mkTempFile (in2dat, in2DATName) || 639 not mkTempFile (in2dat, in2DATName) or
640 not mkTempFile (outdat, outDATName)) 640 not mkTempFile (outdat, outDATName))
641 { 641 {
642 return; 642 return;
643 } 643 }
644 644
672 return; 672 return;
673 673
674 QTemporaryFile in, out; 674 QTemporaryFile in, out;
675 QString inName, outName; 675 QString inName, outName;
676 676
677 if (not mkTempFile (in, inName) || not mkTempFile (out, outName)) 677 if (not mkTempFile (in, inName) or not mkTempFile (out, outName))
678 return; 678 return;
679 679
680 int unmatched = ui.unmatched->currentIndex(); 680 int unmatched = ui.unmatched->currentIndex();
681 681
682 QString argv = join ( 682 QString argv = join (

mercurial