Compare commits
4 Commits
v25.04.2
...
work/nvrwh
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
45c46ddcbb | ||
|
|
31d83ac0e3 | ||
|
|
909eec30d2 | ||
|
|
dbed3e99c2 |
@@ -14,7 +14,7 @@ set(RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_
|
|||||||
|
|
||||||
project(NeoChat VERSION ${RELEASE_SERVICE_VERSION})
|
project(NeoChat VERSION ${RELEASE_SERVICE_VERSION})
|
||||||
|
|
||||||
set(KF_MIN_VERSION "6.6")
|
set(KF_MIN_VERSION "6.5")
|
||||||
set(QT_MIN_VERSION "6.5")
|
set(QT_MIN_VERSION "6.5")
|
||||||
|
|
||||||
find_package(ECM ${KF_MIN_VERSION} REQUIRED NO_MODULE)
|
find_package(ECM ${KF_MIN_VERSION} REQUIRED NO_MODULE)
|
||||||
|
|||||||
@@ -242,6 +242,7 @@ ecm_add_qml_module(neochat URI org.kde.neochat GENERATE_PLUGIN_SOURCE
|
|||||||
qml/EditMenu.qml
|
qml/EditMenu.qml
|
||||||
qml/MessageDelegateContextMenu.qml
|
qml/MessageDelegateContextMenu.qml
|
||||||
qml/FileDelegateContextMenu.qml
|
qml/FileDelegateContextMenu.qml
|
||||||
|
qml/FileDelegateContextMenuMobile.qml
|
||||||
qml/MessageSourceSheet.qml
|
qml/MessageSourceSheet.qml
|
||||||
qml/ConfirmEncryptionDialog.qml
|
qml/ConfirmEncryptionDialog.qml
|
||||||
qml/RoomSearchPage.qml
|
qml/RoomSearchPage.qml
|
||||||
@@ -306,7 +307,7 @@ add_subdirectory(devtools)
|
|||||||
add_subdirectory(login)
|
add_subdirectory(login)
|
||||||
add_subdirectory(chatbar)
|
add_subdirectory(chatbar)
|
||||||
|
|
||||||
if(UNIX)
|
if(NOT ANDROID AND NOT WIN32)
|
||||||
qt_target_qml_sources(neochat QML_FILES qml/ShareAction.qml)
|
qt_target_qml_sources(neochat QML_FILES qml/ShareAction.qml)
|
||||||
else()
|
else()
|
||||||
set_source_files_properties(qml/ShareActionStub.qml PROPERTIES
|
set_source_files_properties(qml/ShareActionStub.qml PROPERTIES
|
||||||
|
|||||||
@@ -28,7 +28,8 @@ void ColorSchemer::apply(int idx)
|
|||||||
|
|
||||||
int ColorSchemer::indexForCurrentScheme()
|
int ColorSchemer::indexForCurrentScheme()
|
||||||
{
|
{
|
||||||
return c->indexForSchemeId(c->activeSchemeId()).row();
|
return -1;
|
||||||
|
// return c->indexForSchemeId(c->activeSchemeId()).row();
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "moc_colorschemer.cpp"
|
#include "moc_colorschemer.cpp"
|
||||||
|
|||||||
@@ -38,20 +38,20 @@ ColumnLayout {
|
|||||||
text: i18n("Edit")
|
text: i18n("Edit")
|
||||||
display: QQC2.AbstractButton.IconOnly
|
display: QQC2.AbstractButton.IconOnly
|
||||||
|
|
||||||
Component {
|
// Component {
|
||||||
id: imageEditorPage
|
// id: imageEditorPage
|
||||||
ImageEditorPage {
|
// ImageEditorPage {
|
||||||
imagePath: root.attachmentPath
|
// imagePath: root.attachmentPath
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
onClicked: {
|
// onClicked: {
|
||||||
let imageEditor = applicationWindow().pageStack.pushDialogLayer(imageEditorPage);
|
// let imageEditor = applicationWindow().pageStack.pushDialogLayer(imageEditorPage);
|
||||||
imageEditor.newPathChanged.connect(function (newPath) {
|
// imageEditor.newPathChanged.connect(function (newPath) {
|
||||||
applicationWindow().pageStack.layers.pop();
|
// applicationWindow().pageStack.layers.pop();
|
||||||
root.attachmentPath = newPath;
|
// root.attachmentPath = newPath;
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
QQC2.ToolTip.text: text
|
QQC2.ToolTip.text: text
|
||||||
QQC2.ToolTip.visible: hovered
|
QQC2.ToolTip.visible: hovered
|
||||||
}
|
}
|
||||||
|
|||||||
116
src/qml/FileDelegateContextMenuMobile.qml
Normal file
116
src/qml/FileDelegateContextMenuMobile.qml
Normal file
@@ -0,0 +1,116 @@
|
|||||||
|
// SPDX-FileCopyrightText: 2019 Black Hat <bhat@encom.eu.org>
|
||||||
|
// SPDX-License-Identifier: GPL-3.0-only
|
||||||
|
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls as QQC2
|
||||||
|
import Qt.labs.platform
|
||||||
|
|
||||||
|
import org.kde.kirigami as Kirigami
|
||||||
|
|
||||||
|
import org.kde.neochat
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief The menu for media messages.
|
||||||
|
*
|
||||||
|
* This component just overloads the actions and nested actions of the base menu
|
||||||
|
* to what is required for a media item.
|
||||||
|
*
|
||||||
|
* @sa DelegateContextMenu
|
||||||
|
*/
|
||||||
|
DelegateContextMenu {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief The MIME type of the media.
|
||||||
|
*/
|
||||||
|
property string mimeType
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Progress info when downloading files.
|
||||||
|
*
|
||||||
|
* @sa Quotient::FileTransferInfo
|
||||||
|
*/
|
||||||
|
required property var progressInfo
|
||||||
|
|
||||||
|
// Web search isn't useful for images
|
||||||
|
enableWebSearch: false
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief The main list of menu item actions.
|
||||||
|
*
|
||||||
|
* Each action will be instantiated as a single line in the menu.
|
||||||
|
*/
|
||||||
|
property list<Kirigami.Action> actions: [
|
||||||
|
Kirigami.Action {
|
||||||
|
text: i18n("Open Externally")
|
||||||
|
icon.name: "document-open"
|
||||||
|
onTriggered: {
|
||||||
|
currentRoom.openEventMediaExternally(root.eventId);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
Kirigami.Action {
|
||||||
|
text: i18n("Save As")
|
||||||
|
icon.name: "document-save"
|
||||||
|
onTriggered: {
|
||||||
|
var dialog = saveAsDialog.createObject(QQC2.Overlay.overlay);
|
||||||
|
dialog.open();
|
||||||
|
dialog.currentFile = dialog.folder + "/" + currentRoom.fileNameToDownload(eventId);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
DelegateContextMenu.ReplyMessageAction {},
|
||||||
|
Kirigami.Action {
|
||||||
|
text: i18n("Copy")
|
||||||
|
icon.name: "edit-copy"
|
||||||
|
onTriggered: {
|
||||||
|
currentRoom.copyEventMedia(root.eventId);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
Kirigami.Action {
|
||||||
|
visible: author.id === currentRoom.localMember.id || currentRoom.canSendState("redact")
|
||||||
|
text: i18n("Remove")
|
||||||
|
icon.name: "edit-delete-remove"
|
||||||
|
icon.color: "red"
|
||||||
|
onTriggered: {
|
||||||
|
let dialog = applicationWindow().pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'ReasonDialog'), {
|
||||||
|
title: i18nc("@title:dialog", "Remove Message"),
|
||||||
|
placeholder: i18nc("@info:placeholder", "Reason for removing this message"),
|
||||||
|
actionText: i18nc("@action:button 'Remove' as in 'Remove this message'", "Remove"),
|
||||||
|
icon: "delete"
|
||||||
|
}, {
|
||||||
|
title: i18nc("@title:dialog", "Remove Message"),
|
||||||
|
width: Kirigami.Units.gridUnit * 25
|
||||||
|
});
|
||||||
|
dialog.accepted.connect(reason => {
|
||||||
|
currentRoom.redactEvent(root.eventId, reason);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
DelegateContextMenu.ReportMessageAction {},
|
||||||
|
DelegateContextMenu.ShowUserAction {},
|
||||||
|
DelegateContextMenu.ViewSourceAction {}
|
||||||
|
]
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief The list of menu item actions that have sub-actions.
|
||||||
|
*
|
||||||
|
* Each action will be instantiated as a single line that opens a sub menu.
|
||||||
|
*/
|
||||||
|
property list<Kirigami.Action> nestedActions: [
|
||||||
|
]
|
||||||
|
|
||||||
|
Component {
|
||||||
|
id: saveAsDialog
|
||||||
|
FileDialog {
|
||||||
|
fileMode: FileDialog.SaveFile
|
||||||
|
folder: NeoChatConfig.lastSaveDirectory.length > 0 ? NeoChatConfig.lastSaveDirectory : StandardPaths.writableLocation(StandardPaths.DownloadLocation)
|
||||||
|
onAccepted: {
|
||||||
|
if (!currentFile) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
NeoChatConfig.lastSaveDirectory = folder;
|
||||||
|
NeoChatConfig.save();
|
||||||
|
currentRoom.downloadFile(eventId, currentFile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -281,15 +281,27 @@ Kirigami.Page {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function onShowFileMenu(eventId, author, messageComponentType, plainText, mimeType, progressInfo, isThread) {
|
function onShowFileMenu(eventId, author, messageComponentType, plainText, mimeType, progressInfo, isThread) {
|
||||||
const contextMenu = fileDelegateContextMenu.createObject(root, {
|
if (Kirigami.Settings.isMobile) {
|
||||||
author: author,
|
const contextMenu = fileDelegateContextMenuMobile.createObject(root, {
|
||||||
eventId: eventId,
|
author: author,
|
||||||
plainText: plainText,
|
eventId: eventId,
|
||||||
mimeType: mimeType,
|
plainText: plainText,
|
||||||
progressInfo: progressInfo,
|
mimeType: mimeType,
|
||||||
isThread: isThread
|
progressInfo: progressInfo,
|
||||||
});
|
isThread: isThread
|
||||||
contextMenu.open();
|
});
|
||||||
|
contextMenu.open();
|
||||||
|
} else {
|
||||||
|
const contextMenu = fileDelegateContextMenu.createObject(root, {
|
||||||
|
author: author,
|
||||||
|
eventId: eventId,
|
||||||
|
plainText: plainText,
|
||||||
|
mimeType: mimeType,
|
||||||
|
progressInfo: progressInfo,
|
||||||
|
isThread: isThread
|
||||||
|
});
|
||||||
|
contextMenu.open();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function onShowMaximizedMedia(index) {
|
function onShowMaximizedMedia(index) {
|
||||||
@@ -327,6 +339,13 @@ Kirigami.Page {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Component {
|
||||||
|
id: fileDelegateContextMenuMobile
|
||||||
|
FileDelegateContextMenuMobile {
|
||||||
|
connection: root.connection
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
id: maximizeComponent
|
id: maximizeComponent
|
||||||
NeochatMaximizeComponent {
|
NeochatMaximizeComponent {
|
||||||
|
|||||||
@@ -217,12 +217,12 @@ FormCard.FormCardPage {
|
|||||||
visible: colorSchemeDelegate.visible
|
visible: colorSchemeDelegate.visible
|
||||||
}
|
}
|
||||||
|
|
||||||
Loader {
|
// Loader {
|
||||||
id: colorSchemeDelegate
|
// id: colorSchemeDelegate
|
||||||
visible: item !== null
|
// visible: item !== null
|
||||||
sourceComponent: Qt.createComponent('org.kde.neochat.settings', 'ColorScheme')
|
// sourceComponent: Qt.createComponent('org.kde.neochat.settings', 'ColorScheme')
|
||||||
Layout.fillWidth: true
|
// Layout.fillWidth: true
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
FormCard.FormCard {
|
FormCard.FormCard {
|
||||||
|
|||||||
Reference in New Issue
Block a user