This is the start of a significant refactoring of everything related to sending messages, which is roughly:
- the chatbox
- action handling
- message sending on the c++ side
- autocompletion of users/rooms/emojis/commands/things i forgot
Notable changes so far include:
- ChatBox is now a ColumnLayout. As part of this, i removed the height animations for now. <del>as far as i can tell, they were broken anyway.</del> I'll readd them later
- Actions were refactored to live outside of the message sending function and are now each an object; it's mostly a wrapper around a function that is executed when the action is invoked
- Everything that used to live in ChatBoxHelper is now in NeoChatRoom; that means that the exact input status (text, message being replied to, message being edited, attachment) is now saved between room switching).
- To edit/reply an event, set `NeoChatRoom::chatBox{edit,reply}Id` to the desired event id, `NeoChatRoom::chatBox{reply,edit}{User,Message}` will then be updated automatically
- Attachments behave equivalently with `NeoChatRoom::chatBoxAttachmentPath`
- Error message reporting from ActionsHandler has been fixed (same fix as in !517) and moved to NeoChatRoom
Broken at the moment:
- [x] Any kind of autocompletion
- [x] Mentions
- [x] Fancy effects
- [x] sed-style edits
- [x] last-user-message edits and replies
- [x] Some of the actions, probably
- [x] Replies from notifications
- [x] Lots of keyboard shortcuts
- [x] Custom emojis
- [x] ChatBox height animations
TODO:
- [x] User / room mentions based on QTextCursors instead of the hack we currently use
- [x] Refactor autocompletion stuff
- [x] ???
- [x] Profit
152 lines
4.7 KiB
CMake
152 lines
4.7 KiB
CMake
# SPDX-FileCopyrightText: 2020-2021 Carl Schwan <carl@carlschwan.eu>
|
|
# SPDX-FileCopyrightText: 2020-2021 Nicolas Fella <nicolas.fella@gmx.de>
|
|
# SPDX-FileCopyrightText: 2020-2021 Tobias Fella <fella@posteo.de>
|
|
# SPDX-FileCopyrightText: 2021 Adriaan de Groot <groot@kde.org>
|
|
# SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
cmake_minimum_required(VERSION 3.16)
|
|
|
|
project(NeoChat)
|
|
set(PROJECT_VERSION "22.09")
|
|
|
|
set(KF5_MIN_VERSION "5.91.0")
|
|
set(QT_MIN_VERSION "5.15.2")
|
|
|
|
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
|
|
|
|
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
|
|
|
|
set(CMAKE_CXX_STANDARD 20)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
set(KDE_COMPILERSETTINGS_LEVEL 5.84)
|
|
|
|
include(FeatureSummary)
|
|
include(ECMSetupVersion)
|
|
include(KDEInstallDirs)
|
|
include(ECMFindQmlModule)
|
|
include(KDECMakeSettings)
|
|
include(KDECompilerSettings NO_POLICY_SCOPE)
|
|
include(ECMAddAppIcon)
|
|
include(KDEGitCommitHooks)
|
|
include(ECMCheckOutboundLicense)
|
|
if (NOT ANDROID)
|
|
include(KDEClangFormat)
|
|
endif()
|
|
|
|
if(NEOCHAT_FLATPAK)
|
|
include(cmake/Flatpak.cmake)
|
|
endif()
|
|
|
|
ecm_setup_version(${PROJECT_VERSION}
|
|
VARIABLE_PREFIX NEOCHAT
|
|
VERSION_HEADER ${CMAKE_CURRENT_BINARY_DIR}/neochat-version.h
|
|
)
|
|
|
|
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} NO_MODULE COMPONENTS Core Quick Gui QuickControls2 Multimedia Svg)
|
|
set_package_properties(Qt${QT_MAJOR_VERSION} PROPERTIES
|
|
TYPE REQUIRED
|
|
PURPOSE "Basic application components"
|
|
)
|
|
find_package(KF5 ${KF5_MIN_VERSION} COMPONENTS Kirigami2 I18n Notifications Config CoreAddons Sonnet)
|
|
set_package_properties(KF5 PROPERTIES
|
|
TYPE REQUIRED
|
|
PURPOSE "Basic application components"
|
|
)
|
|
set_package_properties(KF5Kirigami2 PROPERTIES
|
|
TYPE REQUIRED
|
|
PURPOSE "Kirigami application UI framework"
|
|
)
|
|
|
|
find_package(Qt${QT_MAJOR_VERSION}Keychain)
|
|
set_package_properties(Qt${QT_MAJOR_VERSION}Keychain PROPERTIES
|
|
TYPE REQUIRED
|
|
PURPOSE "Secure storage of account secrets"
|
|
)
|
|
|
|
if(ANDROID)
|
|
find_package(OpenSSL)
|
|
set_package_properties(OpenSSL PROPERTIES
|
|
TYPE REQUIRED
|
|
PURPOSE "Encrypted communications"
|
|
)
|
|
else()
|
|
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} COMPONENTS Widgets)
|
|
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS QQC2DesktopStyle ConfigWidgets KIO WindowSystem)
|
|
set_package_properties(KF5QQC2DesktopStyle PROPERTIES
|
|
TYPE RUNTIME
|
|
)
|
|
ecm_find_qmlmodule(org.kde.syntaxhighlighting 1.0)
|
|
endif()
|
|
|
|
if (NOT ANDROID AND NOT WIN32 AND NOT APPLE)
|
|
find_package(KF5DBusAddons ${KF5_MIN_VERSION} REQUIRED)
|
|
endif()
|
|
|
|
find_package(Quotient 0.6)
|
|
set_package_properties(Quotient PROPERTIES
|
|
TYPE REQUIRED
|
|
DESCRIPTION "Qt wrapper around Matrix API"
|
|
URL "https://github.com/quotient-im/libQuotient/"
|
|
PURPOSE "Talk with matrix server"
|
|
)
|
|
|
|
find_package(cmark)
|
|
set_package_properties(cmark PROPERTIES
|
|
TYPE REQUIRED
|
|
DESCRIPTION "Cmark is the common mark reference implementation"
|
|
URL "https://github.com/commonmark/cmark"
|
|
PURPOSE "Convert markdown to html"
|
|
)
|
|
|
|
ecm_find_qmlmodule(org.kde.kquickimageeditor 1.0)
|
|
ecm_find_qmlmodule(org.kde.kitemmodels 1.0)
|
|
|
|
find_package(KQuickImageEditor COMPONENTS)
|
|
set_package_properties(KQuickImageEditor PROPERTIES
|
|
TYPE REQUIRED
|
|
DESCRIPTION "Simple image editor for QtQuick applications"
|
|
URL "https://invent.kde.org/libraries/kquickimageeditor/"
|
|
PURPOSE "Add image editing capability to image attachments"
|
|
)
|
|
|
|
find_package(QCoro${QT_MAJOR_VERSION} COMPONENTS Core QUIET)
|
|
if(NOT QCoro${QT_MAJOR_VERSION}_FOUND)
|
|
find_package(QCoro REQUIRED)
|
|
endif()
|
|
|
|
qcoro_enable_coroutines()
|
|
|
|
if(NOT Quotient_VERSION_MINOR GREATER 6)
|
|
cmake_policy(SET CMP0063 OLD)
|
|
endif()
|
|
|
|
if(ANDROID)
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/android/version.gradle.in ${CMAKE_BINARY_DIR}/version.gradle)
|
|
endif()
|
|
|
|
ki18n_install(po)
|
|
|
|
install(FILES org.kde.neochat.desktop DESTINATION ${KDE_INSTALL_APPDIR})
|
|
install(FILES org.kde.neochat.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
|
|
install(FILES org.kde.neochat.svg DESTINATION ${KDE_INSTALL_FULL_ICONDIR}/hicolor/scalable/apps)
|
|
install(FILES org.kde.neochat.tray.svg DESTINATION ${KDE_INSTALL_FULL_ICONDIR}/hicolor/scalable/apps)
|
|
|
|
add_definitions(-DQT_NO_FOREACH)
|
|
|
|
add_subdirectory(src)
|
|
|
|
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
|
|
|
|
if (NOT ANDROID)
|
|
file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES src/*.cpp src/*.h)
|
|
kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
|
|
|
|
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
|
|
endif()
|
|
file(GLOB_RECURSE ALL_SOURCE_FILES *.cpp *.h *.qml)
|
|
# CI installs dependency headers to _install and _build, which break the reuse check
|
|
# Fixes the test by excluding this directory
|
|
list(FILTER ALL_SOURCE_FILES EXCLUDE REGEX [[_(install|build)/.*]])
|
|
ecm_check_outbound_license(LICENSES GPL-3.0-only FILES ${ALL_SOURCE_FILES})
|