Merge pull request #139 from AttorneyOnline/posdrp

Fix an oversight with the pos dropdown, add a small feature
This commit is contained in:
oldmud0 2020-04-11 22:46:57 -05:00 committed by GitHub
commit 21a8b6f6e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -991,6 +991,12 @@ void Courtroom::enter_courtroom(int p_cid)
QString side = ao_app->get_char_side(current_char); QString side = ao_app->get_char_side(current_char);
// We block signals from ui_pos_dropdown to stop on_pos_dropdown_changed from firing here.
// Per the Qt docs, QSignalBlocker only affects the rest of this function,
// so it doesn't stop the dropdown from working once we finish here.
const QSignalBlocker blocker(ui_pos_dropdown);
ui_pos_dropdown->setCurrentText(side);
if (side == "jud") if (side == "jud")
{ {
ui_witness_testimony->show(); ui_witness_testimony->show();
@ -3436,7 +3442,7 @@ void Courtroom::on_pos_dropdown_changed(int p_index)
{ {
ui_ic_chat_message->setFocus(); ui_ic_chat_message->setFocus();
if (p_index < 0 || p_index > 5) if (p_index < 0 || p_index > 7)
return; return;
toggle_judge_buttons(false); toggle_judge_buttons(false);
@ -3464,6 +3470,12 @@ void Courtroom::on_pos_dropdown_changed(int p_index)
case 5: case 5:
f_pos = "hlp"; f_pos = "hlp";
break; break;
case 6:
f_pos = "jur";
break;
case 7:
f_pos = "sea";
break;
default: default:
f_pos = ""; f_pos = "";
} }