[atlantik-cvs] CVS: kdegames/atlantik/client atlantik.cpp,1.133,1.134 selectconfiguration_widget.cpp,1.30,1.31 selectconfiguration_widget.h,1.14,1.15

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

Modified Files:
	atlantik.cpp selectconfiguration_widget.cpp 
	selectconfiguration_widget.h 
Log Message:
use portfolioviews instead of klistview for player list during config

Index: atlantik.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/atlantik.cpp,v
retrieving revision 1.133
retrieving revision 1.134
diff -u -d -r1.133 -r1.134
--- atlantik.cpp	19 Jan 2003 19:17:37 -0000	1.133
+++ atlantik.cpp	19 Jan 2003 21:06:16 -0000	1.134
@@ -173,9 +173,6 @@
 	initBoard();
 	m_board->addToken(player);
 
-	if (m_selectConfiguration)
-		m_selectConfiguration->addPlayer(player);
-
 	PortfolioView *portfolioView = new PortfolioView(m_atlanticCore, player, m_config.activeColor, m_config.inactiveColor, m_portfolioWidget);
 	m_portfolioViews.append(portfolioView);
 

Index: selectconfiguration_widget.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/selectconfiguration_widget.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- selectconfiguration_widget.cpp	23 Dec 2002 01:34:46 -0000	1.30
+++ selectconfiguration_widget.cpp	19 Jan 2003 21:06:16 -0000	1.31
@@ -38,18 +38,9 @@
 	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); 
-
-	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); 
 
 	// Player buttons.
 	QHBoxLayout *playerButtons = new QHBoxLayout(this, 0, KDialog::spacingHint());
@@ -62,9 +53,8 @@
 
 	connect(m_tokenButton, SIGNAL(clicked()), this, SLOT(slotTokenButtonClicked()));
 
-	// Game configuration.
-	m_configBox = new QVGroupBox(i18n("Game Configuration"), this, "configBox");
-	m_mainLayout->addWidget(m_configBox); 
+	// Vertical spacer.
+	m_mainLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding));
 
 	// Server buttons.
 	QHBoxLayout *serverButtons = new QHBoxLayout(this, 0, KDialog::spacingHint());
@@ -88,45 +78,6 @@
 	m_mainLayout->addWidget(status_label);
 }
 
-void SelectConfiguration::addPlayer(Player *player)
-{
-	QListViewItem *item = new QListViewItem(m_playerList, player->name(), player->host());
-	if (player->image() != "")
-		item->setPixmap(0, QPixmap(locate("appdata", "themes/default/tokens/" + player->image())));
-	else
-		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());
-		if (player->image() != "")
-			item->setPixmap(0, QPixmap(locate("appdata", "themes/default/tokens/" + player->image())));
-		else
-			item->setPixmap(0, QPixmap(SmallIcon("personal")));
-
-		m_playerList->triggerUpdate();
-	}
-}
-
 void SelectConfiguration::connectClicked()
 {
 	status_label->setText(i18n("Game started. Retrieving full game data..."));
@@ -142,15 +93,6 @@
 	m_tokenWidget->show();
 
 	connect(m_tokenWidget, SIGNAL(iconSelected(const QString &)), this, SLOT(slotTokenSelected(const QString &)));
-}
-
-void SelectConfiguration::slotClicked()
-{
-	delete m_messageBox;
-	m_playerBox->setEnabled(true);
-	m_configBox->setEnabled(true);
-	m_connectButton->setEnabled(true);
-	status_label->setEnabled(true);
 }
 
 void SelectConfiguration::slotTokenSelected(const QString &name)

Index: selectconfiguration_widget.h
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/selectconfiguration_widget.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- selectconfiguration_widget.h	19 Dec 2002 21:34:41 -0000	1.14
+++ selectconfiguration_widget.h	19 Jan 2003 21:06:16 -0000	1.15
@@ -37,21 +37,15 @@
 
 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 slotTokenButtonClicked();
-	void slotClicked();
 	void slotTokenSelected(const QString &name);
 	void gameOption(QString title, QString type, QString value, QString edit, QString command);
 	void optionChanged();
@@ -68,8 +62,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, *m_tokenButton;
 	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.