diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3feb49f5..50940246 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.13)
+cmake_minimum_required(VERSION 3.13..3.21)
option(APPVEYOR_BUILD "Build on appveyor" OFF)
option(CI_BUILD "Set when building in CI. Enables -Werror where possible" OFF)
@@ -395,8 +395,6 @@ set(SRC_FILES
src/ui/NhekoCursorShape.h
src/ui/NhekoDropArea.cpp
src/ui/NhekoDropArea.h
- src/ui/NhekoEventObserver.cpp
- src/ui/NhekoEventObserver.h
src/ui/NhekoGlobalObject.cpp
src/ui/NhekoGlobalObject.h
src/ui/RoomSettings.cpp
@@ -499,8 +497,6 @@ set(SRC_FILES
src/SingleImagePackModel.h
src/TrayIcon.cpp
src/TrayIcon.h
- src/UserDirectoryModel.cpp
- src/UserDirectoryModel.h
src/UserSettingsPage.cpp
src/UserSettingsPage.h
src/UsersModel.cpp
@@ -679,10 +675,10 @@ if(ASAN)
endif()
if(WIN32)
- add_executable (nheko WIN32 ${OS_BUNDLE} ${NHEKO_DEPS})
+ qt_add_executable (nheko WIN32 ${OS_BUNDLE} ${NHEKO_DEPS})
target_compile_definitions(nheko PRIVATE _WIN32_WINNT=0x0601 NOMINMAX WIN32_LEAN_AND_MEAN STRICT)
else()
- add_executable (nheko ${OS_BUNDLE} ${NHEKO_DEPS})
+ qt_add_executable (nheko ${OS_BUNDLE} ${NHEKO_DEPS})
if (HAVE_BACKTRACE_SYMBOLS_FD AND NOT CMAKE_BUILD_TYPE STREQUAL "Release")
set_target_properties(nheko PROPERTIES ENABLE_EXPORTS ON)
@@ -700,6 +696,130 @@ set_target_properties(nheko
file(GLOB LANG_TS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/resources/langs/*.ts")
qt_add_translations(nheko RESOURCE_PREFIX "/translations" TS_FILES ${LANG_TS_SRC})
+
+#
+# Add qml files
+#
+
+set(QML_SOURCES
+ resources/qml/Root.qml
+ resources/qml/ChatPage.qml
+ resources/qml/CommunitiesList.qml
+ resources/qml/RoomList.qml
+ resources/qml/TimelineView.qml
+ resources/qml/Avatar.qml
+ resources/qml/Completer.qml
+ resources/qml/EncryptionIndicator.qml
+ resources/qml/ImageButton.qml
+ resources/qml/ElidedLabel.qml
+ resources/qml/MatrixText.qml
+ resources/qml/MatrixTextField.qml
+ resources/qml/ToggleButton.qml
+ resources/qml/UploadBox.qml
+ resources/qml/MessageInput.qml
+ resources/qml/MessageView.qml
+ resources/qml/PrivacyScreen.qml
+ resources/qml/Reactions.qml
+ resources/qml/ReplyPopup.qml
+ resources/qml/StatusIndicator.qml
+ resources/qml/TimelineRow.qml
+ resources/qml/TopBar.qml
+ resources/qml/QuickSwitcher.qml
+ resources/qml/ForwardCompleter.qml
+ resources/qml/SelfVerificationCheck.qml
+ resources/qml/TypingIndicator.qml
+ resources/qml/MessageInputWarning.qml
+ resources/qml/components/AdaptiveLayout.qml
+ resources/qml/components/AdaptiveLayoutElement.qml
+ resources/qml/components/AvatarListTile.qml
+ resources/qml/components/FlatButton.qml
+ resources/qml/components/MainWindowDialog.qml
+ resources/qml/components/NhekoTabButton.qml
+ resources/qml/components/NotificationBubble.qml
+ resources/qml/components/ReorderableListview.qml
+ resources/qml/components/SpaceMenuLevel.qml
+ resources/qml/components/TextButton.qml
+ resources/qml/components/UserListRow.qml
+ resources/qml/delegates/Encrypted.qml
+ resources/qml/delegates/FileMessage.qml
+ resources/qml/delegates/ImageMessage.qml
+ resources/qml/delegates/MessageDelegate.qml
+ resources/qml/delegates/NoticeMessage.qml
+ resources/qml/delegates/Pill.qml
+ resources/qml/delegates/Placeholder.qml
+ resources/qml/delegates/PlayableMediaMessage.qml
+ resources/qml/delegates/Redacted.qml
+ resources/qml/delegates/Reply.qml
+ resources/qml/delegates/TextMessage.qml
+ resources/qml/device-verification/DeviceVerification.qml
+ resources/qml/device-verification/DigitVerification.qml
+ resources/qml/device-verification/EmojiVerification.qml
+ resources/qml/device-verification/Failed.qml
+ resources/qml/device-verification/NewVerificationRequest.qml
+ resources/qml/device-verification/Success.qml
+ resources/qml/device-verification/Waiting.qml
+ resources/qml/dialogs/AliasEditor.qml
+ resources/qml/dialogs/ConfirmJoinRoomDialog.qml
+ resources/qml/dialogs/CreateDirect.qml
+ resources/qml/dialogs/CreateRoom.qml
+ resources/qml/dialogs/HiddenEventsDialog.qml
+ resources/qml/dialogs/ImageOverlay.qml
+ resources/qml/dialogs/ImagePackEditorDialog.qml
+ resources/qml/dialogs/ImagePackSettingsDialog.qml
+ resources/qml/dialogs/InputDialog.qml
+ resources/qml/dialogs/InviteDialog.qml
+ resources/qml/dialogs/JoinRoomDialog.qml
+ resources/qml/dialogs/LeaveRoomDialog.qml
+ resources/qml/dialogs/LogoutDialog.qml
+ resources/qml/dialogs/PhoneNumberInputDialog.qml
+ resources/qml/dialogs/PowerLevelEditor.qml
+ resources/qml/dialogs/PowerLevelSpacesApplyDialog.qml
+ resources/qml/dialogs/RawMessageDialog.qml
+ resources/qml/dialogs/ReadReceipts.qml
+ resources/qml/dialogs/RoomDirectory.qml
+ resources/qml/dialogs/RoomMembers.qml
+ resources/qml/dialogs/AllowedRoomsSettingsDialog.qml
+ resources/qml/dialogs/RoomSettings.qml
+ resources/qml/dialogs/UserProfile.qml
+ resources/qml/emoji/StickerPicker.qml
+ resources/qml/pages/LoginPage.qml
+ resources/qml/pages/RegisterPage.qml
+ resources/qml/pages/UserSettingsPage.qml
+ resources/qml/pages/WelcomePage.qml
+ resources/qml/ui/NhekoSlider.qml
+ resources/qml/ui/Ripple.qml
+ resources/qml/ui/Snackbar.qml
+ resources/qml/ui/Spinner.qml
+ resources/qml/ui/animations/BlinkAnimation.qml
+ resources/qml/ui/media/MediaControls.qml
+ resources/qml/voip/ActiveCallBar.qml
+ resources/qml/voip/CallDevices.qml
+ resources/qml/voip/CallInvite.qml
+ resources/qml/voip/CallInviteBar.qml
+ resources/qml/voip/DeviceError.qml
+ resources/qml/voip/PlaceCall.qml
+ resources/qml/voip/ScreenShare.qml
+ resources/qml/voip/VideoCall.qml
+ resources/qml/delegates/EncryptionEnabled.qml
+ resources/qml/ui/TimelineEffects.qml
+)
+qt_add_qml_module(nheko
+ URI im.nheko
+ NO_RESOURCE_TARGET_PATH
+ RESOURCE_PREFIX "/"
+ VERSION 1.1
+ DEPENDENCIES QtQml QtQuick # https://bugreports.qt.io/browse/QTBUG-102554
+ QML_FILES
+ ${QML_SOURCES}
+ SOURCES
+ src/UserDirectoryModel.cpp
+ src/UserDirectoryModel.h
+ )
+ #qt_target_qml_sources(nheko
+ # #PREFIX "/"
+ #)
+
+
if(WIN32)
target_compile_definitions(nheko PRIVATE WIN32_LEAN_AND_MEAN)
if(MSVC)
@@ -712,7 +832,7 @@ else()
endif()
endif()
-target_include_directories(nheko PRIVATE src includes)
+target_include_directories(nheko PRIVATE src includes src/timeline/ src/ui/ src/encryption/ src/voip/)
if (USE_BUNDLED_CPPHTTPLIB)
target_include_directories(nheko PRIVATE third_party/cpp-httplib-0.5.12)
diff --git a/resources/qml/Avatar.qml b/resources/qml/Avatar.qml
index 5a28b5de..39061d2b 100644
--- a/resources/qml/Avatar.qml
+++ b/resources/qml/Avatar.qml
@@ -102,7 +102,7 @@ AbstractButton {
target: Presence
}
}
- CursorShape {
+ NhekoCursorShape {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
}
diff --git a/resources/qml/ImageButton.qml b/resources/qml/ImageButton.qml
index 4115cd0a..e2e1b914 100644
--- a/resources/qml/ImageButton.qml
+++ b/resources/qml/ImageButton.qml
@@ -31,7 +31,7 @@ AbstractButton {
sourceSize.height: button.height
sourceSize.width: button.width
}
- CursorShape {
+ NhekoCursorShape {
id: mouseArea
anchors.fill: parent
diff --git a/resources/qml/MatrixText.qml b/resources/qml/MatrixText.qml
index 6d611311..7a71182b 100644
--- a/resources/qml/MatrixText.qml
+++ b/resources/qml/MatrixText.qml
@@ -44,7 +44,7 @@ TextArea {
onPressAndHold: (event) => event.accepted = false
onPressed: (event) => event.accepted = (event.button == Qt.LeftButton)
- CursorShape {
+ NhekoCursorShape {
id: cs
anchors.fill: parent
diff --git a/resources/qml/MessageView.qml b/resources/qml/MessageView.qml
index 3eed4c48..af3a3371 100644
--- a/resources/qml/MessageView.qml
+++ b/resources/qml/MessageView.qml
@@ -332,7 +332,7 @@ Item {
sourceSize.height: button.height
sourceSize.width: button.width
}
- CursorShape {
+ NhekoCursorShape {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
}
@@ -590,7 +590,7 @@ Item {
elideWidth: userInfo.remainingWidth - Math.min(statusMsg.implicitWidth, userInfo.remainingWidth / 3)
text: userName
}
- CursorShape {
+ NhekoCursorShape {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
}
diff --git a/resources/qml/Root.qml b/resources/qml/Root.qml
index b869f95a..85c10ddd 100644
--- a/resources/qml/Root.qml
+++ b/resources/qml/Root.qml
@@ -15,7 +15,6 @@ import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Window
import im.nheko
-import im.nheko.EmojiModel
Pane {
id: timelineRoot
@@ -92,15 +91,14 @@ Pane {
FontMetrics {
id: fontMetrics
- }
- RoomDirectoryModel {
- id: publicRooms
-
}
UserDirectoryModel {
id: userDirectory
}
+ RoomDirectoryModel {
+ id: publicRooms
+ }
Component {
id: readReceiptsDialog
diff --git a/resources/qml/TimelineRow.qml b/resources/qml/TimelineRow.qml
index 9c8ebdc6..16a31a3c 100644
--- a/resources/qml/TimelineRow.qml
+++ b/resources/qml/TimelineRow.qml
@@ -173,7 +173,7 @@ AbstractButton {
Layout.row: 0
blurhash: r.relatedEventCacheBuster, fromModel(Room.Blurhash) ?? ""
body: r.relatedEventCacheBuster, fromModel(Room.Body) ?? ""
- callType: r.relatedEventCacheBuster, fromModel(Room.CallType) ?? ""
+ callType: r.relatedEventCacheBuster, fromModel(Room.Voip) ?? ""
duration: r.relatedEventCacheBuster, fromModel(Room.Duration) ?? 0
encryptionError: r.relatedEventCacheBuster, fromModel(Room.EncryptionError) ?? 0
eventId: fromModel(Room.EventId) ?? ""
diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml
index 18085f28..7b89eb4b 100644
--- a/resources/qml/TimelineView.qml
+++ b/resources/qml/TimelineView.qml
@@ -8,14 +8,13 @@ import "./device-verification"
import "./emoji"
import "./ui"
import "./voip"
-import Qt.labs.platform 1.1 as Platform
-import QtQuick 2.15
-import QtQuick.Controls 2.5
-import QtQuick.Layouts 1.3
-import QtQuick.Particles 2.15
-import QtQuick.Window 2.13
-import im.nheko 1.0
-import im.nheko.EmojiModel 1.0
+import Qt.labs.platform as Platform
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
+import QtQuick.Particles
+import QtQuick.Window
+import im.nheko
Item {
id: timelineView
@@ -123,7 +122,7 @@ Item {
searchString: topBar.searchString
}
Loader {
- source: CallManager.isOnCall && CallManager.callType != CallType.VOICE ? "voip/VideoCall.qml" : ""
+ source: CallManager.isOnCall && CallManager.callType != Voip.VOICE ? "voip/VideoCall.qml" : ""
onLoaded: TimelineManager.setVideoCallItem()
}
@@ -249,7 +248,7 @@ Item {
onLinkActivated: Nheko.openLink(link)
- CursorShape {
+ NhekoCursorShape {
anchors.fill: parent
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
}
diff --git a/resources/qml/TopBar.qml b/resources/qml/TopBar.qml
index 3f2d8d2a..699595e6 100644
--- a/resources/qml/TopBar.qml
+++ b/resources/qml/TopBar.qml
@@ -369,7 +369,7 @@ Pane {
onAccepted: topBar.searchString = text
}
}
- CursorShape {
+ NhekoCursorShape {
anchors.bottomMargin: (pinnedMessages.visible ? pinnedMessages.height : 0) + (widgets.visible ? widgets.height : 0)
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
diff --git a/resources/qml/components/AdaptiveLayout.qml b/resources/qml/components/AdaptiveLayout.qml
index 9fc27055..eea74006 100644
--- a/resources/qml/components/AdaptiveLayout.qml
+++ b/resources/qml/components/AdaptiveLayout.qml
@@ -87,7 +87,7 @@ Container {
x: parent.preferredWidth
z: 3
- CursorShape {
+ NhekoCursorShape {
height: parent.height
width: container.splitterGrabMargin * 2
x: -container.splitterGrabMargin
diff --git a/resources/qml/components/TextButton.qml b/resources/qml/components/TextButton.qml
index 0b1ac270..b6153f22 100644
--- a/resources/qml/components/TextButton.qml
+++ b/resources/qml/components/TextButton.qml
@@ -32,7 +32,7 @@ AbstractButton {
horizontalAlignment: Text.AlignHCenter
}
- CursorShape {
+ NhekoCursorShape {
id: mouseArea
anchors.fill: parent
diff --git a/resources/qml/delegates/FileMessage.qml b/resources/qml/delegates/FileMessage.qml
index 48546592..82b82c1b 100644
--- a/resources/qml/delegates/FileMessage.qml
+++ b/resources/qml/delegates/FileMessage.qml
@@ -49,7 +49,7 @@ Item {
gesturePolicy: TapHandler.ReleaseWithinBounds
}
- CursorShape {
+ NhekoCursorShape {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
}
diff --git a/resources/qml/delegates/Reply.qml b/resources/qml/delegates/Reply.qml
index 94128960..4d4983ac 100644
--- a/resources/qml/delegates/Reply.qml
+++ b/resources/qml/delegates/Reply.qml
@@ -43,7 +43,7 @@ AbstractButton {
implicitHeight: replyContainer.height
implicitWidth: visible? colorLine.width+Math.max(replyContainer.implicitWidth,userName_.fullTextWidth) : 0 // visible? seems to be causing issues
- CursorShape {
+ NhekoCursorShape {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
}
diff --git a/resources/qml/delegates/TextMessage.qml b/resources/qml/delegates/TextMessage.qml
index 1237180b..1eb5e2c0 100644
--- a/resources/qml/delegates/TextMessage.qml
+++ b/resources/qml/delegates/TextMessage.qml
@@ -46,7 +46,7 @@ MatrixText {
enabled: !Settings.mobileMode
font.pointSize: (Settings.enlargeEmojiOnlyMessages && isOnlyEmoji > 0 && isOnlyEmoji < 4) ? Settings.fontSize * 3 : Settings.fontSize
- CursorShape {
+ NhekoCursorShape {
enabled: isReply
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
diff --git a/resources/qml/dialogs/InviteDialog.qml b/resources/qml/dialogs/InviteDialog.qml
index f5d467db..58bae7fd 100644
--- a/resources/qml/dialogs/InviteDialog.qml
+++ b/resources/qml/dialogs/InviteDialog.qml
@@ -212,7 +212,7 @@ ApplicationWindow {
onClicked: invitees.removeUser(model.mxid)
}
- CursorShape {
+ NhekoCursorShape {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
}
diff --git a/resources/qml/dialogs/ReadReceipts.qml b/resources/qml/dialogs/ReadReceipts.qml
index 523b47cb..d65de73c 100644
--- a/resources/qml/dialogs/ReadReceipts.qml
+++ b/resources/qml/dialogs/ReadReceipts.qml
@@ -110,7 +110,7 @@ ApplicationWindow {
}
- CursorShape {
+ NhekoCursorShape {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
}
diff --git a/resources/qml/dialogs/RoomMembers.qml b/resources/qml/dialogs/RoomMembers.qml
index 916c6c86..bbf1605d 100644
--- a/resources/qml/dialogs/RoomMembers.qml
+++ b/resources/qml/dialogs/RoomMembers.qml
@@ -220,7 +220,7 @@ ApplicationWindow {
}
- CursorShape {
+ NhekoCursorShape {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
}
diff --git a/resources/qml/dialogs/RoomSettings.qml b/resources/qml/dialogs/RoomSettings.qml
index 0fa98fff..1f011bf1 100644
--- a/resources/qml/dialogs/RoomSettings.qml
+++ b/resources/qml/dialogs/RoomSettings.qml
@@ -213,7 +213,7 @@ ApplicationWindow {
horizontalAlignment: TextEdit.AlignHCenter
onLinkActivated: Nheko.openLink(link)
- CursorShape {
+ NhekoCursorShape {
anchors.fill: parent
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
}
diff --git a/resources/qml/emoji/StickerPicker.qml b/resources/qml/emoji/StickerPicker.qml
index c10e57e7..b7721db6 100644
--- a/resources/qml/emoji/StickerPicker.qml
+++ b/resources/qml/emoji/StickerPicker.qml
@@ -7,7 +7,6 @@ import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import im.nheko
-import im.nheko.EmojiModel
Menu {
id: stickerPopup
diff --git a/resources/qml/ui/animations/qmldir b/resources/qml/ui/animations/qmldir
deleted file mode 100644
index 14f9ad86..00000000
--- a/resources/qml/ui/animations/qmldir
+++ /dev/null
@@ -1,2 +0,0 @@
-module im.nheko.UI.Animations
-BlinkAnimation 1.0 BlinkAnimation.qml
diff --git a/resources/qml/ui/media/qmldir b/resources/qml/ui/media/qmldir
deleted file mode 100644
index 143b603d..00000000
--- a/resources/qml/ui/media/qmldir
+++ /dev/null
@@ -1,3 +0,0 @@
-module im.nheko.UI.Media
-VolumeSlider 1.0 VolumeSlider.qml
-MediaControls 1.0 MediaControls.qml
\ No newline at end of file
diff --git a/resources/qml/ui/qmldir b/resources/qml/ui/qmldir
deleted file mode 100644
index a2ce7514..00000000
--- a/resources/qml/ui/qmldir
+++ /dev/null
@@ -1,4 +0,0 @@
-module im.nheko.UI
-NhekoSlider 1.0 NhekoSlider.qml
-Ripple 1.0 Ripple.qml
-Spinner 1.0 Spinner.qml
\ No newline at end of file
diff --git a/resources/qml/voip/ActiveCallBar.qml b/resources/qml/voip/ActiveCallBar.qml
index d055c013..45afedab 100644
--- a/resources/qml/voip/ActiveCallBar.qml
+++ b/resources/qml/voip/ActiveCallBar.qml
@@ -16,7 +16,7 @@ Rectangle {
MouseArea {
anchors.fill: parent
onClicked: {
- if (CallManager.callType != CallType.VOICE)
+ if (CallManager.callType != Voip.VOICE)
stackLayout.currentIndex = stackLayout.currentIndex ? 0 : 1;
}
@@ -58,7 +58,7 @@ Rectangle {
states: [
State {
name: "VOICE"
- when: CallManager.callType == CallType.VOICE
+ when: CallManager.callType == Voip.VOICE
PropertyChanges {
target: callTypeIcon
@@ -68,7 +68,7 @@ Rectangle {
},
State {
name: "VIDEO"
- when: CallManager.callType == CallType.VIDEO
+ when: CallManager.callType == Voip.VIDEO
PropertyChanges {
target: callTypeIcon
@@ -78,7 +78,7 @@ Rectangle {
},
State {
name: "SCREEN"
- when: CallManager.callType == CallType.SCREEN
+ when: CallManager.callType == Voip.SCREEN
PropertyChanges {
target: callTypeIcon
@@ -100,7 +100,7 @@ Rectangle {
states: [
State {
name: "OFFERSENT"
- when: CallManager.callState == WebRTCState.OFFERSENT
+ when: CallManager.callState == Voip.OFFERSENT
PropertyChanges {
target: callStateLabel
@@ -110,7 +110,7 @@ Rectangle {
},
State {
name: "CONNECTING"
- when: CallManager.callState == WebRTCState.CONNECTING
+ when: CallManager.callState == Voip.CONNECTING
PropertyChanges {
target: callStateLabel
@@ -120,7 +120,7 @@ Rectangle {
},
State {
name: "ANSWERSENT"
- when: CallManager.callState == WebRTCState.ANSWERSENT
+ when: CallManager.callState == Voip.ANSWERSENT
PropertyChanges {
target: callStateLabel
@@ -130,7 +130,7 @@ Rectangle {
},
State {
name: "CONNECTED"
- when: CallManager.callState == WebRTCState.CONNECTED
+ when: CallManager.callState == Voip.CONNECTED
PropertyChanges {
target: callStateLabel
@@ -144,13 +144,13 @@ Rectangle {
PropertyChanges {
target: stackLayout
- currentIndex: CallManager.callType != CallType.VOICE ? 1 : 0
+ currentIndex: CallManager.callType != Voip.VOICE ? 1 : 0
}
},
State {
name: "DISCONNECTED"
- when: CallManager.callState == WebRTCState.DISCONNECTED
+ when: CallManager.callState == Voip.DISCONNECTED
PropertyChanges {
target: callStateLabel
@@ -176,7 +176,7 @@ Rectangle {
}
interval: 1000
- running: CallManager.callState == WebRTCState.CONNECTED
+ running: CallManager.callState == Voip.CONNECTED
repeat: true
onTriggered: {
var d = new Date();
@@ -190,7 +190,7 @@ Rectangle {
Label {
Layout.leftMargin: 16
- visible: CallManager.callType == CallType.SCREEN && CallManager.callState == WebRTCState.CONNECTED
+ visible: CallManager.callType == Voip.SCREEN && CallManager.callState == Voip.CONNECTED
text: qsTr("You are screen sharing")
font.pointSize: fontMetrics.font.pointSize * 1.1
color: "#000000"
diff --git a/resources/qml/voip/CallDevices.qml b/resources/qml/voip/CallDevices.qml
index d4c554dc..46c8cde3 100644
--- a/resources/qml/voip/CallDevices.qml
+++ b/resources/qml/voip/CallDevices.qml
@@ -43,7 +43,7 @@ Popup {
}
RowLayout {
- visible: CallManager.callType == CallType.VIDEO && CallManager.cameras.length > 0
+ visible: CallManager.callType == Voip.VIDEO && CallManager.cameras.length > 0
Image {
Layout.preferredWidth: 22
diff --git a/resources/qml/voip/CallInvite.qml b/resources/qml/voip/CallInvite.qml
index 25aa0818..8a609c32 100644
--- a/resources/qml/voip/CallInvite.qml
+++ b/resources/qml/voip/CallInvite.qml
@@ -62,7 +62,7 @@ Popup {
Layout.bottomMargin: callInv.height / 25
Image {
- property string image: CallManager.callType == CallType.VIDEO ? ":/icons/icons/ui/video.svg" : ":/icons/icons/ui/place-call.svg"
+ property string image: CallManager.callType == Voip.VIDEO ? ":/icons/icons/ui/video.svg" : ":/icons/icons/ui/place-call.svg"
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: callInv.height / 10
@@ -72,7 +72,7 @@ Popup {
Label {
Layout.alignment: Qt.AlignCenter
- text: CallManager.callType == CallType.VIDEO ? qsTr("Video Call") : qsTr("Voice Call")
+ text: CallManager.callType == Voip.VIDEO ? qsTr("Video Call") : qsTr("Voice Call")
font.pointSize: fontMetrics.font.pointSize * 2
color: palette.windowText
}
@@ -106,7 +106,7 @@ Popup {
}
RowLayout {
- visible: CallManager.callType == CallType.VIDEO && CallManager.cameras.length > 0
+ visible: CallManager.callType == Voip.VIDEO && CallManager.cameras.length > 0
Layout.alignment: Qt.AlignCenter
Image {
@@ -169,7 +169,7 @@ Popup {
RoundButton {
id: acceptButton
- property string image: CallManager.callType == CallType.VIDEO ? ":/icons/icons/ui/video.svg" : ":/icons/icons/ui/place-call.svg"
+ property string image: CallManager.callType == Voip.VIDEO ? ":/icons/icons/ui/video.svg" : ":/icons/icons/ui/place-call.svg"
implicitWidth: buttonLayout.buttonSize
implicitHeight: buttonLayout.buttonSize
diff --git a/resources/qml/voip/CallInviteBar.qml b/resources/qml/voip/CallInviteBar.qml
index 3c7426cc..d82bd143 100644
--- a/resources/qml/voip/CallInviteBar.qml
+++ b/resources/qml/voip/CallInviteBar.qml
@@ -57,12 +57,12 @@ Rectangle {
Layout.leftMargin: 4
Layout.preferredWidth: 24
Layout.preferredHeight: 24
- source: CallManager.callType == CallType.VIDEO ? "qrc:/icons/icons/ui/video.svg" : "qrc:/icons/icons/ui/place-call.svg"
+ source: CallManager.callType == Voip.VIDEO ? "qrc:/icons/icons/ui/video.svg" : "qrc:/icons/icons/ui/place-call.svg"
}
Label {
font.pointSize: fontMetrics.font.pointSize * 1.1
- text: CallManager.callType == CallType.VIDEO ? qsTr("Video Call") : qsTr("Voice Call")
+ text: CallManager.callType == Voip.VIDEO ? qsTr("Video Call") : qsTr("Voice Call")
color: "#000000"
}
@@ -88,7 +88,7 @@ Rectangle {
Button {
Layout.rightMargin: 4
- icon.source: CallManager.callType == CallType.VIDEO ? "qrc:/icons/icons/ui/video.svg" : "qrc:/icons/icons/ui/place-call.svg"
+ icon.source: CallManager.callType == Voip.VIDEO ? "qrc:/icons/icons/ui/video.svg" : "qrc:/icons/icons/ui/place-call.svg"
text: qsTr("Accept")
onClicked: {
if (CallManager.mics.length == 0) {
@@ -108,7 +108,7 @@ Rectangle {
timelineRoot.destroyOnClose(dialog);
return ;
}
- if (CallManager.callType == CallType.VIDEO && CallManager.cameras.length > 0 && !CallManager.cameras.includes(Settings.camera)) {
+ if (CallManager.callType == Voip.VIDEO && CallManager.cameras.length > 0 && !CallManager.cameras.includes(Settings.camera)) {
var dialog = deviceError.createObject(timelineRoot, {
"errorString": qsTr("Unknown camera: %1").arg(Settings.camera),
"image": ":/icons/icons/ui/video.svg"
diff --git a/resources/qml/voip/PlaceCall.qml b/resources/qml/voip/PlaceCall.qml
index 5d9387c3..2d4c46f8 100644
--- a/resources/qml/voip/PlaceCall.qml
+++ b/resources/qml/voip/PlaceCall.qml
@@ -81,7 +81,7 @@ Popup {
onClicked: {
if (buttonLayout.validateMic()) {
Settings.microphone = micCombo.currentText;
- CallManager.sendInvite(room.roomId, CallType.VOICE);
+ CallManager.sendInvite(room.roomId, Voip.VOICE);
close();
}
}
@@ -95,7 +95,7 @@ Popup {
if (buttonLayout.validateMic()) {
Settings.microphone = micCombo.currentText;
Settings.camera = cameraCombo.currentText;
- CallManager.sendInvite(room.roomId, CallType.VIDEO);
+ CallManager.sendInvite(room.roomId, Voip.VIDEO);
close();
}
}
diff --git a/resources/qml/voip/ScreenShare.qml b/resources/qml/voip/ScreenShare.qml
index ce998299..2337f6d0 100644
--- a/resources/qml/voip/ScreenShare.qml
+++ b/resources/qml/voip/ScreenShare.qml
@@ -47,7 +47,7 @@ Popup {
Layout.fillWidth: true
model: CallManager.screenShareTypeList()
- onCurrentIndexChanged: CallManager.setScreenShareType(currentIndex);
+ onCurrentIndexChanged: CallManager.setVoip(currentIndex);
}
}
@@ -63,7 +63,7 @@ Popup {
}
ComboBox {
- visible: CallManager.screenShareType == ScreenShareType.X11
+ visible: CallManager.screenShareType == Voip.X11
id: windowCombo
Layout.fillWidth: true
@@ -71,7 +71,7 @@ Popup {
}
Button {
- visible: CallManager.screenShareType == ScreenShareType.XDP
+ visible: CallManager.screenShareType == Voip.XDP
highlighted: !CallManager.screenShareReady
text: qsTr("Request screencast")
onClicked: {
@@ -165,7 +165,7 @@ Popup {
Settings.screenShareRemoteVideo = remoteVideoCheckBox.checked;
Settings.screenShareHideCursor = hideCursorCheckBox.checked;
- CallManager.sendInvite(room.roomId, CallType.SCREEN, windowCombo.currentIndex);
+ CallManager.sendInvite(room.roomId, Voip.SCREEN, windowCombo.currentIndex);
close();
}
}
diff --git a/resources/res.qrc b/resources/res.qrc
index ed32b2bf..fb857d4a 100644
--- a/resources/res.qrc
+++ b/resources/res.qrc
@@ -92,107 +92,7 @@
qtquickcontrols2.conf
- qml/Root.qml
- qml/ChatPage.qml
- qml/CommunitiesList.qml
- qml/RoomList.qml
- qml/TimelineView.qml
- qml/Avatar.qml
- qml/Completer.qml
- qml/EncryptionIndicator.qml
- qml/ImageButton.qml
- qml/ElidedLabel.qml
- qml/MatrixText.qml
- qml/MatrixTextField.qml
- qml/ToggleButton.qml
- qml/UploadBox.qml
- qml/MessageInput.qml
- qml/MessageView.qml
- qml/PrivacyScreen.qml
- qml/Reactions.qml
- qml/ReplyPopup.qml
- qml/StatusIndicator.qml
- qml/TimelineRow.qml
- qml/TopBar.qml
- qml/QuickSwitcher.qml
- qml/ForwardCompleter.qml
- qml/SelfVerificationCheck.qml
- qml/TypingIndicator.qml
- qml/MessageInputWarning.qml
- qml/components/AdaptiveLayout.qml
- qml/components/AdaptiveLayoutElement.qml
- qml/components/AvatarListTile.qml
- qml/components/FlatButton.qml
- qml/components/MainWindowDialog.qml
- qml/components/NhekoTabButton.qml
- qml/components/NotificationBubble.qml
- qml/components/ReorderableListview.qml
- qml/components/SpaceMenuLevel.qml
- qml/components/TextButton.qml
- qml/components/UserListRow.qml
- qml/delegates/Encrypted.qml
- qml/delegates/FileMessage.qml
- qml/delegates/ImageMessage.qml
- qml/delegates/MessageDelegate.qml
- qml/delegates/NoticeMessage.qml
- qml/delegates/Pill.qml
- qml/delegates/Placeholder.qml
- qml/delegates/PlayableMediaMessage.qml
- qml/delegates/Redacted.qml
- qml/delegates/Reply.qml
- qml/delegates/TextMessage.qml
- qml/device-verification/DeviceVerification.qml
- qml/device-verification/DigitVerification.qml
- qml/device-verification/EmojiVerification.qml
- qml/device-verification/Failed.qml
- qml/device-verification/NewVerificationRequest.qml
- qml/device-verification/Success.qml
- qml/device-verification/Waiting.qml
- qml/dialogs/AliasEditor.qml
- qml/dialogs/ConfirmJoinRoomDialog.qml
- qml/dialogs/CreateDirect.qml
- qml/dialogs/CreateRoom.qml
- qml/dialogs/HiddenEventsDialog.qml
- qml/dialogs/ImageOverlay.qml
- qml/dialogs/ImagePackEditorDialog.qml
- qml/dialogs/ImagePackSettingsDialog.qml
- qml/dialogs/InputDialog.qml
- qml/dialogs/InviteDialog.qml
- qml/dialogs/JoinRoomDialog.qml
- qml/dialogs/LeaveRoomDialog.qml
- qml/dialogs/LogoutDialog.qml
- qml/dialogs/PhoneNumberInputDialog.qml
- qml/dialogs/PowerLevelEditor.qml
- qml/dialogs/PowerLevelSpacesApplyDialog.qml
- qml/dialogs/RawMessageDialog.qml
- qml/dialogs/ReadReceipts.qml
- qml/dialogs/RoomDirectory.qml
- qml/dialogs/RoomMembers.qml
- qml/dialogs/AllowedRoomsSettingsDialog.qml
- qml/dialogs/RoomSettings.qml
- qml/dialogs/UserProfile.qml
- qml/emoji/StickerPicker.qml
- qml/pages/LoginPage.qml
- qml/pages/RegisterPage.qml
- qml/pages/UserSettingsPage.qml
- qml/pages/WelcomePage.qml
- qml/ui/NhekoSlider.qml
- qml/ui/Ripple.qml
- qml/ui/Snackbar.qml
- qml/ui/Spinner.qml
- qml/ui/animations/BlinkAnimation.qml
- qml/ui/media/MediaControls.qml
- qml/voip/ActiveCallBar.qml
- qml/voip/CallDevices.qml
- qml/voip/CallInvite.qml
- qml/voip/CallInviteBar.qml
- qml/voip/DeviceError.qml
- qml/voip/PlaceCall.qml
- qml/voip/ScreenShare.qml
- qml/voip/VideoCall.qml
confettiparticle.svg
- qml/delegates/EncryptionEnabled.qml
- qml/ui/TimelineEffects.qml
media/ring.ogg
diff --git a/src/AliasEditModel.h b/src/AliasEditModel.h
index 2263659b..04de5016 100644
--- a/src/AliasEditModel.h
+++ b/src/AliasEditModel.h
@@ -5,6 +5,7 @@
#pragma once
#include
+#include
#include
#include
@@ -29,6 +30,9 @@ signals:
class AliasEditingModel final : public QAbstractListModel
{
Q_OBJECT
+ QML_ELEMENT
+ QML_UNCREATABLE("Please use editAliases to create the models")
+
Q_PROPERTY(bool canAdvertize READ canAdvertize CONSTANT)
public:
diff --git a/src/CacheCryptoStructs.h b/src/CacheCryptoStructs.h
index 96fc35ec..2a5b895f 100644
--- a/src/CacheCryptoStructs.h
+++ b/src/CacheCryptoStructs.h
@@ -5,6 +5,7 @@
#pragma once
#include
+#include
#include