| 1554 | } |
| 1555 | |
| 1556 | InstanceWindow *Application::showInstanceWindow(InstancePtr instance, QString page) |
| 1557 | { |
| 1558 | if(!instance) |
| 1559 | return nullptr; |
| 1560 | auto id = instance->id(); |
| 1561 | auto & extras = m_instanceExtras[id]; |
| 1562 | auto & window = extras.window; |
| 1563 | |
| 1564 | if(window) |
| 1565 | { |
| 1566 | window->raise(); |
| 1567 | window->activateWindow(); |
| 1568 | } |
| 1569 | else |
| 1570 | { |
| 1571 | window = new InstanceWindow(instance); |
| 1572 | m_openWindows ++; |
| 1573 | connect(window, &InstanceWindow::isClosing, this, &Application::on_windowClose); |
| 1574 | } |
| 1575 | if(!page.isEmpty()) |
| 1576 | { |
| 1577 | window->selectPage(page); |
| 1578 | } |
| 1579 | if(extras.controller) |
| 1580 | { |
| 1581 | extras.controller->setParentWidget(window); |
| 1582 | } |
| 1583 | return window; |
| 1584 | } |
| 1585 | |
| 1586 | void Application::on_windowClose() |
| 1587 | { |
no test coverage detected