add netLeaveTableWhenGameFinish config dialog option for ticket #2,

string changes, better recognizable (pm) support in chat
This commit is contained in:
doitux
2011-10-19 20:49:34 +00:00
parent ec721b9ea5
commit b43909d742
5 changed files with 201 additions and 187 deletions
+8 -3
View File
@@ -60,7 +60,7 @@ void ChatTools::sendMessage()
}
}
void ChatTools::receiveMessage(QString playerName, QString message)
void ChatTools::receiveMessage(QString playerName, QString message, bool pm)
{
if(myTextBrowser) {
@@ -145,7 +145,11 @@ void ChatTools::receiveMessage(QString playerName, QString message)
if(message.indexOf(QString("/me "))==0) {
myTextBrowser->append(tempMsg.replace("/me ","<i>*"+playerName+" ")+"</i>");
} else {
}
else if(pm == true) {
myTextBrowser->append("<i>"+playerName+"(pm): " + tempMsg+"</i>");
}
else {
myTextBrowser->append(playerName + ": " + tempMsg);
}
}
@@ -154,7 +158,8 @@ void ChatTools::receiveMessage(QString playerName, QString message)
void ChatTools::privateMessage(QString playerName, QString message)
{
receiveMessage(playerName, "->" + message);
bool pm=true;
receiveMessage(playerName, message, pm);
}
void ChatTools::clearChat()
+1 -1
View File
@@ -46,7 +46,7 @@ public:
public slots:
void sendMessage();
void receiveMessage(QString playerName, QString message);
void receiveMessage(QString playerName, QString message, bool pm=false);
void privateMessage(QString playerName, QString message);
void clearChat();
void checkInputLength(QString string);
+9 -2
View File
@@ -1554,7 +1554,7 @@ p, li { white-space: pre-wrap; }
<item row="2" column="0" colspan="2">
<widget class="QTabWidget" name="tabWidget_2">
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<widget class="QWidget" name="tab_2">
<attribute name="title">
@@ -1844,7 +1844,7 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="5" column="0">
<item row="6" column="0">
<spacer name="spacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
@@ -1857,6 +1857,13 @@ p, li { white-space: pre-wrap; }
</property>
</spacer>
</item>
<item row="5" column="0">
<widget class="QCheckBox" name="checkBox_InetGane_AutoLeaveTheTableAfterGameFinished">
<property name="text">
<string>Automatically leave the table after the game finished</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_6">
@@ -234,6 +234,7 @@ void settingsDialogImpl::prepareDialog()
lineEdit_InternetGamePassword->setText(QString::fromUtf8(myConfig->readConfigString("InternetGamePassword").c_str()));
}
checkBox_UseLobbyChat->setChecked(myConfig->readConfigInt("UseLobbyChat"));
checkBox_InetGane_AutoLeaveTheTableAfterGameFinished->setChecked(myConfig->readConfigInt("NetAutoLeaveGameAfterFinish"));
comboBox_internetGameType->setCurrentIndex(myConfig->readConfigInt("InternetGameType"));
lineEdit_internetGameName->setText(QString::fromUtf8(myConfig->readConfigString("InternetGameName").c_str()));
@@ -596,6 +597,7 @@ void settingsDialogImpl::isAccepted()
myConfig->writeConfigInt("UseInternetGamePassword", checkBox_UseInternetGamePassword->isChecked());
myConfig->writeConfigString("InternetGamePassword", lineEdit_InternetGamePassword->text().toUtf8().constData());
myConfig->writeConfigInt("UseLobbyChat", checkBox_UseLobbyChat->isChecked());
myConfig->writeConfigInt("NetAutoLeaveGameAfterFinish", checkBox_InetGane_AutoLeaveTheTableAfterGameFinished->isChecked());
myConfig->writeConfigInt("InternetGameType", comboBox_internetGameType->currentIndex());
myConfig->writeConfigString("InternetGameName", lineEdit_internetGameName->text().toUtf8().constData());
+1 -1
View File
@@ -691,7 +691,7 @@ void startWindowImpl::networkError(int errorID, int /*osErrorID*/)
case ERR_SOCK_RECV_FAILED: // Sometimes windows reports recv failed on close.
case ERR_SOCK_CONN_RESET: {
QMessageBox::warning(this, tr("Network Error"),
tr("Connection was closed by the server."),
tr("The connection to the server was lost."),
QMessageBox::Close);
}
break;