MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / showInstanceWindow

Method showInstanceWindow

launcher/Application.cpp:1435–1463  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1433}
1434
1435InstanceWindow *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
1465void Application::on_windowClose()
1466{

Calls 4

isEmptyMethod · 0.80
setParentWidgetMethod · 0.80
idMethod · 0.45
selectPageMethod · 0.45

Tested by

no test coverage detected