start inserting nick-autocompletition for lobbychat input field
This commit is contained in:
@@ -242,7 +242,11 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QSpinBox" name="spinBox_afterThisAlwaysRaiseValue" />
|
<widget class="QSpinBox" name="spinBox_afterThisAlwaysRaiseValue" >
|
||||||
|
<property name="maximum" >
|
||||||
|
<number>9999</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label" >
|
<widget class="QLabel" name="label" >
|
||||||
|
|||||||
@@ -26,6 +26,12 @@ gameLobbyDialogImpl::gameLobbyDialogImpl(QWidget *parent, ConfigFile *c)
|
|||||||
|
|
||||||
myAppDataPath = QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str());
|
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_CreateGame, SIGNAL( clicked() ), this, SLOT( createGame() ) );
|
||||||
connect( pushButton_JoinGame, SIGNAL( clicked() ), this, SLOT( joinGame() ) );
|
connect( pushButton_JoinGame, SIGNAL( clicked() ), this, SLOT( joinGame() ) );
|
||||||
connect( treeWidget_GameList, SIGNAL( currentItemChanged ( QTreeWidgetItem*, QTreeWidgetItem*) ), this, SLOT( gameSelected(QTreeWidgetItem*, QTreeWidgetItem*) ) );
|
connect( treeWidget_GameList, SIGNAL( currentItemChanged ( QTreeWidgetItem*, QTreeWidgetItem*) ), this, SLOT( gameSelected(QTreeWidgetItem*, QTreeWidgetItem*) ) );
|
||||||
@@ -577,3 +583,15 @@ void gameLobbyDialogImpl::hideShowGameDescription(bool show) {
|
|||||||
label_gameDesc7->hide();
|
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 keyPressEvent(QKeyEvent * event);
|
||||||
void hideShowGameDescription(bool show);
|
void hideShowGameDescription(bool show);
|
||||||
|
|
||||||
|
void updateChatInputCompleter();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
@@ -105,6 +105,8 @@ private:
|
|||||||
bool inGame;
|
bool inGame;
|
||||||
LobbyChat *myChat;
|
LobbyChat *myChat;
|
||||||
QString myAppDataPath;
|
QString myAppDataPath;
|
||||||
|
QStringList *chatInputCompleterNickList;
|
||||||
|
QCompleter *chatInputCompleter;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -89,7 +89,11 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QSpinBox" name="spinBox_alwaysRaiseValue" />
|
<widget class="QSpinBox" name="spinBox_alwaysRaiseValue" >
|
||||||
|
<property name="maximum" >
|
||||||
|
<number>9999</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label" >
|
<widget class="QLabel" name="label" >
|
||||||
|
|||||||
Reference in New Issue
Block a user