Compare commits
28 Commits
work/tobia
...
work/nvrwh
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9fc78c4018 | ||
|
|
3b2df95df7 | ||
|
|
8edb248647 | ||
|
|
07bc06f4ff | ||
|
|
0d9988013b | ||
|
|
c1720bbaa7 | ||
|
|
692ce82717 | ||
|
|
ac04fa6a13 | ||
|
|
39aaced0f9 | ||
|
|
9887665560 | ||
|
|
c590cb76a0 | ||
|
|
f9b0c56fa0 | ||
|
|
aa7ab6b2ec | ||
|
|
ac6a5663a1 | ||
|
|
f09dc79995 | ||
|
|
693b2e74fe | ||
|
|
3a54d58516 | ||
|
|
6abb117989 | ||
|
|
b2dee6a96b | ||
|
|
1e1ba1dca3 | ||
|
|
55676b06c2 | ||
|
|
513496cf85 | ||
|
|
69215401dd | ||
|
|
d5ec37e1af | ||
|
|
6a45e2532c | ||
|
|
322926e31c | ||
|
|
29592a7f92 | ||
|
|
8fc8baa2d2 |
354
po/ar/neochat.po
354
po/ar/neochat.po
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
349
po/az/neochat.po
349
po/az/neochat.po
File diff suppressed because it is too large
Load Diff
351
po/ca/neochat.po
351
po/ca/neochat.po
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
349
po/cs/neochat.po
349
po/cs/neochat.po
File diff suppressed because it is too large
Load Diff
349
po/da/neochat.po
349
po/da/neochat.po
File diff suppressed because it is too large
Load Diff
349
po/de/neochat.po
349
po/de/neochat.po
File diff suppressed because it is too large
Load Diff
349
po/el/neochat.po
349
po/el/neochat.po
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
349
po/eo/neochat.po
349
po/eo/neochat.po
File diff suppressed because it is too large
Load Diff
351
po/es/neochat.po
351
po/es/neochat.po
File diff suppressed because it is too large
Load Diff
349
po/eu/neochat.po
349
po/eu/neochat.po
File diff suppressed because it is too large
Load Diff
349
po/fi/neochat.po
349
po/fi/neochat.po
File diff suppressed because it is too large
Load Diff
354
po/fr/neochat.po
354
po/fr/neochat.po
File diff suppressed because it is too large
Load Diff
349
po/ga/neochat.po
349
po/ga/neochat.po
File diff suppressed because it is too large
Load Diff
349
po/gl/neochat.po
349
po/gl/neochat.po
File diff suppressed because it is too large
Load Diff
351
po/he/neochat.po
351
po/he/neochat.po
File diff suppressed because it is too large
Load Diff
349
po/hi/neochat.po
349
po/hi/neochat.po
File diff suppressed because it is too large
Load Diff
349
po/hu/neochat.po
349
po/hu/neochat.po
File diff suppressed because it is too large
Load Diff
354
po/ia/neochat.po
354
po/ia/neochat.po
File diff suppressed because it is too large
Load Diff
349
po/id/neochat.po
349
po/id/neochat.po
File diff suppressed because it is too large
Load Diff
349
po/ie/neochat.po
349
po/ie/neochat.po
File diff suppressed because it is too large
Load Diff
354
po/it/neochat.po
354
po/it/neochat.po
File diff suppressed because it is too large
Load Diff
349
po/ja/neochat.po
349
po/ja/neochat.po
File diff suppressed because it is too large
Load Diff
351
po/ka/neochat.po
351
po/ka/neochat.po
File diff suppressed because it is too large
Load Diff
349
po/ko/neochat.po
349
po/ko/neochat.po
File diff suppressed because it is too large
Load Diff
349
po/lt/neochat.po
349
po/lt/neochat.po
File diff suppressed because it is too large
Load Diff
349
po/lv/neochat.po
349
po/lv/neochat.po
File diff suppressed because it is too large
Load Diff
351
po/nl/neochat.po
351
po/nl/neochat.po
File diff suppressed because it is too large
Load Diff
349
po/nn/neochat.po
349
po/nn/neochat.po
File diff suppressed because it is too large
Load Diff
349
po/pa/neochat.po
349
po/pa/neochat.po
File diff suppressed because it is too large
Load Diff
354
po/pl/neochat.po
354
po/pl/neochat.po
File diff suppressed because it is too large
Load Diff
349
po/pt/neochat.po
349
po/pt/neochat.po
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
349
po/ro/neochat.po
349
po/ro/neochat.po
File diff suppressed because it is too large
Load Diff
349
po/ru/neochat.po
349
po/ru/neochat.po
File diff suppressed because it is too large
Load Diff
349
po/sa/neochat.po
349
po/sa/neochat.po
File diff suppressed because it is too large
Load Diff
349
po/sk/neochat.po
349
po/sk/neochat.po
File diff suppressed because it is too large
Load Diff
353
po/sl/neochat.po
353
po/sl/neochat.po
File diff suppressed because it is too large
Load Diff
349
po/sv/neochat.po
349
po/sv/neochat.po
File diff suppressed because it is too large
Load Diff
349
po/ta/neochat.po
349
po/ta/neochat.po
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
354
po/tr/neochat.po
354
po/tr/neochat.po
File diff suppressed because it is too large
Load Diff
351
po/uk/neochat.po
351
po/uk/neochat.po
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -97,9 +97,9 @@ KirigamiComponents.ConvergentContextMenu {
|
||||
text: i18nc("@action:inmenu Open support dialog", "Support")
|
||||
icon.name: "help-contents-symbolic"
|
||||
onTriggered: {
|
||||
Qt.createComponent("org.kde.neochat", "SupportDialog").createObject(QQC2.Overlay.overlay, {
|
||||
(Qt.createComponent("org.kde.neochat", "SupportDialog").createObject(QQC2.Overlay.overlay, {
|
||||
connection: root.connection,
|
||||
}).open();
|
||||
}) as SupportDialog).open();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,9 +4,6 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
import org.kde.kirigami as Kirigami
|
||||
|
||||
import org.kde.neochat
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ Components.AbstractMaximizeComponent {
|
||||
QQC2.ScrollBar.horizontal.policy: QQC2.ScrollBar.AlwaysOff
|
||||
|
||||
QQC2.TextArea {
|
||||
id: codeText
|
||||
id: codeTextEdit
|
||||
topPadding: Kirigami.Units.smallSpacing
|
||||
bottomPadding: Kirigami.Units.smallSpacing
|
||||
leftPadding: lineNumberColumn.width + lineNumberColumn.anchors.leftMargin + Kirigami.Units.smallSpacing * 2
|
||||
@@ -100,15 +100,15 @@ Components.AbstractMaximizeComponent {
|
||||
|
||||
SyntaxHighlighter {
|
||||
property string definitionName: Repository.definitionForName(root.language).name
|
||||
textEdit: definitionName == "None" ? null : codeText
|
||||
textEdit: definitionName == "None" ? null : codeTextEdit
|
||||
definition: definitionName
|
||||
}
|
||||
ColumnLayout {
|
||||
id: lineNumberColumn
|
||||
anchors {
|
||||
top: codeText.top
|
||||
topMargin: codeText.topPadding + 1
|
||||
left: codeText.left
|
||||
top: codeTextEdit.top
|
||||
topMargin: codeTextEdit.topPadding + 1
|
||||
left: codeTextEdit.left
|
||||
leftMargin: Kirigami.Units.smallSpacing
|
||||
}
|
||||
spacing: 0
|
||||
@@ -116,7 +116,7 @@ Components.AbstractMaximizeComponent {
|
||||
id: repeater
|
||||
model: LineModel {
|
||||
id: lineModel
|
||||
Component.onCompleted: setDocument(codeText.textDocument)
|
||||
Component.onCompleted: setDocument(codeTextEdit.textDocument)
|
||||
}
|
||||
delegate: QQC2.Label {
|
||||
id: label
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls as QQC2
|
||||
import QtQuick.Layouts
|
||||
import QtQml.Models
|
||||
|
||||
import org.kde.kirigami as Kirigami
|
||||
import org.kde.kirigamiaddons.labs.components as KirigamiComponents
|
||||
|
||||
@@ -41,13 +41,11 @@ ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
QQC2.Button {
|
||||
anchors.bottom: parent.bottom
|
||||
text: i18n("They match")
|
||||
icon.name: "dialog-ok"
|
||||
onClicked: root.accept()
|
||||
}
|
||||
QQC2.Button {
|
||||
anchors.bottom: parent.bottom
|
||||
text: i18n("They don't match")
|
||||
icon.name: "dialog-cancel"
|
||||
onClicked: root.reject()
|
||||
|
||||
@@ -9,8 +9,6 @@ import org.kde.kirigami as Kirigami
|
||||
import org.kde.kirigamiaddons.delegates as Delegates
|
||||
import org.kde.kirigamiaddons.labs.components as Components
|
||||
|
||||
import org.kde.neochat
|
||||
|
||||
Delegates.RoundedItemDelegate {
|
||||
id: root
|
||||
|
||||
|
||||
@@ -166,7 +166,7 @@ ColumnLayout {
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
visible: root.currentRoom.connection.canCheckMutualRooms
|
||||
visible: (root.currentRoom.connection as NeoChatConnection).canCheckMutualRooms
|
||||
spacing: 0
|
||||
|
||||
Layout.topMargin: Kirigami.Units.largeSpacing * 2
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
// SPDX-FileCopyrightText: 2022 Tobias Fella <tobias.fella@kde.org>
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls as QQC2
|
||||
import QtQuick.Layouts
|
||||
@@ -8,7 +10,6 @@ import QtQuick.Window
|
||||
import QtQml
|
||||
|
||||
import org.kde.kirigami as Kirigami
|
||||
import org.kde.kirigamiaddons.delegates as Delegates
|
||||
import org.kde.neochat
|
||||
|
||||
Kirigami.Page {
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import QtLocation
|
||||
import QtPositioning
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ Kirigami.ApplicationWindow {
|
||||
|
||||
function onCurrentRoomChanged() {
|
||||
if (RoomManager.currentRoom && root.pageStack.depth <= 1 && root.initialized && Kirigami.Settings.isMobile) {
|
||||
let roomPage = pageStack.push(Qt.createComponent('org.kde.neochat', 'RoomPage'));
|
||||
let roomPage = root.pageStack.push(Qt.createComponent('org.kde.neochat', 'RoomPage'));
|
||||
roomPage.forceActiveFocus();
|
||||
roomPage.backRequested.connect(event => {
|
||||
RoomManager.clearCurrentRoom();
|
||||
@@ -151,8 +151,6 @@ Kirigami.ApplicationWindow {
|
||||
}
|
||||
|
||||
contextDrawer: RoomDrawer {
|
||||
id: contextDrawer
|
||||
|
||||
// This is a memory for all user initiated actions on the drawer, i.e. clicking the button
|
||||
// It is used to ensure that user choice is remembered when changing pages and expanding and contracting the window width
|
||||
property bool drawerUserState: NeoChatConfig.autoRoomInfoDrawer
|
||||
@@ -178,9 +176,9 @@ Kirigami.ApplicationWindow {
|
||||
|
||||
// Connect to the onClicked function of the RoomDrawer handle button
|
||||
Connections {
|
||||
target: contextDrawer.handle.children[0]
|
||||
target: root.contextDrawer.handle.children[0]
|
||||
function onClicked() {
|
||||
contextDrawer.drawerUserState = contextDrawer.drawerOpen;
|
||||
root.contextDrawer.drawerUserState = root.contextDrawer.drawerOpen;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
// SPDX-FileCopyrightText: 2025 Joshua Goins <josh@redstrate.com>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
|
||||
import org.kde.kirigami as Kirigami
|
||||
@@ -16,7 +18,7 @@ Kirigami.PromptDialog {
|
||||
|
||||
customFooterActions: Kirigami.Action {
|
||||
icon.name: "camera-video-symbolic"
|
||||
text: hasExistingMeeting ? i18nc("@action:button Join the Jitsi meeting", "Join") : i18nc("@action:button Start a new Jitsi meeting", "Start")
|
||||
text: root.hasExistingMeeting ? i18nc("@action:button Join the Jitsi meeting", "Join") : i18nc("@action:button Start a new Jitsi meeting", "Start")
|
||||
onTriggered: root.accept()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ Kirigami.Dialog {
|
||||
id: optionModel
|
||||
|
||||
readonly property bool allValuesSet: {
|
||||
for( var i = 0; i < optionModel.rowCount(); i++ ) {
|
||||
for (let i = 0; i < optionModel.rowCount(); i++) {
|
||||
if (optionModel.get(i).optionText.length <= 0) {
|
||||
return false;
|
||||
}
|
||||
@@ -83,7 +83,7 @@ Kirigami.Dialog {
|
||||
|
||||
function values() {
|
||||
let textValues = []
|
||||
for( var i = 0; i < optionModel.rowCount(); i++ ) {
|
||||
for(let i = 0; i < optionModel.rowCount(); i++) {
|
||||
textValues.push(optionModel.get(i).optionText);
|
||||
}
|
||||
return textValues;
|
||||
|
||||
@@ -18,7 +18,7 @@ Kirigami.Page {
|
||||
required property NeoChatConnection connection
|
||||
padding: 0
|
||||
|
||||
Component.onCompleted: camera.start()
|
||||
Component.onCompleted: session.camera.start()
|
||||
|
||||
Connections {
|
||||
target: root.QQC2.ApplicationWindow.window
|
||||
@@ -66,12 +66,8 @@ Kirigami.Page {
|
||||
CaptureSession {
|
||||
id: session
|
||||
|
||||
camera: Camera {
|
||||
id: camera
|
||||
}
|
||||
imageCapture: ImageCapture {
|
||||
id: imageCapture
|
||||
}
|
||||
camera: Camera {}
|
||||
imageCapture: ImageCapture {}
|
||||
videoOutput: viewFinder
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ Kirigami.Page {
|
||||
type: Kirigami.MessageType.Information
|
||||
position: Kirigami.InlineMessage.Position.Header
|
||||
|
||||
text: xi18n("This report will <strong>only</strong> be sent to the administrators of <link>%1</link> (your server).", root.connection.domain)
|
||||
text: xi18nc("@info", "This report will <strong>only</strong> be sent to the administrators of <link>%1</link> (your server).", root.connection.domain)
|
||||
}
|
||||
|
||||
QQC2.TextArea {
|
||||
|
||||
@@ -104,8 +104,8 @@ Kirigami.Page {
|
||||
enabled: hasExistingMeeting || canStartNewMeeting
|
||||
visible: root.currentRoom && !root.currentRoom.isSpace
|
||||
onTriggered: {
|
||||
const dialog = Qt.createComponent("org.kde.neochat", "MeetingDialog").createObject(QQC2.Overlay.overlay, { hasExistingMeeting });
|
||||
dialog.onAccepted.connect(doAction);
|
||||
const dialog = Qt.createComponent("org.kde.neochat", "MeetingDialog").createObject(QQC2.Overlay.overlay, { hasExistingMeeting }) as MeetingDialog;
|
||||
dialog.accepted.connect(doAction);
|
||||
dialog.open();
|
||||
}
|
||||
|
||||
@@ -215,7 +215,7 @@ Kirigami.Page {
|
||||
}
|
||||
|
||||
TapHandler {
|
||||
onTapped: pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'RoomPinnedMessagesPage'), {
|
||||
onTapped: (root.Kirigami.PageStack.pageStack as Kirigami.PageRow).pushDialogLayer(Qt.createComponent('org.kde.neochat', 'RoomPinnedMessagesPage'), {
|
||||
room: root.currentRoom
|
||||
}, {
|
||||
title: i18nc("@title", "Pinned Messages")
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
// SPDX-FileCopyrightText: 2026 Joshua Goins <josh@redstrate.com>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls as QQC2
|
||||
import QtQuick.Layouts
|
||||
|
||||
@@ -8,7 +8,6 @@ import QtQuick.Layouts
|
||||
|
||||
import org.kde.kirigami as Kirigami
|
||||
import org.kde.kirigamiaddons.components as KirigamiComponents
|
||||
import org.kde.kirigamiaddons.formcard as FormCard
|
||||
import org.kde.prison
|
||||
|
||||
import org.kde.neochat
|
||||
|
||||
@@ -40,9 +40,11 @@ ColumnLayout {
|
||||
model: root.connection.getSupportedRoomVersions()
|
||||
|
||||
delegate: FormCard.FormTextDelegate {
|
||||
id: versionDelegate
|
||||
required property var modelData
|
||||
text: modelData.id
|
||||
contentItem.children: QQC2.Label {
|
||||
text: modelData.status
|
||||
text: versionDelegate.modelData.status
|
||||
color: Kirigami.Theme.disabledTextColor
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ SearchPage {
|
||||
id: _private
|
||||
function openManualUserDialog(): void {
|
||||
let dialog = manualUserDialog.createObject(this, {
|
||||
connection: root.connection
|
||||
connection: root.room.connection
|
||||
}) as ManualUserDialog;
|
||||
dialog.parent = root.Window.window.overlay;
|
||||
dialog.accepted.connect(() => {
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
// SPDX-FileCopyrightText: 2024 James Graham <james.h.graham@protonmail.com>
|
||||
// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
||||
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Qt.labs.qmlmodels
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
// SPDX-FileCopyrightText: 2023 James Graham <james.h.graham@protonmail.com>
|
||||
// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
||||
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtCore
|
||||
import QtQuick
|
||||
import QtQuick.Controls as QQC2
|
||||
@@ -34,7 +36,7 @@ QQC2.Control {
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.margins: Kirigami.Units.largeSpacing
|
||||
Layout.preferredHeight: active ? item.implicitHeight : 0
|
||||
Layout.preferredHeight: active ? (item as Item).implicitHeight : 0
|
||||
|
||||
active: visible
|
||||
visible: root.chatBarCache.replyId.length > 0 || root.chatBarCache.attachmentPath.length > 0
|
||||
@@ -71,7 +73,7 @@ QQC2.Control {
|
||||
root.chatBarCache.text = text;
|
||||
}
|
||||
|
||||
Keys.onEnterPressed: {
|
||||
Keys.onEnterPressed: event => {
|
||||
if (completionMenu.visible) {
|
||||
completionMenu.complete();
|
||||
} else if (event.modifiers & Qt.ShiftModifier) {
|
||||
@@ -80,7 +82,7 @@ QQC2.Control {
|
||||
_private.post();
|
||||
}
|
||||
}
|
||||
Keys.onReturnPressed: {
|
||||
Keys.onReturnPressed: event => {
|
||||
if (completionMenu.visible) {
|
||||
completionMenu.complete();
|
||||
} else if (event.modifiers & Qt.ShiftModifier) {
|
||||
@@ -108,7 +110,7 @@ QQC2.Control {
|
||||
height: implicitHeight
|
||||
y: -height - 5
|
||||
z: 10
|
||||
connection: root.Message.room.connection
|
||||
connection: root.Message.room.connection as NeoChatConnection
|
||||
chatDocumentHandler: documentHandler
|
||||
margins: 0
|
||||
Behavior on height {
|
||||
@@ -165,7 +167,7 @@ QQC2.Control {
|
||||
text: i18nc("@action:button", "Attach an image or file")
|
||||
icon.name: "mail-attachment"
|
||||
onClicked: {
|
||||
let dialog = (Clipboard.hasImage ? attachDialog : openFileDialog).createObject(QQC2.Overlay.overlay);
|
||||
let dialog = (Clipboard.hasImage ? attachDialog : openFileDialog).createObject(QQC2.Overlay.overlay) as QQC2.Dialog;
|
||||
dialog.chosen.connect(path => root.chatBarCache.attachmentPath = path);
|
||||
dialog.open();
|
||||
}
|
||||
@@ -225,8 +227,6 @@ QQC2.Control {
|
||||
Message.maxContentWidth: paneLoader.item.width
|
||||
}
|
||||
QQC2.Button {
|
||||
id: cancelButton
|
||||
|
||||
anchors.top: parent.top
|
||||
anchors.right: parent.right
|
||||
|
||||
@@ -261,9 +261,9 @@ QQC2.Control {
|
||||
function updateText() {
|
||||
// This could possibly be undefined due to some esoteric QtQuick issue. Referencing it somewhere in JS is enough.
|
||||
documentHandler.document;
|
||||
if (chatBarCache?.isEditing && chatBarCache.relationMessage.length > 0) {
|
||||
textArea.text = chatBarCache.relationMessage;
|
||||
documentHandler.updateMentions(chatBarCache.editId);
|
||||
if (root.chatBarCache?.isEditing && root.chatBarCache.relationMessage.length > 0) {
|
||||
textArea.text = root.chatBarCache.relationMessage;
|
||||
documentHandler.updateMentions(root.chatBarCache.editId);
|
||||
textArea.forceActiveFocus();
|
||||
textArea.cursorPosition = textArea.text.length;
|
||||
}
|
||||
|
||||
@@ -2,12 +2,13 @@
|
||||
// SPDX-FileCopyrightText: 2024 James Graham <james.h.graham@protonmail.com>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtCore as Core
|
||||
import QtQuick
|
||||
import QtQuick.Controls as QQC2
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Dialogs as Dialogs
|
||||
import Qt.labs.qmlmodels
|
||||
|
||||
import org.kde.coreaddons
|
||||
import org.kde.kirigami as Kirigami
|
||||
@@ -51,7 +52,7 @@ ColumnLayout {
|
||||
property bool autoOpenFile: false
|
||||
|
||||
function saveFileAs() {
|
||||
const dialog = fileDialog.createObject(QQC2.Overlay.overlay);
|
||||
const dialog = fileDialog.createObject(QQC2.Overlay.overlay) as Dialogs.FileDialog;
|
||||
dialog.selectedFile = Message.room.fileNameToDownload(root.eventId);
|
||||
dialog.open();
|
||||
}
|
||||
@@ -70,7 +71,7 @@ ColumnLayout {
|
||||
states: [
|
||||
State {
|
||||
name: "downloadedInstant"
|
||||
when: root.fileTransferInfo.completed && autoOpenFile
|
||||
when: root.fileTransferInfo.completed && root.autoOpenFile
|
||||
|
||||
PropertyChanges {
|
||||
openButton.icon.name: "document-open"
|
||||
@@ -84,7 +85,7 @@ ColumnLayout {
|
||||
},
|
||||
State {
|
||||
name: "downloaded"
|
||||
when: root.fileTransferInfo.completed && !autoOpenFile
|
||||
when: root.fileTransferInfo.completed && !root.autoOpenFile
|
||||
|
||||
PropertyChanges {
|
||||
openButton.visible: false
|
||||
@@ -138,7 +139,7 @@ ColumnLayout {
|
||||
id: openButton
|
||||
icon.name: "document-open"
|
||||
onClicked: {
|
||||
autoOpenFile = true;
|
||||
root.autoOpenFile = true;
|
||||
root.Message.room.downloadTempFile(root.eventId);
|
||||
}
|
||||
|
||||
@@ -166,7 +167,7 @@ ColumnLayout {
|
||||
onAccepted: {
|
||||
NeoChatConfig.lastSaveDirectory = currentFolder;
|
||||
NeoChatConfig.save();
|
||||
if (autoOpenFile) {
|
||||
if (root.autoOpenFile) {
|
||||
UrlHelper.copyTo(root.fileTransferInfo.localPath, selectedFile);
|
||||
} else {
|
||||
root.Message.room.download(root.eventId, selectedFile);
|
||||
|
||||
@@ -40,7 +40,7 @@ ColumnLayout {
|
||||
Layout.maximumWidth: Message.maxContentWidth
|
||||
|
||||
LiveLocationsModel {
|
||||
id: liveLocationModel
|
||||
id: locationModel
|
||||
eventId: root.eventId
|
||||
room: Message.room
|
||||
}
|
||||
@@ -50,13 +50,13 @@ ColumnLayout {
|
||||
Layout.preferredWidth: root.Message.maxContentWidth
|
||||
Layout.preferredHeight: root.Message.maxContentWidth / 16 * 9
|
||||
|
||||
map.center: QtPositioning.coordinate(liveLocationModel.boundingBox.y, liveLocationModel.boundingBox.x)
|
||||
map.center: QtPositioning.coordinate(locationModel.boundingBox.y, locationModel.boundingBox.x)
|
||||
map.zoomLevel: 15
|
||||
|
||||
map.plugin: OsmLocationPlugin.plugin
|
||||
|
||||
MapItemView {
|
||||
model: liveLocationModel
|
||||
model: locationModel
|
||||
delegate: LocationMapItem {}
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ ColumnLayout {
|
||||
acceptedButtons: Qt.LeftButton
|
||||
onTapped: {
|
||||
fullScreenMap.createObject(parent, {
|
||||
liveLocationModel: liveLocationModel
|
||||
liveLocationModel: locationModel
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
// SPDX-FileCopyrightText: 2020 Carl Schwan <carl@carlschwan.eu>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls as QQC2
|
||||
import QtQuick.Layouts
|
||||
|
||||
import org.kde.kirigami as Kirigami
|
||||
|
||||
@@ -102,7 +103,7 @@ Flow {
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
var dialog = emojiDialog.createObject(reactButton);
|
||||
var dialog = emojiDialog.createObject(reactButton) as EmojiDialog;
|
||||
dialog.showStickers = false;
|
||||
dialog.chosen.connect(emoji => {
|
||||
root.Message.room.toggleReaction(root.eventId, emoji);
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
// SPDX-FileCopyrightText: 2024 James Graham <james.h.graham@protonmail.com>
|
||||
// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
||||
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Qt.labs.qmlmodels
|
||||
@@ -117,6 +119,7 @@ DelegateChooser {
|
||||
DelegateChoice {
|
||||
roleValue: MessageComponentType.Location
|
||||
delegate: MimeComponent {
|
||||
required property string display
|
||||
mimeIconSource: "mark-location"
|
||||
label: display
|
||||
}
|
||||
@@ -125,6 +128,7 @@ DelegateChooser {
|
||||
DelegateChoice {
|
||||
roleValue: MessageComponentType.LiveLocation
|
||||
delegate: MimeComponent {
|
||||
required property string display
|
||||
mimeIconSource: "mark-location"
|
||||
label: display
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
// SPDX-FileCopyrightText: 2020 Carl Schwan <carl@carlschwan.eu>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls as QQC2
|
||||
import QtQuick.Layouts
|
||||
@@ -59,7 +61,7 @@ Kirigami.OverlayDrawer {
|
||||
if (_lastX === -1) {
|
||||
return;
|
||||
}
|
||||
if (Qt.application.layoutDirection === Qt.RightToLeft) {
|
||||
if (Application.layoutDirection === Qt.RightToLeft) {
|
||||
root.actualWidth = Math.min(root.maxWidth, Math.max(root.minWidth, root.roomDrawerWidth - _lastX + mapToGlobal(mouseX, mouseY).x));
|
||||
} else {
|
||||
root.actualWidth = Math.min(root.maxWidth, Math.max(root.minWidth, root.roomDrawerWidth + _lastX - mapToGlobal(mouseX, mouseY).x));
|
||||
@@ -68,7 +70,7 @@ Kirigami.OverlayDrawer {
|
||||
}
|
||||
enabled: true
|
||||
|
||||
edge: Qt.application.layoutDirection == Qt.RightToLeft ? Qt.LeftEdge : Qt.RightEdge
|
||||
edge: Application.layoutDirection == Qt.RightToLeft ? Qt.LeftEdge : Qt.RightEdge
|
||||
|
||||
// If modal has been changed and the drawer is closed automatically then dim on popup open will have been switched off in main.qml so switch it back on after the animation completes.
|
||||
// This is to avoid dim being active for a split second when the drawer is switched to modal which looks terrible.
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
// SPDX-FileCopyrightText: 2023 James Graham <james.h.graham@protonmail.com>
|
||||
// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
||||
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
|
||||
import org.kde.kirigami as Kirigami
|
||||
|
||||
@@ -103,7 +104,7 @@ Kirigami.Page {
|
||||
|
||||
Connections {
|
||||
target: root.Kirigami.PageStack.pageStack
|
||||
onWideModeChanged: {
|
||||
function onWideModeChanged(): void {
|
||||
if ((root.Kirigami.PageStack.pageStack as Kirigami.PageRow).wideMode) {
|
||||
root.Kirigami.PageStack.pop();
|
||||
}
|
||||
|
||||
@@ -46,7 +46,6 @@ QQC2.Control {
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
id: column
|
||||
width: scrollView.width
|
||||
spacing: 0
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
// SPDX-FileCopyrightText: 2020 Tobias Fella <tobias.fella@kde.org>
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls as QQC2
|
||||
import QtQuick.Layouts
|
||||
@@ -28,7 +30,7 @@ FormCard.FormCardPage {
|
||||
interval: 10
|
||||
running: false
|
||||
onTriggered: root.QQC2.ApplicationWindow.window.pageStack.layers.push(Qt.createComponent('org.kde.neochat.settings', 'AccountEditorPage'), {
|
||||
connection: initialAccount
|
||||
connection: root.initialAccount
|
||||
}, {
|
||||
title: i18n("Account editor")
|
||||
})
|
||||
@@ -44,7 +46,7 @@ FormCard.FormCardPage {
|
||||
id: accountDelegate
|
||||
required property NeoChatConnection connection
|
||||
Layout.fillWidth: true
|
||||
onClicked: root.QQC2.ApplicationWindow.window.pageStack.layers.push(Qt.createComponent('org.kde.neochat.settings', 'AccountEditorPage'), {
|
||||
onClicked: (root.Kirigami.PageStack.pageStack as Kirigami.PageRow).layers.push(Qt.createComponent('org.kde.neochat.settings', 'AccountEditorPage'), {
|
||||
connection: accountDelegate.connection
|
||||
}, {
|
||||
title: i18n("Account editor")
|
||||
@@ -87,7 +89,7 @@ FormCard.FormCardPage {
|
||||
QQC2.ToolButton {
|
||||
text: i18n("Logout…")
|
||||
icon.name: "im-kick-user"
|
||||
onClicked: confirmLogoutDialogComponent.createObject(root.QQC2.Overlay.overlay).open()
|
||||
onClicked: (confirmLogoutDialogComponent.createObject(root.QQC2.Overlay.overlay) as ConfirmLogoutDialog).open()
|
||||
}
|
||||
|
||||
Component {
|
||||
@@ -124,8 +126,8 @@ FormCard.FormCardPage {
|
||||
property Connections connections: Connections {
|
||||
target: Controller
|
||||
function onConnectionAdded() {
|
||||
if (pageStack.layers.depth > 2) {
|
||||
pageStack.layers.pop();
|
||||
if ((root.Kirigami.PageStack.pageStack as Kirigami.PageRow).layers.depth > 2) {
|
||||
(root.Kirigami.PageStack.pageStack as Kirigami.PageRow).layers.pop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@ FormCard.FormCardPage {
|
||||
required property NeoChatConnection connection
|
||||
|
||||
property DevicesModel devicesModel: DevicesModel {
|
||||
id: devicesModel
|
||||
connection: root.connection
|
||||
}
|
||||
|
||||
@@ -49,7 +48,7 @@ FormCard.FormCardPage {
|
||||
standardButtons: Kirigami.Dialog.Ok
|
||||
})
|
||||
dialog.open();
|
||||
root.connection.onNewKeyVerificationSession.connect(() => {
|
||||
root.connection.newKeyVerificationSession.connect(() => {
|
||||
dialog.close();
|
||||
});
|
||||
}
|
||||
@@ -76,7 +75,7 @@ FormCard.FormCardPage {
|
||||
|
||||
FormCard.AbstractFormDelegate {
|
||||
Layout.fillWidth: true
|
||||
visible: root.connection && devicesModel.count === 0 // We can assume 0 means loading since there is at least one device
|
||||
visible: root.connection && root.devicesModel.count === 0 // We can assume 0 means loading since there is at least one device
|
||||
contentItem: Kirigami.LoadingPlaceholder {}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
// SPDX-FileCopyrightText: 2023 Tobias Fella <tobias.fella@kde.org>
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtCore as Core
|
||||
import QtQuick
|
||||
import QtQuick.Controls as QQC2
|
||||
@@ -27,7 +29,7 @@ FormCard.FormCardPage {
|
||||
title: emoticonType === EmoticonFormCard.Stickers ? (newEmoticon ? i18nc("@title:window", "Add Sticker") : i18nc("@title:window", "Edit Sticker")) : (newEmoticon ? i18nc("@title:window", "Add Emoji") : i18nc("@title:window", "Edit Emoji"))
|
||||
|
||||
FormCard.FormHeader {
|
||||
title: emoticonType === EmoticonFormCard.Stickers ? i18nc("@info:group", "Sticker") : i18nc("@info:group", "Emoji")
|
||||
title: root.emoticonType === EmoticonFormCard.Stickers ? i18nc("@info:group", "Sticker") : i18nc("@info:group", "Emoji")
|
||||
}
|
||||
FormCard.FormCard {
|
||||
FormCard.AbstractFormDelegate {
|
||||
@@ -42,11 +44,9 @@ FormCard.FormCardPage {
|
||||
source: root.url
|
||||
sourceSize.width: Kirigami.Units.gridUnit * 4
|
||||
sourceSize.height: Kirigami.Units.gridUnit * 4
|
||||
width: Kirigami.Units.gridUnit * 4
|
||||
height: Kirigami.Units.gridUnit * 4
|
||||
|
||||
Kirigami.Icon {
|
||||
source: emoticonType === EmoticonFormCard.Stickers ? "stickers" : "preferences-desktop-emoticons"
|
||||
source: root.emoticonType === EmoticonFormCard.Stickers ? "stickers" : "preferences-desktop-emoticons"
|
||||
anchors.fill: parent
|
||||
visible: parent.status !== Image.Ready
|
||||
}
|
||||
@@ -73,7 +73,7 @@ FormCard.FormCardPage {
|
||||
if (fileDialog != null) {
|
||||
return;
|
||||
}
|
||||
fileDialog = openFileDialog.createObject(QQC2.Overlay.overlay);
|
||||
fileDialog = root.openFileDialog.createObject(QQC2.Overlay.overlay);
|
||||
fileDialog.chosen.connect(function (receivedSource) {
|
||||
mouseArea.fileDialog = null;
|
||||
if (!receivedSource) {
|
||||
@@ -94,12 +94,10 @@ FormCard.FormCardPage {
|
||||
}
|
||||
}
|
||||
FormCard.FormTextFieldDelegate {
|
||||
id: shortcode
|
||||
label: i18n("Shortcode:")
|
||||
text: root.shortcode
|
||||
}
|
||||
FormCard.FormTextFieldDelegate {
|
||||
id: description
|
||||
label: i18n("Description:")
|
||||
text: root.description
|
||||
}
|
||||
@@ -107,19 +105,19 @@ FormCard.FormCardPage {
|
||||
id: save
|
||||
text: i18n("Save")
|
||||
icon.name: "document-save"
|
||||
enabled: !root.newEmoticon || (image.source.toString().length > 0 && shortcode.text && description.text)
|
||||
enabled: !root.newEmoticon || (image.source.toString().length > 0 && root.shortcode && root.description)
|
||||
onClicked: {
|
||||
if (root.newEmoticon) {
|
||||
model.addEmoticon(image.source, shortcode.text, description.text, emoticonType === EmoticonFormCard.Stickers ? "sticker" : "emoticon");
|
||||
root.model.addEmoticon(image.source, root.shortcode, root.description, root.emoticonType === EmoticonFormCard.Stickers ? "sticker" : "emoticon");
|
||||
} else {
|
||||
if (description.text !== root.description) {
|
||||
root.model.setEmoticonBody(proxyModel.mapToSource(proxyModel.index(model.index, 0)).row, description.text);
|
||||
if (root.description !== root.description) {
|
||||
root.model.setEmoticonBody(root.proxyModel.mapToSource(root.proxyModel.index(root.model.index, 0)).row, root.description);
|
||||
}
|
||||
if (shortcode.text !== root.shortcode) {
|
||||
root.model.setEmoticonShortcode(proxyModel.mapToSource(proxyModel.index(model.index, 0)).row, shortcode.text);
|
||||
if (root.shortcode !== root.shortcode) {
|
||||
root.model.setEmoticonShortcode(root.proxyModel.mapToSource(root.proxyModel.index(root.model.index, 0)).row, root.shortcode);
|
||||
}
|
||||
if (image.source + "" !== root.url) {
|
||||
root.model.setEmoticonImage(proxyModel.mapToSource(proxyModel.index(model.index, 0)).row, image.source);
|
||||
root.model.setEmoticonImage(root.proxyModel.mapToSource(root.proxyModel.index(root.model.index, 0)).row, image.source);
|
||||
}
|
||||
}
|
||||
root.closeDialog();
|
||||
@@ -127,8 +125,6 @@ FormCard.FormCardPage {
|
||||
}
|
||||
}
|
||||
property Component openFileDialog: Component {
|
||||
id: openFileDialog
|
||||
|
||||
OpenFileDialog {
|
||||
currentFolder: Core.StandardPaths.standardLocations(Core.StandardPaths.PicturesLocation)[0]
|
||||
parentWindow: root.Window.window
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
// SPDX-FileCopyrightText: 2022 James Graham <james.h.graham@protonmail.com>
|
||||
// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
||||
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls as QQC2
|
||||
import QtQuick.Layouts
|
||||
@@ -27,8 +29,8 @@ FormCard.FormCardPage {
|
||||
FormCard.FormCheckDelegate {
|
||||
text: i18n("Enable notifications for this account")
|
||||
description: {
|
||||
if (connection.pushNotificationsAvailable) {
|
||||
if (connection.enablePushNotifications) {
|
||||
if (root.connection.pushNotificationsAvailable) {
|
||||
if (root.connection.enablePushNotifications) {
|
||||
return i18n("Notifications can appear even when NeoChat isn't running.");
|
||||
} else {
|
||||
return i18n("Push notifications are available but could not be enabled.");
|
||||
@@ -52,8 +54,6 @@ FormCard.FormCardPage {
|
||||
spacing: Kirigami.Units.largeSpacing
|
||||
Kirigami.Icon {
|
||||
source: "data-information"
|
||||
width: Kirigami.Units.iconSizes.sizeForLabels
|
||||
height: Kirigami.Units.iconSizes.sizeForLabels
|
||||
}
|
||||
QQC2.Label {
|
||||
text: i18nc("@info", "These are the default notification settings for all rooms. You can customize notifications per-room in the room list or room settings.")
|
||||
@@ -78,7 +78,7 @@ FormCard.FormCardPage {
|
||||
}
|
||||
}
|
||||
|
||||
delegate: ruleDelegate
|
||||
delegate: root.ruleDelegate
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ FormCard.FormCardPage {
|
||||
}
|
||||
}
|
||||
|
||||
delegate: ruleDelegate
|
||||
delegate: root.ruleDelegate
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ FormCard.FormCardPage {
|
||||
}
|
||||
}
|
||||
|
||||
delegate: ruleDelegate
|
||||
delegate: root.ruleDelegate
|
||||
}
|
||||
FormCard.AbstractFormDelegate {
|
||||
Layout.fillWidth: true
|
||||
@@ -176,7 +176,7 @@ FormCard.FormCardPage {
|
||||
}
|
||||
}
|
||||
|
||||
delegate: ruleDelegate
|
||||
delegate: root.ruleDelegate
|
||||
}
|
||||
}
|
||||
|
||||
@@ -197,12 +197,11 @@ FormCard.FormCardPage {
|
||||
}
|
||||
}
|
||||
|
||||
delegate: ruleDelegate
|
||||
delegate: root.ruleDelegate
|
||||
}
|
||||
}
|
||||
|
||||
property Component ruleDelegate: Component {
|
||||
id: ruleDelegate
|
||||
NotificationRuleItem {
|
||||
onDeleteRule: {
|
||||
root.pushRuleModel.removeKeyword(id);
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
// SPDX-FileCopyrightText: 2024 Tobias Fella <tobias.fella@kde.org>
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls as QQC2
|
||||
import QtQuick.Layouts
|
||||
@@ -37,6 +39,8 @@ FormCard.FormCardPage {
|
||||
id: repeater
|
||||
model: root.connection.ignoredUsers()
|
||||
delegate: FormCard.AbstractFormDelegate {
|
||||
id: ignoredUserDelegate
|
||||
required property string modelData
|
||||
topPadding: Kirigami.Units.smallSpacing
|
||||
bottomPadding: Kirigami.Units.smallSpacing
|
||||
|
||||
@@ -46,7 +50,7 @@ FormCard.FormCardPage {
|
||||
|
||||
QQC2.Label {
|
||||
Layout.fillWidth: true
|
||||
text: modelData
|
||||
text: ignoredUserDelegate.modelData
|
||||
elide: Text.ElideRight
|
||||
Accessible.ignored: true // base class sets this text on root already
|
||||
}
|
||||
@@ -54,7 +58,7 @@ FormCard.FormCardPage {
|
||||
QQC2.ToolButton {
|
||||
text: i18nc("@action:button", "Unignore this user")
|
||||
icon.name: "list-remove-symbolic"
|
||||
onClicked: root.connection.removeFromIgnoredUsers(modelData)
|
||||
onClicked: root.connection.removeFromIgnoredUsers(ignoredUserDelegate.modelData)
|
||||
display: QQC2.Button.IconOnly
|
||||
QQC2.ToolTip.text: text
|
||||
QQC2.ToolTip.visible: hovered
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
// SPDX-License-Identifier: LGPL-2.0-or-later
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls as QQC2
|
||||
import QtQuick.Dialogs
|
||||
import QtQuick.Layouts
|
||||
|
||||
import org.kde.kirigami as Kirigami
|
||||
import org.kde.kirigamiaddons.formcard as FormCard
|
||||
|
||||
import io.github.quotient_im.libquotient
|
||||
import org.kde.neochat
|
||||
|
||||
FormCard.FormCardPage {
|
||||
|
||||
@@ -12,348 +12,344 @@ import org.kde.kirigamiaddons.formcard as FormCard
|
||||
import org.kde.neochat
|
||||
import org.kde.neochat.devtools
|
||||
|
||||
FormCard.FormCardPage {
|
||||
Kirigami.ScrollablePage {
|
||||
id: root
|
||||
|
||||
required property NeoChatConnection connection
|
||||
|
||||
title: i18nc("@title:window", "General")
|
||||
|
||||
FormCard.FormHeader {
|
||||
title: i18nc("@title:group", "General Settings")
|
||||
visible: Qt.platform.os !== "android"
|
||||
}
|
||||
FormCard.FormCard {
|
||||
FormCard.FormCheckDelegate {
|
||||
id: closeDelegate
|
||||
text: i18n("Show in System Tray")
|
||||
checked: NeoChatConfig.systemTray
|
||||
visible: Controller.supportSystemTray
|
||||
enabled: !NeoChatConfig.isSystemTrayImmutable
|
||||
onToggled: {
|
||||
NeoChatConfig.systemTray = checked;
|
||||
NeoChatConfig.save();
|
||||
}
|
||||
}
|
||||
Kirigami.Form {
|
||||
Kirigami.FormGroup {
|
||||
title: Qt.platform.os === "android" ? "" : i18nc("@title:group", "General Settings")
|
||||
|
||||
FormCard.FormDelegateSeparator {
|
||||
above: closeDelegate
|
||||
below: minimizeDelegate
|
||||
}
|
||||
|
||||
FormCard.FormCheckDelegate {
|
||||
id: minimizeDelegate
|
||||
text: i18n("Minimize to system tray on startup")
|
||||
checked: NeoChatConfig.minimizeToSystemTrayOnStartup
|
||||
visible: Controller.supportSystemTray && !Kirigami.Settings.isMobile && NeoChatConfig.systemTray
|
||||
enabled: NeoChatConfig.systemTray && !NeoChatConfig.isMinimizeToSystemTrayOnStartupImmutable
|
||||
onToggled: {
|
||||
NeoChatConfig.minimizeToSystemTrayOnStartup = checked;
|
||||
NeoChatConfig.save();
|
||||
}
|
||||
}
|
||||
|
||||
FormCard.FormDelegateSeparator {
|
||||
above: minimizeDelegate
|
||||
below: automaticallyDelegate
|
||||
visible: minimizeDelegate.visible
|
||||
}
|
||||
|
||||
FormCard.FormCheckDelegate {
|
||||
id: automaticallyDelegate
|
||||
text: i18n("Automatically hide/unhide the room information when resizing the window")
|
||||
checked: NeoChatConfig.autoRoomInfoDrawer
|
||||
enabled: !NeoChatConfig.isAutoRoomInfoDrawerImmutable
|
||||
visible: Qt.platform.os !== "android"
|
||||
onToggled: {
|
||||
NeoChatConfig.autoRoomInfoDrawer = checked;
|
||||
NeoChatConfig.save();
|
||||
}
|
||||
}
|
||||
|
||||
FormCard.FormDelegateSeparator {
|
||||
above: automaticallyDelegate
|
||||
below: categorizeDelegate
|
||||
}
|
||||
FormCard.FormCheckDelegate {
|
||||
id: categorizeDelegate
|
||||
text: i18n("Show all rooms in \"Home\" tab")
|
||||
checked: NeoChatConfig.allRoomsInHome
|
||||
enabled: !NeoChatConfig.isAllRoomsInHomeImmutable
|
||||
onToggled: {
|
||||
NeoChatConfig.allRoomsInHome = checked;
|
||||
NeoChatConfig.save();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
FormCard.FormHeader {
|
||||
title: i18nc("@title:group", "Room List Sort Order")
|
||||
}
|
||||
FormCard.FormCard {
|
||||
FormCard.FormTextDelegate {
|
||||
text: i18nc("@info:label", "Hidden events are not considered as recent activity when sorting rooms.")
|
||||
}
|
||||
|
||||
FormCard.FormDelegateSeparator {}
|
||||
|
||||
FormCard.FormRadioDelegate {
|
||||
text: i18nc("As in 'sort something based on last activity'", "Importance")
|
||||
description: i18nc("@info", "Rooms with unread notifications will be shown first.")
|
||||
checked: NeoChatConfig.sortOrder === 1
|
||||
enabled: !NeoChatConfig.isSortOrderImmutable
|
||||
onToggled: {
|
||||
NeoChatConfig.sortOrder = 1
|
||||
NeoChatConfig.customSortOrder = []
|
||||
NeoChatConfig.save()
|
||||
}
|
||||
}
|
||||
FormCard.FormRadioDelegate {
|
||||
text: i18nc("As in 'sort something alphabetically'", "Alphabetical")
|
||||
checked: NeoChatConfig.sortOrder === 0
|
||||
enabled: !NeoChatConfig.isSortOrderImmutable
|
||||
onToggled: {
|
||||
NeoChatConfig.sortOrder = 0
|
||||
NeoChatConfig.customSortOrder = []
|
||||
NeoChatConfig.save()
|
||||
}
|
||||
}
|
||||
FormCard.FormRadioDelegate {
|
||||
text: i18nc("As in 'sort something based on the last event'", "Newest Events")
|
||||
description: i18nc("@info", "Rooms with the newest events will be shown first.")
|
||||
checked: NeoChatConfig.sortOrder === 2
|
||||
enabled: !NeoChatConfig.isSortOrderImmutable
|
||||
onToggled: {
|
||||
NeoChatConfig.sortOrder = 2
|
||||
NeoChatConfig.customSortOrder = []
|
||||
NeoChatConfig.save()
|
||||
}
|
||||
}
|
||||
FormCard.FormRadioDelegate {
|
||||
id: openCustomRoomSortButton
|
||||
text: i18nc("@option:radio", "Custom")
|
||||
checked: NeoChatConfig.sortOrder === 3
|
||||
enabled: !NeoChatConfig.isSortOrderImmutable
|
||||
onClicked: {
|
||||
Qt.createComponent('org.kde.neochat.settings', 'RoomSortParameterDialog').createObject(root).open();
|
||||
}
|
||||
}
|
||||
}
|
||||
FormCard.FormHeader {
|
||||
title: i18nc("@title", "Timeline")
|
||||
}
|
||||
FormCard.FormCard {
|
||||
FormCard.FormComboBoxDelegate {
|
||||
id: markAsReadCombo
|
||||
text: i18n("Mark messages as read when:")
|
||||
textRole: "name"
|
||||
valueRole: "value"
|
||||
model: [
|
||||
{
|
||||
name: i18n("Never"),
|
||||
value: 0
|
||||
},
|
||||
{
|
||||
name: i18nc("@item:inlistbox As in mark messages in the room as read when entering the room", "Entering the room"),
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
name: i18nc("@item:inlistbox As in mark messages in the room as read when entering the room and all messages are visible on screen", "Entering the room and all unread messages are visible"),
|
||||
value: 2
|
||||
},
|
||||
{
|
||||
name: i18nc("@item:inlistbox As in mark messages in the room as read when exiting the room", "Exiting the room"),
|
||||
value: 3
|
||||
},
|
||||
{
|
||||
name: i18nc("@item:inlistbox As in mark messages in the room as read when exiting the room and all messages are visible on screen", "Exiting the room and all unread messages are visible"),
|
||||
value: 4
|
||||
Kirigami.FormEntry {
|
||||
visible: Controller.supportSystemTray
|
||||
contentItem: QQC2.CheckBox {
|
||||
text: i18n("Show in System Tray")
|
||||
checked: NeoChatConfig.systemTray
|
||||
enabled: !NeoChatConfig.isSystemTrayImmutable
|
||||
onToggled: {
|
||||
NeoChatConfig.systemTray = checked;
|
||||
NeoChatConfig.save();
|
||||
}
|
||||
}
|
||||
}
|
||||
Kirigami.FormSeparator {}
|
||||
Kirigami.FormEntry {
|
||||
id: minimizeDelegate
|
||||
visible: Controller.supportSystemTray && !Kirigami.Settings.isMobile && NeoChatConfig.systemTray
|
||||
contentItem: QQC2.CheckBox {
|
||||
text: i18n("Minimize to system tray on startup")
|
||||
checked: NeoChatConfig.minimizeToSystemTrayOnStartup
|
||||
enabled: NeoChatConfig.systemTray && !NeoChatConfig.isMinimizeToSystemTrayOnStartupImmutable
|
||||
onToggled: {
|
||||
NeoChatConfig.minimizeToSystemTrayOnStartup = checked;
|
||||
NeoChatConfig.save();
|
||||
}
|
||||
}
|
||||
}
|
||||
Kirigami.FormSeparator {
|
||||
visible: minimizeDelegate.visible
|
||||
}
|
||||
Kirigami.FormEntry {
|
||||
id: automaticallyDelegate
|
||||
visible: Qt.platform.os !== "android"
|
||||
contentItem: QQC2.CheckBox {
|
||||
text: i18n("Automatically hide/unhide the room information when resizing the window")
|
||||
checked: NeoChatConfig.autoRoomInfoDrawer
|
||||
enabled: !NeoChatConfig.isAutoRoomInfoDrawerImmutable
|
||||
onToggled: {
|
||||
NeoChatConfig.autoRoomInfoDrawer = checked;
|
||||
NeoChatConfig.save();
|
||||
}
|
||||
}
|
||||
}
|
||||
Kirigami.FormSeparator {}
|
||||
Kirigami.FormEntry {
|
||||
id: categorizeDelegate
|
||||
contentItem: QQC2.CheckBox {
|
||||
text: i18n("Show all rooms in \"Home\" tab")
|
||||
checked: NeoChatConfig.allRoomsInHome
|
||||
enabled: !NeoChatConfig.isAllRoomsInHomeImmutable
|
||||
onToggled: {
|
||||
NeoChatConfig.allRoomsInHome = checked;
|
||||
NeoChatConfig.save();
|
||||
}
|
||||
}
|
||||
]
|
||||
Component.onCompleted: currentIndex = NeoChatConfig.markReadCondition
|
||||
onCurrentValueChanged: NeoChatConfig.markReadCondition = currentValue
|
||||
}
|
||||
|
||||
FormCard.FormDelegateSeparator {
|
||||
above: markAsReadCombo
|
||||
below: showDeletedMessages
|
||||
}
|
||||
|
||||
FormCard.FormCheckDelegate {
|
||||
id: showDeletedMessages
|
||||
text: i18n("Show deleted messages")
|
||||
checked: NeoChatConfig.showDeletedMessages
|
||||
enabled: !NeoChatConfig.isShowDeletedMessagesImmutable
|
||||
onToggled: {
|
||||
NeoChatConfig.showDeletedMessages = checked;
|
||||
NeoChatConfig.save();
|
||||
}
|
||||
}
|
||||
Kirigami.FormGroup {
|
||||
title: i18nc("@title:group", "Room List Sort Order")
|
||||
Kirigami.FormEntry {
|
||||
title: i18nc("@info:label", "Hidden events are not considered as recent activity when sorting rooms.")
|
||||
}
|
||||
Kirigami.FormSeparator {}
|
||||
Kirigami.FormEntry {
|
||||
subtitle: i18nc("@info", "Rooms with unread notifications will be shown first.")
|
||||
contentItem: QQC2.RadioButton {
|
||||
text: i18nc("As in 'sort something based on last activity'", "Importance")
|
||||
checked: NeoChatConfig.sortOrder === 1
|
||||
enabled: !NeoChatConfig.isSortOrderImmutable
|
||||
onToggled: {
|
||||
NeoChatConfig.sortOrder = 1
|
||||
NeoChatConfig.customSortOrder = []
|
||||
NeoChatConfig.save()
|
||||
}
|
||||
}
|
||||
}
|
||||
Kirigami.FormEntry {
|
||||
contentItem: QQC2.RadioButton {
|
||||
text: i18nc("As in 'sort something alphabetically'", "Alphabetical")
|
||||
checked: NeoChatConfig.sortOrder === 0
|
||||
enabled: !NeoChatConfig.isSortOrderImmutable
|
||||
onToggled: {
|
||||
NeoChatConfig.sortOrder = 0
|
||||
NeoChatConfig.customSortOrder = []
|
||||
NeoChatConfig.save()
|
||||
}
|
||||
}
|
||||
}
|
||||
Kirigami.FormEntry {
|
||||
subtitle: i18nc("@info", "Rooms with the newest events will be shown first.")
|
||||
contentItem: QQC2.RadioButton {
|
||||
text: i18nc("As in 'sort something based on the last event'", "Newest Events")
|
||||
checked: NeoChatConfig.sortOrder === 2
|
||||
enabled: !NeoChatConfig.isSortOrderImmutable
|
||||
onToggled: {
|
||||
NeoChatConfig.sortOrder = 2
|
||||
NeoChatConfig.customSortOrder = []
|
||||
NeoChatConfig.save()
|
||||
}
|
||||
}
|
||||
}
|
||||
Kirigami.FormEntry {
|
||||
id: openCustomRoomSortButton
|
||||
contentItem: QQC2.RadioButton {
|
||||
text: i18nc("@option:radio", "Custom")
|
||||
checked: NeoChatConfig.sortOrder === 3
|
||||
enabled: !NeoChatConfig.isSortOrderImmutable
|
||||
onClicked: {
|
||||
Qt.createComponent('org.kde.neochat.settings', 'RoomSortParameterDialog').createObject(root).open();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Kirigami.FormGroup {
|
||||
title: i18nc("@title", "Timeline")
|
||||
|
||||
FormCard.FormDelegateSeparator {
|
||||
above: showDeletedMessages
|
||||
below: showStateEvents
|
||||
Kirigami.FormEntry {
|
||||
id: markAsReadCombo
|
||||
title: i18n("Mark messages as read when:")
|
||||
contentItem: QQC2.ComboBox {
|
||||
textRole: "name"
|
||||
valueRole: "value"
|
||||
model: [
|
||||
{
|
||||
name: i18n("Never"),
|
||||
value: 0
|
||||
},
|
||||
{
|
||||
name: i18nc("@item:inlistbox As in mark messages in the room as read when entering the room", "Entering the room"),
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
name: i18nc("@item:inlistbox As in mark messages in the room as read when entering the room and all messages are visible on screen", "Entering the room and all unread messages are visible"),
|
||||
value: 2
|
||||
},
|
||||
{
|
||||
name: i18nc("@item:inlistbox As in mark messages in the room as read when exiting the room", "Exiting the room"),
|
||||
value: 3
|
||||
},
|
||||
{
|
||||
name: i18nc("@item:inlistbox As in mark messages in the room as read when exiting the room and all messages are visible on screen", "Exiting the room and all unread messages are visible"),
|
||||
value: 4
|
||||
}
|
||||
]
|
||||
Component.onCompleted: currentIndex = NeoChatConfig.markReadCondition
|
||||
onCurrentValueChanged: NeoChatConfig.markReadCondition = currentValue
|
||||
}
|
||||
}
|
||||
Kirigami.FormSeparator {}
|
||||
Kirigami.FormEntry {
|
||||
id: showDeletedMessages
|
||||
contentItem: QQC2.CheckBox {
|
||||
text: i18n("Show deleted messages")
|
||||
checked: NeoChatConfig.showDeletedMessages
|
||||
enabled: !NeoChatConfig.isShowDeletedMessagesImmutable
|
||||
onToggled: {
|
||||
NeoChatConfig.showDeletedMessages = checked;
|
||||
NeoChatConfig.save();
|
||||
}
|
||||
}
|
||||
}
|
||||
Kirigami.FormSeparator {}
|
||||
Kirigami.FormEntry {
|
||||
id: showStateEvents
|
||||
contentItem: QQC2.CheckBox {
|
||||
text: i18n("Show state events")
|
||||
checked: NeoChatConfig.showStateEvent
|
||||
enabled: !NeoChatConfig.isShowStateEventImmutable
|
||||
onToggled: {
|
||||
NeoChatConfig.showStateEvent = checked;
|
||||
NeoChatConfig.save();
|
||||
}
|
||||
}
|
||||
}
|
||||
Kirigami.FormSeparator {
|
||||
visible: NeoChatConfig.showStateEvent
|
||||
}
|
||||
Kirigami.FormEntry {
|
||||
id: showLeaveJoinEventDelegate
|
||||
visible: NeoChatConfig.showStateEvent
|
||||
contentItem: QQC2.CheckBox {
|
||||
text: i18n("Show leave and join events")
|
||||
checked: NeoChatConfig.showLeaveJoinEvent
|
||||
enabled: !NeoChatConfig.isShowLeaveJoinEventImmutable
|
||||
onToggled: {
|
||||
NeoChatConfig.showLeaveJoinEvent = checked;
|
||||
NeoChatConfig.save();
|
||||
}
|
||||
}
|
||||
}
|
||||
Kirigami.FormSeparator {
|
||||
visible: NeoChatConfig.showStateEvent
|
||||
}
|
||||
Kirigami.FormEntry {
|
||||
id: showNameDelegate
|
||||
visible: NeoChatConfig.showStateEvent
|
||||
contentItem: QQC2.CheckBox {
|
||||
text: i18n("Show name change events")
|
||||
checked: NeoChatConfig.showRename
|
||||
enabled: !NeoChatConfig.isShowRenameImmutable
|
||||
onToggled: {
|
||||
NeoChatConfig.showRename = checked;
|
||||
NeoChatConfig.save();
|
||||
}
|
||||
}
|
||||
}
|
||||
Kirigami.FormSeparator {
|
||||
visible: NeoChatConfig.showStateEvent
|
||||
}
|
||||
Kirigami.FormEntry {
|
||||
id: showAvatarChangeDelegate
|
||||
visible: NeoChatConfig.showStateEvent
|
||||
contentItem: QQC2.CheckBox {
|
||||
text: i18n("Show name change events")
|
||||
checked: NeoChatConfig.showAvatarUpdate
|
||||
enabled: !NeoChatConfig.isShowAvatarUpdateImmutable
|
||||
onToggled: {
|
||||
NeoChatConfig.showAvatarUpdate = checked;
|
||||
NeoChatConfig.save();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Kirigami.FormGroup {
|
||||
title: i18nc("Chat Editor", "Editor")
|
||||
|
||||
FormCard.FormCheckDelegate {
|
||||
id: showStateEvents
|
||||
text: i18n("Show state events")
|
||||
checked: NeoChatConfig.showStateEvent
|
||||
enabled: !NeoChatConfig.isShowStateEventImmutable
|
||||
onToggled: {
|
||||
NeoChatConfig.showStateEvent = checked;
|
||||
NeoChatConfig.save();
|
||||
Kirigami.FormEntry {
|
||||
visible: !Kirigami.Settings.isMobile
|
||||
contentItem: QQC2.RadioButton {
|
||||
text: i18nc("@option:radio", "Send messages with Enter")
|
||||
checked: NeoChatConfig.sendMessageWith === 0
|
||||
enabled: !NeoChatConfig.isSendMessageWithImmutable
|
||||
onToggled: {
|
||||
NeoChatConfig.sendMessageWith = 0
|
||||
NeoChatConfig.save()
|
||||
}
|
||||
}
|
||||
}
|
||||
Kirigami.FormEntry {
|
||||
visible: !Kirigami.Settings.isMobile
|
||||
contentItem: QQC2.RadioButton {
|
||||
text: i18nc("@option:radio", "Send messages with Ctrl+Enter")
|
||||
checked: NeoChatConfig.sendMessageWith === 1
|
||||
enabled: !NeoChatConfig.isSendMessageWithImmutable
|
||||
onToggled: {
|
||||
NeoChatConfig.sendMessageWith = 1
|
||||
NeoChatConfig.save()
|
||||
}
|
||||
}
|
||||
}
|
||||
Kirigami.FormSeparator {
|
||||
visible: !Kirigami.Settings.isMobile
|
||||
}
|
||||
Kirigami.FormEntry {
|
||||
id: quickEditCheckbox
|
||||
contentItem: QQC2.CheckBox {
|
||||
text: i18n("Use s/text/replacement syntax to edit your last message")
|
||||
checked: NeoChatConfig.allowQuickEdit
|
||||
enabled: !NeoChatConfig.isAllowQuickEditImmutable
|
||||
onToggled: {
|
||||
NeoChatConfig.allowQuickEdit = checked;
|
||||
NeoChatConfig.save();
|
||||
}
|
||||
}
|
||||
}
|
||||
Kirigami.FormSeparator {}
|
||||
Kirigami.FormEntry {
|
||||
id: typingNotificationsDelegate
|
||||
contentItem: QQC2.CheckBox {
|
||||
text: i18n("Send typing notifications")
|
||||
checked: NeoChatConfig.typingNotifications
|
||||
enabled: !NeoChatConfig.isTypingNotificationsImmutable
|
||||
onToggled: {
|
||||
NeoChatConfig.typingNotifications = checked;
|
||||
NeoChatConfig.save();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Kirigami.FormGroup {
|
||||
title: i18n("Developer Settings")
|
||||
|
||||
FormCard.FormDelegateSeparator {
|
||||
visible: NeoChatConfig.showStateEvent
|
||||
above: showStateEvents
|
||||
below: showLeaveJoinEventDelegate
|
||||
Kirigami.FormEntry {
|
||||
id: enableDeveloperToolsDelegate
|
||||
contentItem: QQC2.CheckBox {
|
||||
text: i18n("Enable developer tools")
|
||||
checked: NeoChatConfig.developerTools
|
||||
enabled: !NeoChatConfig.isDeveloperToolsImmutable
|
||||
onToggled: {
|
||||
NeoChatConfig.developerTools = checked;
|
||||
NeoChatConfig.save();
|
||||
}
|
||||
}
|
||||
}
|
||||
Kirigami.FormSeparator {}
|
||||
Kirigami.FormEntry {
|
||||
id: openDeveloperToolsDelegate
|
||||
visible: NeoChatConfig.developerTools
|
||||
leadingItems: Kirigami.Icon {
|
||||
implicitWidth: Kirigami.Units.iconSizes.smallMedium
|
||||
implicitHeight: Kirigami.Units.iconSizes.smallMedium
|
||||
source: "tools"
|
||||
}
|
||||
contentItem: QQC2.Label {
|
||||
text: i18n("Enable developer tools")
|
||||
}
|
||||
onClicked: root.QQC2.ApplicationWindow.window.pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat.devtools', 'DevtoolsPage'), {
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18n("Developer Tools")
|
||||
});
|
||||
}
|
||||
}
|
||||
Kirigami.FormGroup {
|
||||
title: i18nc("@title:group", "Default Settings")
|
||||
|
||||
FormCard.FormCheckDelegate {
|
||||
id: showLeaveJoinEventDelegate
|
||||
visible: NeoChatConfig.showStateEvent
|
||||
text: i18n("Show leave and join events")
|
||||
checked: NeoChatConfig.showLeaveJoinEvent
|
||||
enabled: !NeoChatConfig.isShowLeaveJoinEventImmutable
|
||||
onToggled: {
|
||||
NeoChatConfig.showLeaveJoinEvent = checked;
|
||||
NeoChatConfig.save();
|
||||
Kirigami.FormEntry {
|
||||
leadingItems: Kirigami.Icon {
|
||||
implicitWidth: Kirigami.Units.iconSizes.smallMedium
|
||||
implicitHeight: Kirigami.Units.iconSizes.smallMedium
|
||||
source: "kt-restore-defaults-symbolic"
|
||||
}
|
||||
contentItem: QQC2.Label {
|
||||
text: i18nc("@action:button", "Reset all configuration values to their default…")
|
||||
}
|
||||
onClicked: resetDialog.open()
|
||||
}
|
||||
}
|
||||
|
||||
FormCard.FormDelegateSeparator {
|
||||
visible: NeoChatConfig.showStateEvent
|
||||
above: showLeaveJoinEventDelegate
|
||||
below: showNameDelegate
|
||||
}
|
||||
|
||||
FormCard.FormCheckDelegate {
|
||||
id: showNameDelegate
|
||||
visible: NeoChatConfig.showStateEvent
|
||||
text: i18n("Show name change events")
|
||||
checked: NeoChatConfig.showRename
|
||||
enabled: !NeoChatConfig.isShowRenameImmutable
|
||||
onToggled: {
|
||||
NeoChatConfig.showRename = checked;
|
||||
NeoChatConfig.save();
|
||||
}
|
||||
}
|
||||
|
||||
FormCard.FormDelegateSeparator {
|
||||
visible: NeoChatConfig.showStateEvent
|
||||
above: showNameDelegate
|
||||
below: showAvatarChangeDelegate
|
||||
}
|
||||
|
||||
FormCard.FormCheckDelegate {
|
||||
id: showAvatarChangeDelegate
|
||||
visible: NeoChatConfig.showStateEvent
|
||||
text: i18n("Show avatar update events")
|
||||
checked: NeoChatConfig.showAvatarUpdate
|
||||
enabled: !NeoChatConfig.isShowAvatarUpdateImmutable
|
||||
onToggled: {
|
||||
NeoChatConfig.showAvatarUpdate = checked;
|
||||
NeoChatConfig.save();
|
||||
}
|
||||
}
|
||||
}
|
||||
FormCard.FormHeader {
|
||||
title: i18nc("Chat Editor", "Editor")
|
||||
}
|
||||
FormCard.FormCard {
|
||||
FormCard.FormRadioDelegate {
|
||||
text: i18nc("@option:radio", "Send messages with Enter")
|
||||
checked: NeoChatConfig.sendMessageWith === 0
|
||||
visible: !Kirigami.Settings.isMobile
|
||||
enabled: !NeoChatConfig.isSendMessageWithImmutable
|
||||
onToggled: {
|
||||
NeoChatConfig.sendMessageWith = 0
|
||||
NeoChatConfig.save()
|
||||
}
|
||||
}
|
||||
FormCard.FormRadioDelegate {
|
||||
id: sendWithEnterRadio
|
||||
text: i18nc("@option:radio", "Send messages with Ctrl+Enter")
|
||||
checked: NeoChatConfig.sendMessageWith === 1
|
||||
visible: !Kirigami.Settings.isMobile
|
||||
enabled: !NeoChatConfig.isSendMessageWithImmutable
|
||||
onToggled: {
|
||||
NeoChatConfig.sendMessageWith = 1
|
||||
NeoChatConfig.save()
|
||||
}
|
||||
}
|
||||
FormCard.FormDelegateSeparator {
|
||||
visible: !Kirigami.Settings.isMobile
|
||||
above: sendWithEnterRadio
|
||||
below: quickEditCheckbox
|
||||
}
|
||||
FormCard.FormCheckDelegate {
|
||||
id: quickEditCheckbox
|
||||
text: i18n("Use s/text/replacement syntax to edit your last message")
|
||||
checked: NeoChatConfig.allowQuickEdit
|
||||
enabled: !NeoChatConfig.isAllowQuickEditImmutable
|
||||
onToggled: {
|
||||
NeoChatConfig.allowQuickEdit = checked;
|
||||
NeoChatConfig.save();
|
||||
}
|
||||
}
|
||||
FormCard.FormDelegateSeparator {
|
||||
above: quickEditCheckbox
|
||||
below: typingNotificationsDelegate
|
||||
}
|
||||
FormCard.FormCheckDelegate {
|
||||
id: typingNotificationsDelegate
|
||||
text: i18n("Send typing notifications")
|
||||
checked: NeoChatConfig.typingNotifications
|
||||
enabled: !NeoChatConfig.isTypingNotificationsImmutable
|
||||
onToggled: {
|
||||
NeoChatConfig.typingNotifications = checked;
|
||||
NeoChatConfig.save();
|
||||
}
|
||||
}
|
||||
}
|
||||
FormCard.FormHeader {
|
||||
title: i18n("Developer Settings")
|
||||
}
|
||||
FormCard.FormCard {
|
||||
FormCard.FormCheckDelegate {
|
||||
id: enableDeveloperToolsDelegate
|
||||
text: i18n("Enable developer tools")
|
||||
checked: NeoChatConfig.developerTools
|
||||
enabled: !NeoChatConfig.isDeveloperToolsImmutable
|
||||
onToggled: {
|
||||
NeoChatConfig.developerTools = checked;
|
||||
NeoChatConfig.save();
|
||||
}
|
||||
}
|
||||
FormCard.FormDelegateSeparator {
|
||||
above: enableDeveloperToolsDelegate
|
||||
below: openDeveloperToolsDelegate
|
||||
}
|
||||
FormCard.FormButtonDelegate {
|
||||
id: openDeveloperToolsDelegate
|
||||
visible: NeoChatConfig.developerTools
|
||||
icon.name: "tools"
|
||||
text: i18n("Open Developer Tools")
|
||||
onClicked: root.QQC2.ApplicationWindow.window.pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat.devtools', 'DevtoolsPage'), {
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18n("Developer Tools")
|
||||
});
|
||||
}
|
||||
}
|
||||
FormCard.FormHeader {
|
||||
title: i18nc("@title:group", "Default Settings")
|
||||
}
|
||||
FormCard.FormCard {
|
||||
FormCard.FormButtonDelegate {
|
||||
icon.name: "kt-restore-defaults-symbolic"
|
||||
text: i18nc("@action:button", "Reset all configuration values to their default…")
|
||||
onClicked: resetDialog.open()
|
||||
}
|
||||
}
|
||||
Kirigami.PromptDialog {
|
||||
id: resetDialog
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
// SPDX-FileCopyrightText: 2023 Tobias Fella <tobias.fella@kde.org>
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls as QQC2
|
||||
import QtQuick.Layouts
|
||||
@@ -57,9 +59,9 @@ FormCard.FormCardPage {
|
||||
FormCard.FormCheckDelegate {
|
||||
id: rejectInvitationsDelegate
|
||||
text: i18nc("@option:check", "Reject invitations from unknown users")
|
||||
description: connection.canCheckMutualRooms ? i18nc("@info", "If enabled, NeoChat will reject invitations from users you don't share a room with.") : i18nc("@info", "Your server does not support this setting.")
|
||||
description: root.connection.canCheckMutualRooms ? i18nc("@info", "If enabled, NeoChat will reject invitations from users you don't share a room with.") : i18nc("@info", "Your server does not support this setting.")
|
||||
checked: NeoChatConfig.rejectUnknownInvites
|
||||
enabled: !NeoChatConfig.isRejectUnknownInvitesImmutable && connection.canCheckMutualRooms
|
||||
enabled: !NeoChatConfig.isRejectUnknownInvitesImmutable && root.connection.canCheckMutualRooms
|
||||
onToggled: {
|
||||
NeoChatConfig.rejectUnknownInvites = checked;
|
||||
NeoChatConfig.save();
|
||||
@@ -74,7 +76,7 @@ FormCard.FormCardPage {
|
||||
text: i18nc("@option:check", "Turn on encryption in new chats")
|
||||
description: i18nc("@info", "If enabled, NeoChat will use encryption when starting new direct messages.")
|
||||
checked: NeoChatConfig.preferUsingEncryption
|
||||
enabled: !NeoChatConfig.preferUsingEncryptionImmutable
|
||||
enabled: !NeoChatConfig.isPreferUsingEncryptionImmutable
|
||||
onToggled: {
|
||||
NeoChatConfig.preferUsingEncryption = checked;
|
||||
NeoChatConfig.save();
|
||||
|
||||
@@ -11,6 +11,8 @@ import org.kde.kirigamiaddons.formcard as FormCard
|
||||
import org.kde.neochat
|
||||
|
||||
FormCard.FormCardPage {
|
||||
id: root
|
||||
|
||||
title: i18nc("@title:window", "Proxy")
|
||||
property int currentType
|
||||
property bool proxyConfigChanged: false
|
||||
@@ -21,10 +23,10 @@ FormCard.FormCardPage {
|
||||
FormCard.FormRadioDelegate {
|
||||
id: systemDefault
|
||||
text: i18n("System Default")
|
||||
checked: currentType === 0
|
||||
checked: root.currentType === 0
|
||||
enabled: !NeoChatConfig.isProxyTypeImmutable
|
||||
onToggled: {
|
||||
currentType = 0
|
||||
root.currentType = 0
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,10 +35,10 @@ FormCard.FormCardPage {
|
||||
FormCard.FormRadioDelegate {
|
||||
id:noProxy
|
||||
text: i18n("No Proxy")
|
||||
checked: currentType === 3
|
||||
enabled: !Config.isProxyTypeImmutable
|
||||
checked: root.currentType === 3
|
||||
enabled: !NeoChatConfig.isProxyTypeImmutable
|
||||
onToggled: {
|
||||
currentType = 3;
|
||||
root.currentType = 3;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,10 +47,10 @@ FormCard.FormCardPage {
|
||||
FormCard.FormRadioDelegate {
|
||||
id: http
|
||||
text: i18n("HTTP")
|
||||
checked: currentType === 1
|
||||
checked: root.currentType === 1
|
||||
enabled: !NeoChatConfig.isProxyTypeImmutable
|
||||
onToggled: {
|
||||
currentType = 1
|
||||
root.currentType = 1
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,10 +59,10 @@ FormCard.FormCardPage {
|
||||
FormCard.FormRadioDelegate {
|
||||
id: socks5
|
||||
text: i18n("Socks5")
|
||||
checked: currentType === 2
|
||||
checked: root.currentType === 2
|
||||
enabled: !NeoChatConfig.isProxyTypeImmutable
|
||||
onToggled: {
|
||||
currentType = 2
|
||||
root.currentType = 2
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -71,7 +73,7 @@ FormCard.FormCardPage {
|
||||
|
||||
FormCard.FormCard {
|
||||
// It makes no sense to configure proxy settings for "System Default" and "No Proxy"
|
||||
enabled: currentType !== 0 && currentType !== 3
|
||||
enabled: root.currentType !== 0 && root.currentType !== 3
|
||||
|
||||
FormCard.FormTextFieldDelegate {
|
||||
id: hostField
|
||||
@@ -79,7 +81,7 @@ FormCard.FormCardPage {
|
||||
text: NeoChatConfig.proxyHost
|
||||
inputMethodHints: Qt.ImhUrlCharactersOnly
|
||||
onEditingFinished: {
|
||||
proxyConfigChanged = true
|
||||
root.proxyConfigChanged = true
|
||||
}
|
||||
}
|
||||
FormCard.FormDelegateSeparator { below: hostField; above: portField }
|
||||
@@ -101,7 +103,7 @@ FormCard.FormCardPage {
|
||||
return value // it will add a thousands separator if we don't do this, not sure why
|
||||
}
|
||||
onValueChanged: {
|
||||
proxyConfigChanged = true
|
||||
root.proxyConfigChanged = true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -113,7 +115,7 @@ FormCard.FormCardPage {
|
||||
text: NeoChatConfig.proxyUser
|
||||
inputMethodHints: Qt.ImhUrlCharactersOnly
|
||||
onEditingFinished: {
|
||||
proxyConfigChanged = true
|
||||
root.proxyConfigChanged = true
|
||||
}
|
||||
}
|
||||
FormCard.FormDelegateSeparator { below: userField; above: passwordField }
|
||||
@@ -124,7 +126,7 @@ FormCard.FormCardPage {
|
||||
echoMode: TextInput.Password
|
||||
inputMethodHints: Qt.ImhUrlCharactersOnly
|
||||
onEditingFinished: {
|
||||
proxyConfigChanged = true
|
||||
root.proxyConfigChanged = true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -139,15 +141,15 @@ FormCard.FormCardPage {
|
||||
QQC2.Button {
|
||||
text: i18n("Apply")
|
||||
icon.name: "dialog-ok-apply-symbolic"
|
||||
enabled: currentType !== NeoChatConfig.proxyType || proxyConfigChanged
|
||||
enabled: root.currentType !== NeoChatConfig.proxyType || root.proxyConfigChanged
|
||||
onClicked: {
|
||||
NeoChatConfig.proxyType = currentType;
|
||||
NeoChatConfig.proxyType = root.currentType;
|
||||
NeoChatConfig.proxyHost = hostField.text;
|
||||
NeoChatConfig.proxyPort = portField.value;
|
||||
NeoChatConfig.proxyUser = userField.text;
|
||||
NeoChatConfig.proxyPassword = passwordField.text;
|
||||
NeoChatConfig.save();
|
||||
proxyConfigChanged = false;
|
||||
root.proxyConfigChanged = false;
|
||||
ProxyController.setApplicationProxy();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ FormCard.FormCardPage {
|
||||
property NeoChatRoom room
|
||||
|
||||
property PushRuleModel pushRuleModel: PushRuleModel {
|
||||
connection: root.room.connection
|
||||
connection: root.room.connection as NeoChatConnection
|
||||
}
|
||||
|
||||
title: i18nc('@title:window', 'Notifications')
|
||||
@@ -30,37 +30,37 @@ FormCard.FormCardPage {
|
||||
FormCard.FormRadioDelegate {
|
||||
icon.name: "globe"
|
||||
text: i18nc("As in the default notification setting", "Default Settings")
|
||||
checked: room.pushNotificationState === PushNotificationState.Default
|
||||
enabled: room.pushNotificationState !== PushNotificationState.Unknown
|
||||
checked: root.room.pushNotificationState === PushNotificationState.Default
|
||||
enabled: root.room.pushNotificationState !== PushNotificationState.Unknown
|
||||
onToggled: {
|
||||
room.pushNotificationState = PushNotificationState.Default;
|
||||
root.room.pushNotificationState = PushNotificationState.Default;
|
||||
}
|
||||
}
|
||||
FormCard.FormRadioDelegate {
|
||||
icon.name: "notifications"
|
||||
text: i18nc("As in 'notify for all messages'", "All Messages")
|
||||
checked: room.pushNotificationState === PushNotificationState.All
|
||||
enabled: room.pushNotificationState !== PushNotificationState.Unknown
|
||||
checked: root.room.pushNotificationState === PushNotificationState.All
|
||||
enabled: root.room.pushNotificationState !== PushNotificationState.Unknown
|
||||
onToggled: {
|
||||
room.pushNotificationState = PushNotificationState.All;
|
||||
root.room.pushNotificationState = PushNotificationState.All;
|
||||
}
|
||||
}
|
||||
FormCard.FormRadioDelegate {
|
||||
icon.name: "im-user"
|
||||
text: i18nc("As in 'notify when the user is mentioned or the message contains a set keyword'", "@Mentions and Keywords")
|
||||
checked: room.pushNotificationState === PushNotificationState.MentionKeyword
|
||||
enabled: room.pushNotificationState !== PushNotificationState.Unknown
|
||||
checked: root.room.pushNotificationState === PushNotificationState.MentionKeyword
|
||||
enabled: root.room.pushNotificationState !== PushNotificationState.Unknown
|
||||
onToggled: {
|
||||
room.pushNotificationState = PushNotificationState.MentionKeyword;
|
||||
root.room.pushNotificationState = PushNotificationState.MentionKeyword;
|
||||
}
|
||||
}
|
||||
FormCard.FormRadioDelegate {
|
||||
icon.name: "notifications-disabled"
|
||||
text: i18nc("As in 'do not notify for any messages'", "None")
|
||||
checked: room.pushNotificationState === PushNotificationState.Mute
|
||||
enabled: room.pushNotificationState !== PushNotificationState.Unknown
|
||||
checked: root.room.pushNotificationState === PushNotificationState.Mute
|
||||
enabled: root.room.pushNotificationState !== PushNotificationState.Unknown
|
||||
onToggled: {
|
||||
room.pushNotificationState = PushNotificationState.Mute;
|
||||
root.room.pushNotificationState = PushNotificationState.Mute;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -80,16 +80,11 @@ FormCard.FormCardPage {
|
||||
}
|
||||
}
|
||||
|
||||
delegate: ruleDelegate
|
||||
|
||||
Component {
|
||||
id: ruleDelegate
|
||||
NotificationRuleItem {
|
||||
onDeleteRule: {
|
||||
root.pushRuleModel.removeKeyword(id);
|
||||
}
|
||||
onNotificatonActionChanged: action => root.pushRuleModel.setPushRuleAction(id, action)
|
||||
delegate: NotificationRuleItem {
|
||||
onDeleteRule: {
|
||||
root.pushRuleModel.removeKeyword(id);
|
||||
}
|
||||
onNotificatonActionChanged: action => root.pushRuleModel.setPushRuleAction(id, action)
|
||||
}
|
||||
}
|
||||
FormCard.AbstractFormDelegate {
|
||||
|
||||
@@ -36,7 +36,6 @@ Kirigami.Dialog {
|
||||
clip: true
|
||||
|
||||
ListView {
|
||||
id: listView
|
||||
implicitHeight: contentHeight
|
||||
currentIndex: -1
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
// SPDX-FileCopyrightText: 2023 James Graham <james.h.graham@protonmail.com>
|
||||
// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
||||
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls as QQC2
|
||||
import QtQuick.Layouts
|
||||
@@ -37,7 +39,7 @@ Kirigami.Dialog {
|
||||
standardButtons: Kirigami.Dialog.Ok | Kirigami.Dialog.Cancel
|
||||
onAccepted: {
|
||||
let ids = [];
|
||||
for (var i in spaceGroup.buttons) {
|
||||
for (let i in spaceGroup.buttons) {
|
||||
if (spaceGroup.buttons[i].checked) {
|
||||
ids.push(spaceGroup.buttons[i].modelData.id);
|
||||
}
|
||||
@@ -56,6 +58,7 @@ Kirigami.Dialog {
|
||||
model: root.room.parentObjects(true)
|
||||
|
||||
delegate: FormCard.FormCheckDelegate {
|
||||
id: parentDelegate
|
||||
required property var modelData
|
||||
|
||||
text: modelData.displayName
|
||||
@@ -67,8 +70,8 @@ Kirigami.Dialog {
|
||||
Layout.preferredWidth: Kirigami.Units.gridUnit * 2
|
||||
Layout.preferredHeight: Kirigami.Units.gridUnit * 2
|
||||
|
||||
source: modelData.avatarUrl.toString().length > 0 ? connection.makeMediaUrl(modelData.avatarUrl) : ""
|
||||
name: modelData.displayName
|
||||
source: parentDelegate.modelData.avatarUrl.toString().length > 0 ? root.room.connection.makeMediaUrl(parentDelegate.modelData.avatarUrl) : ""
|
||||
name: parentDelegate.modelData.displayName
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
// SPDX-FileCopyrightText: 2022 James Graham <james.h.graham@protonmail.com>
|
||||
// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
||||
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls as QQC2
|
||||
import QtQuick.Layouts
|
||||
@@ -72,7 +74,7 @@ RowLayout {
|
||||
}
|
||||
}
|
||||
|
||||
QQC2.ToolTip.text: root.model?.readMarkersString ?? ""
|
||||
QQC2.ToolTip.text: (root.model as ReadMarkerModel)?.readMarkersString ?? ""
|
||||
QQC2.ToolTip.visible: hoverHandler.hovered
|
||||
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ KirigamiComponents.ConvergentContextMenu {
|
||||
|
||||
onClicked: {
|
||||
if (emojiText.text === "⋮") {
|
||||
var dialog = emojiDialog.createObject(emojiDelegate) as EmojiDialog;
|
||||
let dialog = emojiDialog.createObject(emojiDelegate) as EmojiDialog;
|
||||
dialog.showStickers = false;
|
||||
dialog.chosen.connect(emoji => {
|
||||
root.room.toggleReaction(root.eventId, emoji);
|
||||
@@ -214,7 +214,7 @@ KirigamiComponents.ConvergentContextMenu {
|
||||
width: Kirigami.Units.gridUnit * 25
|
||||
});
|
||||
dialog.accepted.connect(reason => {
|
||||
currentRoom.redactEvent(root.eventId, reason);
|
||||
root.room.redactEvent(root.eventId, reason);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -340,7 +340,7 @@ KirigamiComponents.ConvergentContextMenu {
|
||||
width: Kirigami.Units.gridUnit * 25
|
||||
});
|
||||
dialog.accepted.connect(reason => {
|
||||
currentRoom.reportEvent(root.eventId, reason);
|
||||
root.room.reportEvent(root.eventId, reason);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
|
||||
import Qt.labs.qmlmodels
|
||||
|
||||
@@ -63,12 +62,10 @@ DelegateChooser {
|
||||
roleValue: DelegateType.Other
|
||||
delegate: NeoChatConfig.showAllEvents ? hiddenDelegate : emptyDelegate
|
||||
|
||||
Component {
|
||||
id: hiddenDelegate
|
||||
property Component hiddenDelegate : Component {
|
||||
HiddenDelegate {}
|
||||
}
|
||||
Component {
|
||||
id: emptyDelegate
|
||||
property Component emptyDelegate : Component {
|
||||
Item {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// SPDX-FileCopyrightText: 2020 Black Hat <bhat@encom.eu.org>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls as QQC2
|
||||
import QtQuick.Layouts
|
||||
import Qt.labs.qmlmodels
|
||||
|
||||
import org.kde.kirigami as Kirigami
|
||||
import org.kde.kirigamiaddons.components as KirigamiComponents
|
||||
@@ -175,7 +175,7 @@ MessageDelegateBase {
|
||||
const menu = Qt.createComponent("org.kde.neochat", "UserMenu").createObject(root, {
|
||||
window: QQC2.ApplicationWindow.window as Kirigami.ApplicationWindow,
|
||||
author: root.author,
|
||||
});
|
||||
}) as UserMenu;
|
||||
console.info(Qt.createComponent("org.kde.neochat", "UserMenu").errorString());
|
||||
menu.popup(root.QQC2.Overlay.overlay);
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ RowLayout {
|
||||
display: QQC2.ToolButton.IconOnly
|
||||
onClicked: {
|
||||
root.reacting = true;
|
||||
var dialog = emojiDialog.createObject(reactButton);
|
||||
var dialog = emojiDialog.createObject(reactButton) as EmojiDialog;
|
||||
dialog.chosen.connect(emoji => {
|
||||
root.reacting = false;
|
||||
root.room.toggleReaction(root.eventId, emoji);
|
||||
|
||||
@@ -155,10 +155,10 @@ void MessageDelegateBase::cleanupIncubator(MessageObjectIncubator *incubator)
|
||||
|
||||
incubator->clear();
|
||||
const auto it = std::find(m_activeIncubators.begin(), m_activeIncubators.end(), incubator);
|
||||
delete incubator;
|
||||
if (it != m_activeIncubators.end()) {
|
||||
m_activeIncubators.erase(it);
|
||||
}
|
||||
delete incubator;
|
||||
}
|
||||
|
||||
void MessageDelegateBase::cleanupItem(QQuickItem *item)
|
||||
@@ -249,7 +249,12 @@ void MessageDelegateBase::updateAvatar()
|
||||
markAsDirty();
|
||||
}
|
||||
m_avatarIncubating = false;
|
||||
cleanupIncubator(incubator);
|
||||
// We can't cleanup the incubator in the completedCallback otherwise
|
||||
// we use after free when we return to the status changed function
|
||||
// of that incubator
|
||||
QTimer::singleShot(0, this, [this, incubator]() {
|
||||
cleanupIncubator(incubator);
|
||||
});
|
||||
},
|
||||
m_errorCallback);
|
||||
m_activeIncubators.push_back(avatarIncubator);
|
||||
@@ -313,7 +318,12 @@ void MessageDelegateBase::updateSection()
|
||||
markAsDirty();
|
||||
}
|
||||
m_sectionIncubating = false;
|
||||
cleanupIncubator(incubator);
|
||||
// We can't cleanup the incubator in the completedCallback otherwise
|
||||
// we use after free when we return to the status changed function
|
||||
// of that incubator
|
||||
QTimer::singleShot(0, this, [this, incubator]() {
|
||||
cleanupIncubator(incubator);
|
||||
});
|
||||
},
|
||||
m_errorCallback);
|
||||
m_activeIncubators.push_back(sectionIncubator);
|
||||
@@ -377,7 +387,12 @@ void MessageDelegateBase::updateReadMarker()
|
||||
markAsDirty();
|
||||
}
|
||||
m_readMarkerIncubating = false;
|
||||
cleanupIncubator(incubator);
|
||||
// We can't cleanup the incubator in the completedCallback otherwise
|
||||
// we use after free when we return to the status changed function
|
||||
// of that incubator
|
||||
QTimer::singleShot(0, this, [this, incubator]() {
|
||||
cleanupIncubator(incubator);
|
||||
});
|
||||
},
|
||||
m_errorCallback);
|
||||
m_activeIncubators.push_back(readMarkerIncubator);
|
||||
@@ -448,7 +463,12 @@ void MessageDelegateBase::updateBackground()
|
||||
markAsDirty();
|
||||
}
|
||||
m_compactBackgroundIncubating = false;
|
||||
cleanupIncubator(incubator);
|
||||
// We can't cleanup the incubator in the completedCallback otherwise
|
||||
// we use after free when we return to the status changed function
|
||||
// of that incubator
|
||||
QTimer::singleShot(0, this, [this, incubator]() {
|
||||
cleanupIncubator(incubator);
|
||||
});
|
||||
},
|
||||
m_errorCallback);
|
||||
m_activeIncubators.push_back(compactBackgroundIncubator);
|
||||
@@ -506,8 +526,13 @@ void MessageDelegateBase::updateQuickAction()
|
||||
}
|
||||
markAsDirty();
|
||||
}
|
||||
cleanupIncubator(incubator);
|
||||
m_quickActionIncubating = false;
|
||||
// We can't cleanup the incubator in the completedCallback otherwise
|
||||
// we use after free when we return to the status changed function
|
||||
// of that incubator
|
||||
QTimer::singleShot(0, this, [this, incubator]() {
|
||||
cleanupIncubator(incubator);
|
||||
});
|
||||
},
|
||||
m_errorCallback);
|
||||
m_activeIncubators.push_back(quickActionIncubator);
|
||||
|
||||
Reference in New Issue
Block a user