diff --git a/data/gfx/gui/table/default/handranking_template.xcf b/data/gfx/gui/table/default/handranking_template.xcf new file mode 100644 index 00000000..e5de5cf6 Binary files /dev/null and b/data/gfx/gui/table/default/handranking_template.xcf differ diff --git a/docs/gui_skinnig_howto.txt b/docs/gui_skinnig_howto.txt index 548fab62..068c86c2 100644 --- a/docs/gui_skinnig_howto.txt +++ b/docs/gui_skinnig_howto.txt @@ -36,13 +36,8 @@ TODO: Edit this. When your style is ready to distribute you should complete the style information StyleDescription, StyleMaintainerEMail and Preview. The best way for Preview will be a screenshot of the style running in PokerTH. -Next step is editing the copyright.txt. Here you need to change "Maintainer" to your name and "EMail" to your valid mail address. -Please read the copyright declaration carefully. If you edited a free licenced gfx file you need to add the source address of the file -and corresponding licence information. - -If you style is ready to be shipped please pack the whole directory into a zip archive and send it to anybody you like. If you like your -style to be added into skin gallery on http://www.pokerth.net please send the archive to webmaster@pokerth.net. We cannot promise that -every style will be added, but if everything works fine and the legal issues are also clear there should be no problem. +If you style is ready to be shipped please pack the whole directory into a zip archive. If you like your style to be added into +skin gallery on http://www.pokerth.net please send a link to the address where you have hosted your archive to webmaster@pokerth.net. We cannot promise that every style will be added, but if everything works fine and the legal issues are also clear there should be no problem. +++++++++++++++++++++++++ diff --git a/pokerth_game.pro b/pokerth_game.pro index 7e6c5de7..4a8765c6 100644 --- a/pokerth_game.pro +++ b/pokerth_game.pro @@ -52,6 +52,7 @@ INCLUDEPATH += . \ src/gui/qt/settingsdialog/manualblindsorderdialog \ src/gui/qt/startnetworkgamedialog \ src/gui/qt/startwindow \ + src/gui/qt/serverlistdialog \ src/gui/qt/styles \ src/gui/qt/changehumanplayernamedialog \ src/gui/qt/changecompleteblindsdialog \ @@ -92,6 +93,7 @@ DEPENDPATH += . \ src/gui/qt/settingsdialog/manualblindsorderdialog \ src/gui/qt/startnetworkgamedialog \ src/gui/qt/startwindow \ + src/gui/qt/serverlistdialog \ src/gui/qt/styles \ src/gui/qt/changehumanplayernamedialog \ src/gui/qt/changecompleteblindsdialog \ @@ -190,7 +192,8 @@ HEADERS += \ src/gui/qt/qttools/qttoolswrapper.h \ src/gui/qt/qttools/qthelper/qthelper.h \ src/gui/generic/serverguiwrapper.h \ - src/gui/qt/gametable/mychancelabel.h + src/gui/qt/gametable/mychancelabel.h \ + src/gui/qt/serverlistdialog/serverlistdialogimpl.h FORMS += \ src/gui/qt/gametable.ui \ @@ -208,7 +211,8 @@ FORMS += \ src/gui/qt/changecompleteblindsdialog.ui \ src/gui/qt/gamelobbydialog.ui \ src/gui/qt/mymessagedialog.ui \ - src/gui/qt/manualblindsorderdialog.ui + src/gui/qt/manualblindsorderdialog.ui \ + src/gui/qt/serverlistdialog.ui SOURCES += \ src/pokerth.cpp \ @@ -253,7 +257,8 @@ SOURCES += \ src/gui/qt/timeoutmsgbox/timeoutmsgboximpl.cpp \ src/net/common/net_helper_client.cpp \ src/core/common/loghelper_client.cpp \ - src/gui/qt/gametable/mychancelabel.cpp + src/gui/qt/gametable/mychancelabel.cpp \ + src/gui/qt/serverlistdialog/serverlistdialogimpl.cpp TRANSLATIONS = \ ts/pokerth_bg.ts \ @@ -277,7 +282,7 @@ TRANSLATIONS = \ ts/pokerth_START_HERE.ts win32 { - QTPLUGIN += qjpeg qgif + QTPLUGIN += qjpeg qgif DEFINES += CURL_STATICLIB DEPENDPATH += src/net/win32/ src/core/win32 INCLUDEPATH += ../boost/ ../SDL/include ../SDL_mixer diff --git a/src/gui/qt/guiwrapper.cpp b/src/gui/qt/guiwrapper.cpp index 88cb8fa6..b3ebb693 100644 --- a/src/gui/qt/guiwrapper.cpp +++ b/src/gui/qt/guiwrapper.cpp @@ -123,8 +123,11 @@ void GuiWrapper::logPlayerWinGame(std::string playerName, int gameID) { myLog->s void GuiWrapper::flushLogAtGame(int gameID) { myLog->signalFlushLogAtGame(gameID); } void GuiWrapper::flushLogAtHand() { myLog->signalFlushLogAtHand(); } -////////// this is for startwindow //////////////////// + void GuiWrapper::SignalNetClientConnect(int actionID) { myStartWindow->signalNetClientConnect(actionID); } +void GuiWrapper::SignalNetClientServerListAdd(unsigned serverId) { myStartWindow->signalNetClientServerListAdd(serverId); } +void GuiWrapper::SignalNetClientServerListShow() { myStartWindow->signalNetClientServerListShow(); } +void GuiWrapper::SignalNetClientServerListClear() { myStartWindow->signalNetClientServerListClear(); } void GuiWrapper::SignalNetClientGameInfo(int actionID) { myStartWindow->signalNetClientGameInfo(actionID); } void GuiWrapper::SignalNetClientError(int errorID, int osErrorID) { myStartWindow->signalNetClientError(errorID, osErrorID); } void GuiWrapper::SignalNetClientNotification(int notificationId) { myStartWindow->signalNetClientNotification(notificationId); } @@ -176,61 +179,3 @@ void GuiWrapper::SignalIrcPlayerLeft(const std::string &nickName) { myStartWindo void GuiWrapper::SignalIrcChatMsg(const std::string &nickName, const std::string &msg) { myStartWindow->signalIrcChatMessage(QString::fromUtf8(nickName.c_str()), QString::fromUtf8(msg.c_str())); } void GuiWrapper::SignalIrcError(int errorCode) { myStartWindow->signalIrcError(errorCode); } void GuiWrapper::SignalIrcServerError(int errorCode) {myStartWindow->signalIrcServerError(errorCode); } - -////////// this is for startwindow //////////////////// - - -//TEMPORARELY UNTIL STARTWINDOW REFACTORING IS OVER TODO - -// void GuiWrapper::SignalNetClientConnect(int actionID) { myW->signalNetClientConnect(actionID); } -// void GuiWrapper::SignalNetClientGameInfo(int actionID) { myW->signalNetClientGameInfo(actionID); } -// void GuiWrapper::SignalNetClientError(int errorID, int osErrorID) { myW->signalNetClientError(errorID, osErrorID); } -// void GuiWrapper::SignalNetClientNotification(int notificationId) { myW->signalNetClientNotification(notificationId); } -// void GuiWrapper::SignalNetClientStatsUpdate(const ServerStats &stats) { myW->signalNetClientStatsUpdate(stats); } -// void GuiWrapper::SignalNetClientShowTimeoutDialog(NetTimeoutReason reason, unsigned remainingSec) { myW->signalNetClientShowTimeoutDialog(reason, remainingSec); } -// void GuiWrapper::SignalNetClientRemovedFromGame(int notificationId) { myW->signalNetClientRemovedFromGame(notificationId); } -// void GuiWrapper::SignalNetClientSelfJoined(unsigned playerId, const string &playerName, PlayerRights rights) { myW->signalNetClientSelfJoined(playerId, QString::fromUtf8(playerName.c_str()), rights); } -// void GuiWrapper::SignalNetClientPlayerJoined(unsigned playerId, const string &playerName, PlayerRights rights) { myW->signalNetClientPlayerJoined(playerId, QString::fromUtf8(playerName.c_str()), rights); } -// void GuiWrapper::SignalNetClientPlayerChanged(unsigned playerId, const string &newPlayerName) -// { -// myW->signalNetClientPlayerChanged(playerId, QString::fromUtf8(newPlayerName.c_str())); -// } -// void GuiWrapper::SignalNetClientPlayerLeft(unsigned playerId, const string &playerName) -// { -// QString tmpName(QString::fromUtf8(playerName.c_str())); -// myW->signalNetClientPlayerLeft(playerId, tmpName); -// if (!playerName.empty() && playerName[0] != '#') -// myLog->signalLogPlayerLeftMsg(tmpName); -// } -// void GuiWrapper::SignalNetClientNewGameAdmin(unsigned playerId, const string &playerName) { -// -// myW->signalNetClientNewGameAdmin(playerId, QString::fromUtf8(playerName.c_str())); -// if (!playerName.empty() && playerName[0] != '#') -// myLog->signalLogNewGameAdminMsg(QString::fromUtf8(playerName.c_str())); -// -// } -// -// void GuiWrapper::SignalNetClientGameListNew(unsigned gameId) { myW->signalNetClientGameListNew(gameId); } -// void GuiWrapper::SignalNetClientGameListRemove(unsigned gameId) { myW->signalNetClientGameListRemove(gameId); } -// void GuiWrapper::SignalNetClientGameListUpdateMode(unsigned gameId, GameMode mode) { myW->signalNetClientGameListUpdateMode(gameId, mode); } -// void GuiWrapper::SignalNetClientGameListUpdateAdmin(unsigned gameId, unsigned adminPlayerId) {myW->signalNetClientGameListUpdateAdmin(gameId, adminPlayerId); } -// void GuiWrapper::SignalNetClientGameListPlayerJoined(unsigned gameId, unsigned playerId) { myW->signalNetClientGameListPlayerJoined(gameId, playerId); } -// void GuiWrapper::SignalNetClientGameListPlayerLeft(unsigned gameId, unsigned playerId) { myW->signalNetClientGameListPlayerLeft(gameId, playerId); } -// -// void GuiWrapper::SignalNetClientGameStart(boost::shared_ptr game) { myW->signalNetClientGameStart(game); } -// void GuiWrapper::SignalNetClientWaitDialog() { myW->signalShowClientDialog(); } -// void GuiWrapper::SignalNetClientChatMsg(const string &playerName, const string &msg) { myW->signalNetClientChatMsg(QString::fromUtf8(playerName.c_str()), QString::fromUtf8(msg.c_str())); } -// void GuiWrapper::SignalNetServerSuccess(int /*actionID*/) { } -// void GuiWrapper::SignalNetServerError(int errorID, int osErrorID) { myW->signalNetServerError(errorID, osErrorID); } -// -// void GuiWrapper::SignalIrcConnect(const string &server) { myW->signalIrcConnect(QString::fromUtf8(server.c_str())); } -// void GuiWrapper::SignalIrcSelfJoined(const string &nickName, const string &channel) { myW->signalIrcSelfJoined(QString::fromUtf8(nickName.c_str()), QString::fromUtf8(channel.c_str())); } -// void GuiWrapper::SignalIrcPlayerJoined(const string &nickName) { myW->signalIrcPlayerJoined(QString::fromUtf8(nickName.c_str())); } -// void GuiWrapper::SignalIrcPlayerChanged(const string &oldNick, const string &newNick) { myW->signalIrcPlayerChanged(QString::fromUtf8(oldNick.c_str()), QString::fromUtf8(newNick.c_str())); } -// void GuiWrapper::SignalIrcPlayerKicked(const std::string &nickName, const std::string &byWhom, const std::string &reason) { myW->signalIrcPlayerKicked(QString::fromUtf8(nickName.c_str()), QString::fromUtf8(byWhom.c_str()), QString::fromUtf8(reason.c_str())); } -// void GuiWrapper::SignalIrcPlayerLeft(const std::string &nickName) { myW->signalIrcPlayerLeft(QString::fromUtf8(nickName.c_str())); } -// void GuiWrapper::SignalIrcChatMsg(const std::string &nickName, const std::string &msg) { myW->signalIrcChatMessage(QString::fromUtf8(nickName.c_str()), QString::fromUtf8(msg.c_str())); } -// void GuiWrapper::SignalIrcError(int errorCode) { myW->signalIrcError(errorCode); } -// void GuiWrapper::SignalIrcServerError(int errorCode) {myW->signalIrcServerError(errorCode); } - -//TEMPORARELY UNTIL STARTWINDOW REFACTORING IS OVER TODO \ No newline at end of file diff --git a/src/gui/qt/guiwrapper.h b/src/gui/qt/guiwrapper.h index e539e596..4aebbeaa 100644 --- a/src/gui/qt/guiwrapper.h +++ b/src/gui/qt/guiwrapper.h @@ -113,6 +113,9 @@ public: void flushLogAtHand(); void SignalNetClientConnect(int actionID); + void SignalNetClientServerListAdd(unsigned serverId); + void SignalNetClientServerListShow(); + void SignalNetClientServerListClear(); void SignalNetClientGameInfo(int actionID); void SignalNetClientError(int errorID, int osErrorID); void SignalNetClientNotification(int notificationId); diff --git a/src/gui/qt/serverlistdialog.ui b/src/gui/qt/serverlistdialog.ui new file mode 100644 index 00000000..4f0a6749 --- /dev/null +++ b/src/gui/qt/serverlistdialog.ui @@ -0,0 +1,80 @@ + + ServerListDialog + + + + 0 + 0 + 400 + 300 + + + + Dialog + + + + + + + Servername + + + + + Country + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + true + + + + + + + + + buttonBox + accepted() + ServerListDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + ServerListDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/src/gui/qt/serverlistdialog/serverlistdialogimpl.cpp b/src/gui/qt/serverlistdialog/serverlistdialogimpl.cpp new file mode 100644 index 00000000..13819fca --- /dev/null +++ b/src/gui/qt/serverlistdialog/serverlistdialogimpl.cpp @@ -0,0 +1,65 @@ +/*************************************************************************** + * Copyright (C) 2006 by FThauer FHammer * + * f.thauer@web.de * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "serverlistdialogimpl.h" +#include "configfile.h" +#include "startwindowimpl.h" +#include "serverdata.h" +#include "session.h" + +serverListDialogImpl::serverListDialogImpl(startWindowImpl *sw, QMainWindow *parent, ConfigFile *c) + : QDialog(parent), myConfig(c), mySw(sw) +{ +#ifdef __APPLE__ + setWindowModality(Qt::ApplicationModal); + setWindowFlags(Qt::WindowSystemMenuHint | Qt::CustomizeWindowHint | Qt::Dialog); +#endif + setupUi(this); + + + connect( buttonBox, SIGNAL( accepted() ), this, SLOT( connectToServer() )); + +} + +void serverListDialogImpl::exec() { + + QDialog::exec(); +} + +void serverListDialogImpl::clearList() +{ + treeWidget_serverList->clear(); +} + +void serverListDialogImpl::addServerItem(unsigned serverId) +{ + ServerInfo info = mySw->getSession()->getClientServerInfo(serverId); + QTreeWidgetItem *item = new QTreeWidgetItem(treeWidget_serverList); + item->setData(0, Qt::DisplayRole, QString::fromUtf8(info.name.c_str())); + item->setData(0, Qt::UserRole, serverId); + item->setData(1, Qt::DisplayRole, QString::fromUtf8(info.country.c_str())); +} + +void serverListDialogImpl::connectToServer() +{ + QTreeWidgetItem *item = treeWidget_serverList->currentItem(); + if (item) { +// mySw->getSession()->connect(item->data(0, Qt::UserRole)) TODO + } +} diff --git a/src/gui/qt/serverlistdialog/serverlistdialogimpl.h b/src/gui/qt/serverlistdialog/serverlistdialogimpl.h new file mode 100644 index 00000000..8426d4f2 --- /dev/null +++ b/src/gui/qt/serverlistdialog/serverlistdialogimpl.h @@ -0,0 +1,52 @@ +/*************************************************************************** + * Copyright (C) 2006 by FThauer FHammer * + * f.thauer@web.de * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef SERVERLISTDIALOGIMPL_H +#define SERVERLISTDIALOGIMPL_H + +#include "ui_serverlistdialog.h" + +#include +#include + + +class ConfigFile; +class startWindowImpl; + +class serverListDialogImpl: public QDialog, public Ui::ServerListDialog { +Q_OBJECT +public: + serverListDialogImpl(startWindowImpl *sw, QMainWindow *parent = 0, ConfigFile* = 0 ); + +public slots: + + void exec(); + void clearList(); + void addServerItem(unsigned); + void connectToServer(); + +private: + + ConfigFile *myConfig; + startWindowImpl *mySw; + +}; + +#endif +void exec(); \ No newline at end of file diff --git a/src/gui/qt/startwindow/startwindowimpl.cpp b/src/gui/qt/startwindow/startwindowimpl.cpp index d01b44dd..2ecdf2ca 100644 --- a/src/gui/qt/startwindow/startwindowimpl.cpp +++ b/src/gui/qt/startwindow/startwindowimpl.cpp @@ -47,6 +47,7 @@ #include "timeoutmsgboximpl.h" #include "lobbychat.h" #include "chat.h" +#include "serverlistdialogimpl.h" using namespace std; @@ -98,6 +99,7 @@ startWindowImpl::startWindowImpl(ConfigFile *c) myGameLobbyDialog->setMyW(myGuiInterface->getMyW()); myTimeoutDialog = new timeoutMsgBoxImpl(this); + myServerListDialog = new serverListDialogImpl(this, this, myConfig); connect( actionStart_Local_Game, SIGNAL( triggered() ), this, SLOT( callNewGameDialog() ) ); connect( pushButtonStart_Local_Game, SIGNAL( clicked() ), this, SLOT( callNewGameDialog() ) ); @@ -118,6 +120,10 @@ startWindowImpl::startWindowImpl(ConfigFile *c) connect(this, SIGNAL(signalNetClientGameInfo(int)), myStartNetworkGameDialog, SLOT(refresh(int))); connect(this, SIGNAL(signalNetClientGameInfo(int)), myGameLobbyDialog, SLOT(refresh(int))); + connect(this, SIGNAL(signalNetClientServerListShow()), myServerListDialog, SLOT(exec())); + connect(this, SIGNAL(signalNetClientServerListClear()), myServerListDialog, SLOT(clearList())); + connect(this, SIGNAL(signalNetClientServerListAdd(unsigned serverId)), myServerListDialog, SLOT(addServerItem(serverId))); + connect(this, SIGNAL(signalNetClientSelfJoined(unsigned, QString, int)), myStartNetworkGameDialog, SLOT(joinedNetworkGame(unsigned, QString, int))); connect(this, SIGNAL(signalNetClientPlayerJoined(unsigned, QString, int)), myStartNetworkGameDialog, SLOT(addConnectedPlayer(unsigned, QString, int))); connect(this, SIGNAL(signalNetClientPlayerChanged(unsigned, QString)), myStartNetworkGameDialog, SLOT(updatePlayer(unsigned, QString))); diff --git a/src/gui/qt/startwindow/startwindowimpl.h b/src/gui/qt/startwindow/startwindowimpl.h index dd9b345a..53c92409 100644 --- a/src/gui/qt/startwindow/startwindowimpl.h +++ b/src/gui/qt/startwindow/startwindowimpl.h @@ -42,7 +42,7 @@ class startNetworkGameDialogImpl; class changeHumanPlayerNameDialogImpl; class gameLobbyDialogImpl; class timeoutMsgBoxImpl; - +class serverListDialogImpl; class startWindowImpl: public QMainWindow, public Ui::startWindow { Q_OBJECT @@ -57,6 +57,9 @@ signals: void signalShowClientDialog(); void signalNetClientConnect(int actionID); + void signalNetClientServerListShow(); + void signalNetClientServerListClear(); + void signalNetClientServerListAdd(unsigned serverId); void signalNetClientGameInfo(int actionID); void signalNetClientError(int errorID, int osErrorID); void signalNetClientNotification(int notificationId); @@ -135,6 +138,7 @@ private: gameLobbyDialogImpl *myGameLobbyDialog; timeoutMsgBoxImpl *myTimeoutDialog; startWindowImpl *myStartWindow; + serverListDialogImpl *myServerListDialog; friend class GuiWrapper;