GUI: ignore player function added (list in settings - remove button will follow)

This commit is contained in:
doitux
2010-03-30 17:30:33 +00:00
parent 5239f496f3
commit 0771aabfb0
10 changed files with 1970 additions and 1872 deletions
+113 -105
View File
@@ -30,7 +30,7 @@ using namespace std;
ChatTools::ChatTools(QLineEdit* l, ConfigFile *c, ChatType ct, QTextBrowser *b, QTreeWidget *t, gameLobbyDialogImpl *lo) : nickAutoCompletitionCounter(0), myLineEdit(l), myNickTreeWidget(t), myNickStringList(NULL), myTextBrowser(b), myChatType(ct), myConfig(c), myNick(""), myLobby(lo)
{
myNick = QString::fromUtf8(myConfig->readConfigString("MyName").c_str());
myNick = QString::fromUtf8(myConfig->readConfigString("MyName").c_str());
}
ChatTools::~ChatTools()
@@ -38,152 +38,160 @@ ChatTools::~ChatTools()
}
void ChatTools::sendMessage() {
if(myLineEdit->text().size() && mySession) {
fillChatLinesHistory(myLineEdit->text());
if(myChatType == INGAME_CHAT) {
mySession->sendGameChatMessage(myLineEdit->text().toUtf8().constData());
}
else {
mySession->sendLobbyChatMessage(myLineEdit->text().toUtf8().constData());
}
myLineEdit->setText("");
}
if(myLineEdit->text().size() && mySession) {
fillChatLinesHistory(myLineEdit->text());
if(myChatType == INGAME_CHAT) {
mySession->sendGameChatMessage(myLineEdit->text().toUtf8().constData());
}
else {
mySession->sendLobbyChatMessage(myLineEdit->text().toUtf8().constData());
}
myLineEdit->setText("");
}
}
void ChatTools::receiveMessage(QString playerName, QString message) {
if(myTextBrowser) {
if(myTextBrowser) {
message = message.replace("<","&lt;");
message = message.replace(">","&gt;");
message = message.replace("<","&lt;");
message = message.replace(">","&gt;");
//refresh myNick if it was changed during runtime
myNick = QString::fromUtf8(myConfig->readConfigString("MyName").c_str());
QString tempMsg;
if(message.contains(myNick, Qt::CaseInsensitive)) {
//refresh myNick if it was changed during runtime
myNick = QString::fromUtf8(myConfig->readConfigString("MyName").c_str());
switch (myChatType) {
case INET_LOBBY_CHAT: {
tempMsg = QString("<span style=\"font-weight:bold;\">"+message+"</span>");
//play beep sound only in INET-lobby-chat
// TODO dont play when message is from yourself
if(myLobby->isVisible() && myConfig->readConfigInt("PlayLobbyChatNotification")) {
myLobby->getMyW()->getMySDLPlayer()->playSound("lobbychatnotify",0);
}
}
break;
case LAN_LOBBY_CHAT: tempMsg = QString("<span style=\"font-weight:bold;\">"+message+"</span>");
break;
case INGAME_CHAT: tempMsg = QString("<span style=\"color:#"+myStyle->getChatTextNickNotifyColor()+";\">"+message+"</span>");
break;
default: tempMsg = message;
}
}
else {
switch (myChatType) {
case INET_LOBBY_CHAT: tempMsg = QString("<span style=\"font-weight:normal;\">"+message+"</span>");
break;
case LAN_LOBBY_CHAT: tempMsg = QString("<span style=\"font-weight:normal;\">"+message+"</span>");
break;
case INGAME_CHAT: tempMsg = QString("<span style=\"color:#"+myStyle->getChatLogTextColor()+";\">"+message+"</span>");
break;
default: tempMsg = message;
}
}
myTextBrowser->append(playerName + ": " + tempMsg);
}
QString tempMsg;
if(message.contains(myNick, Qt::CaseInsensitive)) {
switch (myChatType) {
case INET_LOBBY_CHAT: {
tempMsg = QString("<span style=\"font-weight:bold;\">"+message+"</span>");
//play beep sound only in INET-lobby-chat
// TODO dont play when message is from yourself
if(myLobby->isVisible() && myConfig->readConfigInt("PlayLobbyChatNotification")) {
myLobby->getMyW()->getMySDLPlayer()->playSound("lobbychatnotify",0);
}
}
break;
case LAN_LOBBY_CHAT: tempMsg = QString("<span style=\"font-weight:bold;\">"+message+"</span>");
break;
case INGAME_CHAT: tempMsg = QString("<span style=\"color:#"+myStyle->getChatTextNickNotifyColor()+";\">"+message+"</span>");
break;
default: tempMsg = message;
}
}
else {
switch (myChatType) {
case INET_LOBBY_CHAT: tempMsg = QString("<span style=\"font-weight:normal;\">"+message+"</span>");
break;
case LAN_LOBBY_CHAT: tempMsg = QString("<span style=\"font-weight:normal;\">"+message+"</span>");
break;
case INGAME_CHAT: tempMsg = QString("<span style=\"color:#"+myStyle->getChatLogTextColor()+";\">"+message+"</span>");
break;
default: tempMsg = message;
}
}
myTextBrowser->append(playerName + ": " + tempMsg);
}
}
void ChatTools::clearChat() {
if(myTextBrowser)
myTextBrowser->clear();
if(myTextBrowser)
myTextBrowser->clear();
}
void ChatTools::checkInputLength(QString string) {
if(string.toUtf8().length() > 120) myLineEdit->setMaxLength(string.length());
if(string.toUtf8().length() > 120) myLineEdit->setMaxLength(string.length());
}
void ChatTools::fillChatLinesHistory(QString fillString) {
chatLinesHistory << fillString;
if(chatLinesHistory.size() > 50) chatLinesHistory.removeFirst();
chatLinesHistory << fillString;
if(chatLinesHistory.size() > 50) chatLinesHistory.removeFirst();
}
void ChatTools::showChatHistoryIndex(int index) {
if(index <= chatLinesHistory.size()) {
if(index <= chatLinesHistory.size()) {
// cout << chatLinesHistory.size() << " : " << index << endl;
if(index > 0)
myLineEdit->setText(chatLinesHistory.at(chatLinesHistory.size()-(index)));
else
myLineEdit->setText("");
}
// cout << chatLinesHistory.size() << " : " << index << endl;
if(index > 0)
myLineEdit->setText(chatLinesHistory.at(chatLinesHistory.size()-(index)));
else
myLineEdit->setText("");
}
}
void ChatTools::nickAutoCompletition() {
QString myChatString = myLineEdit->text();
QStringList myChatStringList = myChatString.split(" ");
QString myChatString = myLineEdit->text();
QStringList myChatStringList = myChatString.split(" ");
QStringList matchStringList;
QStringList matchStringList;
if(nickAutoCompletitionCounter == 0) {
if(nickAutoCompletitionCounter == 0) {
if(myNickTreeWidget) {
QTreeWidgetItemIterator it(myNickTreeWidget);
while (*it) {
if ((*it)->text(0).startsWith(myChatStringList.last(), Qt::CaseInsensitive) && myChatStringList.last() != "")
matchStringList << (*it)->text(0);
++it;
}
}
if(myNickTreeWidget) {
QTreeWidgetItemIterator it(myNickTreeWidget);
while (*it) {
if ((*it)->text(0).startsWith(myChatStringList.last(), Qt::CaseInsensitive) && myChatStringList.last() != "")
matchStringList << (*it)->text(0);
++it;
}
}
if(!myNickStringList.isEmpty()) {
if(!myNickStringList.isEmpty()) {
QStringListIterator it(myNickStringList);
while (it.hasNext()) {
QString next = it.next();
if (next.startsWith(myChatStringList.last(), Qt::CaseInsensitive) && myChatStringList.last() != "")
matchStringList << next;
}
}
}
QStringListIterator it(myNickStringList);
while (it.hasNext()) {
QString next = it.next();
if (next.startsWith(myChatStringList.last(), Qt::CaseInsensitive) && myChatStringList.last() != "")
matchStringList << next;
}
}
}
if(!matchStringList.isEmpty() || nickAutoCompletitionCounter > 0) {
myChatStringList.removeLast();
if(!matchStringList.isEmpty() || nickAutoCompletitionCounter > 0) {
// cout << nickAutoCompletitionCounter << endl;
myChatStringList.removeLast();
if(nickAutoCompletitionCounter == 0) {
//first one
lastChatString = myChatStringList.join(" ");
lastMatchStringList = matchStringList;
}
// cout << nickAutoCompletitionCounter << endl;
if(nickAutoCompletitionCounter == lastMatchStringList.size()) nickAutoCompletitionCounter = 0;
if(nickAutoCompletitionCounter == 0) {
//first one
lastChatString = myChatStringList.join(" ");
lastMatchStringList = matchStringList;
}
// cout << nickAutoCompletitionCounter << "\n";
if(lastChatString == "")
myLineEdit->setText(lastMatchStringList.at(nickAutoCompletitionCounter)+": ");
else
myLineEdit->setText(lastChatString+" "+lastMatchStringList.at(nickAutoCompletitionCounter)+" ");
nickAutoCompletitionCounter++;
}
if(nickAutoCompletitionCounter == lastMatchStringList.size()) nickAutoCompletitionCounter = 0;
// cout << nickAutoCompletitionCounter << "\n";
if(lastChatString == "")
myLineEdit->setText(lastMatchStringList.at(nickAutoCompletitionCounter)+": ");
else
myLineEdit->setText(lastChatString+" "+lastMatchStringList.at(nickAutoCompletitionCounter)+" ");
nickAutoCompletitionCounter++;
}
}
void ChatTools::setChatTextEdited() {
nickAutoCompletitionCounter = 0;
nickAutoCompletitionCounter = 0;
}
void ChatTools::refreshIgnoreList()
{
}
+37 -36
View File
@@ -34,55 +34,56 @@ class gameLobbyDialogImpl;
class ChatTools : public QObject
{
Q_OBJECT
Q_OBJECT
public:
ChatTools(QLineEdit*, ConfigFile*, ChatType, QTextBrowser *b = NULL, QTreeWidget *t = NULL, gameLobbyDialogImpl *lo = NULL);
ChatTools(QLineEdit*, ConfigFile*, ChatType, QTextBrowser *b = NULL, QTreeWidget *t = NULL, gameLobbyDialogImpl *lo = NULL);
~ChatTools();
~ChatTools();
void setSession(boost::shared_ptr<Session> session) { mySession = session; }
void setSession(boost::shared_ptr<Session> session) { mySession = session; }
public slots:
void sendMessage();
void receiveMessage(QString playerName, QString message);
void clearChat();
void checkInputLength(QString string);
void fillChatLinesHistory(QString fillString);
void showChatHistoryIndex(int index);
int getChatLinesHistorySize() { return chatLinesHistory.size(); }
void nickAutoCompletition();
void setChatTextEdited();
void setPlayerNicksList(QStringList value) { myNickStringList = value; }
void setMyNick ( const QString& theValue ) { myNick = theValue; }
QString getMyNick () { return myNick; }
void sendMessage();
void receiveMessage(QString playerName, QString message);
void clearChat();
void checkInputLength(QString string);
void fillChatLinesHistory(QString fillString);
void showChatHistoryIndex(int index);
int getChatLinesHistorySize() { return chatLinesHistory.size(); }
void nickAutoCompletition();
void setChatTextEdited();
void setPlayerNicksList(QStringList value) { myNickStringList = value; }
void setMyNick ( const QString& theValue ) { myNick = theValue; }
QString getMyNick () { return myNick; }
void setMyStyle ( GameTableStyleReader* theValue ) { myStyle = theValue; }
void refreshIgnoreList();
void setMyStyle ( GameTableStyleReader* theValue ) { myStyle = theValue; }
private:
QStringList chatLinesHistory;
QString lastChatString;
QStringList lastMatchStringList;
int nickAutoCompletitionCounter;
QStringList chatLinesHistory;
QString lastChatString;
QStringList lastMatchStringList;
int nickAutoCompletitionCounter;
QLineEdit *myLineEdit;
QTreeWidget *myNickTreeWidget;
QStringList myNickStringList;
QTextBrowser *myTextBrowser;
boost::shared_ptr<Session> mySession;
ChatType myChatType;
ConfigFile *myConfig;
QString myNick;
QLineEdit *myLineEdit;
QTreeWidget *myNickTreeWidget;
QStringList myNickStringList;
QTextBrowser *myTextBrowser;
boost::shared_ptr<Session> mySession;
ChatType myChatType;
ConfigFile *myConfig;
GameTableStyleReader *myStyle;
gameLobbyDialogImpl *myLobby;
QString myNick;
GameTableStyleReader *myStyle;
gameLobbyDialogImpl *myLobby;
};
#endif
@@ -21,6 +21,8 @@
#include <net/socket_msg.h>
#include "mymessagedialogimpl.h"
using namespace std;
gameLobbyDialogImpl::gameLobbyDialogImpl(startWindowImpl *parent, ConfigFile *c)
: QDialog(parent), myW(NULL), myStartWindow(parent), myConfig(c), currentGameName(""), myPlayerId(0), myCurrentGameId(0), isGameAdministrator(false), inGame(false), guestMode(false), blinkingButtonAnimationState(true), myChat(NULL), keyUpCounter(0), infoMsgToShowId(0), currentInvitationGameId(0), inviteDialogIsCurrentlyShown(false)
{
@@ -86,6 +88,8 @@ gameLobbyDialogImpl::gameLobbyDialogImpl(startWindowImpl *parent, ConfigFile *c)
nickListContextMenu = new QMenu();
nickListInviteAction = new QAction(QIcon(":/gfx/list_add_user.png"), tr("Invite player"), nickListContextMenu);
nickListContextMenu->addAction(nickListInviteAction);
nickListIgnorePlayerAction = new QAction(QIcon(":/gfx/im-ban-user.png"), tr("Ignore player"), nickListContextMenu);
nickListContextMenu->addAction(nickListIgnorePlayerAction);
connect( pushButton_CreateGame, SIGNAL( clicked() ), this, SLOT( createGame() ) );
connect( pushButton_JoinGame, SIGNAL( clicked() ), this, SLOT( joinGame() ) );
@@ -106,6 +110,7 @@ gameLobbyDialogImpl::gameLobbyDialogImpl(startWindowImpl *parent, ConfigFile *c)
connect( comboBox_gameListFilter, SIGNAL(currentIndexChanged(int)), this, SLOT(changeGameListFilter(int)));
connect( treeWidget_NickList, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT( showNickListContextMenu(QPoint) ) );
connect( nickListInviteAction, SIGNAL(triggered()), this, SLOT( invitePlayerToCurrentGame() ));
connect( nickListIgnorePlayerAction, SIGNAL(triggered()), this, SLOT( putPlayerOnIgnoreList() ));
lineEdit_ChatInput->installEventFilter(this);
@@ -1317,8 +1322,17 @@ void gameLobbyDialogImpl::showNickListContextMenu(QPoint p)
assert(mySession);
if(inGame && mySession->getClientGameInfo(mySession->getClientCurrentGameId()).data.gameType == GAME_TYPE_INVITE_ONLY && treeWidget_NickList->selectedItems().at(0)->data(0, Qt::UserRole).toUInt() != mySession->getClientUniquePlayerId()) {
nickListContextMenu->popup(treeWidget_NickList->mapToGlobal(p));
nickListInviteAction->setEnabled(true);
nickListInviteAction->setText(tr("Invite player %1").arg(QString::fromUtf8(mySession->getClientPlayerInfo(treeWidget_NickList->selectedItems().at(0)->data(0, Qt::UserRole).toUInt()).playerName.c_str())));
}
else {
nickListInviteAction->setText(tr("Invite player ..."));
nickListInviteAction->setEnabled(true);
}
nickListContextMenu->popup(treeWidget_NickList->mapToGlobal(p));
}
}
@@ -1365,13 +1379,14 @@ void gameLobbyDialogImpl::showInvitationDialog(unsigned gameId, unsigned playerI
}
void gameLobbyDialogImpl::chatInfoPlayerInviation(unsigned gameId, unsigned playerIdWho, unsigned playerIdFrom)
void gameLobbyDialogImpl::chatInfoPlayerInvitation(unsigned gameId, unsigned playerIdWho, unsigned playerIdFrom)
{
textBrowser_ChatDisplay->append(tr("<span style='color:blue;'>Player %1 has been invited to %2 by %3.</span>").arg(QString::fromUtf8(mySession->getClientPlayerInfo(playerIdWho).playerName.c_str())).arg(QString::fromUtf8(mySession->getClientGameInfo(gameId).name.c_str())).arg(QString::fromUtf8(mySession->getClientPlayerInfo(playerIdFrom).playerName.c_str())));
}
void gameLobbyDialogImpl::chatInfoPlayerRejectedInviation(unsigned gameId, unsigned playerIdWho, DenyGameInvitationReason reason)
void gameLobbyDialogImpl::chatInfoPlayerRejectedInvitation(unsigned gameId, unsigned playerIdWho, DenyGameInvitationReason reason)
{
QString string;
if(reason == DENY_GAME_INVITATION_NO) string = tr("<span style='color:red;'>Player %1 has rejected intivation to %2.</span>");
@@ -1380,3 +1395,34 @@ void gameLobbyDialogImpl::chatInfoPlayerRejectedInviation(unsigned gameId, unsig
textBrowser_ChatDisplay->append(string.arg(QString::fromUtf8(mySession->getClientPlayerInfo(playerIdWho).playerName.c_str())).arg(QString::fromUtf8(mySession->getClientGameInfo(gameId).name.c_str())));
}
bool gameLobbyDialogImpl::playerIsOnIgnoreList(unsigned playerId) {
list<std::string> playerIgnoreList = myConfig->readConfigStringList("PlayerIgnoreList");
list<std::string>::iterator it1;
for(it1= playerIgnoreList.begin(); it1 != playerIgnoreList.end(); it1++) {
QString tmpString = QString::fromUtf8(it1->c_str());
if(QString("%1").arg(playerId) == tmpString.split(",").at(0)) {
return true;
}
}
return false;
}
void gameLobbyDialogImpl::putPlayerOnIgnoreList(unsigned playerId) {
if(!playerIsOnIgnoreList(playerId)) {
list<std::string> playerIgnoreList = myConfig->readConfigStringList("PlayerIgnoreList");
playerIgnoreList.push_back(QString("%1,%2").arg(playerId).arg(QString::fromUtf8(mySession->getClientPlayerInfo(playerId).playerName.c_str())).toUtf8().constData());
myConfig->writeConfigStringList("PlayerIgnoreList", playerIgnoreList);
myConfig->writeBuffer();
myChat->refreshIgnoreList();
}
}
@@ -106,8 +106,10 @@ public slots:
void invitePlayerToCurrentGame();
void showInfoMsgBox();
void showInvitationDialog(unsigned gameId, unsigned playerIdFrom);
void chatInfoPlayerInviation(unsigned gameId, unsigned playerIdWho, unsigned playerIdFrom);
void chatInfoPlayerRejectedInviation(unsigned gameId, unsigned playerIdWho, DenyGameInvitationReason reason);
void chatInfoPlayerInvitation(unsigned gameId, unsigned playerIdWho, unsigned playerIdFrom);
void chatInfoPlayerRejectedInvitation(unsigned gameId, unsigned playerIdWho, DenyGameInvitationReason reason);
void putPlayerOnIgnoreList(unsigned playerid);
bool playerIsOnIgnoreList(unsigned playerid);
private:
@@ -140,7 +142,7 @@ private:
MyGameListSortFilterProxyModel *myGameListSortFilterProxyModel;
QMenu *nickListContextMenu;
QAction *nickListInviteAction;
QAction *ignorePlayerAction;
QAction *nickListIgnorePlayerAction;
int infoMsgToShowId;
int currentInvitationGameId;
bool inviteDialogIsCurrentlyShown;
Binary file not shown.

After

Width:  |  Height:  |  Size: 830 B

+1
View File
@@ -44,6 +44,7 @@
<file>ktip.png</file>
<file>system_help_64.png</file>
<file>list_add_user_64.png</file>
<file>im-ban-user.png</file>
</qresource>
<qresource prefix="/cflags">
<file>cflags/ad.png</file>
+352 -330
View File
@@ -125,7 +125,7 @@
<item>
<widget class="QStackedWidget" name="stackedWidget">
<property name="currentIndex">
<number>5</number>
<number>0</number>
</property>
<widget class="QWidget" name="page">
<layout class="QGridLayout" name="gridLayout_8">
@@ -1464,319 +1464,384 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="1" column="0">
<item row="1" column="0" colspan="2">
<widget class="Line" name="line_9">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_43">
<property name="text">
<string>&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
<item row="2" column="0" colspan="2">
<widget class="QTabWidget" name="tabWidget_2">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Server</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_18">
<item row="0" column="0">
<widget class="QGroupBox" name="groupBox_automaticServerConfig">
<property name="title">
<string>Automatic Server Configuration URL</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QLabel" name="label_18">
<property name="text">
<string>Serverlist Address:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit_InternetServerListAddress"/>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QGroupBox" name="groupBox_manualServerConfig">
<property name="minimumSize">
<size>
<width>0</width>
<height>116</height>
</size>
</property>
<property name="title">
<string>Manual Server Configuration</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0">
<widget class="QLabel" name="label_41">
<property name="text">
<string>Server Address:</string>
</property>
<property name="buddy">
<cstring>lineEdit_InternetServerAddress</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit_InternetServerAddress">
<property name="maxLength">
<number>60</number>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_31">
<property name="text">
<string>Server Port:</string>
</property>
<property name="buddy">
<cstring>spinBox_InternetServerPort</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="spinBox_InternetServerPort">
<property name="minimum">
<number>80</number>
</property>
<property name="maximum">
<number>65535</number>
</property>
<property name="value">
<number>7234</number>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="checkBox_useAvatarServer">
<property name="text">
<string>Avatar Server:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="lineEdit_avatarServerAddress"/>
</item>
<item row="3" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QCheckBox" name="checkBox_InternetServerUseIpv6">
<property name="text">
<string>Use IPv6</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_32">
<property name="text">
<string>&lt;a href=&quot;http://en.wikipedia.org/wiki/Ipv6&quot;&gt;What is this?&lt;/a&gt;</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="checkBox_InternetServerUseSctp">
<property name="text">
<string>Use SCTP</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_42">
<property name="text">
<string>&lt;a href=&quot;http://en.wikipedia.org/wiki/Stream_Control_Transmission_Protocol&quot;&gt;What is this?&lt;/a&gt;</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_5">
<attribute name="title">
<string>Game</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="0">
<widget class="QLabel" name="label_43">
<property name="text">
<string>&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot;font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-style:italic;&quot;&gt;Note: Default &lt;/span&gt;&lt;span style=&quot; font-weight:600; font-style:italic;&quot;&gt;Game Settings&lt;/span&gt;&lt;span style=&quot; font-style:italic;&quot;&gt; like &quot;Maximum number of players&quot;, &quot;Start Cash&quot; and &quot;Small Blind&quot; will be used &lt;/span&gt;&lt;span style=&quot; font-weight:600; font-style:italic;&quot;&gt;from Network Game Settings.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QGroupBox" name="groupBox_4">
<property name="title">
<string>Internet Server</string>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="0">
<widget class="QGroupBox" name="groupBox_automaticServerConfig">
<property name="title">
<string>Automatic Server Configuration URL</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<property name="topMargin">
<number>4</number>
</property>
<property name="bottomMargin">
<number>6</number>
<property name="wordWrap">
<bool>true</bool>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_18">
</widget>
</item>
<item row="1" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<widget class="QLabel" name="label_23">
<property name="text">
<string>Serverlist Address:</string>
<string>Default game name:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit_InternetServerListAddress"/>
<item>
<widget class="QLineEdit" name="lineEdit_internetGameName"/>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QGroupBox" name="groupBox_manualServerConfig">
<property name="minimumSize">
<size>
<width>0</width>
<height>116</height>
</size>
</property>
<property name="title">
<string>Manual Server Configuration</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<property name="topMargin">
<number>4</number>
</item>
<item row="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QLabel" name="label_17">
<property name="text">
<string>Default game type:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox_internetGameType">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>Standard</string>
</property>
<property name="icon">
<iconset resource="resources/pokerth.qrc">
<normaloff>:/gfx/player_play.png</normaloff>:/gfx/player_play.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>Registered players only</string>
</property>
<property name="icon">
<iconset resource="resources/pokerth.qrc">
<normaloff>:/gfx/registered.png</normaloff>:/gfx/registered.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>Invited players only</string>
</property>
<property name="icon">
<iconset resource="resources/pokerth.qrc">
<normaloff>:/gfx/list_add_user.png</normaloff>:/gfx/list_add_user.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>Ranking game</string>
</property>
<property name="icon">
<iconset resource="resources/pokerth.qrc">
<normaloff>:/gfx/cup.png</normaloff>:/gfx/cup.png</iconset>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item row="3" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>0</number>
</property>
<property name="bottomMargin">
<item>
<widget class="QCheckBox" name="checkBox_UseInternetGamePassword">
<property name="text">
<string>Use password for private game:</string>
</property>
<property name="icon">
<iconset resource="resources/pokerth.qrc">
<normaloff>:/gfx/lock.png</normaloff>:/gfx/lock.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_InternetGamePassword">
<property name="enabled">
<bool>false</bool>
</property>
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
</widget>
</item>
</layout>
</item>
<item row="4" column="0">
<widget class="QCheckBox" name="checkBox_UseLobbyChat">
<property name="text">
<string>Show lobby chat</string>
</property>
</widget>
</item>
<item row="5" column="0">
<spacer name="spacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>437</width>
<height>72</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_6">
<attribute name="title">
<string>Ignored Players</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_19">
<item row="0" column="0">
<widget class="QTreeWidget" name="treeWidget_internetGameIgnoredPlayers">
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="indentation">
<number>5</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_41">
<property name="text">
<string>Server Address:</string>
</property>
<property name="buddy">
<cstring>lineEdit_InternetServerAddress</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit_InternetServerAddress">
<property name="maxLength">
<number>60</number>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_31">
<property name="text">
<string>Server Port:</string>
</property>
<property name="buddy">
<cstring>spinBox_InternetServerPort</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="spinBox_InternetServerPort">
<property name="minimum">
<number>80</number>
</property>
<property name="maximum">
<number>65535</number>
</property>
<property name="value">
<number>7234</number>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="checkBox_useAvatarServer">
<property name="text">
<string>Avatar Server:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="lineEdit_avatarServerAddress"/>
</item>
<item row="3" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QCheckBox" name="checkBox_InternetServerUseIpv6">
<property name="text">
<string>Use IPv6</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_32">
<property name="text">
<string>&lt;a href=&quot;http://en.wikipedia.org/wiki/Ipv6&quot;&gt;What is this?&lt;/a&gt;</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="checkBox_InternetServerUseSctp">
<property name="text">
<string>Use SCTP</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_42">
<property name="text">
<string>&lt;a href=&quot;http://en.wikipedia.org/wiki/Stream_Control_Transmission_Protocol&quot;&gt;What is this?&lt;/a&gt;</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
<property name="rootIsDecorated">
<bool>false</bool>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
<column>
<property name="text">
<string>Player</string>
</property>
</column>
</widget>
</item>
<item row="0" column="1" rowspan="2">
<spacer name="horizontalSpacer_9">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>256</width>
<height>218</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<widget class="QPushButton" name="pushButton">
<property name="text">
<string>Remove Player</string>
</property>
<property name="icon">
<iconset resource="resources/pokerth.qrc">
<normaloff>:/gfx/list-remove.png</normaloff>:/gfx/list-remove.png</iconset>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item row="4" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<widget class="QLabel" name="label_23">
<property name="text">
<string>Default game name:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_internetGameName"/>
</item>
</layout>
</item>
<item row="5" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QLabel" name="label_17">
<property name="text">
<string>Default game type:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox_internetGameType">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>Standard</string>
</property>
<property name="icon">
<iconset resource="resources/pokerth.qrc">
<normaloff>:/gfx/player_play.png</normaloff>:/gfx/player_play.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>Registered players only</string>
</property>
<property name="icon">
<iconset resource="resources/pokerth.qrc">
<normaloff>:/gfx/registered.png</normaloff>:/gfx/registered.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>Invited players only</string>
</property>
<property name="icon">
<iconset resource="resources/pokerth.qrc">
<normaloff>:/gfx/list_add_user.png</normaloff>:/gfx/list_add_user.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>Ranking game</string>
</property>
<property name="icon">
<iconset resource="resources/pokerth.qrc">
<normaloff>:/gfx/cup.png</normaloff>:/gfx/cup.png</iconset>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item row="6" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="QCheckBox" name="checkBox_UseInternetGamePassword">
<property name="text">
<string>Use password for private game:</string>
</property>
<property name="icon">
<iconset resource="resources/pokerth.qrc">
<normaloff>:/gfx/lock.png</normaloff>:/gfx/lock.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_InternetGamePassword">
<property name="enabled">
<bool>false</bool>
</property>
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
</widget>
</item>
</layout>
</item>
<item row="7" column="0">
<widget class="QCheckBox" name="checkBox_UseLobbyChat">
<property name="text">
<string>Show lobby chat</string>
</property>
</widget>
</item>
<item row="8" column="0">
<spacer>
<item row="3" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>437</width>
<height>16</height>
<width>20</width>
<height>121</height>
</size>
</property>
</spacer>
@@ -3452,17 +3517,6 @@ p, li { white-space: pre-wrap; }
<tabstop>spinBox_serverPort</tabstop>
<tabstop>checkBox_useIpv6</tabstop>
<tabstop>checkBox_useSctp</tabstop>
<tabstop>groupBox_automaticServerConfig</tabstop>
<tabstop>lineEdit_InternetServerListAddress</tabstop>
<tabstop>groupBox_manualServerConfig</tabstop>
<tabstop>lineEdit_InternetServerAddress</tabstop>
<tabstop>spinBox_InternetServerPort</tabstop>
<tabstop>checkBox_useAvatarServer</tabstop>
<tabstop>lineEdit_avatarServerAddress</tabstop>
<tabstop>checkBox_InternetServerUseIpv6</tabstop>
<tabstop>checkBox_InternetServerUseSctp</tabstop>
<tabstop>checkBox_UseInternetGamePassword</tabstop>
<tabstop>lineEdit_InternetGamePassword</tabstop>
<tabstop>pushButton_HumanPlayerAvatar</tabstop>
<tabstop>lineEdit_HumanPlayerName</tabstop>
<tabstop>pushButton_Opponent1Avatar</tabstop>
@@ -3526,22 +3580,6 @@ p, li { white-space: pre-wrap; }
</hint>
</hints>
</connection>
<connection>
<sender>checkBox_UseInternetGamePassword</sender>
<signal>toggled(bool)</signal>
<receiver>lineEdit_InternetGamePassword</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>402</x>
<y>434</y>
</hint>
<hint type="destinationlabel">
<x>774</x>
<y>436</y>
</hint>
</hints>
</connection>
<connection>
<sender>horizontalSlider_soundVolume</sender>
<signal>valueChanged(int)</signal>
@@ -3590,22 +3628,6 @@ p, li { white-space: pre-wrap; }
</hint>
</hints>
</connection>
<connection>
<sender>checkBox_useAvatarServer</sender>
<signal>toggled(bool)</signal>
<receiver>lineEdit_avatarServerAddress</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>314</x>
<y>318</y>
</hint>
<hint type="destinationlabel">
<x>366</x>
<y>320</y>
</hint>
</hints>
</connection>
<connection>
<sender>radioButton_flipsideOwn</sender>
<signal>toggled(bool)</signal>
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -162,8 +162,8 @@ startWindowImpl::startWindowImpl(ConfigFile *c)
connect(this, SIGNAL(signalNetClientGameStart(boost::shared_ptr<Game>)), this, SLOT(networkStart(boost::shared_ptr<Game>)));
connect(this, SIGNAL(signalSelfGameInvitation(unsigned, unsigned)), myGameLobbyDialog, SLOT(showInvitationDialog(unsigned, unsigned)));
connect(this, SIGNAL(signalPlayerGameInvitation(unsigned, unsigned, unsigned)), myGameLobbyDialog, SLOT(chatInfoPlayerInviation(unsigned, unsigned, unsigned)));
connect(this, SIGNAL(signalRejectedGameInvitation(unsigned, unsigned, DenyGameInvitationReason)), myGameLobbyDialog, SLOT(chatInfoPlayerRejectedInviation(unsigned, unsigned, DenyGameInvitationReason)));
connect(this, SIGNAL(signalPlayerGameInvitation(unsigned, unsigned, unsigned)), myGameLobbyDialog, SLOT(chatInfoPlayerInvitation(unsigned, unsigned, unsigned)));
connect(this, SIGNAL(signalRejectedGameInvitation(unsigned, unsigned, DenyGameInvitationReason)), myGameLobbyDialog, SLOT(chatInfoPlayerRejectedInvitation(unsigned, unsigned, DenyGameInvitationReason)));
this->show();