Work
This commit is contained in:
@@ -99,6 +99,7 @@ ecm_add_qml_module(neochat URI org.kde.neochat GENERATE_PLUGIN_SOURCE
|
||||
qml/ReasonDialog.qml
|
||||
qml/NewPollDialog.qml
|
||||
qml/UserMenu.qml
|
||||
qml/IncomingCallDialog.qml
|
||||
DEPENDENCIES
|
||||
QtCore
|
||||
QtQuick
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <Quotient/settings.h>
|
||||
|
||||
#include "accountmanager.h"
|
||||
#include "callmanager.h"
|
||||
#include "enums/roomsortparameter.h"
|
||||
#include "mediasizehelper.h"
|
||||
#include "models/actionsmodel.h"
|
||||
@@ -72,6 +73,11 @@ Controller::Controller(QObject *parent)
|
||||
{
|
||||
Connection::setRoomType<NeoChatRoom>();
|
||||
|
||||
CallManager::instance().setCallsEnabled(NeoChatConfig::calls());
|
||||
connect(NeoChatConfig::self(), &NeoChatConfig::CallsChanged, this, []() {
|
||||
CallManager::instance().setCallsEnabled(NeoChatConfig::calls());
|
||||
});
|
||||
|
||||
Connection::setDirectChatEncryptionDefault(NeoChatConfig::preferUsingEncryption());
|
||||
connect(NeoChatConfig::self(), &NeoChatConfig::PreferUsingEncryptionChanged, this, [] {
|
||||
Connection::setDirectChatEncryptionDefault(NeoChatConfig::preferUsingEncryption());
|
||||
|
||||
39
src/app/qml/IncomingCallDialog.qml
Normal file
39
src/app/qml/IncomingCallDialog.qml
Normal file
@@ -0,0 +1,39 @@
|
||||
// SPDX-FileCopyrightText: 2025 Tobias Fella <tobias.fella@kde.org>
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls as QQC2
|
||||
|
||||
import org.kde.kirigami as Kirigami
|
||||
import org.kde.kirigamiaddons.formcard as FormCard
|
||||
import org.kde.kirigamiaddons.components as Components
|
||||
|
||||
import org.kde.neochat.libneochat
|
||||
|
||||
FormCard.FormCardPage {
|
||||
id: root
|
||||
|
||||
title: i18nc("@title:dialog", "Incoming Call")
|
||||
|
||||
FormCard.FormCard {
|
||||
topPadding: Kirigami.Units.largeSpacing
|
||||
FormCard.AbstractFormDelegate {
|
||||
contentItem: Components.Avatar {
|
||||
name: CallManager.room.displayName
|
||||
source: CallManager.room.avatarMediaUrl
|
||||
}
|
||||
}
|
||||
FormCard.FormTextDelegate {
|
||||
text: i18nc("@info", "%1 is calling you.", CallManager.callingMember.htmlSafeDisplayName)
|
||||
}
|
||||
FormCard.FormButtonDelegate {
|
||||
text: i18nc("@action:button", "Accept Call")
|
||||
onClicked: console.warn("unimplemented")
|
||||
}
|
||||
FormCard.FormButtonDelegate {
|
||||
text: i18nc("@action:button", "Decline Call")
|
||||
onClicked: CallManager.declineCall()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -83,6 +83,16 @@ Kirigami.ApplicationWindow {
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: CallManager
|
||||
property IncomingCallDialog dialog
|
||||
function onIsRingingChanged(): void {
|
||||
if (CallManager.isRinging) {
|
||||
root.pageStack.pushDialogLayer(Qt.createComponent("org.kde.neochat", "IncomingCallDialog"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
active: Kirigami.Settings.hasPlatformMenuBar && !Kirigami.Settings.isMobile
|
||||
sourceComponent: GlobalMenu {
|
||||
|
||||
Reference in New Issue
Block a user