[prev in list] [next in list] [prev in thread] [next in thread]
List: atlantik-devel
Subject: [atlantik-cvs] CVS: kdegames/atlantik/client event.cpp, NONE,
From: kde () office ! kde ! org
Date: 2003-11-15 13:31:07
[Download RAW message or body]
Update of /home/kde/kdegames/atlantik/client
In directory office:/tmp/cvs-serv18240/client
Modified Files:
Tag: atlantik_3_3_branch
Makefile.am atlantik.cpp atlantik.h main.h
selectconfiguration_widget.cpp selectconfiguration_widget.h
selectgame_widget.cpp selectgame_widget.h
selectserver_widget.cpp selectserver_widget.h
Added Files:
event.cpp event.h eventlogwidget.cpp eventlogwidget.h
Log Message:
eventlog and statusbar support
--- NEW FILE: event.cpp ---
// Copyright (c) 2003 Rob Kaper <cap@capsi.com>
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License version 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this library; see the file COPYING.LIB. If not, write to
// the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
// Boston, MA 02111-1307, USA.
#include <qdatetime.h>
#include <qstring.h>
#include "event.moc"
Event::Event(const QDateTime &dateTime, const QString &description, const QString \
&icon) {
m_dateTime = dateTime;
m_description = description;
m_icon = icon;
}
QDateTime Event::dateTime() const
{
return m_dateTime;
}
QString Event::description() const
{
return m_description;
}
QString Event::icon() const
{
return m_icon;
}
--- NEW FILE: event.h ---
// Copyright (c) 2003 Rob Kaper <cap@capsi.com>
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License version 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this library; see the file COPYING.LIB. If not, write to
// the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
// Boston, MA 02111-1307, USA.
#ifndef ATLANTIK_EVENT_H
#define ATLANTIK_EVENT_H
#include <qobject.h>
class QDateTime;
class QString;
class Event : public QObject
{
Q_OBJECT
public:
Event(const QDateTime &dateTime, const QString &description, const QString &icon = \
QString::null); QDateTime dateTime() const;
QString description() const;
QString icon() const;
private:
QDateTime m_dateTime;
QString m_description, m_icon;
};
#endif
--- NEW FILE: eventlogwidget.cpp ---
// Copyright (c) 2003 Rob Kaper <cap@capsi.com>
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License version 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this library; see the file COPYING.LIB. If not, write to
// the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
// Boston, MA 02111-1307, USA.
#include <iostream>
#include <qlayout.h>
#include <qdatetime.h>
#include <klocale.h>
#include <klistview.h>
#include <kdialogbase.h>
#include <kiconloader.h>
#include <kpushbutton.h>
#include "event.h"
#include "eventlogwidget.moc"
EventLog::EventLog()
{
}
void EventLog::addEvent(const QString &description, const QString &icon)
{
Event *event = new Event(QDateTime::currentDateTime(), description, icon);
m_events.append(event);
emit newEvent(event);
}
void EventLog::emitAll()
{
for (QPtrListIterator<Event> it(m_events); (*it) ; ++it)
emit newEvent((*it));
}
EventLogWidget::EventLogWidget(EventLog *eventLog, QWidget *parent, const char *name)
: QWidget(parent, name,
WType_Dialog | WStyle_Customize | WStyle_DialogBorder | WStyle_Title |
WStyle_Minimize | WStyle_ContextHelp )
{
m_eventLog = eventLog;
connect(m_eventLog, SIGNAL(newEvent(Event *)), this, SLOT(addEvent(Event *)));
setCaption(i18n("Event Log"));
QVBoxLayout *listCompBox = new QVBoxLayout(this, KDialog::marginHint());
m_eventList = new KListView(this, "eventList");
listCompBox->addWidget(m_eventList);
m_eventList->addColumn(i18n("Date/Time"));
m_eventList->addColumn(i18n("Description"));
QHBoxLayout *actionBox = new QHBoxLayout(this, 0, KDialog::spacingHint());
listCompBox->addItem(actionBox);
actionBox->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, \
QSizePolicy::Minimum));
m_saveButton = new KPushButton(BarIcon("save", KIcon::SizeSmall), i18n("Save"), \
this); actionBox->addWidget(m_saveButton);
connect(m_saveButton, SIGNAL(clicked()), this, SLOT(save()));
}
void EventLogWidget::addEvent(Event *event)
{
KListViewItem *item = new KListViewItem(m_eventList, \
event->dateTime().toString("yyyy-MM-dd hh:mm:ss zzz"), event->description()); if \
(event->icon().isEmpty()) item->setPixmap(1, QPixmap(SmallIcon("atlantik")));
else
item->setPixmap(1, QPixmap(SmallIcon(event->icon())));
m_eventList->ensureItemVisible(item);
}
void EventLogWidget::closeEvent(QCloseEvent *e)
{
e->accept();
}
--- NEW FILE: eventlogwidget.h ---
// Copyright (c) 2003 Rob Kaper <cap@capsi.com>
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License version 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this library; see the file COPYING.LIB. If not, write to
// the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
// Boston, MA 02111-1307, USA.
#ifndef ATLANTIK_EVENTLOGWIDGET_H
#define ATLANTIK_EVENTLOGWIDGET_H
#include <qwidget.h>
#include <qmap.h>
class QString;
class Event;
class KListView;
class KListViewItem;
class KPushButton;
class EventLog : public QObject
{
Q_OBJECT
public:
EventLog();
void emitAll();
public slots:
void addEvent(const QString &description, const QString &icon = QString::null);
signals:
void newEvent(Event *event);
private:
QPtrList<Event> m_events;
};
class EventLogWidget : public QWidget
{
Q_OBJECT
public:
enum EventLogType { Default, Net_In, Net_Out };
EventLogWidget(EventLog *eventLog, QWidget *parent=0, const char *name = 0);
public slots:
void addEvent(Event *event);
protected:
void closeEvent(QCloseEvent *e);
private:
EventLog *m_eventLog;
KListView *m_eventList;
KPushButton *m_saveButton;
};
#endif
Index: Makefile.am
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/Makefile.am,v
retrieving revision 1.39
retrieving revision 1.39.2.1
diff -u -d -r1.39 -r1.39.2.1
--- Makefile.am 19 Dec 2002 03:11:07 -0000 1.39
+++ Makefile.am 15 Nov 2003 13:31:04 -0000 1.39.2.1
@@ -3,9 +3,9 @@
atlantik_LDFLAGS = $(all_libraries) $(KDE_RPATH)
atlantik_LDADD = ../libatlantikui/libatlantikui.la \
../libatlantikclient/libatlantikclient.la $(LIB_KDEGAMES) $(LIB_KIO)
-atlantik_SOURCES = atlantik.cpp configdlg.cpp main.cpp monopigator.cpp \
- selectconfiguration_widget.cpp selectgame_widget.cpp \
- selectserver_widget.cpp tokenwidget.cpp
+atlantik_SOURCES = atlantik.cpp configdlg.cpp event.cpp eventlogwidget.cpp \
+ main.cpp monopigator.cpp selectconfiguration_widget.cpp \
+ selectgame_widget.cpp selectserver_widget.cpp tokenwidget.cpp
KDE_ICON = atlantik
Index: atlantik.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/atlantik.cpp,v
retrieving revision 1.157
retrieving revision 1.157.2.1
diff -u -d -r1.157 -r1.157.2.1
--- atlantik.cpp 5 Aug 2003 03:03:34 -0000 1.157
+++ atlantik.cpp 15 Nov 2003 13:31:04 -0000 1.157.2.1
@@ -21,12 +21,14 @@
#include <qlineedit.h>
#include <qscrollbar.h>
+#include <kaboutapplication.h>
#include <kapplication.h>
#include <kcmdlineargs.h>
#include <kconfig.h>
#include <klocale.h>
#include <knotifyclient.h>
#include <knotifydialog.h>
+#include <kstatusbar.h>
#include <kstdgameaction.h>
#include <kstdaction.h>
#include <ktoolbar.h>
@@ -43,6 +45,8 @@
#include <board.h>
#include <trade_widget.h>
+#include "eventlogwidget.h"
+#include "main.h"
#include "selectserver_widget.h"
#include "selectgame_widget.h"
#include "selectconfiguration_widget.h"
@@ -54,6 +58,7 @@
// Toolbar: Game
// KStdGameAction::gameNew(this, SLOT(slotNewGame()), actionCollection(), \
"game_new"); + m_showEventLog = new KAction(i18n("Show Event &Log"), \
"atlantik_showeventlog", CTRL+Key_L, this, SLOT(showEventLog()), actionCollection(), \
"showeventlog"); KStdGameAction::quit(kapp, SLOT(closeAllWindows()), \
actionCollection(), "game_quit");
// Toolbar: Settings
@@ -63,6 +68,7 @@
// Initialize pointers to 0L
m_configDialog = 0;
m_board = 0;
+ m_eventLogWidget = 0;
m_selectServer = 0;
m_selectGame = 0;
m_selectConfiguration = 0;
@@ -70,6 +76,7 @@
// Game and network core
m_atlanticCore = new AtlanticCore(this, "atlanticCore");
+ initEventLog();
initNetworkObject();
connect(m_atlanticCore, SIGNAL(removeGUI(Player *)), this, SLOT(removeGUI(Player \
*))); @@ -93,6 +100,9 @@
// Mix code and XML into GUI
KMainWindow::createGUI();
+ KMainWindow::statusBar()->insertItem("Atlantik " ATLANTIK_VERSION_STRING, 0);
+ KMainWindow::statusBar()->insertItem(QString::null, 1);
+ connect(statusBar(), SIGNAL(released(int)), this, SLOT(statusBarClick(int)));
// Main widget, containing all others
m_mainWidget = new QWidget(this, "main");
@@ -194,7 +204,7 @@
connect(player, SIGNAL(gainedTurn()), this, SLOT(gainedTurn()));
connect(player, SIGNAL(changed(Player *)), m_board, SLOT(playerChanged(Player *)));
- KNotifyClient::event("newplayer");
+ KNotifyClient::event(this->winId(), "newplayer");
}
void Atlantik::newEstate(Estate *estate)
@@ -248,11 +258,11 @@
}
m_atlanticCore->reset(true);
-
initNetworkObject();
connect(m_atlantikNetwork, SIGNAL(gameListClear()), this, SLOT(showSelectGame()));
connect(m_selectServer, SIGNAL(serverConnect(const QString, int)), \
m_atlantikNetwork, SLOT(serverConnect(const QString, int))); \
+ connect(m_selectServer, SIGNAL(msgStatus(const QString &)), this, \
SLOT(slotMsgStatus(const QString &))); }
void Atlantik::showSelectGame()
@@ -296,6 +306,7 @@
connect(m_selectGame, SIGNAL(joinGame(int)), m_atlantikNetwork, \
SLOT(joinGame(int))); connect(m_selectGame, SIGNAL(newGame(const QString &)), \
m_atlantikNetwork, SLOT(newGame(const QString &))); connect(m_selectGame, \
SIGNAL(leaveServer()), this, SLOT(showSelectServer())); + connect(m_selectGame, \
SIGNAL(msgStatus(const QString &)), this, SLOT(slotMsgStatus(const QString &))); }
void Atlantik::showSelectConfiguration()
@@ -325,6 +336,7 @@
connect(m_selectConfiguration, SIGNAL(leaveGame()), m_atlantikNetwork, \
SLOT(leaveGame())); connect(m_selectConfiguration, SIGNAL(buttonCommand(QString)), \
m_atlantikNetwork, SLOT(writeData(QString))); connect(m_selectConfiguration, \
SIGNAL(iconSelected(const QString &)), m_atlantikNetwork, SLOT(setImage(const QString \
&))); + connect(m_selectConfiguration, SIGNAL(statusMessage(const QString &)), this, \
SLOT(slotMsgStatus(const QString &))); }
void Atlantik::initBoard()
@@ -383,9 +395,6 @@
void Atlantik::slotNetworkConnected()
{
- // We're connected, so let's make ourselves known.
- m_atlantikNetwork->setName(m_config.playerName);
-
// Check command-line args to see if we need to auto-join
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
@@ -433,6 +442,16 @@
connect(m_configDialog, SIGNAL(okClicked()), this, SLOT(slotUpdateConfig()));
}
+void Atlantik::showEventLog()
+{
+ if (!m_eventLogWidget)
+ {
+ m_eventLogWidget = new EventLogWidget(m_eventLog, 0);
+ m_eventLog->emitAll();
+ }
+ m_eventLogWidget->show();
+}
+
void Atlantik::configureNotifications()
{
KNotifyDialog::configure(this);
@@ -549,6 +568,12 @@
serverMsgsAppend("Error: " + msg);
}
+void Atlantik::slotMsgStatus(const QString &message, const QString &icon)
+{
+ KMainWindow::statusBar()->changeItem(message, 1);
+ m_eventLog->addEvent(message, icon);
+}
+
void Atlantik::slotMsgChat(QString player, QString msg)
{
if (m_config.chatTimestamps)
@@ -558,7 +583,7 @@
}
else
serverMsgsAppend(player + ": " + msg);
- KNotifyClient::event("chat");
+ KNotifyClient::event(this->winId(), "chat");
}
void Atlantik::serverMsgsAppend(QString msg)
@@ -622,13 +647,20 @@
void Atlantik::gainedTurn()
{
- KNotifyClient::event("gainedturn");
+ KNotifyClient::event(this->winId(), "gainedturn");
+}
+
+void Atlantik::initEventLog()
+{
+ m_eventLog = new EventLog();
}
void Atlantik::initNetworkObject()
{
if (m_atlantikNetwork)
{
+ if (!m_atlantikNetwork->host().isEmpty())
+ slotMsgStatus( i18n("Disconnected from \
%1:%2.").arg(m_atlantikNetwork->host()).arg(m_atlantikNetwork->port()), \
QString("connect_no") ); m_atlantikNetwork->reset();
return;
}
@@ -636,11 +668,12 @@
m_atlantikNetwork = new AtlantikNetwork(m_atlanticCore);
connect(m_atlantikNetwork, SIGNAL(msgInfo(QString)), this, \
SLOT(slotMsgInfo(QString))); connect(m_atlantikNetwork, SIGNAL(msgError(QString)), \
this, SLOT(slotMsgError(QString))); + connect(m_atlantikNetwork, \
SIGNAL(msgStatus(const QString &, const QString &)), this, SLOT(slotMsgStatus(const \
QString &, const QString &))); connect(m_atlantikNetwork, SIGNAL(msgChat(QString, \
QString)), this, SLOT(slotMsgChat(QString, QString)));
connect(m_atlantikNetwork, SIGNAL(connectionSuccess()), this, \
SLOT(slotNetworkConnected())); connect(m_atlantikNetwork, \
SIGNAL(connectionFailed(int)), this, SLOT(slotNetworkError(int)));
-
+ connect(m_atlantikNetwork, SIGNAL(receivedHandshake()), this, \
SLOT(sendHandshake())); connect(m_atlantikNetwork, SIGNAL(gameListClear()), this, \
SLOT(showSelectGame())); connect(m_atlantikNetwork, SIGNAL(gameConfig()), this, \
SLOT(showSelectConfiguration())); connect(m_atlantikNetwork, SIGNAL(gameInit()), \
this, SLOT(initBoard())); @@ -653,6 +686,7 @@
connect(m_atlantikNetwork, SIGNAL(newAuction(Auction *)), this, \
SLOT(newAuction(Auction *)));
connect(m_atlantikNetwork, SIGNAL(clientCookie(QString)), this, \
SLOT(clientCookie(QString))); + connect(m_atlantikNetwork, SIGNAL(networkEvent(const \
QString &, const QString &)), m_eventLog, SLOT(addEvent(const QString &, const \
QString &)));
connect(this, SIGNAL(rollDice()), m_atlantikNetwork, SLOT(rollDice()));
connect(this, SIGNAL(buyEstate()), m_atlantikNetwork, SLOT(buyEstate()));
@@ -683,6 +717,22 @@
return;
config->sync();
+}
+
+void Atlantik::sendHandshake()
+{
+ m_atlantikNetwork->setName(m_config.playerName);
+}
+
+void Atlantik::statusBarClick(int item)
+{
+ if ( item == 0 )
+ {
+ KAboutApplication dialog(kapp->aboutData(), this);
+ dialog.exec();
+ }
+ else if ( item == 1)
+ showEventLog();
}
PortfolioView *Atlantik::addPortfolioView(Player *player)
Index: atlantik.h
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/atlantik.h,v
retrieving revision 1.62
retrieving revision 1.62.2.1
diff -u -d -r1.62 -r1.62.2.1
--- atlantik.h 5 Aug 2003 03:03:35 -0000 1.62
+++ atlantik.h 15 Nov 2003 13:31:04 -0000 1.62.2.1
@@ -56,6 +56,8 @@
QColor activeColor, inactiveColor;
};
+class EventLog;
+class EventLogWidget;
class SelectServer;
class SelectGame;
class SelectConfiguration;
@@ -105,6 +107,8 @@
void showBoard();
void freezeBoard();
void clientCookie(QString cookie);
+ void sendHandshake();
+ void statusBarClick(int);
public slots:
@@ -130,6 +134,12 @@
void slotConfigure();
/**
+ * Opens the event log widget.
+ *
+ */
+ void showEventLog();
+
+ /**
* Opens the KNotify dialog for configuration events.
*
*/
@@ -159,6 +169,8 @@
*/
void slotMsgInfo(QString msg);
+ void slotMsgStatus(const QString &message, const QString &icon = QString::null);
+
/**
* Informs serverMsgs() to append an incoming message from the
* server to the text view as error message.
@@ -197,6 +209,7 @@
void jailRoll();
private:
+ void initEventLog();
void initNetworkObject();
PortfolioView *addPortfolioView(Player *player);
PortfolioView *findPortfolioView(Player *player);
@@ -210,7 +223,8 @@
QTextEdit *m_serverMsgs;
KAction *m_roll, *m_buyEstate, *m_auctionEstate, *m_endTurn,
- *m_jailCard, *m_jailPay, *m_jailRoll, *m_configure;
+ *m_jailCard, *m_jailPay, *m_jailRoll, *m_configure,
+ *m_showEventLog;
AtlanticCore *m_atlanticCore;
AtlantikNetwork *m_atlantikNetwork;
@@ -221,6 +235,8 @@
SelectServer *m_selectServer;
SelectGame *m_selectGame;
SelectConfiguration *m_selectConfiguration;
+ EventLog *m_eventLog;
+ EventLogWidget *m_eventLogWidget;
QPtrList<PortfolioView> m_portfolioViews;
QMap<Trade *, TradeDisplay *> m_tradeGUIMap;
Index: main.h
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/main.h,v
retrieving revision 1.40
retrieving revision 1.40.2.1
diff -u -d -r1.40 -r1.40.2.1
--- main.h 5 Nov 2003 19:36:07 -0000 1.40
+++ main.h 15 Nov 2003 13:31:04 -0000 1.40.2.1
@@ -17,10 +17,10 @@
#ifndef ATLANTIK_MAIN_H
#define ATLANTIK_MAIN_H
-#define ATLANTIK_VERSION 060
-#define ATLANTIK_VERSION_STRING "0.6.0"
+#define ATLANTIK_VERSION 070
+#define ATLANTIK_VERSION_STRING "0.7.0 (CVS >= 20031108)"
#define ATLANTIK_VERSION_MAJOR 0
-#define ATLANTIK_VERSION_MINOR 6
+#define ATLANTIK_VERSION_MINOR 7
#define ATLANTIK_VERSION_RELEASE 0
int main(int, char *[]);
Index: selectconfiguration_widget.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/selectconfiguration_widget.cpp,v
retrieving revision 1.39
retrieving revision 1.39.2.1
diff -u -d -r1.39 -r1.39.2.1
--- selectconfiguration_widget.cpp 11 Nov 2003 17:48:43 -0000 1.39
+++ selectconfiguration_widget.cpp 15 Nov 2003 13:31:04 -0000 1.39.2.1
@@ -72,20 +72,12 @@
connect(m_startButton, SIGNAL(clicked()), this, SIGNAL(startGame()));
- // Status indicator.
- m_statusLabel = new QLabel(this);
- m_statusLabel->setText(i18n("Retrieving configuration list..."));
- m_mainLayout->addWidget(m_statusLabel);
-}
-
-SelectConfiguration::~SelectConfiguration()
-{
- delete m_statusLabel;
+ emit statusMessage(i18n("Retrieving configuration list..."));
}
void SelectConfiguration::initGame()
{
- m_statusLabel->setText(i18n("Game started. Retrieving full game data..."));
+ emit statusMessage(i18n("Game started. Retrieving full game data..."));
}
void SelectConfiguration::slotTokenButtonClicked()
@@ -150,7 +142,7 @@
void SelectConfiguration::slotEndUpdate()
{
- m_statusLabel->setText(i18n("Retrieved configuration list."));
+ emit statusMessage(i18n("Retrieved configuration list."));
}
void SelectConfiguration::setCanStart(const bool &canStart)
Index: selectconfiguration_widget.h
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/selectconfiguration_widget.h,v
retrieving revision 1.19
retrieving revision 1.19.2.1
diff -u -d -r1.19 -r1.19.2.1
--- selectconfiguration_widget.h 12 Jul 2003 17:45:21 -0000 1.19
+++ selectconfiguration_widget.h 15 Nov 2003 13:31:04 -0000 1.19.2.1
@@ -20,7 +20,6 @@
#include <qwidget.h>
#include <qlayout.h>
#include <qvgroupbox.h>
-#include <qlabel.h>
#include <klistview.h>
#include <kpushbutton.h>
@@ -37,7 +36,6 @@
public:
SelectConfiguration(QWidget *parent, const char *name=0);
- ~SelectConfiguration();
void setCanStart(const bool &canStart);
QString hostToConnect() const;
@@ -58,11 +56,10 @@
void newConfiguration();
void buttonCommand(QString);
void iconSelected(const QString &);
-// void statusChanged();
+ void statusMessage(const QString &message);
private:
QVBoxLayout *m_mainLayout;
- QLabel *m_statusLabel;
QVGroupBox *m_configBox, *m_messageBox;
KPushButton *m_backButton, *m_startButton, *m_tokenButton;
QMap <QObject *, QString> m_optionCommandMap;
Index: selectgame_widget.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/selectgame_widget.cpp,v
retrieving revision 1.28
retrieving revision 1.28.2.1
diff -u -d -r1.28 -r1.28.2.1
--- selectgame_widget.cpp 27 May 2003 21:03:19 -0000 1.28
+++ selectgame_widget.cpp 15 Nov 2003 13:31:04 -0000 1.28.2.1
@@ -63,22 +63,17 @@
connect(m_connectButton, SIGNAL(clicked()), this, SLOT(connectClicked()));
- // Status indicator
- m_statusLabel = new QLabel(this);
- m_statusLabel->setText(i18n("Retrieving game list..."));
- m_mainLayout->addWidget(m_statusLabel);
}
void SelectGame::slotGameListClear()
{
m_gameList->clear();
validateConnectButton();
-// emit statusChanged();
}
void SelectGame::slotGameListEndUpdate()
{
- m_statusLabel->setText(i18n("Retrieved game list."));
+ emit msgStatus(i18n("Retrieved game list."));
}
void SelectGame::slotGameListAdd(QString gameId, QString name, QString description, \
QString players, QString gameType, bool canBeJoined) @@ -93,7 +88,7 @@
QListViewItem *item = new QListViewItem(m_gameList, i18n("Join %1 Game \
#%2").arg(name).arg(gameId), description, gameId, players, gameType); \
item->setPixmap(0, QPixmap(SmallIcon("atlantik"))); item->setEnabled(canBeJoined);
- KNotifyClient::event("newgame");
+ KNotifyClient::event(this->winId(), "newgame");
}
validateConnectButton();
Index: selectgame_widget.h
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/selectgame_widget.h,v
retrieving revision 1.16
retrieving revision 1.16.2.1
diff -u -d -r1.16 -r1.16.2.1
--- selectgame_widget.h 14 Dec 2002 01:04:02 -0000 1.16
+++ selectgame_widget.h 15 Nov 2003 13:31:04 -0000 1.16.2.1
@@ -19,7 +19,6 @@
#include <qwidget.h>
#include <qlayout.h>
-#include <qlabel.h>
#include <klistview.h>
#include <kpushbutton.h>
@@ -48,15 +47,15 @@
void connectClicked();
void slotGameListEndUpdate();
- signals:
- void joinGame(int gameId);
- void newGame(const QString &gameType);
- void leaveServer();
-// void statusChanged();
+signals:
+ void joinGame(int gameId);
+ void newGame(const QString &gameType);
+ void leaveServer();
+ void msgStatus(const QString &status);
+// void statusChanged();
private:
QVBoxLayout *m_mainLayout;
- QLabel *m_statusLabel;
KListView *m_gameList;
KPushButton *m_connectButton;
};
Index: selectserver_widget.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/selectserver_widget.cpp,v
retrieving revision 1.36
retrieving revision 1.36.2.1
diff -u -d -r1.36 -r1.36.2.1
--- selectserver_widget.cpp 26 Oct 2003 09:57:00 -0000 1.36
+++ selectserver_widget.cpp 15 Nov 2003 13:31:04 -0000 1.36.2.1
@@ -14,6 +14,7 @@
// the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
// Boston, MA 02111-1307, USA.
+#include <qlabel.h>
#include <qlayout.h>
#include <qradiobutton.h>
#include <qsizepolicy.h>
@@ -87,10 +88,6 @@
connect(m_connectButton, SIGNAL(clicked()), this, SLOT(slotConnect()));
-// Status indicator
- status_label = new QLabel(this);
- m_mainLayout->addWidget(status_label);
-
// Monopigator
m_monopigator = new Monopigator();
@@ -114,7 +111,8 @@
void SelectServer::initMonopigator()
{
// Hardcoded, but there aren't any other Monopigator root servers at the moment
- status_label->setText(i18n("Retrieving server list..."));
+ emit msgStatus(i18n("Retrieving server list..."));
+
m_refreshButton->setGuiItem(KGuiItem(i18n("Reload Server List"), "reload"));
m_monopigator->loadData("http://gator.monopd.net/");
}
@@ -131,13 +129,13 @@
void SelectServer::monopigatorFinished()
{
- status_label->setText(i18n("Retrieved server list."));
+ emit msgStatus(i18n("Retrieved server list."));
m_refreshButton->setEnabled(true);
}
void SelectServer::monopigatorTimeout()
{
- status_label->setText(i18n("Error while retrieving the server list."));
+ emit msgStatus(i18n("Error while retrieving the server list."));
m_refreshButton->setEnabled(true);
}
Index: selectserver_widget.h
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/selectserver_widget.h,v
retrieving revision 1.18
retrieving revision 1.18.2.1
diff -u -d -r1.18 -r1.18.2.1
--- selectserver_widget.h 27 Jul 2003 17:58:33 -0000 1.18
+++ selectserver_widget.h 15 Nov 2003 13:31:04 -0000 1.18.2.1
@@ -20,7 +20,6 @@
#include <qwidget.h>
#include <qlayout.h>
#include <qradiobutton.h>
-#include <qlabel.h>
#include <klineedit.h>
#include <klistview.h>
@@ -58,12 +57,12 @@
signals:
void serverConnect(const QString host, int port);
+ void msgStatus(const QString &message);
private:
void initMonopigator();
QVBoxLayout *m_mainLayout;
- QLabel *status_label;
KListView *m_serverList;
KLineEdit *m_hostEdit, *m_portEdit;
KPushButton *m_addServerButton, *m_refreshButton, *m_customConnect, \
*m_connectButton;
_______________________________________________
atlantik-cvs mailing list
atlantik-cvs@kde.org
https://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