aboutsummaryrefslogtreecommitdiff
path: root/src/aooptionsdialog.cpp
diff options
context:
space:
mode:
authorCrystalwarrior <Varsash@Gmail.com>2020-08-19 19:16:41 +0300
committerGitHub <noreply@github.com>2020-08-19 11:16:41 -0500
commitcef0ebc6eb2ac549a5475bee332be35ab7f565fc (patch)
treed0a250c7d7061432bde6a5b6d2aa46cb90d6f023 /src/aooptionsdialog.cpp
parentc984c57102bd269fed48a6b84fa9546f48e23dc9 (diff)
IC log rewrite (#259)
* Rewrite the IC Log code to drastically reduce code duplication and have both downward and upward mode in the same function Regenerate the IC Log in set_widgets() function, making sure the maximum_blocks is accounted for and clearing the log to prepare for different log mode (upwards/downwards) if it's different from previous Add placeholder text telling the user the direction in which the log will go Remove useless first_message_sent global boolean, a remnant from a w e a k e r c o d e r m a n * Add log_colors boolean to reduce color I/O happening in append_ic_text (optimization meme) Clear the IC log when log_colors setting changes and reload theme is pressed Fix https://github.com/AttorneyOnline/AO2-Client/issues/221 * Add configurable margin between IC log entries Add configurable newline/singleline log mode Options in settings for these * Add optional timestamps * Un-hardcode "played music" from the chatlogpiece and introduce the "action" argument so that "presented evidence" is fully supported now Translate "has presented evidence" Regenerate IC chatlog instead of clearing it, properly updating every element with the new configurations * Go away *temp, code duplication making me shid and cry rn Why is this not done in append_ic_text, or why isn't there a dedicated ic logging func aAAAaaaaAAAaa Fix presenting evidence not being properly logged Fix timestamp being UTC instead of local time (local time will not be as confusing) * okok it was a joke a big ol bamboozle you got gnomed haha rick rolled beaned stickbugged I did NOT copy paste code, no, I actually intended to fix copy pasted code all along. log_ic_text was always planned. (Fix copypasted code for ic_chatlog_history and consolidate it into a single log_ic_text func)
Diffstat (limited to 'src/aooptionsdialog.cpp')
-rw-r--r--src/aooptionsdialog.cpp46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/aooptionsdialog.cpp b/src/aooptionsdialog.cpp
index 6cedee8d..4e6aca65 100644
--- a/src/aooptionsdialog.cpp
+++ b/src/aooptionsdialog.cpp
@@ -121,6 +121,49 @@ AOOptionsDialog::AOOptionsDialog(QWidget *parent, AOApplication *p_ao_app)
ui_gameplay_form->setWidget(row, QFormLayout::FieldRole, ui_length_spinbox);
row += 1;
+ ui_log_newline_lbl = new QLabel(ui_form_layout_widget);
+ ui_log_newline_lbl->setText(tr("Log newline:"));
+ ui_log_newline_lbl->setToolTip(
+ tr("If ticked, new messages will appear separated, "
+ "with the message coming on the next line after the name. "
+ "When unticked, it displays it as 'name: message'."));
+
+ ui_gameplay_form->setWidget(row, QFormLayout::LabelRole, ui_log_newline_lbl);
+
+ ui_log_newline_cb = new QCheckBox(ui_form_layout_widget);
+ ui_log_newline_cb->setChecked(p_ao_app->get_log_newline());
+
+ ui_gameplay_form->setWidget(row, QFormLayout::FieldRole, ui_log_newline_cb);
+
+ row += 1;
+ ui_log_margin_lbl = new QLabel(ui_form_layout_widget);
+ ui_log_margin_lbl->setText(tr("Log margin:"));
+ ui_log_margin_lbl->setToolTip(tr(
+ "The distance in pixels between each entry in the IC log. "
+ "Default: 0."));
+
+ ui_gameplay_form->setWidget(row, QFormLayout::LabelRole, ui_log_margin_lbl);
+
+ ui_log_margin_spinbox = new QSpinBox(ui_form_layout_widget);
+ ui_log_margin_spinbox->setMaximum(1000);
+ ui_log_margin_spinbox->setValue(p_ao_app->get_log_margin());
+
+ ui_gameplay_form->setWidget(row, QFormLayout::FieldRole, ui_log_margin_spinbox);
+
+ row += 1;
+ ui_log_timestamp_lbl = new QLabel(ui_form_layout_widget);
+ ui_log_timestamp_lbl->setText(tr("Log timestamp:"));
+ ui_log_timestamp_lbl->setToolTip(
+ tr("If ticked, log will contain a timestamp in UTC before the name."));
+
+ ui_gameplay_form->setWidget(row, QFormLayout::LabelRole, ui_log_timestamp_lbl);
+
+ ui_log_timestamp_cb = new QCheckBox(ui_form_layout_widget);
+ ui_log_timestamp_cb->setChecked(p_ao_app->get_log_timestamp());
+
+ ui_gameplay_form->setWidget(row, QFormLayout::FieldRole, ui_log_timestamp_cb);
+
+ row += 1;
ui_log_names_divider = new QFrame(ui_form_layout_widget);
ui_log_names_divider->setFrameShape(QFrame::HLine);
ui_log_names_divider->setFrameShadow(QFrame::Sunken);
@@ -726,6 +769,9 @@ void AOOptionsDialog::save_pressed()
configini->setValue("theme", ui_theme_combobox->currentText());
configini->setValue("log_goes_downwards", ui_downwards_cb->isChecked());
configini->setValue("log_maximum", ui_length_spinbox->value());
+ configini->setValue("log_newline", ui_log_newline_cb->isChecked());
+ configini->setValue("log_margin", ui_log_margin_spinbox->value());
+ configini->setValue("log_timestamp", ui_log_timestamp_cb->isChecked());
configini->setValue("default_username", ui_username_textbox->text());
configini->setValue("show_custom_shownames", ui_showname_cb->isChecked());
configini->setValue("master", ui_ms_textbox->text());