| 1495 | } |
| 1496 | |
| 1497 | InstanceWindow *Application::showInstanceWindow(InstancePtr instance, QString page) |
| 1498 | { |
| 1499 | if(!instance) |
| 1500 | return nullptr; |
| 1501 | auto id = instance->id(); |
| 1502 | auto & extras = m_instanceExtras[id]; |
| 1503 | auto & window = extras.window; |
| 1504 | |
| 1505 | if(window) |
| 1506 | { |
| 1507 | window->raise(); |
| 1508 | window->activateWindow(); |
| 1509 | } |
| 1510 | else |
| 1511 | { |
| 1512 | window = new InstanceWindow(instance); |
| 1513 | m_openWindows ++; |
| 1514 | connect(window, &InstanceWindow::isClosing, this, &Application::on_windowClose); |
| 1515 | } |
| 1516 | if(!page.isEmpty()) |
| 1517 | { |
| 1518 | window->selectPage(page); |
| 1519 | } |
| 1520 | if(extras.controller) |
| 1521 | { |
| 1522 | extras.controller->setParentWidget(window); |
| 1523 | } |
| 1524 | return window; |
| 1525 | } |
| 1526 | |
| 1527 | void Application::on_windowClose() |
| 1528 | { |
no test coverage detected