mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 15:15:50 +08:00
Ref T111, allow to limit entries in log component
This commit is contained in:
committed by
Mathew Sutcliffe
parent
4c8ae06eff
commit
266a418c90
@@ -39,6 +39,20 @@ namespace BlackGui
|
||||
this->setFilterDialog(new CStatusMessageFilterDialog(this));
|
||||
}
|
||||
|
||||
void CStatusMessageView::keepLatest(int desiredSize)
|
||||
{
|
||||
if (desiredSize >= this->rowCount()) { return; }
|
||||
if (desiredSize < 1)
|
||||
{
|
||||
this->clear();
|
||||
return;
|
||||
}
|
||||
|
||||
CStatusMessageList msgs = this->container();
|
||||
msgs.keepLatest(desiredSize);
|
||||
this->updateContainerMaybeAsync(msgs);
|
||||
}
|
||||
|
||||
CStatusMessageFilterDialog *CStatusMessageView::getFilterDialog() const
|
||||
{
|
||||
return qobject_cast<CStatusMessageFilterDialog *>(this->getFilterWidget());
|
||||
|
||||
@@ -43,6 +43,9 @@ namespace BlackGui
|
||||
//! Add my own filter dialog
|
||||
void addFilterDialog();
|
||||
|
||||
//! \copydoc BlackMisc::CStatusMessageList::keepLatest
|
||||
void keepLatest(int desiredSize);
|
||||
|
||||
//! Filter dialog if any
|
||||
BlackGui::Filters::CStatusMessageFilterDialog *getFilterDialog() const;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user