qmlFrontend/qml/qmlFrontend/LobbyPage.qml
branchqmlfrontend
changeset 11418 091149424aa4
parent 11415 05cf35103206
child 11419 8a5cc31483c6
--- a/qmlFrontend/qml/qmlFrontend/LobbyPage.qml	Fri Nov 20 23:05:49 2015 +0300
+++ b/qmlFrontend/qml/qmlFrontend/LobbyPage.qml	Fri Nov 20 23:56:13 2015 +0300
@@ -1,8 +1,75 @@
 import QtQuick 2.0
+import Hedgewars.Engine 1.0
 
 Rectangle {
+    ListView {
+        id: roomsList
+        x: 20
+        y: 0
+        width: parent.width
+        height: parent.height - x
+        focus: true
+        clip: true
+
+        model: ListModel {
+            id: roomsListModel
+        }
+
+        delegate: Rectangle {
+            id: roomDelegate
+            height: 24
+            width: parent.width
+            color: "transparent"
+
+            Row {
+                spacing: 8;
+                Text {
+                    text: name
+                }
+                Text {
+                    text: players + " / " + teams
+                }
+                Text {
+                    text: host
+                }
+                Text {
+                    text: map
+                }
+                Text {
+                    text: script
+                }
+                Text {
+                    text: scheme
+                }
+                Text {
+                    text: weapons
+                }
+            }
+
+            MouseArea {
+                 z: 1
+                 anchors.fill: parent
+                 onClicked: ;
+            }
+        }
+
+        Connections {
+            target: HWEngine
+            onRoomAdded: roomsListModel.append({
+                               "name" : name
+                               , "players": players
+                               , "teams": teams
+                               , "host": host
+                               , "map": map
+                               , "script": script
+                               , "scheme": scheme
+                               , "weapons": weapons
+                           })
+        }
+    }
 
     Chat {
+        id: lobbyChat;
         x: 0;
         y: 100;
         width: parent.width;