[prev in list] [next in list] [prev in thread] [next in thread] 

List:       atlantik-devel
Subject:    [atlantik-cvs]
From:       kde () office ! kde ! org
Date:       2003-06-29 3:54:12
[Download RAW message or body]

Update of /home/kde/kdegames/atlantik/client
In directory office:/tmp/cvs-serv4795/client

Modified Files:
	atlantik.cpp atlantik.h configdlg.cpp configdlg.h main.h 
	selectserver_widget.cpp selectserver_widget.h 
Log Message:
add option to hide development servers, on by default

Index: atlantik.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/atlantik.cpp,v
retrieving revision 1.150
retrieving revision 1.151
diff -u -d -r1.150 -r1.151
--- atlantik.cpp	23 Jun 2003 01:22:40 -0000	1.150
+++ atlantik.cpp	29 Jun 2003 03:54:10 -0000	1.151
@@ -164,6 +164,7 @@
 	// Meta server configuation
 	config->setGroup("Monopigator");
 	m_config.connectOnStart = config->readBoolEntry("ConnectOnStart", false);
+	m_config.hideDevelopmentServers = config->readBoolEntry("HideDevelopmentServers", \
true);  
 	// Portfolio colors
 	config->setGroup("WM");
@@ -226,7 +227,7 @@
 
 void Atlantik::showSelectServer()
 {
-	m_selectServer = new SelectServer(m_config.connectOnStart, m_mainWidget, \
"selectServer"); +	m_selectServer = new SelectServer(m_config.connectOnStart, \
m_config.hideDevelopmentServers, m_mainWidget, "selectServer");  \
m_mainLayout->addMultiCellWidget(m_selectServer, 0, 2, 1, 1);  \
m_selectServer->show();  
@@ -483,6 +484,16 @@
 		configChanged = true;
 	}
 
+	optBool = m_configDialog->hideDevelopmentServers();
+	if (m_config.hideDevelopmentServers != optBool)
+	{
+		m_config.hideDevelopmentServers = optBool;
+		if (m_selectServer)
+			m_selectServer->setHideDevelopmentServers(optBool);
+
+		configChanged = true;
+	}
+
 	config->setGroup("Personalization");
 	config->writeEntry("PlayerName", m_config.playerName);
 
@@ -495,6 +506,7 @@
 
 	config->setGroup("Monopigator");
 	config->writeEntry("ConnectOnStart", m_config.connectOnStart);
+	config->writeEntry("HideDevelopmentServers", m_config.hideDevelopmentServers);
 
 	config->sync();
 

Index: atlantik.h
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/atlantik.h,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -d -r1.56 -r1.57
--- atlantik.h	18 Jun 2003 00:58:39 -0000	1.56
+++ atlantik.h	29 Jun 2003 03:54:10 -0000	1.57
@@ -47,6 +47,7 @@
 
 	// Meta server options
 	bool connectOnStart;
+	bool hideDevelopmentServers;
 
 	// Portfolio colors
 	QColor activeColor, inactiveColor;

Index: configdlg.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/configdlg.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- configdlg.cpp	9 Jan 2003 01:35:43 -0000	1.19
+++ configdlg.cpp	29 Jun 2003 03:54:10 -0000	1.20
@@ -74,6 +74,11 @@
 	return configMonopigator->connectOnStart();
 }
 
+bool ConfigDialog::hideDevelopmentServers()
+{
+	return configMonopigator->hideDevelopmentServers();
+}
+
 AtlantikConfig ConfigDialog::config()
 {
 	return m_parent->config();
@@ -118,6 +123,15 @@
 		"request a list of Internet servers.\n");
 	QWhatsThis::add(m_connectOnStart, message);
 
+	m_hideDevelopmentServers = new QCheckBox(i18n("Hide development servers"), parent);
+	layout->addWidget(m_hideDevelopmentServers);
+
+	message=i18n(
+		"Some of the Internet servers might be running development\n"
+		"versions of the server software. If checked, Atlantik will not\n"
+		"display these servers.\n");
+	QWhatsThis::add(m_hideDevelopmentServers, message);
+
 	layout->addStretch(1);
 
 	reset();
@@ -128,9 +142,15 @@
 	return m_connectOnStart->isChecked();
 }
 
+bool ConfigMonopigator::hideDevelopmentServers()
+{
+	return m_hideDevelopmentServers->isChecked();
+}
+
 void ConfigMonopigator::reset()
 {
 	m_connectOnStart->setChecked(m_configDialog->config().connectOnStart);
+	m_hideDevelopmentServers->setChecked(m_configDialog->config().hideDevelopmentServers);
  }
 
 ConfigBoard::ConfigBoard(ConfigDialog *configDialog, QWidget *parent, const char \
*name) : QWidget(parent, name)

