fix: Page container extra info set on logs page
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
bcf45c74a1
commit
6d0e255ca1
@ -44,7 +44,7 @@
|
|||||||
|
|
||||||
class BasePage {
|
class BasePage {
|
||||||
public:
|
public:
|
||||||
using updateExtraInfoFunc = std::function<void(QString)>;
|
using updateExtraInfoFunc = std::function<void(QString, QString)>;
|
||||||
virtual ~BasePage() {}
|
virtual ~BasePage() {}
|
||||||
virtual QString id() const = 0;
|
virtual QString id() const = 0;
|
||||||
virtual QString displayName() const = 0;
|
virtual QString displayName() const = 0;
|
||||||
|
@ -83,7 +83,7 @@ ExternalResourcesPage::ExternalResourcesPage(BaseInstance* instance, std::shared
|
|||||||
connect(selection_model, &QItemSelectionModel::currentChanged, this, &ExternalResourcesPage::current);
|
connect(selection_model, &QItemSelectionModel::currentChanged, this, &ExternalResourcesPage::current);
|
||||||
auto updateExtra = [this]() {
|
auto updateExtra = [this]() {
|
||||||
if (updateExtraInfo)
|
if (updateExtraInfo)
|
||||||
updateExtraInfo(extraHeaderInfoString());
|
updateExtraInfo(id(), extraHeaderInfoString());
|
||||||
};
|
};
|
||||||
connect(selection_model, &QItemSelectionModel::selectionChanged, this, updateExtra);
|
connect(selection_model, &QItemSelectionModel::selectionChanged, this, updateExtra);
|
||||||
connect(model.get(), &ResourceFolderModel::updateFinished, this, updateExtra);
|
connect(model.get(), &ResourceFolderModel::updateFinished, this, updateExtra);
|
||||||
|
@ -93,8 +93,8 @@ PageContainer::PageContainer(BasePageProvider *pageProvider, QString defaultId,
|
|||||||
page->listIndex = counter;
|
page->listIndex = counter;
|
||||||
page->setParentContainer(this);
|
page->setParentContainer(this);
|
||||||
counter++;
|
counter++;
|
||||||
page->updateExtraInfo = [this](QString info) {
|
page->updateExtraInfo = [this](QString id, QString info) {
|
||||||
if (m_currentPage)
|
if (m_currentPage && id == m_currentPage->id())
|
||||||
m_header->setText(m_currentPage->displayName() + info);
|
m_header->setText(m_currentPage->displayName() + info);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user