start inserting nick-autocompletition for lobbychat input field

This commit is contained in:
doitux
2007-10-07 21:38:28 +00:00
parent 0d0d8dc810
commit 49845451f2
4 changed files with 31 additions and 3 deletions
@@ -26,6 +26,12 @@ gameLobbyDialogImpl::gameLobbyDialogImpl(QWidget *parent, ConfigFile *c)
myAppDataPath = QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str());
chatInputCompleterNickList = new QStringList;
chatInputCompleter = new QCompleter(*chatInputCompleterNickList);
chatInputCompleter->setCaseSensitivity(Qt::CaseInsensitive);
lineEdit_ChatInput->setCompleter(chatInputCompleter);
connect( pushButton_CreateGame, SIGNAL( clicked() ), this, SLOT( createGame() ) );
connect( pushButton_JoinGame, SIGNAL( clicked() ), this, SLOT( joinGame() ) );
connect( treeWidget_GameList, SIGNAL( currentItemChanged ( QTreeWidgetItem*, QTreeWidgetItem*) ), this, SLOT( gameSelected(QTreeWidgetItem*, QTreeWidgetItem*) ) );
@@ -577,3 +583,15 @@ void gameLobbyDialogImpl::hideShowGameDescription(bool show) {
label_gameDesc7->hide();
}
}
void gameLobbyDialogImpl::updateChatInputCompleter() {
chatInputCompleterNickList->clear();
int i;
for (i=0; i < treeWidget_NickList->topLevelItemCount(); i++) {
chatInputCompleterNickList->append(treeWidget_NickList->itemAt(0,i)->text(0));
}
}