]> git.sesse.net Git - ultimatescore/blobdiff - client/mainwindow.cpp
Add an option (default on) to autoshow comment when time goes out.
[ultimatescore] / client / mainwindow.cpp
index 228fe6b2044435d4de924645e6dc6593e524af69..d6d32008e73ba6f89f8ae8ea2dda007b18a278af 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);
@@ -333,6 +334,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()