From: APTX Date: Mon, 10 Jan 2011 21:45:37 +0000 (+0100) Subject: Minor fixes. X-Git-Url: https://gitweb.aptx.org/?a=commitdiff_plain;p=tim.git Minor fixes. --- diff --git a/chatclient.cpp b/chatclient.cpp index 8e174ae..f804386 100644 --- a/chatclient.cpp +++ b/chatclient.cpp @@ -39,7 +39,7 @@ void ChatClient::startChat(const QString &sessionkey) { m_sessionkey = sessionkey; socket->connectToHost(m_tcphost, m_port); - setChatLog(""); + setChatLog(">> Type /quit to close Chat View.\n"); } void ChatClient::stopChat() @@ -63,13 +63,15 @@ void ChatClient::onMessageRecieved() void ChatClient::onError() { - systemMessage("Connection error: " + socket->errorString() + "\n"); + systemMessage("Connection error: " + socket->errorString()); if (socket->isOpen()) socket->close(); } void ChatClient::sendMessage(const QString &message) { + if (message.isEmpty()) + return; QString messageToSend = message + QChar('\n'); socket->write(messageToSend.toUtf8()); appendToChatLog("You: " + messageToSend); @@ -77,5 +79,5 @@ void ChatClient::sendMessage(const QString &message) void ChatClient::systemMessage(const QString &message) { - appendToChatLog(">> " + message); + appendToChatLog(">> " + message + "\n"); } diff --git a/qml/tim-game/Components/ChatView.qml b/qml/tim-game/Components/ChatView.qml index 73b1202..4df428d 100644 --- a/qml/tim-game/Components/ChatView.qml +++ b/qml/tim-game/Components/ChatView.qml @@ -48,6 +48,9 @@ FocusScope { Keys.onEnterPressed: inputLine.sendMessage(); function sendMessage() { + if (inputLine.text === "") + return; + var message = inputLine.text; inputLine.text = ""; diff --git a/qml/tim-game/main.qml b/qml/tim-game/main.qml index a1df435..16b7e40 100644 --- a/qml/tim-game/main.qml +++ b/qml/tim-game/main.qml @@ -62,6 +62,10 @@ Item { model: scoreModel.model delegate: Components.ScoreDelegate {} width: parent.width - 8; height: parent.height - 8; x: 4; y: 4; cacheBuffer: 100; + footer: Item { + width: highScoreTable.width + height: toolBar.height + 5 + } }