add netLeaveTableWhenGameFinish config dialog option for ticket #2,
string changes, better recognizable (pm) support in chat
This commit is contained in:
@@ -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) {
|
if(myTextBrowser) {
|
||||||
@@ -145,7 +145,11 @@ void ChatTools::receiveMessage(QString playerName, QString message)
|
|||||||
|
|
||||||
if(message.indexOf(QString("/me "))==0) {
|
if(message.indexOf(QString("/me "))==0) {
|
||||||
myTextBrowser->append(tempMsg.replace("/me ","<i>*"+playerName+" ")+"</i>");
|
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);
|
myTextBrowser->append(playerName + ": " + tempMsg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -154,7 +158,8 @@ void ChatTools::receiveMessage(QString playerName, QString message)
|
|||||||
|
|
||||||
void ChatTools::privateMessage(QString playerName, QString message)
|
void ChatTools::privateMessage(QString playerName, QString message)
|
||||||
{
|
{
|
||||||
receiveMessage(playerName, "->" + message);
|
bool pm=true;
|
||||||
|
receiveMessage(playerName, message, pm);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatTools::clearChat()
|
void ChatTools::clearChat()
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public:
|
|||||||
public slots:
|
public slots:
|
||||||
|
|
||||||
void sendMessage();
|
void sendMessage();
|
||||||
void receiveMessage(QString playerName, QString message);
|
void receiveMessage(QString playerName, QString message, bool pm=false);
|
||||||
void privateMessage(QString playerName, QString message);
|
void privateMessage(QString playerName, QString message);
|
||||||
void clearChat();
|
void clearChat();
|
||||||
void checkInputLength(QString string);
|
void checkInputLength(QString string);
|
||||||
|
|||||||
@@ -1554,7 +1554,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
<item row="2" column="0" colspan="2">
|
<item row="2" column="0" colspan="2">
|
||||||
<widget class="QTabWidget" name="tabWidget_2">
|
<widget class="QTabWidget" name="tabWidget_2">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tab_2">
|
<widget class="QWidget" name="tab_2">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
@@ -1844,7 +1844,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="0">
|
<item row="6" column="0">
|
||||||
<spacer name="spacer">
|
<spacer name="spacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
@@ -1857,6 +1857,13 @@ p, li { white-space: pre-wrap; }
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</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>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="tab_6">
|
<widget class="QWidget" name="tab_6">
|
||||||
|
|||||||
@@ -234,6 +234,7 @@ void settingsDialogImpl::prepareDialog()
|
|||||||
lineEdit_InternetGamePassword->setText(QString::fromUtf8(myConfig->readConfigString("InternetGamePassword").c_str()));
|
lineEdit_InternetGamePassword->setText(QString::fromUtf8(myConfig->readConfigString("InternetGamePassword").c_str()));
|
||||||
}
|
}
|
||||||
checkBox_UseLobbyChat->setChecked(myConfig->readConfigInt("UseLobbyChat"));
|
checkBox_UseLobbyChat->setChecked(myConfig->readConfigInt("UseLobbyChat"));
|
||||||
|
checkBox_InetGane_AutoLeaveTheTableAfterGameFinished->setChecked(myConfig->readConfigInt("NetAutoLeaveGameAfterFinish"));
|
||||||
comboBox_internetGameType->setCurrentIndex(myConfig->readConfigInt("InternetGameType"));
|
comboBox_internetGameType->setCurrentIndex(myConfig->readConfigInt("InternetGameType"));
|
||||||
lineEdit_internetGameName->setText(QString::fromUtf8(myConfig->readConfigString("InternetGameName").c_str()));
|
lineEdit_internetGameName->setText(QString::fromUtf8(myConfig->readConfigString("InternetGameName").c_str()));
|
||||||
|
|
||||||
@@ -596,6 +597,7 @@ void settingsDialogImpl::isAccepted()
|
|||||||
myConfig->writeConfigInt("UseInternetGamePassword", checkBox_UseInternetGamePassword->isChecked());
|
myConfig->writeConfigInt("UseInternetGamePassword", checkBox_UseInternetGamePassword->isChecked());
|
||||||
myConfig->writeConfigString("InternetGamePassword", lineEdit_InternetGamePassword->text().toUtf8().constData());
|
myConfig->writeConfigString("InternetGamePassword", lineEdit_InternetGamePassword->text().toUtf8().constData());
|
||||||
myConfig->writeConfigInt("UseLobbyChat", checkBox_UseLobbyChat->isChecked());
|
myConfig->writeConfigInt("UseLobbyChat", checkBox_UseLobbyChat->isChecked());
|
||||||
|
myConfig->writeConfigInt("NetAutoLeaveGameAfterFinish", checkBox_InetGane_AutoLeaveTheTableAfterGameFinished->isChecked());
|
||||||
myConfig->writeConfigInt("InternetGameType", comboBox_internetGameType->currentIndex());
|
myConfig->writeConfigInt("InternetGameType", comboBox_internetGameType->currentIndex());
|
||||||
myConfig->writeConfigString("InternetGameName", lineEdit_internetGameName->text().toUtf8().constData());
|
myConfig->writeConfigString("InternetGameName", lineEdit_internetGameName->text().toUtf8().constData());
|
||||||
|
|
||||||
|
|||||||
@@ -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_RECV_FAILED: // Sometimes windows reports recv failed on close.
|
||||||
case ERR_SOCK_CONN_RESET: {
|
case ERR_SOCK_CONN_RESET: {
|
||||||
QMessageBox::warning(this, tr("Network Error"),
|
QMessageBox::warning(this, tr("Network Error"),
|
||||||
tr("Connection was closed by the server."),
|
tr("The connection to the server was lost."),
|
||||||
QMessageBox::Close);
|
QMessageBox::Close);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user