src/dialogs.cpp

changeset 226
3dd9e63698cd
parent 212
79c5205b807c
child 248
4431371f3ffe
equal deleted inserted replaced
225:a78179b182e1 226:3dd9e63698cd
385 // ============================================================================= 385 // =============================================================================
386 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 386 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
387 // ============================================================================= 387 // =============================================================================
388 void NewPartDialog::StaticDialog () { 388 void NewPartDialog::StaticDialog () {
389 NewPartDialog dlg (g_win); 389 NewPartDialog dlg (g_win);
390 if (dlg.exec ()) { 390 if (dlg.exec () == false)
391 newFile (); 391 return;
392 392
393 short idx; 393 newFile ();
394 str author = dlg.le_author->text (); 394
395 vector<LDObject*>& objs = g_curfile->m_objs; 395 short idx;
396 396 str author = dlg.le_author->text ();
397 idx = dlg.rb_BFC->value (); 397 vector<LDObject*>& objs = g_curfile->m_objs;
398 const LDBFC::Type BFCType = 398
399 (idx == CCW) ? LDBFC::CertifyCCW : 399 idx = dlg.rb_BFC->value ();
400 (idx == CW) ? LDBFC::CertifyCW : 400 const LDBFC::Type BFCType =
401 LDBFC::NoCertify; 401 (idx == CCW) ? LDBFC::CertifyCCW :
402 402 (idx == CW) ? LDBFC::CertifyCW :
403 idx = dlg.rb_license->value (); 403 LDBFC::NoCertify;
404 const char* license = 404
405 (idx == CCAL) ? "Redistributable under CCAL version 2.0 : see CAreadme.txt" : 405 idx = dlg.rb_license->value ();
406 (idx == NonCA) ? "Not redistributable : see NonCAreadme.txt" : 406 const char* license =
407 null; 407 (idx == CCAL) ? "Redistributable under CCAL version 2.0 : see CAreadme.txt" :
408 408 (idx == NonCA) ? "Not redistributable : see NonCAreadme.txt" :
409 objs.push_back (new LDComment (dlg.le_name->text ())); 409 null;
410 objs.push_back (new LDComment ("Name: <untitled>.dat")); 410
411 objs.push_back (new LDComment (fmt ("Author: %s", author.chars()))); 411 objs.push_back (new LDComment (dlg.le_name->text ()));
412 objs.push_back (new LDComment (fmt ("!LDRAW_ORG Unofficial_Part"))); 412 objs.push_back (new LDComment ("Name: <untitled>.dat"));
413 413 objs.push_back (new LDComment (fmt ("Author: %s", author.chars())));
414 if (license != null) 414 objs.push_back (new LDComment (fmt ("!LDRAW_ORG Unofficial_Part")));
415 objs.push_back (new LDComment (fmt ("!LICENSE %s", license))); 415
416 416 if (license != null)
417 objs.push_back (new LDEmpty); 417 objs.push_back (new LDComment (fmt ("!LICENSE %s", license)));
418 objs.push_back (new LDBFC (BFCType)); 418
419 objs.push_back (new LDEmpty); 419 objs.push_back (new LDEmpty);
420 420 objs.push_back (new LDBFC (BFCType));
421 g_win->fullRefresh (); 421 objs.push_back (new LDEmpty);
422 } 422
423 g_win->fullRefresh ();
423 } 424 }
424 425
425 RotationPointDialog::RotationPointDialog (QWidget* parent, Qt::WindowFlags f) : QDialog (parent, f) { 426 RotationPointDialog::RotationPointDialog (QWidget* parent, Qt::WindowFlags f) : QDialog (parent, f) {
426 rb_rotpoint = new RadioBox ("Rotation Point", { "Object center", "Custom" }, 0, Qt::Vertical, this); 427 rb_rotpoint = new RadioBox ("Rotation Point", { "Object center", "Custom" }, 0, Qt::Vertical, this);
427 connect (rb_rotpoint, SIGNAL (valueChanged (int)), this, SLOT (radioBoxChanged ())); 428 connect (rb_rotpoint, SIGNAL (valueChanged (int)), this, SLOT (radioBoxChanged ()));

mercurial