author | unc0rr |
Sat, 15 Dec 2007 20:08:08 +0000 | |
changeset 667 | 194dc62d1519 |
parent 665 | 5c7bfc8bac6a |
child 668 | 0d7683a66d61 |
permissions | -rw-r--r-- |
486 | 1 |
/* |
2 |
* Hedgewars, a worms-like game |
|
3 |
* Copyright (c) 2007 Igor Ulyanov <iulyanov@gmail.com> |
|
667 | 4 |
* Copyright (c) 2007 Andrey Korotaev <unC0Rr@gmail.com> |
486 | 5 |
* |
6 |
* This program is free software; you can redistribute it and/or modify |
|
7 |
* it under the terms of the GNU General Public License as published by |
|
8 |
* the Free Software Foundation; version 2 of the License |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
|
18 |
*/ |
|
19 |
||
413
523f1769f2bc
udp server detecting experimental version (added files)
displacer
parents:
diff
changeset
|
20 |
#ifndef _NET_UDPWIDGET_INCLUDED |
523f1769f2bc
udp server detecting experimental version (added files)
displacer
parents:
diff
changeset
|
21 |
#define _NET_UDPWIDGET_INCLUDED |
523f1769f2bc
udp server detecting experimental version (added files)
displacer
parents:
diff
changeset
|
22 |
|
667 | 23 |
#include <QStringList> |
634 | 24 |
#include "netserverslist.h" |
667 | 25 |
|
413
523f1769f2bc
udp server detecting experimental version (added files)
displacer
parents:
diff
changeset
|
26 |
class QUdpSocket; |
523f1769f2bc
udp server detecting experimental version (added files)
displacer
parents:
diff
changeset
|
27 |
|
667 | 28 |
class HWNetUdpModel : public HWNetServersModel |
413
523f1769f2bc
udp server detecting experimental version (added files)
displacer
parents:
diff
changeset
|
29 |
{ |
523f1769f2bc
udp server detecting experimental version (added files)
displacer
parents:
diff
changeset
|
30 |
Q_OBJECT |
523f1769f2bc
udp server detecting experimental version (added files)
displacer
parents:
diff
changeset
|
31 |
|
667 | 32 |
public: |
33 |
HWNetUdpModel(QObject *parent = 0); |
|
413
523f1769f2bc
udp server detecting experimental version (added files)
displacer
parents:
diff
changeset
|
34 |
|
667 | 35 |
QVariant data(const QModelIndex &index, int role) const; |
36 |
QVariant headerData(int section, Qt::Orientation orientation, int role) const; |
|
37 |
int rowCount(const QModelIndex & parent) const; |
|
38 |
int columnCount(const QModelIndex & parent) const; |
|
416 | 39 |
|
667 | 40 |
public slots: |
41 |
void updateList(); |
|
42 |
||
43 |
private slots: |
|
44 |
void onClientRead(); |
|
413
523f1769f2bc
udp server detecting experimental version (added files)
displacer
parents:
diff
changeset
|
45 |
|
667 | 46 |
private: |
47 |
QUdpSocket* pUdpSocket; |
|
48 |
QList<QStringList> games; |
|
413
523f1769f2bc
udp server detecting experimental version (added files)
displacer
parents:
diff
changeset
|
49 |
}; |
667 | 50 |
|
413
523f1769f2bc
udp server detecting experimental version (added files)
displacer
parents:
diff
changeset
|
51 |
#endif // _NET_UDPWIDGET_INCLUDED |