mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-28 03:35:38 +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());
|
||||
|
||||
Reference in New Issue
Block a user