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