Add qml files in CMakeLists

This commit is contained in:
Nicolas Werner 2022-04-14 15:28:17 +02:00
parent 843a619e70
commit 423d649aa7
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
102 changed files with 139 additions and 123 deletions

View file

@ -324,7 +324,6 @@ set(SRC_FILES
src/timeline/Reaction.cpp src/timeline/Reaction.cpp
src/timeline/TimelineViewManager.cpp src/timeline/TimelineViewManager.cpp
src/timeline/TimelineModel.cpp src/timeline/TimelineModel.cpp
src/timeline/DelegateChooser.cpp
src/timeline/Permissions.cpp src/timeline/Permissions.cpp
src/timeline/PresenceEmitter.cpp src/timeline/PresenceEmitter.cpp
src/timeline/RoomlistModel.cpp src/timeline/RoomlistModel.cpp
@ -506,7 +505,7 @@ if (NOT APPLE AND NOT WIN32)
add_compile_definitions(NHEKO_DBUS_SYS) add_compile_definitions(NHEKO_DBUS_SYS)
endif() endif()
qt_wrap_cpp(MOC_HEADERS set(MOC_HEADERS
# Dialogs # Dialogs
src/dialogs/FallbackAuth.h src/dialogs/FallbackAuth.h
src/dialogs/ReCaptcha.h src/dialogs/ReCaptcha.h
@ -522,7 +521,6 @@ qt_wrap_cpp(MOC_HEADERS
src/timeline/Reaction.h src/timeline/Reaction.h
src/timeline/TimelineViewManager.h src/timeline/TimelineViewManager.h
src/timeline/TimelineModel.h src/timeline/TimelineModel.h
src/timeline/DelegateChooser.h
src/timeline/Permissions.h src/timeline/Permissions.h
src/timeline/PresenceEmitter.h src/timeline/PresenceEmitter.h
src/timeline/RoomlistModel.h src/timeline/RoomlistModel.h
@ -533,7 +531,6 @@ qt_wrap_cpp(MOC_HEADERS
src/ui/MxcMediaProxy.h src/ui/MxcMediaProxy.h
src/ui/NhekoCursorShape.h src/ui/NhekoCursorShape.h
src/ui/NhekoEventObserver.h src/ui/NhekoEventObserver.h
src/ui/NhekoDropArea.h
src/ui/NhekoGlobalObject.h src/ui/NhekoGlobalObject.h
src/ui/RoomSettings.h src/ui/RoomSettings.h
src/ui/Theme.h src/ui/Theme.h
@ -646,6 +643,113 @@ endif()
file(GLOB LANG_TS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/resources/langs/*.ts") file(GLOB LANG_TS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/resources/langs/*.ts")
qt_add_translations(nheko RESOURCE_PREFIX "/translations" TS_FILES ${LANG_TS_SRC}) qt_add_translations(nheko RESOURCE_PREFIX "/translations" TS_FILES ${LANG_TS_SRC})
set_property(TARGET nheko PROPERTY AUTOMOC ON)
qt_add_qml_module(nheko
URI im.nheko2
RESOURCE_PREFIX "/"
VERSION 1.0
SOURCES
src/timeline/DelegateChooser.cpp
src/timeline/DelegateChooser.h
src/ui/NhekoDropArea.h
)
qt_target_qml_sources(nheko
#PREFIX "/"
QML_FILES
qml/Avatar.qml
qml/ChatPage.qml
qml/ElidedLabel.qml
qml/EncryptionIndicator.qml
qml/ForwardCompleter.qml
qml/ImageButton.qml
qml/MatrixText.qml
qml/MatrixTextField.qml
qml/MessageInput.qml
qml/NhekoBusyIndicator.qml
qml/NotificationWarning.qml
qml/QuickSwitcher.qml
qml/Reactions.qml
qml/SelfVerificationCheck.qml
qml/StatusIndicator.qml
qml/ToggleButton.qml
qml/TypingIndicator.qml
qml/UploadBox.qml
qml/components/AdaptiveLayout.qml
qml/components/AdaptiveLayoutElement.qml
qml/components/AvatarListTile.qml
qml/components/MainWindowDialog.qml
qml/components/TextButton.qml
qml/components/FlatButton.qml
qml/delegates/Encrypted.qml
qml/delegates/FileMessage.qml
qml/delegates/NoticeMessage.qml
qml/delegates/Pill.qml
qml/delegates/Placeholder.qml
qml/delegates/Redacted.qml
qml/delegates/Reply.qml
qml/delegates/PlayableMediaMessage.qml
qml/delegates/ImageMessage.qml
qml/delegates/TextMessage.qml
qml/delegates/MessageDelegate.qml
qml/device-verification/DeviceVerification.qml
qml/device-verification/DigitVerification.qml
qml/device-verification/EmojiElement.qml
qml/device-verification/EmojiVerification.qml
qml/device-verification/Failed.qml
qml/device-verification/NewVerificationRequest.qml
qml/device-verification/Success.qml
qml/device-verification/Waiting.qml
qml/dialogs/HiddenEventsDialog.qml
qml/dialogs/ImageOverlay.qml
qml/dialogs/LeaveRoomDialog.qml
qml/dialogs/LogoutDialog.qml
qml/dialogs/CreateDirect.qml
qml/dialogs/CreateRoom.qml
qml/dialogs/ImagePackEditorDialog.qml
qml/dialogs/ImagePackSettingsDialog.qml
qml/dialogs/InputDialog.qml
qml/dialogs/InviteDialog.qml
qml/dialogs/JoinRoomDialog.qml
qml/dialogs/PhoneNumberInputDialog.qml
qml/dialogs/RawMessageDialog.qml
qml/dialogs/ReadReceipts.qml
qml/dialogs/RoomDirectory.qml
qml/dialogs/RoomMembers.qml
qml/dialogs/UserProfile.qml
qml/dialogs/RoomSettings.qml
qml/emoji/EmojiPicker.qml
qml/emoji/StickerPicker.qml
qml/pages/LoginPage.qml
qml/pages/RegisterPage.qml
qml/pages/WelcomePage.qml
qml/pages/UserSettingsPage.qml
qml/ui/NhekoSlider.qml
qml/ui/Snackbar.qml
qml/ui/animations/BlinkAnimation.qml
qml/ui/media/MediaControls.qml
qml/ui/Ripple.qml
qml/ui/Spinner.qml
qml/voip/ActiveCallBar.qml
qml/voip/CallDevices.qml
qml/voip/CallInvite.qml
qml/voip/CallInviteBar.qml
qml/voip/DeviceError.qml
qml/voip/PlaceCall.qml
qml/voip/ScreenShare.qml
qml/voip/VideoCall.qml
qml/PrivacyScreen.qml
qml/TimelineRow.qml
qml/Root.qml
qml/ReplyPopup.qml
qml/MessageView.qml
qml/RoomList.qml
qml/CommunitiesList.qml
qml/TopBar.qml
qml/Completer.qml
qml/TimelineView.qml
)
if(APPLE) if(APPLE)
target_link_libraries (nheko PRIVATE Qt5::MacExtras) target_link_libraries (nheko PRIVATE Qt5::MacExtras)
elseif(WIN32) elseif(WIN32)
@ -660,7 +764,7 @@ else()
target_compile_definitions(nheko PRIVATE NHEKO_FLATPAK) target_compile_definitions(nheko PRIVATE NHEKO_FLATPAK)
endif() endif()
endif() endif()
target_include_directories(nheko PRIVATE src includes third_party/blurhash third_party/cpp-httplib-0.5.12) target_include_directories(nheko PRIVATE src includes third_party/blurhash third_party/cpp-httplib-0.5.12 src/timeline src/ui)
# Fixup bundled keychain include dirs # Fixup bundled keychain include dirs
if (USE_BUNDLED_QTKEYCHAIN) if (USE_BUNDLED_QTKEYCHAIN)

View file

@ -3,11 +3,13 @@
// //
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
import "./ui" import QtQuick
import QtQuick 2.15 import QtQuick.Controls
import QtQuick.Controls 2.15 import QtQuick.Layouts
import QtQuick.Layouts 1.15 import im.nheko
import im.nheko 1.0 import im.nheko2
import "./ui/"
Control { Control {
id: popup id: popup

View file

@ -14,7 +14,8 @@ import QtQuick 2.15
import QtQuick.Controls 2.5 import QtQuick.Controls 2.5
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import QtQuick.Window 2.13 import QtQuick.Window 2.13
import im.nheko 1.0 import im.nheko
import im.nheko2
import im.nheko.EmojiModel 1.0 import im.nheko.EmojiModel 1.0
Item { Item {

View file

@ -6,7 +6,8 @@
import QtQuick 2.6 import QtQuick 2.6
import QtQuick.Controls 2.1 import QtQuick.Controls 2.1
import QtQuick.Layouts 1.2 import QtQuick.Layouts 1.2
import im.nheko 1.0 import im.nheko
import im.nheko2
Item { Item {
id: d id: d

View file

@ -4,8 +4,9 @@
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
import ".." import ".."
import QtQuick.Controls 2.3 import QtQuick
import im.nheko 1.0 import QtQuick.Controls
import im.nheko
MatrixText { MatrixText {
required property string body required property string body

View file

@ -10,7 +10,8 @@ import QtQuick 2.15
import QtQuick.Controls 2.15 import QtQuick.Controls 2.15
import QtQuick.Layouts 1.2 import QtQuick.Layouts 1.2
import QtQuick.Window 2.15 import QtQuick.Window 2.15
import im.nheko 1.0 import im.nheko
import im.nheko2
Rectangle { Rectangle {
id: userSettingsDialog id: userSettingsDialog

View file

@ -1,4 +0,0 @@
module im.nheko.UI
NhekoSlider 1.0 NhekoSlider.qml
Ripple 1.0 Ripple.qml
Spinner 1.0 Spinner.qml

View file

@ -86,96 +86,6 @@
</qresource> </qresource>
<qresource prefix="/"> <qresource prefix="/">
<file>qtquickcontrols2.conf</file> <file>qtquickcontrols2.conf</file>
<file>qml/Root.qml</file>
<file>qml/ChatPage.qml</file>
<file>qml/CommunitiesList.qml</file>
<file>qml/RoomList.qml</file>
<file>qml/TimelineView.qml</file>
<file>qml/Avatar.qml</file>
<file>qml/Completer.qml</file>
<file>qml/EncryptionIndicator.qml</file>
<file>qml/ImageButton.qml</file>
<file>qml/ElidedLabel.qml</file>
<file>qml/MatrixText.qml</file>
<file>qml/MatrixTextField.qml</file>
<file>qml/ToggleButton.qml</file>
<file>qml/UploadBox.qml</file>
<file>qml/MessageInput.qml</file>
<file>qml/MessageView.qml</file>
<file>qml/NhekoBusyIndicator.qml</file>
<file>qml/PrivacyScreen.qml</file>
<file>qml/Reactions.qml</file>
<file>qml/ReplyPopup.qml</file>
<file>qml/StatusIndicator.qml</file>
<file>qml/TimelineRow.qml</file>
<file>qml/TopBar.qml</file>
<file>qml/QuickSwitcher.qml</file>
<file>qml/ForwardCompleter.qml</file>
<file>qml/SelfVerificationCheck.qml</file>
<file>qml/TypingIndicator.qml</file>
<file>qml/NotificationWarning.qml</file>
<file>qml/pages/UserSettingsPage.qml</file>
<file>qml/pages/WelcomePage.qml</file>
<file>qml/pages/LoginPage.qml</file>
<file>qml/pages/RegisterPage.qml</file>
<file>qml/components/AdaptiveLayout.qml</file>
<file>qml/components/AdaptiveLayoutElement.qml</file>
<file>qml/components/AvatarListTile.qml</file>
<file>qml/components/FlatButton.qml</file>
<file>qml/components/MainWindowDialog.qml</file>
<file>qml/components/TextButton.qml</file>
<file>qml/delegates/Encrypted.qml</file>
<file>qml/delegates/FileMessage.qml</file>
<file>qml/delegates/ImageMessage.qml</file>
<file>qml/delegates/MessageDelegate.qml</file>
<file>qml/delegates/NoticeMessage.qml</file>
<file>qml/delegates/Pill.qml</file>
<file>qml/delegates/Placeholder.qml</file>
<file>qml/delegates/PlayableMediaMessage.qml</file>
<file>qml/delegates/Redacted.qml</file>
<file>qml/delegates/Reply.qml</file>
<file>qml/delegates/TextMessage.qml</file>
<file>qml/device-verification/DeviceVerification.qml</file>
<file>qml/device-verification/DigitVerification.qml</file>
<file>qml/device-verification/EmojiVerification.qml</file>
<file>qml/device-verification/Failed.qml</file>
<file>qml/device-verification/NewVerificationRequest.qml</file>
<file>qml/device-verification/Success.qml</file>
<file>qml/device-verification/Waiting.qml</file>
<file>qml/dialogs/CreateDirect.qml</file>
<file>qml/dialogs/CreateRoom.qml</file>
<file>qml/dialogs/ImageOverlay.qml</file>
<file>qml/dialogs/ImagePackEditorDialog.qml</file>
<file>qml/dialogs/ImagePackSettingsDialog.qml</file>
<file>qml/dialogs/PhoneNumberInputDialog.qml</file>
<file>qml/dialogs/InputDialog.qml</file>
<file>qml/dialogs/InviteDialog.qml</file>
<file>qml/dialogs/JoinRoomDialog.qml</file>
<file>qml/dialogs/LeaveRoomDialog.qml</file>
<file>qml/dialogs/LogoutDialog.qml</file>
<file>qml/dialogs/RawMessageDialog.qml</file>
<file>qml/dialogs/ReadReceipts.qml</file>
<file>qml/dialogs/RoomDirectory.qml</file>
<file>qml/dialogs/RoomMembers.qml</file>
<file>qml/dialogs/RoomSettings.qml</file>
<file>qml/dialogs/UserProfile.qml</file>
<file>qml/dialogs/HiddenEventsDialog.qml</file>
<file>qml/emoji/EmojiPicker.qml</file>
<file>qml/emoji/StickerPicker.qml</file>
<file>qml/ui/NhekoSlider.qml</file>
<file>qml/ui/Ripple.qml</file>
<file>qml/ui/Spinner.qml</file>
<file>qml/ui/Snackbar.qml</file>
<file>qml/ui/animations/BlinkAnimation.qml</file>
<file>qml/ui/media/MediaControls.qml</file>
<file>qml/voip/ActiveCallBar.qml</file>
<file>qml/voip/CallDevices.qml</file>
<file>qml/voip/CallInvite.qml</file>
<file>qml/voip/CallInviteBar.qml</file>
<file>qml/voip/DeviceError.qml</file>
<file>qml/voip/PlaceCall.qml</file>
<file>qml/voip/ScreenShare.qml</file>
<file>qml/voip/VideoCall.qml</file>
</qresource> </qresource>
<qresource prefix="/media"> <qresource prefix="/media">
<file>media/ring.ogg</file> <file>media/ring.ogg</file>

View file

@ -42,13 +42,11 @@
#include "emoji/Provider.h" #include "emoji/Provider.h"
#include "encryption/DeviceVerificationFlow.h" #include "encryption/DeviceVerificationFlow.h"
#include "encryption/SelfVerificationStatus.h" #include "encryption/SelfVerificationStatus.h"
#include "timeline/DelegateChooser.h"
#include "timeline/TimelineViewManager.h" #include "timeline/TimelineViewManager.h"
#include "ui/HiddenEvents.h" #include "ui/HiddenEvents.h"
#include "ui/MxcAnimatedImage.h" #include "ui/MxcAnimatedImage.h"
#include "ui/MxcMediaProxy.h" #include "ui/MxcMediaProxy.h"
#include "ui/NhekoCursorShape.h" #include "ui/NhekoCursorShape.h"
#include "ui/NhekoDropArea.h"
#include "ui/NhekoEventObserver.h" #include "ui/NhekoEventObserver.h"
#include "ui/NhekoGlobalObject.h" #include "ui/NhekoGlobalObject.h"
#include "ui/UIA.h" #include "ui/UIA.h"
@ -81,7 +79,7 @@ MainWindow::MainWindow(QWindow *parent)
registerQmlTypes(); registerQmlTypes();
setColor(Theme::paletteFromTheme(userSettings_->theme()).window().color()); setColor(Theme::paletteFromTheme(userSettings_->theme()).window().color());
setSource(QUrl(QStringLiteral("qrc:///qml/Root.qml"))); setSource(QUrl(QStringLiteral("qrc:///im/nheko2/qml/Root.qml")));
trayIcon_ = new TrayIcon(QStringLiteral(":/logos/nheko.svg"), this); trayIcon_ = new TrayIcon(QStringLiteral(":/logos/nheko.svg"), this);
@ -163,9 +161,6 @@ MainWindow::registerQmlTypes()
"VerificationStatus", "VerificationStatus",
QStringLiteral("Can't instantiate enum!")); QStringLiteral("Can't instantiate enum!"));
qmlRegisterType<DelegateChoice>("im.nheko", 1, 0, "DelegateChoice");
qmlRegisterType<DelegateChooser>("im.nheko", 1, 0, "DelegateChooser");
qmlRegisterType<NhekoDropArea>("im.nheko", 1, 0, "NhekoDropArea");
qmlRegisterType<NhekoCursorShape>("im.nheko", 1, 0, "CursorShape"); qmlRegisterType<NhekoCursorShape>("im.nheko", 1, 0, "CursorShape");
qmlRegisterType<NhekoEventObserver>("im.nheko", 1, 0, "EventObserver"); qmlRegisterType<NhekoEventObserver>("im.nheko", 1, 0, "EventObserver");
qmlRegisterType<MxcAnimatedImage>("im.nheko", 1, 0, "MxcAnimatedImage"); qmlRegisterType<MxcAnimatedImage>("im.nheko", 1, 0, "MxcAnimatedImage");

View file

@ -9,6 +9,7 @@
#pragma once #pragma once
#include <QQmlComponent> #include <QQmlComponent>
#include <QQmlEngine>
#include <QQmlIncubator> #include <QQmlIncubator>
#include <QQmlListProperty> #include <QQmlListProperty>
#include <QQuickItem> #include <QQuickItem>
@ -20,6 +21,7 @@ class QQmlAdaptorModel;
class DelegateChoice : public QObject class DelegateChoice : public QObject
{ {
Q_OBJECT Q_OBJECT
QML_ELEMENT
Q_CLASSINFO("DefaultProperty", "delegate") Q_CLASSINFO("DefaultProperty", "delegate")
public: public:
@ -46,6 +48,7 @@ private:
class DelegateChooser : public QQuickItem class DelegateChooser : public QQuickItem
{ {
Q_OBJECT Q_OBJECT
QML_ELEMENT
Q_CLASSINFO("DefaultProperty", "choices") Q_CLASSINFO("DefaultProperty", "choices")
public: public:

View file

@ -25,6 +25,15 @@
#include "emoji/EmojiModel.h" #include "emoji/EmojiModel.h"
#include "emoji/Provider.h" #include "emoji/Provider.h"
Q_DECLARE_METATYPE(mtx::events::msg::KeyVerificationAccept)
Q_DECLARE_METATYPE(mtx::events::msg::KeyVerificationCancel)
Q_DECLARE_METATYPE(mtx::events::msg::KeyVerificationDone)
Q_DECLARE_METATYPE(mtx::events::msg::KeyVerificationKey)
Q_DECLARE_METATYPE(mtx::events::msg::KeyVerificationMac)
Q_DECLARE_METATYPE(mtx::events::msg::KeyVerificationReady)
Q_DECLARE_METATYPE(mtx::events::msg::KeyVerificationRequest)
Q_DECLARE_METATYPE(mtx::events::msg::KeyVerificationStart)
namespace msgs = mtx::events::msg; namespace msgs = mtx::events::msg;
namespace { namespace {

Some files were not shown because too many files have changed in this diff Show more