[prev in list] [next in list] [prev in thread] [next in thread]
List: atlantik-devel
Subject: [atlantik-cvs] CVS: kdegames/atlantik/client main.h,1.35,1.36
From: kde () office ! kde ! org
Date: 2003-07-20 11:38:32
[Download RAW message or body]
Update of /home/kde/kdegames/atlantik/client
In directory office:/tmp/cvs-serv23379/client
Modified Files:
main.h selectserver_widget.cpp selectserver_widget.h
Log Message:
GUI: add option to connect to custom (read: local) server
CCMAIL: 52775-done@bugs.kde.org
Index: main.h
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/main.h,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- main.h 29 Jun 2003 03:54:10 -0000 1.35
+++ main.h 20 Jul 2003 11:38:30 -0000 1.36
@@ -18,7 +18,7 @@
#define ATLANTIK_MAIN_H
#define ATLANTIK_VERSION 060
-#define ATLANTIK_VERSION_STRING "0.6.0 (CVS >= 20030629)"
+#define ATLANTIK_VERSION_STRING "0.6.0 (CVS >= 20030720)"
#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.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- selectserver_widget.cpp 12 Jul 2003 22:58:46 -0000 1.30
+++ selectserver_widget.cpp 20 Jul 2003 11:38:30 -0000 1.31
@@ -14,12 +14,14 @@
// the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
// Boston, MA 02111-1307, USA.
-#include <qvbuttongroup.h>
+#include <qlayout.h>
#include <qradiobutton.h>
+#include <qsizepolicy.h>
+#include <qvbuttongroup.h>
+#include <qhgroupbox.h>
#include <kdialog.h>
#include <kextendedsocket.h>
-#include <klineeditdlg.h>
#include <klocale.h>
#include <kiconloader.h>
@@ -32,8 +34,25 @@
m_mainLayout = new QVBoxLayout(this, KDialog::marginHint());
Q_CHECK_PTR(m_mainLayout);
- QVButtonGroup *bgroup;
- bgroup = new QVButtonGroup(i18n("Select monopd Server"), this, "bgroup");
+ // Custom server group
+ QHGroupBox *customGroup = new QHGroupBox(i18n("Enter custom monopd Server"), this, \
"customGroup"); + m_mainLayout->addWidget(customGroup);
+
+ QLabel *hostLabel = new QLabel(i18n("Hostname"), customGroup);
+
+ m_hostEdit = new KLineEdit(customGroup);
+ m_hostEdit->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, \
QSizePolicy::Minimum)); +
+ QLabel *portLabel = new QLabel(i18n("Port"), customGroup);
+
+ m_portEdit = new KLineEdit(QString::number(1234), customGroup);
+ m_portEdit->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, \
QSizePolicy::Minimum)); +
+ KPushButton *connectButton = new KPushButton( KGuiItem(i18n("Connect"), "network"), \
customGroup); + connect(connectButton, SIGNAL(clicked()), this, \
SLOT(customConnect())); +
+ // Server list group
+ QVButtonGroup *bgroup = new QVButtonGroup(i18n("Select monopd Server"), this, \
"bgroup"); bgroup->setExclusive(true);
m_mainLayout->addWidget(bgroup);
@@ -54,14 +73,8 @@
QHBoxLayout *buttonBox = new QHBoxLayout(m_mainLayout, KDialog::spacingHint());
buttonBox->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, \
QSizePolicy::Minimum));
- // Add Server
- m_addServerButton = new KPushButton( KGuiItem(i18n("Add Server"), "bookmark_add"), \
this);
- buttonBox->addWidget(m_addServerButton);
-
- connect(m_addServerButton, SIGNAL(clicked()), this, SLOT(slotAddServer()));
-
// Server List / Refresh
- m_refreshButton = new KPushButton( KGuiItem(useMonopigatorOnStart ? i18n("Refresh") \
: i18n("Server List"), useMonopigatorOnStart ? "reload" : "network"), this); \
+ m_refreshButton = new KPushButton( KGuiItem(useMonopigatorOnStart ? i18n("Reload \
Server List") : i18n("Get Server List"), useMonopigatorOnStart ? "reload" : \
"network"), this); buttonBox->addWidget(m_refreshButton);
connect(m_refreshButton, SIGNAL(clicked()), this, SLOT(slotRefresh()));
@@ -73,7 +86,7 @@
connect(m_connectButton, SIGNAL(clicked()), this, SLOT(slotConnect()));
- // Status indicator
+// Status indicator
status_label = new QLabel(this);
m_mainLayout->addWidget(status_label);
@@ -105,7 +118,7 @@
{
// Hardcoded, but there aren't any other Monopigator root servers at the moment
status_label->setText(i18n("Retrieving server list..."));
- m_refreshButton->setGuiItem(KGuiItem(i18n("Refresh"), "reload"));
+ m_refreshButton->setGuiItem(KGuiItem(i18n("Reload Server List"), "reload"));
m_monopigator->loadData("http://gator.monopd.net/");
}
@@ -205,19 +218,14 @@
}
}
-void SelectServer::slotAddServer()
-{
- KLineEditDlg dlg(i18n("Host:"), "", 0);
- dlg.setCaption(i18n("Add monopd Server"));
- dlg.enableButtonOK(false); // text is empty by default
- if (!dlg.exec())
- return;
-
- checkCustomServer(dlg.text(), 1234);
-}
-
void SelectServer::slotConnect()
{
if (QListViewItem *item = m_serverList->selectedItem())
emit serverConnect(item->text(0), item->text(3).toInt());
+}
+
+void SelectServer::customConnect()
+{
+ if (!m_hostEdit->text().isEmpty() && !m_portEdit->text().isEmpty())
+ emit serverConnect(m_hostEdit->text(), m_portEdit->text().toInt());
}
Index: selectserver_widget.h
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/selectserver_widget.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- selectserver_widget.h 29 Jun 2003 03:54:10 -0000 1.16
+++ selectserver_widget.h 20 Jul 2003 11:38:30 -0000 1.17
@@ -22,6 +22,7 @@
#include <qradiobutton.h>
#include <qlabel.h>
+#include <klineedit.h>
#include <klistview.h>
#include <kpushbutton.h>
@@ -50,18 +51,17 @@
void slotMonopigatorAdd(QString host, QString port, QString version, int users);
void slotListClicked(QListViewItem *);
- private slots:
- void slotConnect();
- void slotRefresh(bool useMonopigator = true);
- void slotAddServer();
- void slotCustomConnected();
- void slotCustomError();
- void monopigatorFinished();
- void monopigatorTimeout();
+private slots:
+ void slotConnect();
+ void customConnect();
+ void slotRefresh(bool useMonopigator = true);
+ void slotCustomConnected();
+ void slotCustomError();
+ void monopigatorFinished();
+ void monopigatorTimeout();
- signals:
- void serverConnect(const QString host, int port);
-// void statusChanged();
+signals:
+ void serverConnect(const QString host, int port);
private:
void checkCustomServer(const QString &host, int port);
@@ -71,7 +71,8 @@
QLabel *status_label;
QRadioButton *m_localGameButton, *m_onlineGameButton;
KListView *m_serverList;
- KPushButton *m_addServerButton, *m_refreshButton, *m_connectButton;
+ KLineEdit *m_hostEdit, *m_portEdit;
+ KPushButton *m_addServerButton, *m_refreshButton, *m_customConnect, \
*m_connectButton; Monopigator *m_monopigator;
KExtendedSocket *m_localSocket;
bool m_localServerAvailable, m_hideDevelopmentServers;
_______________________________________________
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