fix dropdown bug, add minor feature

This commit is contained in:
in1tiate 2020-04-11 20:04:41 -05:00
parent 558fa55be8
commit ed9632f220

View File

@ -991,6 +991,12 @@ void Courtroom::enter_courtroom(int p_cid)
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")
{
ui_witness_testimony->show();
@ -3436,7 +3442,7 @@ void Courtroom::on_pos_dropdown_changed(int p_index)
{
ui_ic_chat_message->setFocus();
if (p_index < 0 || p_index > 5)
if (p_index < 0 || p_index > 7)
return;
toggle_judge_buttons(false);
@ -3464,6 +3470,12 @@ void Courtroom::on_pos_dropdown_changed(int p_index)
case 5:
f_pos = "hlp";
break;
case 6:
f_pos = "jur";
break;
case 7:
f_pos = "sea";
break;
default:
f_pos = "";
}