[atlantik-cvs] CVS: kdegames/atlantik/client atlantik.cpp,1.121.6.17,1.121.6.18 selectconfiguration_widget.cpp,1.26.6.4,1.26.6.5 selectconfiguration_widget.h,1.12.6.2,1.12.6.3

[email protected]
Newsgroups gmane.comp.kde.devel.atlantik
Message-ID <[email protected]>
Update of /home/kde/kdegames/atlantik/client
In directory office:/tmp/cvs-serv13591/client

Modified Files:
      Tag: KDE_3_1_BRANCH
	atlantik.cpp selectconfiguration_widget.cpp 
	selectconfiguration_widget.h 
Log Message:
backport of various fixes

Index: atlantik.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/atlantik.cpp,v
retrieving revision 1.121.6.17
retrieving revision 1.121.6.18
diff -u -d -r1.121.6.17 -r1.121.6.18
--- atlantik.cpp	23 Jun 2003 01:24:38 -0000	1.121.6.17
+++ atlantik.cpp	23 Jun 2003 02:54:53 -0000	1.121.6.18
@@ -247,8 +247,10 @@
 	// Reset core and GUI
 	if (m_board)
 	{
-		delete m_board;
-		m_board = 0;
+		m_board->hide();
+		m_board->reset();
+//		delete m_board;
+//		m_board = 0;
 
 		m_portfolioViews.clear();
 		m_atlanticCore->reset();
@@ -293,11 +295,13 @@
 		return;
 
 	m_selectConfiguration = new SelectConfiguration(m_mainWidget, "selectConfiguration");
+	m_selectConfiguration->setCanStart(m_playerSelf ? m_playerSelf->master() : false);
 	m_mainLayout->addMultiCellWidget(m_selectConfiguration, 0, 2, 1, 1);
 	m_selectConfiguration->show();
 
 	connect(m_atlantikNetwork, SIGNAL(gameListClear()), this, SLOT(showSelectGame()));
 	connect(m_atlantikNetwork, SIGNAL(gameOption(QString, QString, QString, QString, QString)), m_selectConfiguration, SLOT(gameOption(QString, QString, QString, QString, QString)));
+	connect(m_atlantikNetwork, SIGNAL(endConfigUpdate()), m_selectConfiguration, SLOT(slotEndUpdate()));
 	connect(m_selectConfiguration, SIGNAL(startGame()), m_atlantikNetwork, SLOT(startGame()));
 	connect(m_selectConfiguration, SIGNAL(leaveGame()), m_atlantikNetwork, SLOT(leaveGame()));
 	connect(m_selectConfiguration, SIGNAL(buttonCommand(QString)), m_atlantikNetwork, SLOT(writeData(QString)));
@@ -338,6 +342,7 @@
 		initBoard();
 
 	m_mainLayout->addMultiCellWidget(m_board, 0, 2, 1, 1);
+	m_board->displayDefault();
 	m_board->show();
 
 	PortfolioView *portfolioView = 0;
@@ -510,6 +515,9 @@
 
 	if (player == m_playerSelf)
 	{
+		if (m_selectConfiguration)
+			m_selectConfiguration->setCanStart(player->master());
+
 		m_roll->setEnabled(player->canRoll());
 		m_buyEstate->setEnabled(player->canBuy());
 		m_auctionEstate->setEnabled(player->canAuction());

Index: selectconfiguration_widget.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/selectconfiguration_widget.cpp,v
retrieving revision 1.26.6.4
retrieving revision 1.26.6.5
diff -u -d -r1.26.6.4 -r1.26.6.5
--- selectconfiguration_widget.cpp	3 Jun 2003 21:11:31 -0000	1.26.6.4
+++ selectconfiguration_widget.cpp	23 Jun 2003 02:54:53 -0000	1.26.6.5
@@ -60,14 +60,19 @@
 	connect(m_connectButton, SIGNAL(clicked()), this, SLOT(connectClicked()));
 
     // Status indicator.
-	status_label = new QLabel(this);
-	status_label->setText(i18n("Retrieving configuration list..."));
-	m_mainLayout->addWidget(status_label);
+	m_statusLabel = new QLabel(this);
+	m_statusLabel->setText(i18n("Retrieving configuration list..."));
+	m_mainLayout->addWidget(m_statusLabel);
+}
+
+SelectConfiguration::~SelectConfiguration()
+{
+	delete m_statusLabel;
 }
 
 void SelectConfiguration::connectClicked()
 {
-	status_label->setText(i18n("Game started. Retrieving full game data..."));
+	m_statusLabel->setText(i18n("Game started. Retrieving full game data..."));
 	emit startGame();
 }
 
@@ -99,26 +104,6 @@
 	// TODO: Enable edit for master only
 }
 
-/*
-// some old code i might want to reuse
-
-void ConfigureGame::slotPlayerlistEndUpdate(QString type)
-{
-	if (type=="full")
-		status_label->setText(i18n("Fetched list of players."));
-
-	emit statusChanged();
-}
-
-bool ConfigureGame::validateNext()
-{
-	if (list->childCount() >= 2)
-		return true;
-	else
-		return false;
-}
-*/
-
 void SelectConfiguration::optionChanged()
 {
 	QString command = m_optionCommandMap[(QObject *)QObject::sender()];
@@ -128,4 +113,13 @@
 		command.append(QString::number(checkBox->isChecked()));
 		emit buttonCommand(command);
 	}
+}
+
+void SelectConfiguration::slotEndUpdate()
+{
+}
+
+void SelectConfiguration::setCanStart(const bool &canStart)
+{
+	m_connectButton->setEnabled(canStart);
 }

Index: selectconfiguration_widget.h
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/selectconfiguration_widget.h,v
retrieving revision 1.12.6.2
retrieving revision 1.12.6.3
diff -u -d -r1.12.6.2 -r1.12.6.3
--- selectconfiguration_widget.h	21 Jan 2003 01:24:51 -0000	1.12.6.2
+++ selectconfiguration_widget.h	23 Jun 2003 02:54:53 -0000	1.12.6.3
@@ -36,9 +36,10 @@
 
 public:
 	SelectConfiguration(QWidget *parent, const char *name=0);
+	~SelectConfiguration();
 
 	void initPage();
-	bool validateNext();
+	void setCanStart(const bool &canStart);
 	QString hostToConnect() const;
 	int portToConnect();
 
@@ -46,6 +47,7 @@
 	void connectClicked();
 	void gameOption(QString title, QString type, QString value, QString edit, QString command);
 	void optionChanged();
+	void slotEndUpdate();
 
 signals:
 	void startGame();
@@ -57,7 +59,7 @@
 
 private:
 	QVBoxLayout *m_mainLayout;
-	QLabel *status_label;
+	QLabel *m_statusLabel;
 	QVGroupBox *m_configBox, *m_messageBox;
 	KPushButton *m_backButton, *m_connectButton;
 	QMap <QObject *, QString> m_optionCommandMap;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.