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

Method showInstanceWindow

launcher/Application.cpp:1497–1525  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1495}
1496
1497InstanceWindow *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
1527void Application::on_windowClose()
1528{

Calls 4

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

Tested by

no test coverage detected