2021-05-14 16:23:32 +03:00
|
|
|
// SPDX-FileCopyrightText: 2021 Nheko Contributors
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
|
|
|
import "./delegates"
|
|
|
|
import "./device-verification"
|
2021-07-21 14:37:57 +03:00
|
|
|
import "./dialogs"
|
2021-05-14 16:23:32 +03:00
|
|
|
import "./emoji"
|
|
|
|
import "./voip"
|
|
|
|
import Qt.labs.platform 1.1 as Platform
|
2021-08-04 03:27:50 +03:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
2021-05-14 16:23:32 +03:00
|
|
|
import QtQuick.Layouts 1.3
|
2021-08-04 03:27:50 +03:00
|
|
|
import QtQuick.Window 2.15
|
2021-05-14 16:23:32 +03:00
|
|
|
import im.nheko 1.0
|
|
|
|
import im.nheko.EmojiModel 1.0
|
|
|
|
|
|
|
|
Page {
|
|
|
|
id: timelineRoot
|
|
|
|
|
|
|
|
palette: Nheko.colors
|
|
|
|
|
|
|
|
FontMetrics {
|
|
|
|
id: fontMetrics
|
|
|
|
}
|
|
|
|
|
|
|
|
EmojiPicker {
|
|
|
|
id: emojiPopup
|
|
|
|
|
|
|
|
colors: palette
|
|
|
|
model: TimelineManager.completerFor("allemoji", "")
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: userProfileComponent
|
|
|
|
|
|
|
|
UserProfile {
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: roomSettingsComponent
|
|
|
|
|
|
|
|
RoomSettings {
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2021-07-17 23:16:18 +03:00
|
|
|
Component {
|
|
|
|
id: roomMembersComponent
|
|
|
|
|
|
|
|
RoomMembers {
|
|
|
|
}
|
2021-07-19 21:31:08 +03:00
|
|
|
|
2021-07-17 23:16:18 +03:00
|
|
|
}
|
|
|
|
|
2021-05-14 16:23:32 +03:00
|
|
|
Component {
|
|
|
|
id: mobileCallInviteDialog
|
|
|
|
|
|
|
|
CallInvite {
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: quickSwitcherComponent
|
|
|
|
|
|
|
|
QuickSwitcher {
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2021-07-17 23:16:18 +03:00
|
|
|
Component {
|
|
|
|
id: deviceVerificationDialog
|
|
|
|
|
|
|
|
DeviceVerification {
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2021-07-19 21:31:08 +03:00
|
|
|
|
2021-07-17 23:16:18 +03:00
|
|
|
Component {
|
|
|
|
id: inviteDialog
|
|
|
|
|
|
|
|
InviteDialog {
|
|
|
|
}
|
2021-07-19 21:31:08 +03:00
|
|
|
|
2021-07-17 23:16:18 +03:00
|
|
|
}
|
|
|
|
|
2021-07-21 14:37:57 +03:00
|
|
|
Component {
|
|
|
|
id: packSettingsComponent
|
|
|
|
|
|
|
|
ImagePackSettingsDialog {
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2021-07-24 01:11:33 +03:00
|
|
|
Component {
|
|
|
|
id: readReceiptsDialog
|
|
|
|
|
|
|
|
ReadReceipts {
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2021-07-31 05:13:58 +03:00
|
|
|
Component {
|
|
|
|
id: rawMessageDialog
|
|
|
|
|
|
|
|
RawMessageDialog {
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2021-05-14 16:23:32 +03:00
|
|
|
Shortcut {
|
|
|
|
sequence: "Ctrl+K"
|
|
|
|
onActivated: {
|
|
|
|
var quickSwitch = quickSwitcherComponent.createObject(timelineRoot);
|
|
|
|
TimelineManager.focusTimeline();
|
|
|
|
quickSwitch.open();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-11 15:00:00 +03:00
|
|
|
Shortcut {
|
|
|
|
sequence: "Alt+A"
|
|
|
|
onActivated: Rooms.nextRoomWithActivity()
|
|
|
|
}
|
|
|
|
|
2021-05-29 00:25:57 +03:00
|
|
|
Shortcut {
|
|
|
|
sequence: "Ctrl+Down"
|
2021-05-30 14:22:11 +03:00
|
|
|
onActivated: Rooms.nextRoom()
|
2021-05-29 00:25:57 +03:00
|
|
|
}
|
2021-05-30 14:22:11 +03:00
|
|
|
|
2021-05-29 00:25:57 +03:00
|
|
|
Shortcut {
|
|
|
|
sequence: "Ctrl+Up"
|
2021-05-30 14:22:11 +03:00
|
|
|
onActivated: Rooms.previousRoom()
|
2021-05-29 00:25:57 +03:00
|
|
|
}
|
|
|
|
|
2021-05-14 16:23:32 +03:00
|
|
|
Connections {
|
2021-07-27 23:35:38 +03:00
|
|
|
function onNewDeviceVerificationRequest(flow) {
|
2021-05-14 16:23:32 +03:00
|
|
|
var dialog = deviceVerificationDialog.createObject(timelineRoot, {
|
|
|
|
"flow": flow
|
|
|
|
});
|
|
|
|
dialog.show();
|
|
|
|
}
|
2021-07-27 23:35:38 +03:00
|
|
|
|
|
|
|
function onOpenProfile(profile) {
|
2021-05-14 16:23:32 +03:00
|
|
|
var userProfile = userProfileComponent.createObject(timelineRoot, {
|
|
|
|
"profile": profile
|
|
|
|
});
|
|
|
|
userProfile.show();
|
|
|
|
}
|
2021-07-27 23:35:38 +03:00
|
|
|
|
|
|
|
function onShowImagePackSettings(packlist) {
|
2021-07-21 14:37:57 +03:00
|
|
|
var packSet = packSettingsComponent.createObject(timelineRoot, {
|
|
|
|
"packlist": packlist
|
|
|
|
});
|
|
|
|
packSet.show();
|
|
|
|
}
|
2021-05-14 16:23:32 +03:00
|
|
|
|
2021-08-14 00:58:26 +03:00
|
|
|
function onOpenRoomMembersDialog(members, room) {
|
2021-06-11 03:13:12 +03:00
|
|
|
var membersDialog = roomMembersComponent.createObject(timelineRoot, {
|
|
|
|
"members": members,
|
2021-08-14 00:58:26 +03:00
|
|
|
"room": room
|
2021-06-11 03:13:12 +03:00
|
|
|
});
|
|
|
|
membersDialog.show();
|
|
|
|
}
|
2021-07-27 23:35:38 +03:00
|
|
|
|
|
|
|
function onOpenRoomSettingsDialog(settings) {
|
2021-06-11 03:13:12 +03:00
|
|
|
var roomSettings = roomSettingsComponent.createObject(timelineRoot, {
|
|
|
|
"roomSettings": settings
|
|
|
|
});
|
|
|
|
roomSettings.show();
|
|
|
|
}
|
2021-07-27 23:35:38 +03:00
|
|
|
|
|
|
|
function onOpenInviteUsersDialog(invitees) {
|
2021-06-11 03:13:12 +03:00
|
|
|
var dialog = inviteDialog.createObject(timelineRoot, {
|
2021-07-17 23:16:18 +03:00
|
|
|
"roomId": Rooms.currentRoom.roomId,
|
2021-07-21 02:17:20 +03:00
|
|
|
"plainRoomName": Rooms.currentRoom.plainRoomName,
|
2021-07-18 01:23:21 +03:00
|
|
|
"invitees": invitees
|
2021-07-17 23:16:18 +03:00
|
|
|
});
|
2021-06-11 03:13:12 +03:00
|
|
|
dialog.show();
|
|
|
|
}
|
2021-07-27 23:35:38 +03:00
|
|
|
|
|
|
|
target: TimelineManager
|
|
|
|
}
|
|
|
|
|
|
|
|
Connections {
|
|
|
|
function onNewInviteState() {
|
|
|
|
if (CallManager.haveCallInvite && Settings.mobileMode) {
|
|
|
|
var dialog = mobileCallInviteDialog.createObject(msgView);
|
|
|
|
dialog.open();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
target: CallManager
|
2021-06-11 03:13:12 +03:00
|
|
|
}
|
|
|
|
|
2021-05-14 16:23:32 +03:00
|
|
|
ChatPage {
|
|
|
|
anchors.fill: parent
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|