summaryrefslogtreecommitdiffstats
path: root/application/widgets/PageContainer.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2015-05-29 02:22:02 +0200
committerPetr Mrázek <peterix@gmail.com>2015-05-29 02:22:02 +0200
commitb7f8241968b4cf684c31c575a6159d577faab76a (patch)
treed88807c22e41d4676f66c193eced467074ac7d55 /application/widgets/PageContainer.cpp
parenta98e1df10cef774672e919497c43373e86c77f97 (diff)
downloadMultiMC-b7f8241968b4cf684c31c575a6159d577faab76a.tar
MultiMC-b7f8241968b4cf684c31c575a6159d577faab76a.tar.gz
MultiMC-b7f8241968b4cf684c31c575a6159d577faab76a.tar.lz
MultiMC-b7f8241968b4cf684c31c575a6159d577faab76a.tar.xz
MultiMC-b7f8241968b4cf684c31c575a6159d577faab76a.zip
GH-994 hopefully fix issue with people still using jar mods
Added an 'add mods' button to the version page Add jar mods now has a very angry nag dialog until it's used successfully Buttons on version page are rearranged to deemphasize jar mods
Diffstat (limited to 'application/widgets/PageContainer.cpp')
-rw-r--r--application/widgets/PageContainer.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/application/widgets/PageContainer.cpp b/application/widgets/PageContainer.cpp
index 679039a7..0fe4ea25 100644
--- a/application/widgets/PageContainer.cpp
+++ b/application/widgets/PageContainer.cpp
@@ -68,6 +68,7 @@ PageContainer::PageContainer(BasePageProviderPtr pageProvider, QString defaultId
{
page->stackIndex = m_pageStack->addWidget(dynamic_cast<QWidget *>(page));
page->listIndex = counter;
+ page->setParentContainer(this);
counter++;
if (firstIndex == -1)
{
@@ -87,8 +88,13 @@ PageContainer::PageContainer(BasePageProviderPtr pageProvider, QString defaultId
this, SLOT(currentChanged(QModelIndex)));
m_pageStack->setStackingMode(QStackedLayout::StackOne);
m_pageList->setFocus();
+ selectPage(defaultId);
+}
+
+bool PageContainer::selectPage(QString pageId)
+{
// now find what we want to have selected...
- auto page = m_model->findPageEntryById(defaultId);
+ auto page = m_model->findPageEntryById(pageId);
QModelIndex index;
if (page)
{
@@ -99,7 +105,11 @@ PageContainer::PageContainer(BasePageProviderPtr pageProvider, QString defaultId
index = m_proxyModel->index(0, 0);
}
if (index.isValid())
+ {
m_pageList->setCurrentIndex(index);
+ return true;
+ }
+ return false;
}
void PageContainer::createUI()