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

Method selectPage

launcher/ui/widgets/PageContainer.cpp:112–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110}
111
112bool PageContainer::selectPage(QString pageId)
113{
114 // now find what we want to have selected...
115 auto page = m_model->findPageEntryById(pageId);
116 QModelIndex index;
117 if (page)
118 {
119 index = m_proxyModel->mapFromSource(m_model->index(page->listIndex));
120 }
121 if(!index.isValid())
122 {
123 index = m_proxyModel->index(0, 0);
124 }
125 if (index.isValid())
126 {
127 m_pageList->setCurrentIndex(index);
128 return true;
129 }
130 return false;
131}
132
133void PageContainer::refreshContainer()
134{

Callers 4

StoragePageMethod · 0.45
NewInstanceDialogMethod · 0.45
ModDownloadDialogMethod · 0.45

Calls 4

findPageEntryByIdMethod · 0.80
mapFromSourceMethod · 0.80
indexMethod · 0.45
isValidMethod · 0.45

Tested by

no test coverage detected