Add line limit to server chat and debug log panes (#784)

Set default maximum block size to 5,000 unless otherwise specified
This commit is contained in:
Salanto 2022-06-11 16:09:53 -07:00 committed by GitHub
parent b8a5deeaae
commit ffcd783c10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 3 deletions

View File

@ -9,7 +9,7 @@
class AOTextArea : public QTextBrowser {
public:
AOTextArea(QWidget *p_parent = nullptr);
AOTextArea(QWidget *p_parent = nullptr, int p_log_length = 5000);
void append_linked(QString p_message);
void append_chatmessage(QString p_name, QString p_message,

View File

@ -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)
{

View File

@ -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();