players get points now which are shown per word
[multypo.git] / qt / player.cpp
index 871ecb9d474182fd1ad50ddd6790fff4a4d71d42..4c84eb74a182ba66b2ef472b0d58ae07e8fcbe88 100644 (file)
@@ -12,6 +12,7 @@ static QString colorToString(QColor col)
 Player::Player(QWidget* parent) {
        theLabel = new QLabel (parent);
        parent->layout()->addWidget(theLabel);
+       modifyable = true;
 }
 
 
@@ -27,12 +28,20 @@ QString Player::getCurrentLine() {
        return currentLine;
 }
 
+void Player::setWaiting(QString labeltext) {
+       theLabel->setText(labeltext);
+       modifyable = false;
+}
+
 void Player::resetText() {
        currentLine.clear();
        theLabel->setText(currentLine);
+       modifyable = true;
 }
 
 void Player::handleKey(QString str) {
+       if (!modifyable)
+               return;
        if (str.length() == 1) {
                currentLine += str;
        } else if (!hasName() && str == "Return") {