From ffcd783c10b6e3d37bacae3ac61f595938a50e27 Mon Sep 17 00:00:00 2001 From: Salanto <62221668+Salanto@users.noreply.github.com> Date: Sat, 11 Jun 2022 16:09:53 -0700 Subject: Add line limit to server chat and debug log panes (#784) Set default maximum block size to 5,000 unless otherwise specified --- src/aotextarea.cpp | 5 ++++- src/courtroom.cpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/aotextarea.cpp b/src/aotextarea.cpp index 3513d221..a4259039 100644 --- a/src/aotextarea.cpp +++ b/src/aotextarea.cpp @@ -1,6 +1,9 @@ #include "aotextarea.h" -AOTextArea::AOTextArea(QWidget *p_parent) : QTextBrowser(p_parent) {} +AOTextArea::AOTextArea(QWidget *p_parent, int p_log_length) : QTextBrowser(p_parent) +{ + this->document()->setMaximumBlockCount(p_log_length); +} void AOTextArea::append_linked(QString p_message) { diff --git a/src/courtroom.cpp b/src/courtroom.cpp index 1c043789..516d3fc2 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -121,7 +121,7 @@ Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow() log_timestamp = ao_app->get_log_timestamp(); log_timestamp_format = ao_app->get_log_timestamp_format(); - ui_debug_log = new AOTextArea(this); + ui_debug_log = new AOTextArea(this, ao_app->get_max_log_size()); ui_debug_log->setReadOnly(true); ui_debug_log->setOpenExternalLinks(true); ui_debug_log->hide(); -- cgit