]> git.sesse.net Git - ultimatescore/blobdiff - client/mainwindow.cpp
Update to three groups.
[ultimatescore] / client / mainwindow.cpp
index 3ea51a013db70c18cdbb2fe783d3af7020c7806d..26f684ece2caf52a94e8f35abd5bba06b4040469 100644 (file)
@@ -124,6 +124,7 @@ MainWindow::MainWindow(QWidget *parent) :
        connect(ui->set_and_show_comment_btn, &QPushButton::clicked, this, &MainWindow::set_and_show_comment_clicked);
        connect(ui->hide_comment_btn, &QPushButton::clicked, this, &MainWindow::hide_comment_clicked);
        connect(ui->set_and_show_autocomment_btn, &QPushButton::clicked, this, &MainWindow::set_and_show_autocomment_clicked);
+       connect(ui->autoshow_autocomment, &QCheckBox::stateChanged, this, &MainWindow::autocomment_update);
 
        connect(ui->show_lower_third_btn, &QPushButton::clicked, this, &MainWindow::show_lower_third_clicked);
        connect(ui->hide_lower_third_btn, &QPushButton::clicked, this, &MainWindow::hide_lower_third_clicked);
@@ -134,6 +135,7 @@ MainWindow::MainWindow(QWidget *parent) :
        connect(ui->show_scorebug_btn, &QPushButton::clicked, this, &MainWindow::show_scorebug_clicked);
        connect(ui->show_group_a_btn, &QPushButton::clicked, this, [this]() { show_group_clicked("Group A"); });
        connect(ui->show_group_b_btn, &QPushButton::clicked, this, [this]() { show_group_clicked("Group B"); });
+       connect(ui->show_group_c_btn, &QPushButton::clicked, this, [this]() { show_group_clicked("Group C"); });
        connect(ui->show_schedule_btn, &QPushButton::clicked, this, &MainWindow::show_schedule_clicked);
        connect(ui->show_carousel_btn, &QPushButton::clicked, this, &MainWindow::show_carousel_clicked);
        connect(ui->show_nothing_btn, &QPushButton::clicked, this, &MainWindow::show_nothing_clicked);
@@ -333,6 +335,11 @@ void MainWindow::autocomment_update()
                }
        }
        ui->autocomment_edit->setText(QString::fromStdString(msg));
+
+       map<string, string> param;
+       param["autocomment_on_clock_limit"] = ui->autoshow_autocomment->isChecked() ? "1" : "0";
+       param["autocomment"] = msg;
+       ws->send_command("update " + serialize_as_json(param));
 }
 
 void MainWindow::show_scorebug_clicked()
@@ -465,8 +472,8 @@ void MainWindow::bt6000_message_received(const string &msg, int port)
 
        if (msg.size() >= 9 && msg[0] == 'G' && msg[1] == '0' && msg[2] == '1') {
                // G01: Game clock, period number, and number of time-outs.
-               bool clock_running = !(msg[4] & 0x02);
-//             bool klaxon = (msg[4] & 0x04);
+               bool clock_running = !(msg[3] & 0x02);
+//             bool klaxon = (msg[3] & 0x04);
                int minutes = parse_clock(msg[5], msg[6]);
                int seconds = parse_clock(msg[7], msg[8]);