From a6ea197a43ac48a6618487e960d9380b07b4b65b Mon Sep 17 00:00:00 2001 From: doitux Date: Fri, 25 May 2007 17:57:03 +0000 Subject: [PATCH] set chatinput maximum --- src/gui/qt/mainwindow/chat/chat.cpp | 5 +++++ src/gui/qt/mainwindow/chat/chat.h | 1 + src/gui/qt/mainwindow/mainwindowimpl.cpp | 3 +++ src/gui/qt/mainwindow/mainwindowimpl.h | 1 + 4 files changed, 10 insertions(+) diff --git a/src/gui/qt/mainwindow/chat/chat.cpp b/src/gui/qt/mainwindow/chat/chat.cpp index c81638c9..d8477cc8 100644 --- a/src/gui/qt/mainwindow/chat/chat.cpp +++ b/src/gui/qt/mainwindow/chat/chat.cpp @@ -58,3 +58,8 @@ void Chat::checkInvisible() { default: { myW->tabWidget->startBlinkChatTab(); } } } + +void Chat::checkInputLength(QString string) { + + if(string.toUtf8().length() > 120) myW->lineEdit_ChatInput->setMaxLength(string.length()); +} diff --git a/src/gui/qt/mainwindow/chat/chat.h b/src/gui/qt/mainwindow/chat/chat.h index 726d6013..541e4d9e 100644 --- a/src/gui/qt/mainwindow/chat/chat.h +++ b/src/gui/qt/mainwindow/chat/chat.h @@ -47,6 +47,7 @@ public slots: void sendMessage(); void receiveMessage(QString playerName, QString msg); void checkInvisible(); + void checkInputLength(QString); private: diff --git a/src/gui/qt/mainwindow/mainwindowimpl.cpp b/src/gui/qt/mainwindow/mainwindowimpl.cpp index 39db24f9..d116ad24 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.cpp +++ b/src/gui/qt/mainwindow/mainwindowimpl.cpp @@ -560,6 +560,7 @@ mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent) connect( tabWidget, SIGNAL( currentChanged(int) ), this, SLOT( tabSwitchAction() ) ); connect( lineEdit_ChatInput, SIGNAL( returnPressed () ), this, SLOT( sendChatMessage() ) ); + connect( lineEdit_ChatInput, SIGNAL( textChanged (QString) ), this, SLOT( checkChatInputLength(QString) ) ); //Nachrichten Thread-Save connect(this, SIGNAL(signalRefreshSet()), this, SLOT(refreshSet())); @@ -2510,6 +2511,8 @@ void mainWindowImpl::blinkingStartButtonAnimationAction() { } void mainWindowImpl::sendChatMessage() { myChat->sendMessage(); } +void mainWindowImpl::checkChatInputLength(QString string) { myChat->checkInputLength(string); } + void mainWindowImpl::tabSwitchAction() { diff --git a/src/gui/qt/mainwindow/mainwindowimpl.h b/src/gui/qt/mainwindow/mainwindowimpl.h index cde025a7..e571f5d6 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.h +++ b/src/gui/qt/mainwindow/mainwindowimpl.h @@ -237,6 +237,7 @@ public slots: void paintStartSplash(); void sendChatMessage(); + void checkChatInputLength(QString); void tabSwitchAction(); void networkError(int, int);