]> Some of my projects - tim.git/commitdiff
Minor fixes. master
authorAPTX <marek321@gmail.com>
Mon, 10 Jan 2011 21:45:37 +0000 (22:45 +0100)
committerAPTX <marek321@gmail.com>
Mon, 10 Jan 2011 21:45:37 +0000 (22:45 +0100)
chatclient.cpp
qml/tim-game/Components/ChatView.qml
qml/tim-game/main.qml

index 8e174ae86d2b94265d068746055a5bd6e252f87d..f8043867f5eeedabb336315862c72c80ca91ffa9 100644 (file)
@@ -39,7 +39,7 @@ void ChatClient::startChat(const QString &sessionkey)
 {
        m_sessionkey = sessionkey;
        socket->connectToHost(m_tcphost, m_port);
 {
        m_sessionkey = sessionkey;
        socket->connectToHost(m_tcphost, m_port);
-       setChatLog("");
+       setChatLog(">> Type /quit to close Chat View.\n");
 }
 
 void ChatClient::stopChat()
 }
 
 void ChatClient::stopChat()
@@ -63,13 +63,15 @@ void ChatClient::onMessageRecieved()
 
 void ChatClient::onError()
 {
 
 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 (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);
        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)
 {
 
 void ChatClient::systemMessage(const QString &message)
 {
-       appendToChatLog(">> " + message);
+       appendToChatLog(">> " + message + "\n");
 }
 }
index 73b120243c6c3af2377af00f57db3573ff060c37..4df428de008b6860176f10fc4f161f6db9fc57dd 100644 (file)
@@ -48,6 +48,9 @@ FocusScope {
                Keys.onEnterPressed: inputLine.sendMessage();
 
                function sendMessage() {
                Keys.onEnterPressed: inputLine.sendMessage();
 
                function sendMessage() {
+                       if (inputLine.text === "")
+                               return;
+
                        var message = inputLine.text;
                        inputLine.text = "";
 
                        var message = inputLine.text;
                        inputLine.text = "";
 
index a1df435dfbdfbe17660f99fc2cfe42cacb906861..16b7e40ebd0ff417383773e2e17c0e24c50b8b3c 100644 (file)
@@ -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;
                        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
+                       }
 
                }
 
 
                }