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
+8 -6
View File
@@ -48,7 +48,7 @@ ConfigFile::ConfigFile(char *argv0, bool readonly) : noWriteAccess(readonly)
myQtToolsInterface = CreateQtToolsWrapper(); myQtToolsInterface = CreateQtToolsWrapper();
// !!!! Revisionsnummer der Configdefaults !!!!! // !!!! Revisionsnummer der Configdefaults !!!!!
configRev = 82; configRev = 83;
//standard defaults //standard defaults
logOnOffDefault = "1"; logOnOffDefault = "1";
@@ -271,11 +271,12 @@ ConfigFile::ConfigFile(char *argv0, bool readonly) : noWriteAccess(readonly)
configList.push_back(ConfigInfo("InternetLoginPassword", CONFIG_TYPE_STRING, "")); configList.push_back(ConfigInfo("InternetLoginPassword", CONFIG_TYPE_STRING, ""));
configList.push_back(ConfigInfo("InternetSavePassword", CONFIG_TYPE_INT, "0")); configList.push_back(ConfigInfo("InternetSavePassword", CONFIG_TYPE_INT, "0"));
configList.push_back(ConfigInfo("IfInfoMessageShowList", CONFIG_TYPE_STRING_LIST, "Msg")); configList.push_back(ConfigInfo("IfInfoMessageShowList", CONFIG_TYPE_STRING_LIST, "Msg"));
configList.push_back(ConfigInfo("PlayerIgnoreList", CONFIG_TYPE_STRING_LIST, "Player"));
//fill tempList firstTime //fill tempList firstTime
configBufferList = configList; configBufferList = configList;
// cout << configTempList[3].name << " " << configTempList[10].defaultValue << endl; // cout << configTempList[3].name << " " << configTempList[10].defaultValue << endl;
if(!noWriteAccess) { if(!noWriteAccess) {
configFileName += "config.xml"; configFileName += "config.xml";
@@ -367,7 +368,7 @@ void ConfigFile::fillBuffer() {
} }
else { LOG_ERROR("Could not find the root element in the config file!"); } else { LOG_ERROR("Could not find the root element in the config file!"); }
// cout << configBufferList[i].name << " " << configBufferList[i].defaultValue << endl; // cout << configBufferList[i].name << " " << configBufferList[i].defaultValue << endl;
} }
} }
} }
@@ -497,8 +498,8 @@ void ConfigFile::updateConfig(ConfigState myConfigState) {
TiXmlElement* oldConf = oldDocHandle.FirstChild( "PokerTH" ).FirstChild( "Configuration" ).FirstChild( configList[i].name ).ToElement(); TiXmlElement* oldConf = oldDocHandle.FirstChild( "PokerTH" ).FirstChild( "Configuration" ).FirstChild( configList[i].name ).ToElement();
// //HACK remove after 0.6 // //HACK remove after 0.6
// TiXmlElement* ISAIRCChannelUpdateDone = oldDocHandle.FirstChild( "PokerTH" ).FirstChild( "Configuration" ).FirstChild( "InternetServerAddressIRCChannelUpdateDone" ).ToElement(); // TiXmlElement* ISAIRCChannelUpdateDone = oldDocHandle.FirstChild( "PokerTH" ).FirstChild( "Configuration" ).FirstChild( "InternetServerAddressIRCChannelUpdateDone" ).ToElement();
if ( oldConf /*&& (ISAIRCChannelUpdateDone || !(configList[i].name == "IRCChannel" || (configList[i].name == "InternetServerAddress" )))*/ /*HACK remove after 0.6*/ ) { if ( oldConf /*&& (ISAIRCChannelUpdateDone || !(configList[i].name == "IRCChannel" || (configList[i].name == "InternetServerAddress" )))*/ /*HACK remove after 0.6*/ ) {
// if element is already there --> take over the saved values // if element is already there --> take over the saved values
@@ -583,7 +584,7 @@ string ConfigFile::readConfigString(string varName) const
} }
return tempString; return tempString;
} }
int ConfigFile::readConfigInt(string varName) const int ConfigFile::readConfigInt(string varName) const
{ {
@@ -719,3 +720,4 @@ void ConfigFile::writeConfigStringList(string varName, list<string> varCont)
if (configBufferList[i].name == varName) { configBufferList[i].defaultListValue = varCont; } if (configBufferList[i].name == varName) { configBufferList[i].defaultListValue = varCont; }
} }
} }
+12 -4
View File
@@ -69,7 +69,7 @@ void ChatTools::receiveMessage(QString playerName, QString message) {
case INET_LOBBY_CHAT: { case INET_LOBBY_CHAT: {
tempMsg = QString("<span style=\"font-weight:bold;\">"+message+"</span>"); tempMsg = QString("<span style=\"font-weight:bold;\">"+message+"</span>");
//play beep sound only in INET-lobby-chat //play beep sound only in INET-lobby-chat
// TODO dont play when message is from yourself // TODO dont play when message is from yourself
if(myLobby->isVisible() && myConfig->readConfigInt("PlayLobbyChatNotification")) { if(myLobby->isVisible() && myConfig->readConfigInt("PlayLobbyChatNotification")) {
myLobby->getMyW()->getMySDLPlayer()->playSound("lobbychatnotify",0); myLobby->getMyW()->getMySDLPlayer()->playSound("lobbychatnotify",0);
} }
@@ -94,6 +94,8 @@ void ChatTools::receiveMessage(QString playerName, QString message) {
} }
} }
myTextBrowser->append(playerName + ": " + tempMsg); myTextBrowser->append(playerName + ": " + tempMsg);
} }
} }
@@ -121,7 +123,7 @@ void ChatTools::showChatHistoryIndex(int index) {
if(index <= chatLinesHistory.size()) { if(index <= chatLinesHistory.size()) {
// cout << chatLinesHistory.size() << " : " << index << endl; // cout << chatLinesHistory.size() << " : " << index << endl;
if(index > 0) if(index > 0)
myLineEdit->setText(chatLinesHistory.at(chatLinesHistory.size()-(index))); myLineEdit->setText(chatLinesHistory.at(chatLinesHistory.size()-(index)));
else else
@@ -162,7 +164,7 @@ void ChatTools::nickAutoCompletition() {
myChatStringList.removeLast(); myChatStringList.removeLast();
// cout << nickAutoCompletitionCounter << endl; // cout << nickAutoCompletitionCounter << endl;
if(nickAutoCompletitionCounter == 0) { if(nickAutoCompletitionCounter == 0) {
//first one //first one
@@ -172,7 +174,7 @@ void ChatTools::nickAutoCompletition() {
if(nickAutoCompletitionCounter == lastMatchStringList.size()) nickAutoCompletitionCounter = 0; if(nickAutoCompletitionCounter == lastMatchStringList.size()) nickAutoCompletitionCounter = 0;
// cout << nickAutoCompletitionCounter << "\n"; // cout << nickAutoCompletitionCounter << "\n";
if(lastChatString == "") if(lastChatString == "")
myLineEdit->setText(lastMatchStringList.at(nickAutoCompletitionCounter)+": "); myLineEdit->setText(lastMatchStringList.at(nickAutoCompletitionCounter)+": ");
@@ -187,3 +189,9 @@ void ChatTools::setChatTextEdited() {
nickAutoCompletitionCounter = 0; nickAutoCompletitionCounter = 0;
} }
void ChatTools::refreshIgnoreList()
{
}
+2 -1
View File
@@ -34,7 +34,7 @@ class gameLobbyDialogImpl;
class ChatTools : public QObject class ChatTools : public QObject
{ {
Q_OBJECT Q_OBJECT
public: 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);
@@ -62,6 +62,7 @@ public slots:
QString getMyNick () { return myNick; } QString getMyNick () { return myNick; }
void setMyStyle ( GameTableStyleReader* theValue ) { myStyle = theValue; } void setMyStyle ( GameTableStyleReader* theValue ) { myStyle = theValue; }
void refreshIgnoreList();
private: private:
@@ -21,6 +21,8 @@
#include <net/socket_msg.h> #include <net/socket_msg.h>
#include "mymessagedialogimpl.h" #include "mymessagedialogimpl.h"
using namespace std;
gameLobbyDialogImpl::gameLobbyDialogImpl(startWindowImpl *parent, ConfigFile *c) 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) : 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(); nickListContextMenu = new QMenu();
nickListInviteAction = new QAction(QIcon(":/gfx/list_add_user.png"), tr("Invite player"), nickListContextMenu); nickListInviteAction = new QAction(QIcon(":/gfx/list_add_user.png"), tr("Invite player"), nickListContextMenu);
nickListContextMenu->addAction(nickListInviteAction); 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_CreateGame, SIGNAL( clicked() ), this, SLOT( createGame() ) );
connect( pushButton_JoinGame, SIGNAL( clicked() ), this, SLOT( joinGame() ) ); 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( comboBox_gameListFilter, SIGNAL(currentIndexChanged(int)), this, SLOT(changeGameListFilter(int)));
connect( treeWidget_NickList, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT( showNickListContextMenu(QPoint) ) ); connect( treeWidget_NickList, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT( showNickListContextMenu(QPoint) ) );
connect( nickListInviteAction, SIGNAL(triggered()), this, SLOT( invitePlayerToCurrentGame() )); connect( nickListInviteAction, SIGNAL(triggered()), this, SLOT( invitePlayerToCurrentGame() ));
connect( nickListIgnorePlayerAction, SIGNAL(triggered()), this, SLOT( putPlayerOnIgnoreList() ));
lineEdit_ChatInput->installEventFilter(this); lineEdit_ChatInput->installEventFilter(this);
@@ -1317,8 +1322,17 @@ void gameLobbyDialogImpl::showNickListContextMenu(QPoint p)
assert(mySession); 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()) { 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()))); 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; QString string;
if(reason == DENY_GAME_INVITATION_NO) string = tr("<span style='color:red;'>Player %1 has rejected intivation to %2.</span>"); 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()))); 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 invitePlayerToCurrentGame();
void showInfoMsgBox(); void showInfoMsgBox();
void showInvitationDialog(unsigned gameId, unsigned playerIdFrom); void showInvitationDialog(unsigned gameId, unsigned playerIdFrom);
void chatInfoPlayerInviation(unsigned gameId, unsigned playerIdWho, unsigned playerIdFrom); void chatInfoPlayerInvitation(unsigned gameId, unsigned playerIdWho, unsigned playerIdFrom);
void chatInfoPlayerRejectedInviation(unsigned gameId, unsigned playerIdWho, DenyGameInvitationReason reason); void chatInfoPlayerRejectedInvitation(unsigned gameId, unsigned playerIdWho, DenyGameInvitationReason reason);
void putPlayerOnIgnoreList(unsigned playerid);
bool playerIsOnIgnoreList(unsigned playerid);
private: private:
@@ -140,7 +142,7 @@ private:
MyGameListSortFilterProxyModel *myGameListSortFilterProxyModel; MyGameListSortFilterProxyModel *myGameListSortFilterProxyModel;
QMenu *nickListContextMenu; QMenu *nickListContextMenu;
QAction *nickListInviteAction; QAction *nickListInviteAction;
QAction *ignorePlayerAction; QAction *nickListIgnorePlayerAction;
int infoMsgToShowId; int infoMsgToShowId;
int currentInvitationGameId; int currentInvitationGameId;
bool inviteDialogIsCurrentlyShown; bool inviteDialogIsCurrentlyShown;
Binary file not shown.

