aboutsummaryrefslogtreecommitdiff
path: root/src/courtroom.cpp
diff options
context:
space:
mode:
authorRosemary Witchaven <32779090+in1tiate@users.noreply.github.com>2021-09-22 18:59:59 -0500
committerGitHub <noreply@github.com>2021-09-22 18:59:59 -0500
commitc163aab671b9590910039a7031ed4f02ff989ed8 (patch)
treed2e116e33e6b8ba136665d9f5bb7baffad5c297a /src/courtroom.cpp
parentb2a4a41fd707633a03ecdef8a484c0f16f13779e (diff)
Allow user to configure log timestamp format (#590)
* user configurable timestamp format * fix label making the entire settings window move jankily * add a dropdown for sane timestamp formats * streamline adding options to log timestamp format
Diffstat (limited to 'src/courtroom.cpp')
-rw-r--r--src/courtroom.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/courtroom.cpp b/src/courtroom.cpp
index 9d0ead76..12b97e5a 100644
--- a/src/courtroom.cpp
+++ b/src/courtroom.cpp
@@ -109,6 +109,7 @@ Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow()
log_newline = ao_app->get_log_newline();
log_margin = ao_app->get_log_margin();
log_timestamp = ao_app->get_log_timestamp();
+ log_timestamp_format = ao_app->get_log_timestamp_format();
ui_ms_chatlog = new AOTextArea(this);
ui_ms_chatlog->setReadOnly(true);
@@ -708,12 +709,14 @@ void Courtroom::set_widgets()
log_colors != ao_app->is_colorlog_enabled() ||
log_newline != ao_app->get_log_newline() ||
log_margin != ao_app->get_log_margin() ||
- log_timestamp != ao_app->get_log_timestamp();
+ log_timestamp != ao_app->get_log_timestamp() ||
+ log_timestamp_format != ao_app->get_log_timestamp_format();
log_goes_downwards = ao_app->get_log_goes_downwards();
log_colors = ao_app->is_colorlog_enabled();
log_newline = ao_app->get_log_newline();
log_margin = ao_app->get_log_margin();
log_timestamp = ao_app->get_log_timestamp();
+ log_timestamp_format = ao_app->get_log_timestamp_format();
if (regenerate)
regenerate_ic_chatlog();
@@ -3127,7 +3130,7 @@ void Courtroom::append_ic_text(QString p_text, QString p_name, QString p_action,
if (log_timestamp) {
if (timestamp.isValid()) {
ui_ic_chatlog->textCursor().insertText(
- "[" + timestamp.toString("h:mm:ss AP") + "] ", normal);
+ "[" + timestamp.toString(log_timestamp_format) + "] ", normal);
} else {
qDebug() << "could not insert invalid timestamp";
}