src/addObjectDialog.cpp

changeset 295
a91fa09d686c
parent 293
a0ed563e14b2
child 306
fef00a6cbff0
--- a/src/addObjectDialog.cpp	Sun Jun 16 00:48:09 2013 +0300
+++ b/src/addObjectDialog.cpp	Sun Jun 16 00:58:20 2013 +0300
@@ -107,6 +107,11 @@
 					SubfileListItem* item = new SubfileListItem (parentItem, &prim);
 					item->setText (0, fmt ("%1 - %2", prim.name, prim.title));
 					subfileItems << item;
+					
+					// If this primitive is the one the current object points to,
+					// select it by default
+					if (obj && static_cast<LDSubfile*> (obj)->fileInfo ()->name () == prim.name)
+						tw_subfileList->setCurrentItem (item);
 				}
 				
 				tw_subfileList->addTopLevelItem (parentItem);

mercurial