After

Width:  |  Height:  |  Size: 830 B

+1
View File
@@ -44,6 +44,7 @@
<file>ktip.png</file> <file>ktip.png</file>
<file>system_help_64.png</file> <file>system_help_64.png</file>
<file>list_add_user_64.png</file> <file>list_add_user_64.png</file>
<file>im-ban-user.png</file>
</qresource> </qresource>
<qresource prefix="/cflags"> <qresource prefix="/cflags">
<file>cflags/ad.png</file> <file>cflags/ad.png</file>
+104 -82
View File
@@ -125,7 +125,7 @@
<item> <item>
<widget class="QStackedWidget" name="stackedWidget"> <widget class="QStackedWidget" name="stackedWidget">
<property name="currentIndex"> <property name="currentIndex">
<number>5</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="page"> <widget class="QWidget" name="page">
<layout class="QGridLayout" name="gridLayout_8"> <layout class="QGridLayout" name="gridLayout_8">
@@ -1464,32 +1464,23 @@ p, li { white-space: pre-wrap; }
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="1" column="0" colspan="2">
<widget class="Line" name="line_9"> <widget class="Line" name="line_9">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item row="2" column="0" colspan="2">
<widget class="QLabel" name="label_43"> <widget class="QTabWidget" name="tabWidget_2">
<property name="text"> <property name="currentIndex">
<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; <number>0</number>
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>
<property name="wordWrap"> <widget class="QWidget" name="tab_2">
<bool>true</bool> <attribute name="title">
</property> <string>Server</string>
</widget> </attribute>
</item> <layout class="QGridLayout" name="gridLayout_18">
<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"> <item row="0" column="0">
<widget class="QGroupBox" name="groupBox_automaticServerConfig"> <widget class="QGroupBox" name="groupBox_automaticServerConfig">
<property name="title"> <property name="title">
@@ -1499,12 +1490,6 @@ p, li { white-space: pre-wrap; }
<bool>true</bool> <bool>true</bool>
</property> </property>
<layout class="QGridLayout" name="gridLayout_3"> <layout class="QGridLayout" name="gridLayout_3">
<property name="topMargin">
<number>4</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_18"> <widget class="QLabel" name="label_18">
<property name="text"> <property name="text">
@@ -1536,12 +1521,6 @@ p, li { white-space: pre-wrap; }
<bool>false</bool> <bool>false</bool>
</property> </property>
<layout class="QGridLayout" name="gridLayout_4"> <layout class="QGridLayout" name="gridLayout_4">
<property name="topMargin">
<number>4</number>
</property>
<property name="bottomMargin">
<number>5</number>
</property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_41"> <widget class="QLabel" name="label_41">
<property name="text"> <property name="text">
@@ -1661,8 +1640,25 @@ p, li { white-space: pre-wrap; }
</item> </item>
</layout> </layout>
</widget> </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>
<item row="4" column="0"> <item row="1" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_8"> <layout class="QHBoxLayout" name="horizontalLayout_8">
<item> <item>
<widget class="QLabel" name="label_23"> <widget class="QLabel" name="label_23">
@@ -1676,7 +1672,7 @@ p, li { white-space: pre-wrap; }
</item> </item>
</layout> </layout>
</item> </item>
<item row="5" column="0"> <item row="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_6"> <layout class="QHBoxLayout" name="horizontalLayout_6">
<item> <item>
<widget class="QLabel" name="label_17"> <widget class="QLabel" name="label_17">
@@ -1733,7 +1729,7 @@ p, li { white-space: pre-wrap; }
</item> </item>
</layout> </layout>
</item> </item>
<item row="6" column="0"> <item row="3" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing"> <property name="spacing">
<number>0</number> <number>0</number>
@@ -1761,22 +1757,91 @@ p, li { white-space: pre-wrap; }
</item> </item>
</layout> </layout>
</item> </item>
<item row="7" column="0"> <item row="4" column="0">
<widget class="QCheckBox" name="checkBox_UseLobbyChat"> <widget class="QCheckBox" name="checkBox_UseLobbyChat">
<property name="text"> <property name="text">
<string>Show lobby chat</string> <string>Show lobby chat</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="8" column="0"> <item row="5" column="0">
<spacer> <spacer name="spacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>437</width> <width>437</width>
<height>16</height> <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>
<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="3" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>121</height>
</size> </size>
</property> </property>
</spacer> </spacer>
@@ -3452,17 +3517,6 @@ p, li { white-space: pre-wrap; }
<tabstop>spinBox_serverPort</tabstop> <tabstop>spinBox_serverPort</tabstop>
<tabstop>checkBox_useIpv6</tabstop> <tabstop>checkBox_useIpv6</tabstop>
<tabstop>checkBox_useSctp</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>pushButton_HumanPlayerAvatar</tabstop>
<tabstop>lineEdit_HumanPlayerName</tabstop> <tabstop>lineEdit_HumanPlayerName</tabstop>
<tabstop>pushButton_Opponent1Avatar</tabstop> <tabstop>pushButton_Opponent1Avatar</tabstop>
@@ -3526,22 +3580,6 @@ p, li { white-space: pre-wrap; }
</hint> </hint>
</hints> </hints>
</connection> </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> <connection>
<sender>horizontalSlider_soundVolume</sender> <sender>horizontalSlider_soundVolume</sender>
<signal>valueChanged(int)</signal> <signal>valueChanged(int)</signal>
@@ -3590,22 +3628,6 @@ p, li { white-space: pre-wrap; }
</hint> </hint>
</hints> </hints>
</connection> </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> <connection>
<sender>radioButton_flipsideOwn</sender> <sender>radioButton_flipsideOwn</sender>
<signal>toggled(bool)</signal> <signal>toggled(bool)</signal>
@@ -98,8 +98,8 @@ settingsDialogImpl::settingsDialogImpl(QWidget *parent, ConfigFile *c, selectAva
connect( checkBox_UseInternetGamePassword, SIGNAL( toggled(bool) ), this, SLOT( clearInternetGamePassword(bool)) ); connect( checkBox_UseInternetGamePassword, SIGNAL( toggled(bool) ), this, SLOT( clearInternetGamePassword(bool)) );
// connect( spinBox_netFirstSmallBlind, SIGNAL( valueChanged(int) ), this, SLOT ( checkProperNetFirstSmallBlind(int))); // connect( spinBox_netFirstSmallBlind, SIGNAL( valueChanged(int) ), this, SLOT ( checkProperNetFirstSmallBlind(int)));
// connect( spinBox_firstSmallBlind, SIGNAL( valueChanged(int) ), this, SLOT ( checkProperFirstSmallBlind(int))); // connect( spinBox_firstSmallBlind, SIGNAL( valueChanged(int) ), this, SLOT ( checkProperFirstSmallBlind(int)));
connect( radioButton_netManualBlindsOrder, SIGNAL( toggled(bool) ), this, SLOT( setFirstSmallBlindMargin() )); connect( radioButton_netManualBlindsOrder, SIGNAL( toggled(bool) ), this, SLOT( setFirstSmallBlindMargin() ));
connect( radioButton_manualBlindsOrder, SIGNAL( toggled(bool) ), this, SLOT( setFirstSmallBlindMargin() )); connect( radioButton_manualBlindsOrder, SIGNAL( toggled(bool) ), this, SLOT( setFirstSmallBlindMargin() ));
@@ -211,6 +211,14 @@ void settingsDialogImpl::exec() {
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()));
std::list<std::string> playerIgnoreList = myConfig->readConfigStringList("PlayerIgnoreList");
std::list<std::string>::iterator it5;
for(it5= playerIgnoreList.begin(); it5 != playerIgnoreList.end(); it5++) {
QTreeWidgetItem *item = new QTreeWidgetItem(treeWidget_internetGameIgnoredPlayers);
item->setText(0, QString::fromUtf8(it5->c_str()).split(",").at(1) );
item->setData(0, Qt::UserRole, QString::fromUtf8(it5->c_str()).split(",").at(0) );
}
//Interface //Interface
comboBox_switchLanguage->setCurrentIndex(comboBox_switchLanguage->findData(QString::fromUtf8(myConfig->readConfigString("Language").c_str()).section('_', 0, 0))); comboBox_switchLanguage->setCurrentIndex(comboBox_switchLanguage->findData(QString::fromUtf8(myConfig->readConfigString("Language").c_str()).section('_', 0, 0)));
checkBox_showLeftToolbox->setChecked(myConfig->readConfigInt("ShowLeftToolBox")); checkBox_showLeftToolbox->setChecked(myConfig->readConfigInt("ShowLeftToolBox"));
@@ -227,7 +235,7 @@ void settingsDialogImpl::exec() {
//S t y l e //S t y l e
//TABLE //TABLE
// define PokerTH default GameTableStyle // define PokerTH default GameTableStyle
listWidget_gameTableStyles->clear(); listWidget_gameTableStyles->clear();
GameTableStyleReader defaultTableStyle(myConfig, this); GameTableStyleReader defaultTableStyle(myConfig, this);
@@ -370,7 +378,7 @@ void settingsDialogImpl::exec() {
} }
} }
// refresh Card Deck Style Preview // refresh Card Deck Style Preview
showCurrentCardDeckStylePreview(); showCurrentCardDeckStylePreview();
radioButton_flipsideTux->setChecked(myConfig->readConfigInt("FlipsideTux")); radioButton_flipsideTux->setChecked(myConfig->readConfigInt("FlipsideTux"));
@@ -428,7 +436,7 @@ void settingsDialogImpl::isAccepted() {
settingsCorrect = TRUE; settingsCorrect = TRUE;
// Player Nicks // Player Nicks
myConfig->writeConfigString("MyName", lineEdit_HumanPlayerName->text().trimmed().toUtf8().constData()); myConfig->writeConfigString("MyName", lineEdit_HumanPlayerName->text().trimmed().toUtf8().constData());
myConfig->writeConfigString("MyAvatar", pushButton_HumanPlayerAvatar->getMyLink().toUtf8().constData()); myConfig->writeConfigString("MyAvatar", pushButton_HumanPlayerAvatar->getMyLink().toUtf8().constData());
@@ -459,7 +467,7 @@ void settingsDialogImpl::isAccepted() {
myConfig->writeConfigString("Opponent9Name", lineEdit_Opponent9Name->text().toUtf8().constData()); myConfig->writeConfigString("Opponent9Name", lineEdit_Opponent9Name->text().toUtf8().constData());
myConfig->writeConfigString("Opponent9Avatar", pushButton_Opponent9Avatar->getMyLink().toUtf8().constData()); myConfig->writeConfigString("Opponent9Avatar", pushButton_Opponent9Avatar->getMyLink().toUtf8().constData());
// Local Game Settings // Local Game Settings
myConfig->writeConfigInt("NumberOfPlayers", spinBox_quantityPlayers->value()); myConfig->writeConfigInt("NumberOfPlayers", spinBox_quantityPlayers->value());
myConfig->writeConfigInt("StartCash", spinBox_startCash->value()); myConfig->writeConfigInt("StartCash", spinBox_startCash->value());
myConfig->writeConfigInt("FirstSmallBlind", spinBox_firstSmallBlind->value()); myConfig->writeConfigInt("FirstSmallBlind", spinBox_firstSmallBlind->value());
@@ -494,10 +502,10 @@ void settingsDialogImpl::isAccepted() {
myConfig->writeConfigInt("InternetServerConfigMode", 0); myConfig->writeConfigInt("InternetServerConfigMode", 0);
// QUrl serverList; // QUrl serverList;
// serverList.setUrl(lineEdit_InternetServerListAddress->text(),QUrl::StrictMode); // serverList.setUrl(lineEdit_InternetServerListAddress->text(),QUrl::StrictMode);
// QRegExp rx("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?"); // QRegExp rx("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?");
// if(lineEdit_InternetServerListAddress->text().contains(rx)) { // if(lineEdit_InternetServerListAddress->text().contains(rx)) {
if(lineEdit_InternetServerListAddress->text().contains("/") && lineEdit_InternetServerListAddress->text().contains(".") ) { if(lineEdit_InternetServerListAddress->text().contains("/") && lineEdit_InternetServerListAddress->text().contains(".") ) {
myConfig->writeConfigString("InternetServerListAddress", lineEdit_InternetServerListAddress->text().toUtf8().constData()); myConfig->writeConfigString("InternetServerListAddress", lineEdit_InternetServerListAddress->text().toUtf8().constData());
@@ -532,7 +540,15 @@ void settingsDialogImpl::isAccepted() {
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());
// Interface int k;
std::list<std::string> playerIgnoreList;
for(k=0; k<treeWidget_internetGameIgnoredPlayers->topLevelItemCount(); k++) {
playerIgnoreList.push_back(QString("%1,%2").arg(treeWidget_internetGameIgnoredPlayers->topLevelItem(k)->data(0,Qt::UserRole).toUInt()).arg(treeWidget_internetGameIgnoredPlayers->topLevelItem(k)->text(0)).toUtf8().constData());
}
myConfig->writeConfigStringList("PlayerIgnoreList", playerIgnoreList);
// Interface
myConfig->writeConfigString("Language", comboBox_switchLanguage->itemData(comboBox_switchLanguage->currentIndex()).toString().toUtf8().constData()); myConfig->writeConfigString("Language", comboBox_switchLanguage->itemData(comboBox_switchLanguage->currentIndex()).toString().toUtf8().constData());
myConfig->writeConfigInt("ShowLeftToolBox", checkBox_showLeftToolbox->isChecked()); myConfig->writeConfigInt("ShowLeftToolBox", checkBox_showLeftToolbox->isChecked());
myConfig->writeConfigInt("ShowRightToolBox", checkBox_showRightToolbox->isChecked()); myConfig->writeConfigInt("ShowRightToolBox", checkBox_showRightToolbox->isChecked());
@@ -559,7 +575,7 @@ void settingsDialogImpl::isAccepted() {
} }
//S T Y L E //S T Y L E
// TABLE // TABLE
//save game table styles list //save game table styles list
myGameTableStylesList.clear(); myGameTableStylesList.clear();
int i; int i;
@@ -576,7 +592,7 @@ void settingsDialogImpl::isAccepted() {
if(!item->icon().isNull()) if(!item->icon().isNull())
myConfig->writeConfigString("CurrentGameTableStyle", item->data(15).toString().toUtf8().constData()); myConfig->writeConfigString("CurrentGameTableStyle", item->data(15).toString().toUtf8().constData());
} }
// CARDS // CARDS
//save card deck styles list //save card deck styles list
myCardDeckStylesList.clear(); myCardDeckStylesList.clear();
int j; int j;
@@ -601,7 +617,7 @@ void settingsDialogImpl::isAccepted() {
myConfig->writeConfigInt("PlayLobbyChatNotification", checkBox_playLobbyChatNotification->isChecked()); myConfig->writeConfigInt("PlayLobbyChatNotification", checkBox_playLobbyChatNotification->isChecked());
myConfig->writeConfigInt("PlayNetworkGameNotification", checkBox_playNetworkGameNotification->isChecked()); myConfig->writeConfigInt("PlayNetworkGameNotification", checkBox_playNetworkGameNotification->isChecked());
// Log // Log
myConfig->writeConfigInt("LogOnOff", groupBox_logOnOff->isChecked()); myConfig->writeConfigInt("LogOnOff", groupBox_logOnOff->isChecked());
if (myConfig->readConfigInt("LogOnOff")) { if (myConfig->readConfigInt("LogOnOff")) {
// if log On // if log On
@@ -660,7 +676,7 @@ void settingsDialogImpl::setFlipsidePicFileName()
if (!fileName.isEmpty()) if (!fileName.isEmpty())
lineEdit_OwnFlipsideFilename->setText(fileName); lineEdit_OwnFlipsideFilename->setText(fileName);
} }
void settingsDialogImpl::setAvatarFile0() { void settingsDialogImpl::setAvatarFile0() {
@@ -753,14 +769,14 @@ void settingsDialogImpl::setAvatarFile9() {
} }
} }
void settingsDialogImpl::setLogDir() void settingsDialogImpl::setLogDir()
{ {
QString dir = QFileDialog::getExistingDirectory(this, tr("Open Directory"), QString dir = QFileDialog::getExistingDirectory(this, tr("Open Directory"),
QDir::homePath(), QDir::homePath(),
QFileDialog::ShowDirsOnly QFileDialog::ShowDirsOnly
| QFileDialog::DontResolveSymlinks); | QFileDialog::DontResolveSymlinks);
if (!dir.isEmpty()) lineEdit_logDir->setText(dir); if (!dir.isEmpty()) lineEdit_logDir->setText(dir);
} }
void settingsDialogImpl::clearInternetGamePassword(bool clear) { void settingsDialogImpl::clearInternetGamePassword(bool clear) {
+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(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(signalSelfGameInvitation(unsigned, unsigned)), myGameLobbyDialog, SLOT(showInvitationDialog(unsigned, unsigned)));
connect(this, SIGNAL(signalPlayerGameInvitation(unsigned, unsigned, unsigned)), myGameLobbyDialog, SLOT(chatInfoPlayerInviation(unsigned, unsigned, unsigned))); connect(this, SIGNAL(signalPlayerGameInvitation(unsigned, unsigned, unsigned)), myGameLobbyDialog, SLOT(chatInfoPlayerInvitation(unsigned, unsigned, unsigned)));
connect(this, SIGNAL(signalRejectedGameInvitation(unsigned, unsigned, DenyGameInvitationReason)), myGameLobbyDialog, SLOT(chatInfoPlayerRejectedInviation(unsigned, unsigned, DenyGameInvitationReason))); connect(this, SIGNAL(signalRejectedGameInvitation(unsigned, unsigned, DenyGameInvitationReason)), myGameLobbyDialog, SLOT(chatInfoPlayerRejectedInvitation(unsigned, unsigned, DenyGameInvitationReason)));
this->show(); this->show();