| 1433 | } |
| 1434 | |
| 1435 | InstanceWindow *Application::showInstanceWindow(InstancePtr instance, QString page) |
| 1436 | { |
| 1437 | if(!instance) |
| 1438 | return nullptr; |
| 1439 | auto id = instance->id(); |
| 1440 | auto & extras = m_instanceExtras[id]; |
| 1441 | auto & window = extras.window; |
| 1442 | |
| 1443 | if(window) |
| 1444 | { |
| 1445 | window->raise(); |
| 1446 | window->activateWindow(); |
| 1447 | } |
| 1448 | else |
| 1449 | { |
| 1450 | window = new InstanceWindow(instance); |
| 1451 | m_openWindows ++; |
| 1452 | connect(window, &InstanceWindow::isClosing, this, &Application::on_windowClose); |
| 1453 | } |
| 1454 | if(!page.isEmpty()) |
| 1455 | { |
| 1456 | window->selectPage(page); |
| 1457 | } |
| 1458 | if(extras.controller) |
| 1459 | { |
| 1460 | extras.controller->setParentWidget(window); |
| 1461 | } |
| 1462 | return window; |
| 1463 | } |
| 1464 | |
| 1465 | void Application::on_windowClose() |
| 1466 | { |
no test coverage detected