Improve QML types
This commit is contained in:
@@ -261,6 +261,7 @@ int main(int argc, char *argv[])
|
||||
qmlRegisterUncreatableType<PushNotificationAction>("org.kde.neochat", 1, 0, "PushNotificationAction", "ENUM");
|
||||
qmlRegisterUncreatableType<NeoChatRoomType>("org.kde.neochat", 1, 0, "NeoChatRoomType", "ENUM");
|
||||
qmlRegisterUncreatableType<NeoChatUser>("org.kde.neochat", 1, 0, "NeoChatUser", {});
|
||||
qmlRegisterUncreatableType<NeoChatRoom>("org.kde.neochat", 1, 0, "NeoChatRoom", {});
|
||||
|
||||
qRegisterMetaType<User *>("User*");
|
||||
qRegisterMetaType<User *>("const User*");
|
||||
|
||||
@@ -36,7 +36,7 @@ QQC2.Control {
|
||||
/**
|
||||
* @brief The current room that user is viewing.
|
||||
*/
|
||||
property var currentRoom
|
||||
property NeoChatRoom currentRoom
|
||||
|
||||
/**
|
||||
* @brief The QQC2.TextArea object.
|
||||
|
||||
@@ -35,7 +35,7 @@ ColumnLayout {
|
||||
/**
|
||||
* @brief The current room that user is viewing.
|
||||
*/
|
||||
property var currentRoom
|
||||
property NeoChatRoom currentRoom
|
||||
|
||||
/**
|
||||
* @brief The chatBar object
|
||||
|
||||
@@ -11,10 +11,12 @@ import org.kde.kirigamiaddons.labs.components 1.0 as Components
|
||||
|
||||
import org.kde.kirigami 2.15 as Kirigami
|
||||
|
||||
import org.kde.neochat 1.0
|
||||
|
||||
Components.AbstractMaximizeComponent {
|
||||
id: root
|
||||
|
||||
required property var room
|
||||
required property NeoChatRoom room
|
||||
property var location
|
||||
|
||||
title: i18n("Choose a Location")
|
||||
|
||||
@@ -12,7 +12,7 @@ import org.kde.neochat 1.0
|
||||
Kirigami.PlaceholderMessage {
|
||||
id: root
|
||||
|
||||
required property var currentRoom
|
||||
required property NeoChatRoom currentRoom
|
||||
|
||||
text: i18n("Accept this invitation?")
|
||||
RowLayout {
|
||||
@@ -32,4 +32,4 @@ Kirigami.PlaceholderMessage {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ QQC2.Dialog {
|
||||
delegate: Kirigami.BasicListItem {
|
||||
id: roomListItem
|
||||
|
||||
required property var currentRoom
|
||||
required property NeoChatRoom currentRoom
|
||||
required property string displayName
|
||||
required property int index
|
||||
required property int notificationCount
|
||||
|
||||
@@ -11,7 +11,7 @@ import org.kde.neochat 1.0
|
||||
QQC2.TextArea {
|
||||
id: root
|
||||
|
||||
property var room
|
||||
property NeoChatRoom room
|
||||
onRoomChanged: room.chatBoxEditIdChanged.connect(updateEditText)
|
||||
|
||||
property string messageId
|
||||
|
||||
@@ -15,7 +15,7 @@ import org.kde.neochat 1.0
|
||||
|
||||
QQC2.ScrollView {
|
||||
id: root
|
||||
required property var currentRoom
|
||||
required property NeoChatRoom currentRoom
|
||||
readonly property bool isLoaded: root.width * root.height > 10
|
||||
readonly property bool atYEnd: messageListView.atYEnd
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import org.kde.kirigami 2.15 as Kirigami
|
||||
QQC2.Dialog {
|
||||
id: confirmEncryptionDialog
|
||||
|
||||
property var room
|
||||
property NeoChatRoom room
|
||||
|
||||
ColumnLayout {
|
||||
Kirigami.Heading {
|
||||
|
||||
@@ -13,7 +13,7 @@ Kirigami.OverlaySheet {
|
||||
id: root
|
||||
title: i18n("Edit user power level")
|
||||
|
||||
property var room
|
||||
property NeoChatRoom room
|
||||
property var userId
|
||||
property int powerLevel
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ Kirigami.OverlaySheet {
|
||||
|
||||
signal closed()
|
||||
|
||||
property var room
|
||||
property NeoChatRoom room
|
||||
property var user
|
||||
|
||||
parent: applicationWindow().overlay
|
||||
|
||||
@@ -10,7 +10,7 @@ import org.kde.kirigami 2.20 as Kirigami
|
||||
Kirigami.Page {
|
||||
id: banSheet
|
||||
|
||||
property var room
|
||||
property NeoChatRoom room
|
||||
property string userId
|
||||
|
||||
title: i18n("Ban User")
|
||||
|
||||
@@ -10,7 +10,7 @@ import org.kde.kirigami 2.20 as Kirigami
|
||||
Kirigami.Page {
|
||||
id: deleteSheet
|
||||
|
||||
property var room
|
||||
property NeoChatRoom room
|
||||
property string eventId
|
||||
|
||||
property string userId: ""
|
||||
|
||||
@@ -10,7 +10,7 @@ import org.kde.kirigami 2.20 as Kirigami
|
||||
Kirigami.Page {
|
||||
id: reportSheet
|
||||
|
||||
property var room
|
||||
property NeoChatRoom room
|
||||
property string eventId
|
||||
|
||||
title: i18n("Report Message")
|
||||
|
||||
@@ -12,7 +12,7 @@ import org.kde.neochat 1.0
|
||||
Kirigami.Page {
|
||||
id: devtoolsPage
|
||||
|
||||
property var room
|
||||
property NeoChatRoom room
|
||||
|
||||
title: i18n("Developer Tools")
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import org.kde.neochat 1.0
|
||||
Kirigami.ScrollablePage {
|
||||
id: root
|
||||
|
||||
property var room
|
||||
property NeoChatRoom room
|
||||
|
||||
title: i18n("Invite a User")
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ Kirigami.ScrollablePage {
|
||||
Kirigami.SearchField {
|
||||
id: identifierField
|
||||
property bool isRoomAlias: text.match(/#(.+):(.+)/g)
|
||||
property var room: isRoomAlias ? connection.roomByAlias(text) : null
|
||||
property NeoChatRoom room: isRoomAlias ? connection.roomByAlias(text) : null
|
||||
property bool isJoined: room != null
|
||||
|
||||
Layout.fillWidth: true
|
||||
|
||||
@@ -16,7 +16,7 @@ import './' as RoomList
|
||||
QQC2.ItemDelegate {
|
||||
id: root
|
||||
|
||||
required property var currentRoom
|
||||
required property NeoChatRoom currentRoom
|
||||
required property bool categoryVisible
|
||||
required property string filterText
|
||||
required property string avatar
|
||||
|
||||
@@ -15,7 +15,7 @@ import org.kde.neochat 1.0
|
||||
*/
|
||||
Loader {
|
||||
id: root
|
||||
property var room
|
||||
property NeoChatRoom room
|
||||
signal closed()
|
||||
|
||||
Component {
|
||||
|
||||
@@ -19,7 +19,7 @@ Kirigami.BasicListItem {
|
||||
required property int index
|
||||
required property int notificationCount
|
||||
required property int highlightCount
|
||||
required property var currentRoom
|
||||
required property NeoChatRoom currentRoom
|
||||
required property bool categoryVisible
|
||||
required property string filterText
|
||||
required property string avatar
|
||||
|
||||
@@ -15,7 +15,7 @@ import org.kde.neochat 1.0
|
||||
*/
|
||||
Loader {
|
||||
id: root
|
||||
property var room
|
||||
property NeoChatRoom room
|
||||
signal closed()
|
||||
|
||||
Component {
|
||||
|
||||
@@ -16,7 +16,7 @@ Kirigami.Page {
|
||||
id: root
|
||||
|
||||
/// Not readonly because of the separate window view.
|
||||
property var currentRoom: RoomManager.currentRoom
|
||||
property NeoChatRoom currentRoom: RoomManager.currentRoom
|
||||
property bool loading: !root.currentRoom || (root.currentRoom.timelineSize === 0 && !root.currentRoom.allHistoryLoaded)
|
||||
/// Used to determine if scrolling to the bottom should mark the message as unread
|
||||
property bool hasScrolledUpBefore: false;
|
||||
|
||||
@@ -7,9 +7,11 @@ import QtQuick.Layouts 1.15
|
||||
|
||||
import org.kde.kirigami 2.15 as Kirigami
|
||||
|
||||
import org.kde.neochat 1.0
|
||||
|
||||
Kirigami.ApplicationWindow {
|
||||
id: window
|
||||
required property var currentRoom
|
||||
required property NeoChatRoom currentRoom
|
||||
minimumWidth: Kirigami.Units.gridUnit * 10
|
||||
minimumHeight: Kirigami.Units.gridUnit * 15
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import org.kde.neochat 1.0
|
||||
Kirigami.ScrollablePage {
|
||||
id: searchPage
|
||||
|
||||
property var currentRoom
|
||||
property NeoChatRoom currentRoom
|
||||
|
||||
title: i18nc("@action:title", "Search Messages")
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import org.kde.neochat 1.0
|
||||
|
||||
Kirigami.OverlayDrawer {
|
||||
id: roomDrawer
|
||||
readonly property var room: RoomManager.currentRoom
|
||||
readonly property NeoChatRoom room: RoomManager.currentRoom
|
||||
|
||||
width: actualWidth
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import QtQuick.Layouts 1.15
|
||||
|
||||
Kirigami.CategorizedSettings {
|
||||
id: root
|
||||
property var room
|
||||
property NeoChatRoom room
|
||||
|
||||
objectName: "settingsPage"
|
||||
actions: [
|
||||
|
||||
@@ -15,7 +15,7 @@ import org.kde.neochat 1.0
|
||||
Kirigami.ScrollablePage {
|
||||
id: root
|
||||
|
||||
property var room
|
||||
property NeoChatRoom room
|
||||
|
||||
title: i18n("General")
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import org.kde.neochat 1.0
|
||||
Kirigami.ScrollablePage {
|
||||
id: root
|
||||
|
||||
property var room
|
||||
property NeoChatRoom room
|
||||
|
||||
title: i18nc('@title:window', 'Permissions')
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import org.kde.neochat 1.0
|
||||
|
||||
Kirigami.ScrollablePage {
|
||||
|
||||
property var room
|
||||
property NeoChatRoom room
|
||||
|
||||
title: i18nc('@title:window', 'Notifications')
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import org.kde.neochat 1.0
|
||||
Kirigami.ScrollablePage {
|
||||
id: root
|
||||
|
||||
property var room
|
||||
property NeoChatRoom room
|
||||
property string needUpgradeRoom: i18n("You need to upgrade this room to a newer version to enable this setting.")
|
||||
|
||||
title: i18n("Security")
|
||||
|
||||
Reference in New Issue
Block a user