[atlantik-cvs] CVS: kdegames/atlantik/client atlantik.cpp,1.121.6.7,1.121.6.8 selectconfiguration_widget.cpp,1.26.6.2,1.26.6.3 selectconfiguration_widget.h,1.12.6.1,1.12.6.2

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

Modified Files:
      Tag: KDE_3_1_BRANCH
	atlantik.cpp selectconfiguration_widget.cpp 
	selectconfiguration_widget.h 
Log Message:
backport: remove duplicate playerlist in config status

Index: atlantik.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/atlantik.cpp,v
retrieving revision 1.121.6.7
retrieving revision 1.121.6.8
diff -u -d -r1.121.6.7 -r1.121.6.8
--- atlantik.cpp	21 Jan 2003 00:31:13 -0000	1.121.6.7
+++ atlantik.cpp	21 Jan 2003 01:24:51 -0000	1.121.6.8
@@ -170,9 +170,6 @@
 	initBoard();
 	m_board->addToken(player);
 
-	if (m_selectConfiguration)
-		m_selectConfiguration->addPlayer(player);
-
 	addPortfolioView(player);
 
 	if (player->isSelf())

Index: selectconfiguration_widget.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/selectconfiguration_widget.cpp,v
retrieving revision 1.26.6.2
retrieving revision 1.26.6.3
diff -u -d -r1.26.6.2 -r1.26.6.3
--- selectconfiguration_widget.cpp	21 Jan 2003 00:58:11 -0000	1.26.6.2
+++ selectconfiguration_widget.cpp	21 Jan 2003 01:24:51 -0000	1.26.6.3
@@ -35,90 +35,39 @@
 	m_mainLayout = new QVBoxLayout(this, KDialog::marginHint());
 	Q_CHECK_PTR(m_mainLayout);
 
-	// Player list.
-	m_playerBox = new QVGroupBox(i18n("Player List"), this, "playerBox");
-	m_mainLayout->addWidget(m_playerBox); 
-
-	// List of  players
-	m_playerList = new KListView(m_playerBox, "m_playerList");
-	m_playerList->addColumn(QString(i18n("Name")));
-	m_playerList->addColumn(QString(i18n("Host")));
-	m_playerList->setAllColumnsShowFocus(true);
-	m_playerList->setFullWidth(true);
-//	m_mainLayout->addWidget(m_playerList);
-
-	connect(m_playerList, SIGNAL(doubleClicked(QListViewItem *)), this, SLOT(connectClicked()));
-
 	// Game configuration.
 	m_configBox = new QVGroupBox(i18n("Game Configuration"), this, "configBox");
 	m_mainLayout->addWidget(m_configBox); 
 
-	QHBoxLayout *buttonBox = new QHBoxLayout(this, 0, KDialog::spacingHint());
-	m_mainLayout->addItem(buttonBox);
+	// Vertical spacer.
+	m_mainLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding));
+
+	// Server buttons.
+	QHBoxLayout *serverButtons = new QHBoxLayout(this, 0, KDialog::spacingHint());
+	m_mainLayout->addItem(serverButtons);
 
 	m_backButton = new KPushButton(SmallIcon("back"), i18n("Leave Game"), this);
-	buttonBox->addWidget(m_backButton);
+	serverButtons->addWidget(m_backButton);
 
 	connect(m_backButton, SIGNAL(clicked()), this, SIGNAL(leaveGame()));
 
-	buttonBox->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum));
+	serverButtons->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum));
 
 	m_connectButton = new KPushButton(SmallIcon("forward"), i18n("Start Game"), this);
-	buttonBox->addWidget(m_connectButton);
+	serverButtons->addWidget(m_connectButton);
 
 	connect(m_connectButton, SIGNAL(clicked()), this, SLOT(connectClicked()));
-	
-    // Status indicator
+
+    // Status indicator.
 	status_label = new QLabel(this);
 	status_label->setText(i18n("Retrieving configuration list..."));
 	m_mainLayout->addWidget(status_label);
 }
 
-void SelectConfiguration::addPlayer(Player *player)
-{
-	QListViewItem *item = new QListViewItem(m_playerList, player->name(), player->host());
-	item->setPixmap(0, QPixmap(SmallIcon("personal")));
-
-	m_items[player] = item;
-
-	connect(player, SIGNAL(changed(Player *)), this, SLOT(slotPlayerChanged(Player *)));
-}
-
-void SelectConfiguration::slotDelPlayer(Player *player)
-{
-	QListViewItem *item = m_items[player];
-	if (item)
-	{
-		delete item;
-		m_items[player] = 0;
-	}
-}
-
-void SelectConfiguration::slotPlayerChanged(Player *player)
-{
-	QListViewItem *item = m_items[player];
-	if (item)
-	{
-		item->setText(0, player->name());
-		item->setText(1, player->host());
-		item->setPixmap(0, QPixmap(SmallIcon("personal")));
-		m_playerList->triggerUpdate();
-	}
-}
-
 void SelectConfiguration::connectClicked()
 {
 	status_label->setText(i18n("Game started. Retrieving full game data..."));
 	emit startGame();
-}
-
-void SelectConfiguration::slotClicked()
-{
-	delete m_messageBox;
-	m_playerBox->setEnabled(true);
-	m_configBox->setEnabled(true);
-	m_connectButton->setEnabled(true);
-	status_label->setEnabled(true);
 }
 
 void SelectConfiguration::gameOption(QString title, QString type, QString value, QString edit, QString command)

Index: selectconfiguration_widget.h
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/selectconfiguration_widget.h,v
retrieving revision 1.12.6.1
retrieving revision 1.12.6.2
diff -u -d -r1.12.6.1 -r1.12.6.2
--- selectconfiguration_widget.h	13 Jan 2003 17:14:39 -0000	1.12.6.1
+++ selectconfiguration_widget.h	21 Jan 2003 01:24:51 -0000	1.12.6.2
@@ -36,22 +36,17 @@
 
 public:
 	SelectConfiguration(QWidget *parent, const char *name=0);
-	void addPlayer(Player *player);
 
 	void initPage();
 	bool validateNext();
 	QString hostToConnect() const;
 	int portToConnect();
 
-public slots:
-	void slotDelPlayer(Player *player);
-	void slotPlayerChanged(Player *player);
-
 private slots:
 	void connectClicked();
-	void slotClicked();
 	void gameOption(QString title, QString type, QString value, QString edit, QString command);
 	void optionChanged();
+
 signals:
 	void startGame();
 	void leaveGame();
@@ -63,8 +58,7 @@
 private:
 	QVBoxLayout *m_mainLayout;
 	QLabel *status_label;
-	QVGroupBox *m_playerBox, *m_configBox, *m_messageBox;
-	KListView *m_playerList;
+	QVGroupBox *m_configBox, *m_messageBox;
 	KPushButton *m_backButton, *m_connectButton;
 	QMap <QObject *, QString> m_optionCommandMap;
 	QMap <QString, QCheckBox *> m_checkBoxMap;
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.