Index: configdlg.h
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/configdlg.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- configdlg.h	9 Jan 2003 01:35:43 -0000	1.12
+++ configdlg.h	29 Jun 2003 03:54:10 -0000	1.13
@@ -72,12 +72,13 @@
 	ConfigMonopigator(ConfigDialog *dialog, QWidget *parent, const char *name = 0);
 
 	bool connectOnStart();
+	bool hideDevelopmentServers();
 
 private:
 	void reset();
 
 	ConfigDialog *m_configDialog;
-	QCheckBox *m_connectOnStart;
+	QCheckBox *m_connectOnStart, *m_hideDevelopmentServers;
 };
 
 class ConfigDialog : public KDialogBase
@@ -95,6 +96,7 @@
 	AtlantikConfig config();
 	QString playerName();
 	bool connectOnStart();
+	bool hideDevelopmentServers();
 
 private:
 	Atlantik *m_parent;

Index: main.h
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/main.h,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- main.h	22 Jun 2003 23:44:19 -0000	1.34
+++ main.h	29 Jun 2003 03:54:10 -0000	1.35
@@ -18,7 +18,7 @@
 #define ATLANTIK_MAIN_H
 
 #define	ATLANTIK_VERSION 060
-#define	ATLANTIK_VERSION_STRING "0.6.0 (CVS >= 20030623)"
+#define	ATLANTIK_VERSION_STRING "0.6.0 (CVS >= 20030629)"
 #define ATLANTIK_VERSION_MAJOR 0
 #define ATLANTIK_VERSION_MINOR 6
 #define ATLANTIK_VERSION_RELEASE 0

Index: selectserver_widget.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/selectserver_widget.cpp,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- selectserver_widget.cpp	23 Jun 2003 03:07:54 -0000	1.28
+++ selectserver_widget.cpp	29 Jun 2003 03:54:10 -0000	1.29
@@ -25,8 +25,10 @@
 
 #include "selectserver_widget.moc"
 
-SelectServer::SelectServer(bool useMonopigatorOnStart, QWidget *parent, const char \
*name) : QWidget(parent, name) +SelectServer::SelectServer(bool \
useMonopigatorOnStart, bool hideDevelopmentServers, QWidget *parent, const char \
*name) : QWidget(parent, name)  {
+	m_hideDevelopmentServers = hideDevelopmentServers;
+
 	m_mainLayout = new QVBoxLayout(this, KDialog::marginHint());
 	Q_CHECK_PTR(m_mainLayout);
 
@@ -94,6 +96,11 @@
 	delete m_localSocket;
 }
 
+void SelectServer::setHideDevelopmentServers(bool hideDevelopmentServers)
+{
+	m_hideDevelopmentServers = hideDevelopmentServers;
+}
+
 void SelectServer::initMonopigator()
 {
 	// Hardcoded, but there aren't any other Monopigator root servers at the moment
@@ -114,6 +121,9 @@
 
 void SelectServer::slotMonopigatorAdd(QString host, QString port, QString version, \
int users)  {
+	if (m_hideDevelopmentServers && version.contains("CVS"))
+		return;
+
 	QListViewItem *item = new QListViewItem(m_serverList, host, version, (users == -1) \
? i18n("unknown") : QString::number(users), port);  item->setPixmap(0, \
BarIcon("atlantik", KIcon::SizeSmall));  validateConnectButton();

Index: selectserver_widget.h
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/selectserver_widget.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- selectserver_widget.h	23 Jun 2003 03:07:54 -0000	1.15
+++ selectserver_widget.h	29 Jun 2003 03:54:10 -0000	1.16
@@ -34,10 +34,11 @@
 Q_OBJECT
 
 public:
-	SelectServer(bool useMonopigatorOnStart, QWidget *parent, const char *name=0);
+	SelectServer(bool useMonopigatorOnStart, bool hideDevelopmentServers, QWidget \
*parent, const char *name=0);  virtual ~SelectServer();
 
 	void initPage();
+	void setHideDevelopmentServers(bool hideDevelopmentServers);
 		bool validateNext();
 		QString hostToConnect() const;
 		int portToConnect();
@@ -73,7 +74,7 @@
 	KPushButton *m_addServerButton, *m_refreshButton, *m_connectButton;
 	Monopigator *m_monopigator;
 	KExtendedSocket *m_localSocket;
-	bool m_localServerAvailable;
+	bool m_localServerAvailable, m_hideDevelopmentServers;
 };
 
 #endif

_______________________________________________
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