Page MenuHomePhorge

CreateRoomPage.qml
No OneTemporary

Size
2 KB
Referenced Files
None
Subscribers
None

CreateRoomPage.qml

/*
* This file is part of kazv.
* SPDX-FileCopyrightText: 2022 tusooa <tusooa@kazv.moe>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import QtQuick 2.1
import org.kde.kirigami 2.4 as Kirigami
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.1
Kirigami.Page {
id: createRoomPage
title: l10n.get('create-room-page-title')
ButtonGroup {
id: visibilityButtons
}
ColumnLayout {
width: parent.width
spacing: Kirigami.Units.largeSpacing
GridLayout {
columns: 2
Label {
text: l10n.get('create-room-page-visibility-prompt')
}
ColumnLayout {
RadioButton {
id: visibilityPublic
checked: true
text: l10n.get('create-room-page-visibility-public')
ButtonGroup.group: visibilityButtons
}
RadioButton {
id: visibilityPrivate
text: l10n.get('create-room-page-visibility-private')
ButtonGroup.group: visibilityButtons
}
}
Label {
text: l10n.get('create-room-page-name-prompt')
}
TextField {
id: roomName
placeholderText: l10n.get('create-room-page-name-placeholder')
Layout.fillWidth: true
}
Label {
text: l10n.get('create-room-page-alias-prompt')
}
TextField {
id: roomAlias
placeholderText: l10n.get('create-room-page-alias-placeholder')
Layout.fillWidth: true
}
Label {
text: l10n.get('create-room-page-topic-prompt')
}
TextField {
id: roomTopic
placeholderText: l10n.get('create-room-page-topic-placeholder')
Layout.fillWidth: true
}
CheckBox {
id: allowFederate
checked: true
text: l10n.get('create-room-page-allow-federate-prompt')
Layout.columnSpan: 2
}
}
Button {
text: l10n.get('create-room-page-action-create-room')
onClicked: createRoomPage.createRoom()
}
}
Connections {
target: matrixSdk
function onCreateRoomSuccessful() {
showPassiveNotification(l10n.get('create-room-page-success-prompt'));
}
function onCreateRoomFailed(errorCode, errorMsg) {
showPassiveNotification(l10n.get('create-room-page-failed-prompt', { errorCode, errorMsg }));
}
}
function createRoom()
{
matrixSdk.createRoom(
/* isPrivate = */ visibilityPrivate.checked,
roomName.text,
roomAlias.text,
[],
/* isDirect = */ false,
/* allowFederate = */ allowFederate.checked,
roomTopic.text,
{}
);
}
}

File Metadata

Mime Type
text/plain
Expires
Sun, Dec 1, 7:16 PM (1 d, 16 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41817
Default Alt Text
CreateRoomPage.qml (2 KB)

Event Timeline