| 144 | } |
| 145 | |
| 146 | void ModelTreeView::showDefinition() |
| 147 | { |
| 148 | auto item = GetSelection(); |
| 149 | wxutil::TreeModel::Row row(item, *GetModel()); |
| 150 | |
| 151 | decl::IDeclaration::Ptr decl; |
| 152 | |
| 153 | if (row[Columns().isSkin].getBool()) |
| 154 | { |
| 155 | decl = GlobalDeclarationManager().findDeclaration(decl::Type::Skin, GetSelectedSkin()); |
| 156 | } |
| 157 | else |
| 158 | { |
| 159 | // Must be a modelDef |
| 160 | auto selectedModelPath = row[Columns().modelPath].getString().ToStdString(); |
| 161 | decl = GlobalDeclarationManager().findDeclaration(decl::Type::ModelDef, selectedModelPath); |
| 162 | } |
| 163 | |
| 164 | if (decl) |
| 165 | { |
| 166 | auto view = new wxutil::DeclarationSourceView(this); |
| 167 | view->setDeclaration(decl); |
| 168 | |
| 169 | view->ShowModal(); |
| 170 | view->Destroy(); |
| 171 | } |
| 172 | } |
| 173 | |
| 174 | bool ModelTreeView::testShowDefinition() |
| 175 | { |
nothing calls this directly
no test coverage detected