Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Page container extra info set on logs page #1272

Merged
merged 1 commit into from
Jun 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion launcher/ui/pages/BasePage.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

class BasePage {
public:
using updateExtraInfoFunc = std::function<void(QString)>;
using updateExtraInfoFunc = std::function<void(QString, QString)>;
virtual ~BasePage() {}
virtual QString id() const = 0;
virtual QString displayName() const = 0;
Expand Down
2 changes: 1 addition & 1 deletion launcher/ui/pages/instance/ExternalResourcesPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ ExternalResourcesPage::ExternalResourcesPage(BaseInstance* instance, std::shared
connect(selection_model, &QItemSelectionModel::currentChanged, this, &ExternalResourcesPage::current);
auto updateExtra = [this]() {
if (updateExtraInfo)
updateExtraInfo(extraHeaderInfoString());
updateExtraInfo(id(), extraHeaderInfoString());
};
connect(selection_model, &QItemSelectionModel::selectionChanged, this, updateExtra);
connect(model.get(), &ResourceFolderModel::updateFinished, this, updateExtra);
Expand Down
4 changes: 2 additions & 2 deletions launcher/ui/widgets/PageContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ PageContainer::PageContainer(BasePageProvider *pageProvider, QString defaultId,
page->listIndex = counter;
page->setParentContainer(this);
counter++;
page->updateExtraInfo = [this](QString info) {
if (m_currentPage)
page->updateExtraInfo = [this](QString id, QString info) {
if (m_currentPage && id == m_currentPage->id())
m_header->setText(m_currentPage->displayName() + info);
};
}
Expand Down