src/addObjectDialog.cpp

changeset 357
9c954c222996
parent 327
9ea604af1319
child 363
75583c9f289d
equal deleted inserted replaced
356:08398f57aba3 357:9c954c222996
52 QDialog (parent) 52 QDialog (parent)
53 { 53 {
54 setlocale (LC_ALL, "C"); 54 setlocale (LC_ALL, "C");
55 55
56 short coordCount = 0; 56 short coordCount = 0;
57 str typeName = LDObject::typeName( type );
57 58
58 switch (type) { 59 switch (type) {
59 case LDObject::Comment: 60 case LDObject::Comment:
60 le_comment = new QLineEdit; 61 le_comment = new QLineEdit;
61 if (obj) 62 if (obj)
133 } 134 }
134 break; 135 break;
135 } 136 }
136 137
137 default: 138 default:
138 critical (fmt ("Unhandled LDObject type %1 (%2) in AddObjectDialog", (int) type, g_saObjTypeNames[type])); 139 critical (fmt ("Unhandled LDObject type %1 (%2) in AddObjectDialog", (int) type, typeName));
139 return; 140 return;
140 } 141 }
141 142
142 QPixmap icon = getIcon (fmt ("add-%1", g_saObjTypeIcons[type])); 143 QPixmap icon = getIcon (fmt ("add-%1", typeName));
143 LDObject* defaults = LDObject::getDefault (type); 144 LDObject* defaults = LDObject::getDefault (type);
144 145
145 lb_typeIcon = new QLabel; 146 lb_typeIcon = new QLabel;
146 lb_typeIcon->setPixmap (icon); 147 lb_typeIcon->setPixmap (icon);
147 148
228 qCoordLayout->addWidget (dsb_coords[i], (i / 3), (i % 3)); 229 qCoordLayout->addWidget (dsb_coords[i], (i / 3), (i % 3));
229 230
230 layout->addLayout (qCoordLayout, 0, 1, (coordCount / 3), 3); 231 layout->addLayout (qCoordLayout, 0, 1, (coordCount / 3), 3);
231 } 232 }
232 233
233 layout->addWidget (makeButtonBox (*this), 5, 0, 1, 4); 234 layout->addWidget( makeButtonBox( *this ), 5, 0, 1, 4 );
234 setLayout (layout); 235 setLayout( layout );
235 setWindowTitle (fmt (APPNAME ": New %1", 236 setWindowTitle( fmt( tr( "Edit %1" ), typeName ));
236 g_saObjTypeNames[type]));
237 237
238 setWindowIcon (icon); 238 setWindowIcon (icon);
239 delete defaults; 239 delete defaults;
240 } 240 }
241 241

mercurial