your own text in lobby-chat is colored now to easier seperate it from other messages. change internet game dialog maxlenght to 48.

This commit is contained in:
doitux
2010-07-14 09:29:05 +00:00
parent 44a8999095
commit 041d68d4a1
4 changed files with 17 additions and 9 deletions
+4 -5
View File
@@ -36,11 +36,7 @@
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit">
<property name="maxLength">
<number>12</number>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit"/>
</item>
</layout>
</item>
@@ -49,6 +45,9 @@
<property name="text">
<string>in der Konfiguration speichern!</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item row="3" column="0">
@@ -37,6 +37,7 @@ changeContentDialogImpl::changeContentDialogImpl(QWidget *parent, ConfigFile *co
label_Message->setText(tr("You cannot join Internet-Game-Lobby with \"Human Player\" as nickname.\nPlease choose another one."));
label_lineLabel->setText(tr("Nick name:"));
lineEdit->setText(QString::fromUtf8(myConfig->readConfigString("MyName").c_str()));
lineEdit->setMaxLength(12);
checkBox->hide();
this->setGeometry(this->x(), this->y(), this->width(), this->height()-20 );
}
@@ -45,18 +46,21 @@ changeContentDialogImpl::changeContentDialogImpl(QWidget *parent, ConfigFile *co
label_Message->setText(tr("Your player name is already used by another player.\nPlease choose a different name."));
label_lineLabel->setText(tr("Nick name:"));
lineEdit->setText(QString::fromUtf8(myConfig->readConfigString("MyName").c_str()));
lineEdit->setMaxLength(12);
}
break;
case CHANGE_NICK_INVALID: {
label_Message->setText(tr("The player name is too short, too long or invalid. Please choose another one."));
label_lineLabel->setText(tr("Nick name:"));
lineEdit->setText(QString::fromUtf8(myConfig->readConfigString("MyName").c_str()));
lineEdit->setMaxLength(12);
}
break;
case CHANGE_INET_GAME_NAME: {
label_Message->setText(tr("There is already a game with your choosen game name.\nPlease choose another one!"));
label_lineLabel->setText(tr("Game name:"));
lineEdit->setText(QString::fromUtf8(myConfig->readConfigString("InternetGameName").c_str()));
lineEdit->setMaxLength(48);
}
break;
}
+4 -3
View File
@@ -32,6 +32,7 @@ ChatTools::ChatTools(QLineEdit* l, ConfigFile *c, ChatType ct, QTextBrowser *b,
{
myNick = QString::fromUtf8(myConfig->readConfigString("MyName").c_str());
ignoreList = myConfig->readConfigStringList("PlayerIgnoreList");
}
ChatTools::~ChatTools()
@@ -68,7 +69,7 @@ void ChatTools::receiveMessage(QString playerName, QString message) {
switch (myChatType) {
case INET_LOBBY_CHAT: {
tempMsg = QString("<span style=\"font-weight:bold;\">"+message+"</span>");
tempMsg = QString("<span style=\"font-weight:bold; color:"+myLobby->palette().highlight().color().name()+";\">"+message+"</span>");
//play beep sound only in INET-lobby-chat
// TODO dont play when message is from yourself
if(myLobby->isVisible() && myConfig->readConfigInt("PlayLobbyChatNotification")) {
@@ -85,7 +86,7 @@ void ChatTools::receiveMessage(QString playerName, QString message) {
}
else {
switch (myChatType) {
case INET_LOBBY_CHAT: tempMsg = QString("<span style=\"font-weight:normal;\">"+message+"</span>");
case INET_LOBBY_CHAT: tempMsg = QString("<span style=\"font-weight:normal; color:"+myLobby->palette().highlight().color().name()+";\">"+message+"</span>");
break;
case LAN_LOBBY_CHAT: tempMsg = QString("<span style=\"font-weight:normal;\">"+message+"</span>");
break;
@@ -106,7 +107,7 @@ void ChatTools::receiveMessage(QString playerName, QString message) {
}
if(!nickFoundOnIgnoreList) {
myTextBrowser->append(playerName + ": " + tempMsg);
myTextBrowser->append(playerName + ": " + tempMsg);
}
}
}
+5 -1
View File
@@ -30,7 +30,11 @@
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_gameName"/>
<widget class="QLineEdit" name="lineEdit_gameName">
<property name="maxLength">
<number>48</number>
</property>
</widget>
</item>
</layout>
</item>