| 184 | } |
| 185 | |
| 186 | void UIContext::onAddDocument(doc::Document* doc) |
| 187 | { |
| 188 | m_lastSelectedDoc = static_cast<app::Document*>(doc); |
| 189 | |
| 190 | // We don't create views in batch mode. |
| 191 | if (!App::instance()->isGui()) |
| 192 | return; |
| 193 | |
| 194 | // Add a new view for this document |
| 195 | DocumentView* view = new DocumentView( |
| 196 | m_lastSelectedDoc, |
| 197 | DocumentView::Normal, |
| 198 | App::instance()->mainWindow()->getPreviewEditor()); |
| 199 | |
| 200 | // Add a tab with the new view for the document |
| 201 | App::instance()->workspace()->addView(view); |
| 202 | |
| 203 | setActiveView(view); |
| 204 | view->editor()->setDefaultScroll(); |
| 205 | } |
| 206 | |
| 207 | void UIContext::onRemoveDocument(doc::Document* doc) |
| 208 | { |
nothing calls this directly
no test coverage detected