| 111 | } |
| 112 | |
| 113 | void ReadableEditorDialog::RunDialog(const cmd::ArgumentList& args) |
| 114 | { |
| 115 | // Check prerequisites |
| 116 | const SelectionInfo& info = GlobalSelectionSystem().getSelectionInfo(); |
| 117 | |
| 118 | if (info.entityCount == 1 && info.totalCount == info.entityCount) |
| 119 | { |
| 120 | // Check the entity type |
| 121 | Entity* entity = Node_getEntity(GlobalSelectionSystem().ultimateSelected()); |
| 122 | |
| 123 | if (entity != NULL && entity->getKeyValue("editor_readable") == "1") |
| 124 | { |
| 125 | // Show the dialog |
| 126 | ReadableEditorDialog* dialog = new ReadableEditorDialog(entity); |
| 127 | |
| 128 | dialog->ShowModal(); |
| 129 | dialog->Destroy(); |
| 130 | return; |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | // Exactly one redable entity must be selected. |
| 135 | wxutil::Messagebox::ShowError(_(NO_ENTITY_ERROR)); |
| 136 | } |
| 137 | |
| 138 | // UI Creation |
| 139 |
nothing calls this directly
no test coverage detected