diff --git a/src/gui/qt/chattools/chattools.cpp b/src/gui/qt/chattools/chattools.cpp index 2dafbb95..e906d9c4 100644 --- a/src/gui/qt/chattools/chattools.cpp +++ b/src/gui/qt/chattools/chattools.cpp @@ -50,8 +50,11 @@ void ChatTools::sendMessage() if(chatText.indexOf(QString("/msg ")) == 0) { chatText.remove(0, 5); unsigned playerId = parsePrivateMessageTarget(chatText); - if (playerId) + if (playerId) { mySession->sendPrivateChatMessage(playerId, chatText.toUtf8().constData()); + QString tmp = tr("private message sent to player: %1"); + myTextBrowser->append(""+tmp.arg(QString::fromUtf8(mySession->getClientPlayerInfo(playerId).playerName.c_str()))+""); + } } else { mySession->sendLobbyChatMessage(chatText.toUtf8().constData()); } @@ -243,10 +246,18 @@ void ChatTools::nickAutoCompletition() // cout << nickAutoCompletitionCounter << "\n"; - if(lastChatString == "") + if(lastChatString == "") { myLineEdit->setText(lastMatchStringList.at(nickAutoCompletitionCounter)+": "); - else - myLineEdit->setText(lastChatString+" "+lastMatchStringList.at(nickAutoCompletitionCounter)+" "); + } + else { + //check if lastChatString is pm-code + if((lastChatString == "/msg" || lastChatString == "/msg ") && lastMatchStringList.at(nickAutoCompletitionCounter).contains(" ")) { + myLineEdit->setText(lastChatString+" \""+lastMatchStringList.at(nickAutoCompletitionCounter)+"\" "); + } + else { + myLineEdit->setText(lastChatString+" "+lastMatchStringList.at(nickAutoCompletitionCounter)+" "); + } + } nickAutoCompletitionCounter++; } diff --git a/src/gui/qt/settingsdialog.ui b/src/gui/qt/settingsdialog.ui index 15eacfab..821bc661 100644 --- a/src/gui/qt/settingsdialog.ui +++ b/src/gui/qt/settingsdialog.ui @@ -1554,7 +1554,7 @@ p, li { white-space: pre-wrap; } - 1 + 0