# HG changeset patch # User Santeri Piippo # Date 1373070279 -10800 # Node ID 1376ad3262baad76ef39be7d70bccbba67440588 # Parent 55fcf67230fdab622a00c69c949822dbf3fc2695 Converted Ytruder interface to Designer UI diff -r 55fcf67230fd -r 1376ad3262ba .gitignore --- a/.gitignore Sat Jul 06 03:06:00 2013 +0300 +++ b/.gitignore Sat Jul 06 03:24:39 2013 +0300 @@ -3,4 +3,5 @@ src/ui_*.h Makefile ldforge -*.dat \ No newline at end of file +*.dat +debug_lastOutput \ No newline at end of file diff -r 55fcf67230fd -r 1376ad3262ba src/extprogs.cpp --- a/src/extprogs.cpp Sat Jul 06 03:06:00 2013 +0300 +++ b/src/extprogs.cpp Sat Jul 06 03:24:39 2013 +0300 @@ -35,6 +35,7 @@ #include "history.h" #include "labeledwidget.h" +#include "ui_ytruder.h" #include "ui_intersector.h" #include "ui_rectifier.h" #include "ui_coverer.h" @@ -284,36 +285,25 @@ if (!checkProgPath (prog_ytruder, Ytruder)) return; - QDialog dlg; - - RadioBox* rb_mode = new RadioBox ("Extrusion mode", {"Distance", "Symmetry", "Projection", "Radial"}, 0, Qt::Horizontal); - RadioBox* rb_axis = new RadioBox ("Axis", {"X", "Y", "Z"}, 0, Qt::Horizontal); - LabeledWidget* dsb_depth = new LabeledWidget ("Plane depth"), - *dsb_condAngle = new LabeledWidget ("Conditional line threshold"); + QDialog* dlg = new QDialog; + Ui::YtruderUI ui; + ui.setupUi( dlg ); - rb_axis->setValue (Y); - dsb_depth->w ()->setMinimum (-10000.0); - dsb_depth->w ()->setMaximum (10000.0); - dsb_depth->w ()->setDecimals (3); - dsb_condAngle->w ()->setValue (30.0f); - - QVBoxLayout* layout = new QVBoxLayout (&dlg); - layout->addWidget (rb_mode); - layout->addWidget (rb_axis); - layout->addWidget (dsb_depth); - layout->addWidget (dsb_condAngle); - layout->addWidget (makeButtonBox (dlg)); - - dlg.setWindowIcon (getIcon ("extrude")); - - if (!dlg.exec ()) + if (!dlg->exec ()) return; // Read the user's choices - const enum modetype { Distance, Symmetry, Projection, Radial } mode = (modetype) rb_mode->value (); - const Axis axis = (Axis) rb_axis->value (); - const double depth = dsb_depth->w ()->value (), - condAngle = dsb_condAngle->w ()->value (); + const enum { Distance, Symmetry, Projection, Radial } mode = + ui.mode_distance->isChecked() ? Distance : + ui.mode_symmetry->isChecked() ? Symmetry : + ui.mode_projection->isChecked() ? Projection : Radial; + + const Axis axis = + ui.axis_x->isChecked() ? X : + ui.axis_y->isChecked() ? Y : Z; + + const double depth = ui.planeDepth->value(), + condAngle = ui.condAngle->value(); QTemporaryFile indat, outdat; str inDATName, outDATName; diff -r 55fcf67230fd -r 1376ad3262ba src/ui/ytruder.ui --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/ui/ytruder.ui Sat Jul 06 03:24:39 2013 +0300 @@ -0,0 +1,201 @@ + + + YtruderUI + + + + 0 + 0 + 340 + 170 + + + + Ytruder + + + + + + + + Extrusion Mode + + + + + + Distance + + + true + + + + + + + Symmetry + + + + + + + Projection + + + + + + + Radial + + + + + + + + + + + + Axis + + + + + + X + + + + + + + Y + + + true + + + + + + + Z + + + + + + + + + + + + Plane depth: + + + + + + + Line threshold angle: + + + + + + + + 85 + 0 + + + + 3 + + + 10000.000000000000000 + + + + + + + + 85 + 0 + + + + ° + + + 3 + + + 360.000000000000000 + + + 30.000000000000000 + + + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + YtruderUI + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + YtruderUI + reject() + + + 316 + 260 + + + 286 + 274 + + + + +