[prev in list] [next in list] [prev in thread] [next in thread]
List: atlantik-devel
Subject: [atlantik-cvs] CVS: kdegames/atlantik/client atlantik.cpp,1.118,1.119 atlantik.h,1.49,1.50 main.h,1.
From: kde () office ! kde ! org
Date: 2002-09-11 1:41:02
[Download RAW message or body]
Update of /home/kde/kdegames/atlantik/client
In directory office:/tmp/cvs-serv6931/client
Modified Files:
atlantik.cpp atlantik.h main.h selectconfiguration_widget.cpp
Log Message:
API: replaced joinedgame with correct use of <gameupdate> tag, which fixed
token positioning on game start
i18n: added status message when retrieving full game data
Index: atlantik.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/atlantik.cpp,v
retrieving revision 1.118
retrieving revision 1.119
diff -u -d -r1.118 -r1.119
--- atlantik.cpp 2002/08/30 12:42:55 1.118
+++ atlantik.cpp 2002/09/11 01:40:59 1.119
@@ -165,7 +165,7 @@
void Atlantik::newPlayer(Player *player)
{
if (!m_board)
- initGame();
+ initBoard();
m_board->addToken(player);
@@ -188,7 +188,7 @@
void Atlantik::newEstate(Estate *estate)
{
if (!m_board)
- initGame();
+ initBoard();
m_board->addEstateView(estate, m_config.indicateUnowned, m_config.highliteUnowned, \
m_config.darkenMortgaged, m_config.quartzEffects); }
@@ -203,7 +203,7 @@
void Atlantik::newAuction(Auction *auction)
{
if (!m_board)
- initGame();
+ initBoard();
m_board->addAuctionWidget(auction);
}
@@ -263,15 +263,19 @@
void Atlantik::showSelectConfiguration()
{
- m_selectConfiguration = new SelectConfiguration(m_mainWidget, \
"selectConfiguration");
- m_mainLayout->addMultiCellWidget(m_selectConfiguration, 0, 2, 1, 1);
- m_selectConfiguration->show();
if (m_selectGame)
{
delete m_selectGame;
m_selectGame = 0;
}
+ if (m_selectConfiguration)
+ return;
+
+ m_selectConfiguration = new SelectConfiguration(m_mainWidget, \
"selectConfiguration"); + m_mainLayout->addMultiCellWidget(m_selectConfiguration, 0, \
2, 1, 1); + m_selectConfiguration->show();
+
connect(m_atlantikNetwork, SIGNAL(playerListClear()), m_selectConfiguration, \
SLOT(slotPlayerListClear())); connect(m_atlantikNetwork, \
SIGNAL(playerListAdd(QString, QString, QString)), m_selectConfiguration, \
SLOT(slotPlayerListAdd(QString, QString, QString))); connect(m_atlantikNetwork, \
SIGNAL(playerListEdit(QString, QString, QString)), m_selectConfiguration, \
SLOT(slotPlayerListEdit(QString, QString, QString))); @@ -283,6 +287,40 @@
connect(m_selectConfiguration, SIGNAL(buttonCommand(QString)), m_atlantikNetwork, \
SLOT(writeData(QString))); }
+void Atlantik::initBoard()
+{
+ m_board = new AtlantikBoard(m_atlanticCore, 40, AtlantikBoard::Play, m_mainWidget, \
"board"); + m_board->setViewProperties(m_config.indicateUnowned, \
m_config.highliteUnowned, m_config.darkenMortgaged, m_config.quartzEffects, \
m_config.animateTokens); +
+ connect(m_atlantikNetwork, SIGNAL(displayText(QString, QString)), m_board, \
SLOT(displayText(QString, QString))); + connect(m_atlantikNetwork, \
SIGNAL(displayEstate(Estate *)), m_board, SLOT(insertEstateDetails(Estate *))); \
+ connect(m_atlantikNetwork, SIGNAL(displayDefault()), m_board, \
SLOT(displayDefault())); + connect(m_atlantikNetwork, \
SIGNAL(addCommandButton(QString, QString, bool)), m_board, \
SLOT(displayButton(QString, QString, bool))); + connect(m_atlantikNetwork, \
SIGNAL(addCloseButton()), m_board, SLOT(addCloseButton())); + connect(m_board, \
SIGNAL(tokenConfirmation(Estate *)), m_atlantikNetwork, SLOT(tokenConfirmation(Estate \
*))); + connect(m_board, SIGNAL(buttonCommand(QString)), m_atlantikNetwork, \
SLOT(writeData(QString))); +}
+
+void Atlantik::showBoard()
+{
+ if (m_selectConfiguration)
+ {
+ delete m_selectConfiguration;
+ m_selectConfiguration = 0;
+ }
+
+ if (!m_board)
+ initBoard();
+
+ m_mainLayout->addMultiCellWidget(m_board, 0, 2, 1, 1);
+ m_board->show();
+
+ PortfolioView *portfolioView = 0;
+ for (QPtrListIterator<PortfolioView> it(m_portfolioViews); *it; ++it)
+ if ((portfolioView = dynamic_cast<PortfolioView*>(*it)))
+ portfolioView->buildPortfolio();
+}
+
void Atlantik::slotNetworkConnected()
{
// We're connected, so let's make ourselves known.
@@ -325,38 +363,7 @@
initNetworkObject();
}
-void Atlantik::initGame()
-{
- // Create board widget and replace the game configuration widget.
- m_board = new AtlantikBoard(m_atlanticCore, 40, AtlantikBoard::Play, m_mainWidget, \
"board");
- m_board->setViewProperties(m_config.indicateUnowned, m_config.highliteUnowned, \
m_config.darkenMortgaged, m_config.quartzEffects, \
m_config.animateTokens);
-
- m_mainLayout->addMultiCellWidget(m_board, 0, 2, 1, 1);
- m_board->show();
- if (m_selectConfiguration)
- {
- delete m_selectConfiguration;
- m_selectConfiguration = 0;
- }
-
- connect(m_atlantikNetwork, SIGNAL(displayText(QString, QString)), m_board, \
SLOT(displayText(QString, QString)));
- connect(m_atlantikNetwork, SIGNAL(displayEstate(Estate *)), m_board, \
SLOT(insertEstateDetails(Estate *)));
- connect(m_atlantikNetwork, SIGNAL(displayDefault()), m_board, \
SLOT(displayDefault()));
- connect(m_atlantikNetwork, SIGNAL(addCommandButton(QString, QString, bool)), \
m_board, SLOT(displayButton(QString, QString, bool)));
- connect(m_atlantikNetwork, SIGNAL(addCloseButton()), m_board, \
SLOT(addCloseButton()));
- connect(m_board, SIGNAL(tokenConfirmation(Estate *)), m_atlantikNetwork, \
SLOT(tokenConfirmation(Estate *)));
- connect(m_board, SIGNAL(buttonCommand(QString)), m_atlantikNetwork, \
SLOT(writeData(QString)));
-}
-
-void Atlantik::gameStarted()
-{
- PortfolioView *portfolioView = 0;
- for (QPtrListIterator<PortfolioView> it(m_portfolioViews); *it; ++it)
- if ((portfolioView = dynamic_cast<PortfolioView*>(*it)))
- portfolioView->buildPortfolio();
-}
-
void Atlantik::slotConfigure()
{
if (m_configDialog == 0)
@@ -487,9 +494,9 @@
connect(m_atlantikNetwork, SIGNAL(connectionSuccess()), this, \
SLOT(slotNetworkConnected())); connect(m_atlantikNetwork, \
SIGNAL(connectionFailed(int)), this, SLOT(slotNetworkError(int)));
- connect(m_atlantikNetwork, SIGNAL(joinedGame()), this, \
SLOT(showSelectConfiguration()));
- connect(m_atlantikNetwork, SIGNAL(initGame()), this, SLOT(initGame()));
- connect(m_atlantikNetwork, SIGNAL(gameStarted()), this, SLOT(gameStarted()));
+ connect(m_atlantikNetwork, SIGNAL(gameConfig()), this, \
SLOT(showSelectConfiguration())); + connect(m_atlantikNetwork, SIGNAL(gameInit()), \
this, SLOT(initBoard())); + connect(m_atlantikNetwork, SIGNAL(gameRun()), this, \
SLOT(showBoard()));
connect(m_atlantikNetwork, SIGNAL(newPlayer(Player *)), this, SLOT(newPlayer(Player \
*))); connect(m_atlantikNetwork, SIGNAL(newEstate(Estate *)), this, \
SLOT(newEstate(Estate *)));
Index: atlantik.h
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/atlantik.h,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- atlantik.h 2002/07/29 03:42:28 1.49
+++ atlantik.h 2002/09/11 01:40:59 1.50
@@ -94,6 +94,8 @@
void showSelectServer();
void showSelectGame();
void showSelectConfiguration();
+ void initBoard();
+ void showBoard();
public slots:
@@ -111,14 +113,6 @@
* @param errno See http://doc.trolltech.com/3.0/qsocket.html#Error-enum
*/
void slotNetworkError(int errnum);
-
- /**
- * A game was succesfully created or joined, so we can show the
- * configuration dialog instead of the game list.
- *
- */
- void initGame();
- void gameStarted();
/**
* Creates a new modeless configure dialog or raises it when it already exists.
Index: main.h
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/main.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- main.h 2002/07/29 19:09:49 1.22
+++ main.h 2002/09/11 01:40:59 1.23
@@ -18,7 +18,7 @@
#define ATLANTIK_MAIN_H
#define ATLANTIK_VERSION 041
-#define ATLANTIK_VERSION_STRING "0.4.1 (CVS >= 20020729)"
+#define ATLANTIK_VERSION_STRING "0.4.1 (CVS >= 20020911)"
#define ATLANTIK_VERSION_MAJOR 0
#define ATLANTIK_VERSION_MINOR 4
#define ATLANTIK_VERSION_RELEASE 1
Index: selectconfiguration_widget.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/selectconfiguration_widget.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- selectconfiguration_widget.cpp 2002/08/13 18:09:42 1.25
+++ selectconfiguration_widget.cpp 2002/09/11 01:40:59 1.26
@@ -122,36 +122,8 @@
void SelectConfiguration::connectClicked()
{
+ status_label->setText(i18n("Game started. Retrieving full game data..."));
emit startGame();
- return;
-
- if (QListViewItem *item = m_playerList->selectedItem())
- {
- if (int playerId = item->text(1).toInt())
- emit joinConfiguration(playerId);
- else
- emit newConfiguration();
- }
-
- m_messageBox = new QVGroupBox(i18n("Sorry"), this, "messageBox");
- m_mainLayout->addWidget(m_messageBox);
-
- QLabel *label = new QLabel(m_messageBox);
- label->setText(i18n(
- "The new game wizard is undergoing a rewrite which has not been finished yet.\n"
- "You cannot start a game at the moment."
- ));
-
- KPushButton *button = new KPushButton(i18n("OK"), m_messageBox, "button");
-
- m_playerBox->setEnabled(false);
- m_configBox->setEnabled(false);
- m_connectButton->setEnabled(false);
- status_label->setEnabled(false);
-
- connect(button, SIGNAL(clicked()), this, SLOT(slotClicked()));
-
- m_messageBox->show();
}
void SelectConfiguration::slotClicked()
_______________________________________________
atlantik-cvs mailing list
atlantik-cvs@mail.kde.org
http://mail.kde.org/mailman/listinfo/atlantik-cvs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic