When editing an existing subfile, select the primitive from the list automatically if found

Sun, 16 Jun 2013 00:58:20 +0300

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Sun, 16 Jun 2013 00:58:20 +0300
changeset 295
a91fa09d686c
parent 294
2892deee4c1b
child 296
d544de09c93b

When editing an existing subfile, select the primitive from the list automatically if found

src/addObjectDialog.cpp file | annotate | diff | comparison | revisions
--- 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