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 |
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); |