MCPcopy Create free account
hub / github.com/MultiMC/Launcher / showInstanceWindow

Method showInstanceWindow

launcher/Application.cpp:1556–1584  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1554}
1555
1556InstanceWindow *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
1586void Application::on_windowClose()
1587{

Calls 4

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

Tested by

no test coverage detected