Files
neochat/imports/NeoChat/RoomManager.qml
Tobias Fella 3a70a9d91c Set all internal qml versions to 1.0
They're useless and anything else just causes problem
2020-11-11 20:14:43 +01:00

41 lines
778 B
QML

/**
* SPDX-FileCopyrightText: 2020 Carl Schwan <carl@carlschwan.eu>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
pragma Singleton
import QtQuick 2.14
import NeoChat.Page 1.0
/**
* Manage opening and close rooms
*/
Item {
id: openRoomAction
property var currentRoom: null
property var pageStack: null
readonly property bool hasOpenRoom: currentRoom != null
signal leaveRoom(string room);
signal openRoom(string room);
function enterRoom(room) {
if (currentRoom != null) {
currentRoom = null;
pageStack.removePage(pageStack.lastItem);
}
pageStack.push(roomPage, {"currentRoom": room});
currentRoom = room;
}
Component {
id: roomPage
RoomPage {}
}
}