src/addObjectDialog.cpp

changeset 1011
4fdd74a04790
parent 1010
969b48eddd6b
child 1014
f0a8ecb6a357
child 1217
314e12e23c3a
equal deleted inserted replaced
1010:969b48eddd6b 1011:4fdd74a04790
88 88
89 if (obj) 89 if (obj)
90 rb_bfcType->setValue ((int) static_cast<LDBfc*> (obj)->statement()); 90 rb_bfcType->setValue ((int) static_cast<LDBfc*> (obj)->statement());
91 } break; 91 } break;
92 92
93 case OBJ_Subfile: 93 case OBJ_SubfileReference:
94 { 94 {
95 coordCount = 3; 95 coordCount = 3;
96 tw_subfileList = new QTreeWidget(); 96 tw_subfileList = new QTreeWidget();
97 tw_subfileList->setHeaderLabel (tr ("Primitives")); 97 tw_subfileList->setHeaderLabel (tr ("Primitives"));
98 populatePrimitivesTree (tw_subfileList, (obj ? static_cast<LDSubfile*> (obj)->fileInfo()->name() : "")); 98 populatePrimitivesTree (tw_subfileList, (obj ? static_cast<LDSubfileReference*> (obj)->fileInfo()->name() : ""));
99 99
100 connect (tw_subfileList, SIGNAL (itemSelectionChanged()), this, SLOT (slot_subfileTypeChanged())); 100 connect (tw_subfileList, SIGNAL (itemSelectionChanged()), this, SLOT (slot_subfileTypeChanged()));
101 lb_subfileName = new QLabel ("File:"); 101 lb_subfileName = new QLabel ("File:");
102 le_subfileName = new QLineEdit; 102 le_subfileName = new QLineEdit;
103 le_subfileName->setFocus(); 103 le_subfileName->setFocus();
104 104
105 if (obj) 105 if (obj)
106 { 106 {
107 LDSubfile* ref = static_cast<LDSubfile*> (obj); 107 LDSubfileReference* ref = static_cast<LDSubfileReference*> (obj);
108 le_subfileName->setText (ref->fileInfo()->name()); 108 le_subfileName->setText (ref->fileInfo()->name());
109 } 109 }
110 } break; 110 } break;
111 111
112 default: 112 default:
170 170
171 case OBJ_Bfc: 171 case OBJ_Bfc:
172 layout->addWidget (rb_bfcType, 0, 1); 172 layout->addWidget (rb_bfcType, 0, 1);
173 break; 173 break;
174 174
175 case OBJ_Subfile: 175 case OBJ_SubfileReference:
176 layout->addWidget (tw_subfileList, 1, 1, 1, 2); 176 layout->addWidget (tw_subfileList, 1, 1, 1, 2);
177 layout->addWidget (lb_subfileName, 2, 1); 177 layout->addWidget (lb_subfileName, 2, 1);
178 layout->addWidget (le_subfileName, 2, 2); 178 layout->addWidget (le_subfileName, 2, 2);
179 break; 179 break;
180 180
301 return; 301 return;
302 302
303 if (dlg.exec() == QDialog::Rejected) 303 if (dlg.exec() == QDialog::Rejected)
304 return; 304 return;
305 305
306 if (type == OBJ_Subfile) 306 if (type == OBJ_SubfileReference)
307 { 307 {
308 QStringList matrixstrvals = dlg.le_matrix->text().split (" ", QString::SkipEmptyParts); 308 QStringList matrixstrvals = dlg.le_matrix->text().split (" ", QString::SkipEmptyParts);
309 309
310 if (matrixstrvals.size() == 9) 310 if (matrixstrvals.size() == 9)
311 { 311 {
355 int value = dlg.rb_bfcType->value(); 355 int value = dlg.rb_bfcType->value();
356 if (value == qBound (0, value, int (BfcStatement::NumValues) - 1)) 356 if (value == qBound (0, value, int (BfcStatement::NumValues) - 1))
357 bfc->setStatement (BfcStatement (dlg.rb_bfcType->value())); 357 bfc->setStatement (BfcStatement (dlg.rb_bfcType->value()));
358 } break; 358 } break;
359 359
360 case OBJ_Subfile: 360 case OBJ_SubfileReference:
361 { 361 {
362 QString name = dlg.le_subfileName->text(); 362 QString name = dlg.le_subfileName->text();
363 363
364 if (name.length() == 0) 364 if (name.length() == 0)
365 return; // no subfile filename 365 return; // no subfile filename
370 { 370 {
371 Critical (format ("Couldn't open `%1': %2", name, strerror (errno))); 371 Critical (format ("Couldn't open `%1': %2", name, strerror (errno)));
372 return; 372 return;
373 } 373 }
374 374
375 LDSubfile* ref = InitObject<LDSubfile> (obj); 375 LDSubfileReference* ref = InitObject<LDSubfileReference> (obj);
376 376
377 for_axes (ax) 377 for_axes (ax)
378 ref->setCoordinate (ax, dlg.dsb_coords[ax]->value()); 378 ref->setCoordinate (ax, dlg.dsb_coords[ax]->value());
379 379
380 ref->setTransform (transform); 380 ref->setTransform (transform);

mercurial