fixed gui bug for multiple internetgames (chat_tab)

This commit is contained in:
doitux
2007-10-11 00:30:52 +00:00
parent 9f478855db
commit 5a7ae2c586
3 changed files with 9 additions and 9 deletions
@@ -560,7 +560,7 @@ void gameLobbyDialogImpl::keyPressEvent ( QKeyEvent * event ) {
myChat->showChatHistoryIndex(keyUpCounter);
}
else if(event->key() == Qt::Key_Down && lineEdit_ChatInput->hasFocus()) {
if((keyUpCounter - 1) > 0) { keyUpCounter--; }
if((keyUpCounter - 1) >= 0) { keyUpCounter--; }
// std::cout << "Down keyUpCounter: " << keyUpCounter << "\n";
myChat->showChatHistoryIndex(keyUpCounter);
}
@@ -246,10 +246,13 @@ void LobbyChat::fillChatLinesHistory(QString fillString) {
void LobbyChat::showChatHistoryIndex(int index) {
if(index <= chatLinesHistory.size() && index > 0) {
if(index <= chatLinesHistory.size()) {
// cout << chatLinesHistory.size() << " : " << index << endl;
myLobby->lineEdit_ChatInput->setText(chatLinesHistory.at(chatLinesHistory.size()-(index)));
if(index > 0)
myLobby->lineEdit_ChatInput->setText(chatLinesHistory.at(chatLinesHistory.size()-(index)));
else
myLobby->lineEdit_ChatInput->setText("");
}
}
@@ -257,12 +260,8 @@ void LobbyChat::nickAutoCompletition() {
QString myChatString = myLobby->lineEdit_ChatInput->text();
QStringList myChatStringList = myChatString.split(" ");
// qDebug(myChatStringList.last().toLocal8Bit().constData());
QStringList matchStringList;
// QList<QTreeWidgetItem*> matchItemsList = myLobby->treeWidget_NickList->findItems(myChatStringList.last(),Qt::MatchStartsWith);
// QListIterator<QTreeWidgetItem*> it(matchItemsList);
if(nickAutoCompletitionCounter == 0) {
QTreeWidgetItemIterator it(myLobby->treeWidget_NickList);
@@ -299,7 +298,6 @@ void LobbyChat::nickAutoCompletition() {
nickAutoCompletitionCounter++;
}
}
void LobbyChat::setChatTextEdited() {
+3 -1
View File
@@ -3690,7 +3690,9 @@ void mainWindowImpl::localGameModification() {
void mainWindowImpl::networkGameModification() {
tabWidget_Left->insertTab(1, tab_Chat, QString(tr("Chat")));
if(tabWidget_Left->widget(1) != tab_Chat)
tabWidget_Left->insertTab(1, tab_Chat, QString(tr("Chat")));
tabWidget_Left->setCurrentIndex(1);
myChat->clearNewGame();