diff options
| author | oldmud0 <oldmud0@users.noreply.github.com> | 2020-04-11 22:46:57 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-11 22:46:57 -0500 |
| commit | 21a8b6f6e6178ace10430254435cca02e00a47e0 (patch) | |
| tree | c3d805bf72127f4f3ce2c4c2a4800c7eb474e106 | |
| parent | ade12fcd2d7d81f64ef8b9cd5da1508e31f3a18f (diff) | |
| parent | ed9632f220c434e5bdc9d2d7ec2ab4619cb91802 (diff) | |
Merge pull request #139 from AttorneyOnline/posdrp
Fix an oversight with the pos dropdown, add a small feature
| -rw-r--r-- | src/courtroom.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/courtroom.cpp b/src/courtroom.cpp index e3e84504..f083c516 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -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 = ""; } |
