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
+5 -1
View File
@@ -242,7 +242,11 @@
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBox_afterThisAlwaysRaiseValue" />
<widget class="QSpinBox" name="spinBox_afterThisAlwaysRaiseValue" >
<property name="maximum" >
<number>9999</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label" >
@@ -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));
}
}
@@ -91,7 +91,7 @@ public slots:
void keyPressEvent(QKeyEvent * event);
void hideShowGameDescription(bool show);
void updateChatInputCompleter();
private:
@@ -105,6 +105,8 @@ private:
bool inGame;
LobbyChat *myChat;
QString myAppDataPath;
QStringList *chatInputCompleterNickList;
QCompleter *chatInputCompleter;
};
+5 -1
View File
@@ -89,7 +89,11 @@
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBox_alwaysRaiseValue" />
<widget class="QSpinBox" name="spinBox_alwaysRaiseValue" >
<property name="maximum" >
<number>9999</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label" >