start inserting nick-autocompletition for lobbychat input field
This commit is contained in:
@@ -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;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -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" >
|
||||
|
||||
Reference in New Issue
Block a user