diff --git a/src/apps/qml/AboutDialog.qml b/src/apps/qml/AboutDialog.qml index 2632e99d..f027589d 100644 --- a/src/apps/qml/AboutDialog.qml +++ b/src/apps/qml/AboutDialog.qml @@ -1,167 +1,167 @@ /* Copyright (c) 2017-2019 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.9 import QtQuick.Layouts 1.12 import QtQuick.Controls 2.5 as QQC2 import QtQuick.Window 2.0 import KDE.Ruqola.RuqolaAboutDataAuthorModel 1.0 import KDE.Ruqola.RuqolaAboutData 1.0 -import org.kde.kirigami 2.4 as Kirigami +import org.kde.kirigami 2.7 as Kirigami QQC2.Dialog { id: aboutDialog title: i18n("About Ruqola") standardButtons: QQC2.Dialog.Close signal openurl(string link) property QtObject applicationData x: parent.width / 2 - width / 2 y: parent.height / 2 - height / 2 width: Math.min(bar.contentWidth + Kirigami.Units.smallSpacing * 2, 500) height: 600 modal: true focus: true Item { id: contentRect anchors.fill: parent anchors.leftMargin: Kirigami.Units.smallSpacing * 2 anchors.rightMargin: Kirigami.Units.smallSpacing * 2 clip: true QQC2.TabBar { id: bar width: parent.width QQC2.TabButton { text: i18n("About") } QQC2.TabButton { text: i18n("Libraries") } QQC2.TabButton { text: i18n("Author") } QQC2.TabButton { text: i18n("Thanks To") visible: applicationData.creditsModel.rowCount() > 0 } QQC2.TabButton { text: i18n("Translation") visible: applicationData.translatorModel.rowCount() > 0 } } StackLayout { anchors.top: bar.bottom anchors.bottom: parent.bottom width: parent.width currentIndex: bar.currentIndex Item { id: aboutTab ColumnLayout { Layout.fillHeight: true Layout.fillWidth: true QQC2.Label { text: applicationData.title wrapMode: QQC2.Label.Wrap textFormat: Qt.RichText } QQC2.Label { text: applicationData.about wrapMode: QQC2.Label.Wrap textFormat: Qt.RichText } QQC2.Label { text: applicationData.licenses wrapMode: QQC2.Label.Wrap textFormat: Qt.RichText onLinkActivated: { licenseDialog.licenseText = applicationData.licenseText(link); licenseDialog.open(); } } } } Item { id: librariesTab ColumnLayout { Layout.fillHeight: true Layout.fillWidth: true Layout.topMargin: Kirigami.Units.smallSpacing QQC2.Label { text: applicationData.libraries wrapMode: QQC2.Label.Wrap textFormat: Qt.RichText } } } Item { id: authorTab ColumnLayout { Layout.topMargin: Kirigami.Units.smallSpacing QQC2.Label { id: reportBugsLink visible: applicationData.reportBugs !== "" text: applicationData.reportBugs wrapMode: QQC2.Label.Wrap textFormat: Qt.RichText onLinkActivated: { aboutDialog.openurl(link); } } PersonsListView { personsModel: applicationData.authorModel } } } Item { id: thanksToTab ColumnLayout { Layout.topMargin: Kirigami.Units.smallSpacing PersonsListView { personsModel: applicationData.creditsModel } } } Item { id: translatorToTab ColumnLayout { Layout.topMargin: Kirigami.Units.largeSpacing PersonsListView { personsModel: applicationData.translatorModel } } } } } LicenseDialog { id: licenseDialog } } diff --git a/src/apps/qml/ActiveChat.qml b/src/apps/qml/ActiveChat.qml index edd2d0b1..7a343571 100644 --- a/src/apps/qml/ActiveChat.qml +++ b/src/apps/qml/ActiveChat.qml @@ -1,131 +1,131 @@ /* Copyright (c) 2017-2019 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.9 -import org.kde.kirigami 2.4 as Kirigami +import org.kde.kirigami 2.7 as Kirigami ListView { id: activeChat clip: true signal openDirectChannel(string userName) signal openChannel(string channel) signal jitsiCallConfActivated() signal deleteMessage(string messageId) signal downloadAttachment(string url) signal editMessage(string messageId, string messageStr) signal copyMessage(string messageId, string messageStr) signal replyMessage(string messageId) signal setFavoriteMessage(string messageId, bool starred) signal displayImage(url imageUrl, string title, bool isAnimatedImage) signal deleteReaction(string messageId, string emoji) signal ignoreUser(string userId, bool ignored) property QtObject rcAccount property string roomId: "" property bool enableEditingMode: false spacing: Kirigami.Units.smallSpacing highlightRangeMode: ListView.ApplyRange preferredHighlightBegin: currentItem === null ? parent.height : parent.height - currentItem.height preferredHighlightEnd: parent.height onCountChanged: { //if (atYEnd) { currentIndex = count - 1 //} } Component.onCompleted: positionViewAtEnd() visible: count > 0 onDragEnded : { if (roomId !== "") { rcAccount.loadHistory(roomId) } } delegate: FancyMessageDelegate { anchors.left: parent.left anchors.right: parent.right anchors.rightMargin: Kirigami.Units.largeSpacing anchors.leftMargin: Kirigami.Units.largeSpacing i_originalMessage: originalMessage i_messageText: messageConverted i_username: username i_usernameurl: usernameurl i_aliasname: alias i_systemMessageType: type i_timestamp: timestamp i_messageID: messageID i_messageType: messagetype i_avatar: avatar == "" ? rcAccount.avatarUrl(userID) : avatar i_urls: urls i_attachments: attachments i_reactions: reactions i_roles: roles i_date: date i_own_username: rcAccount.userName i_can_editing_message: canEditingMessage i_starred: starred i_pinned: pinned i_editedByUserName: editedByUsername i_user_ignored: userIsIgnored onOpenChannel: { activeChat.openChannel(channel) } onOpenDirectChannel: { if (rcAccount.userName !== userName) { activeChat.openDirectChannel(userName) } } onJitsiCallConfActivated: { activeChat.jitsiCallConfActivated() } onDeleteMessage: { activeChat.deleteMessage(messageId) } onDownloadAttachment: { activeChat.downloadAttachment(url) } onEditMessage: { activeChat.editMessage(messageId, messageStr) } onCopyMessage: { activeChat.copyMessage(messageId, messageStr) } onReplyMessage: { activeChat.replyMessage(messageId) } onSetFavoriteMessage: { activeChat.setFavoriteMessage(messageId, starred) } onDisplayImage: { activeChat.displayImage(imageUrl, title, isAnimatedImage) } onDeleteReaction: { activeChat.deleteReaction(messageId, emoji) } onIgnoreUser: { activeChat.ignoreUser(userID, ignored) } } } diff --git a/src/apps/qml/ConfigureServerList.qml b/src/apps/qml/ConfigureServerList.qml index aec1219b..107e65b5 100644 --- a/src/apps/qml/ConfigureServerList.qml +++ b/src/apps/qml/ConfigureServerList.qml @@ -1,101 +1,101 @@ /* Copyright (c) 2017-2019 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.9 import QtQuick.Layouts 1.12 import QtQuick.Controls 1.4 import QtQuick.Controls 2.5 as QQC2 -import org.kde.kirigami 2.4 as Kirigami +import org.kde.kirigami 2.7 as Kirigami import KDE.Ruqola.RocketChatAccount 1.0 Kirigami.Page { id: configureServer implicitHeight: 400 implicitWidth: 300 property QtObject accountModel signal closeConfigureServer() ColumnLayout { ListView { id: listview width: 300; height: 200 clip: true model: accountModel delegate: RowLayout { QQC2.Label { text: name } Kirigami.Icon { //Fix icon ?? source: "list-remove" //FIXME icon size height: 22 width: 22 MouseArea { anchors.fill: parent onClicked: { deleteAccountDialog.accountName = name deleteAccountDialog.open() } } } } } Kirigami.Icon { //Fix icon ?? source: "list-add" //FIXME icon size height: 22 width: 22 MouseArea { anchors.fill: parent onClicked: { createNewAccountDialog.initializeAndOpen() } } } Button { text: i18n("Close") onClicked: { configureServer.closeConfigureServer() } } } CreateNewAccountDialog { id: createNewAccountDialog onCreateNewAccount: { appid.accountManager.addAccount(accountName, username, serverUrl); } } DeleteAccountDialog { id: deleteAccountDialog onAccepted: { appid.accountManager.removeAccount(accountName) } } } diff --git a/src/apps/qml/Desktop.qml b/src/apps/qml/Desktop.qml index 105c87f9..de3fbd05 100644 --- a/src/apps/qml/Desktop.qml +++ b/src/apps/qml/Desktop.qml @@ -1,285 +1,285 @@ /* * Copyright 2016 Riccardo Iaconelli * Copyright (c) 2017-2019 Montel Laurent * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ import QtQuick 2.9 import QtQuick.Controls 1.4 import QtQuick.Window 2.2 import QtQuick.Dialogs 1.2 import QtQuick.Layouts 1.1 import QtQuick.Controls 2.5 as QQC2 import KDE.Ruqola.RuqolaUtils 1.0 import KDE.Ruqola.Ruqola 1.0 import KDE.Ruqola.DDPClient 1.0 import KDE.Ruqola.RoomFilterProxyModel 1.0 -import org.kde.kirigami 2.4 as Kirigami +import org.kde.kirigami 2.7 as Kirigami import KDE.Ruqola.DebugCategory 1.0 import KDE.Ruqola.Channel 1.0 import KDE.Ruqola.AccountManager 1.0 Kirigami.ApplicationWindow { id: appid readonly property int margin: 11 property string selectedRoomID: ""; property QtObject selectedRoom property QtObject messageModel property QtObject userModel property QtObject filesModel property QtObject accountManager: Ruqola.accountManager() property QtObject accountManagerModel: accountManager.rocketChatAccountModel() property QtObject rocketChatAccount: accountManager.firstAccount() property QtObject inputCompleterModel: rocketChatAccount.inputCompleterModel() property QtObject searchMessageModel: rocketChatAccount.searchMessageFilterProxyModel() property string userInputMessageText: ""; width: Kirigami.Units.gridUnit * 55 height: Kirigami.Units.gridUnit * 40 title: i18n("Ruqola") pageStack.initialPage: [roomsComponent, mainComponent] pageStack.visible: rocketChatAccount.loginStatus === DDPClient.LoggedIn globalDrawer: Kirigami.GlobalDrawer { drawerOpen: false handleVisible: true resetMenuOnTriggered: true topContent: [ QQC2.Label { text: rocketChatAccount.userName === "" ? "" : i18n("Hello, %1", rocketChatAccount.userName) } ] actions: [ Kirigami.Action { text: i18n("About") iconName: ":/icons/systray.png" onTriggered: { aboutDataDialog.open() } }, Kirigami.Action { text: i18n("Log out") iconName: "system-log-out" onTriggered: { rocketChatAccount.logOut(); appid.globalDrawer.drawerOpen = false; } }, Kirigami.Action { text: i18n("Report a Bug") iconName: "tools-report-bug" onTriggered: { Qt.openUrlExternally("https://bugs.kde.org/report.cgi"); } }, Kirigami.Action { text: i18n("Configure Account") iconName: "settings-configure" onTriggered: { configureServerList.visible = true pageStack.visible = false } }, Kirigami.Action { text: i18n("Handbook") iconName: "system-help" onTriggered: { rocketChatAccount.openDocumentation(); } }, Kirigami.Action { separator: true }, Kirigami.Action { shortcut: StandardKey.Quit text: i18n("Quit") iconName: "application-exit" onTriggered: { Qt.quit(); } } ] } ConfigureServerList { id: configureServerList accountModel: accountManagerModel visible: false onCloseConfigureServer: { configureServerList.visible = false pageStack.visible = true } } LoginPage { id: loginTab rcAccount: rocketChatAccount } AboutDialog { id: aboutDataDialog applicationData: Ruqola.applicationData() onOpenurl: { RuqolaUtils.openUrl(link); } } PrivateChannelInfoDialog { id: privateChannelInfoDialog onBlockUser: { rocketChatAccount.blockUser(rid, block) } } NotificationOptionsDialog { id: notificationsDialog rid: (appid && appid.selectedRoomID) ? appid.selectedRoomID : "" onModifyNotificationsSetting: { rocketChatAccount.changeNotificationsSettings(roomId, type, newVal) } } ChannelInfoDialog { id: channelInfoDialog channelName: (appid && appid.selectedRoomID) ? appid.selectedRoomID : "" onDeleteRoom: { rocketChatAccount.eraseRoom(roomId, appid.selectedRoom.channelType) } onModifyChannelSetting: { rocketChatAccount.changeChannelSettings(roomId, type, newVal, channelType) } } LeaveChannelDialog { id: leaveChannelDialog onLeaveChannel: { rocketChatAccount.leaveRoom(roomId, channelType) } } AddUserDialog { id: addUserDialog completerModel: rocketChatAccount.userCompleterFilterModelProxy() onSearchUserName: { rocketChatAccount.userAutocomplete(pattern, ""); } onAddUser: { rocketChatAccount.addUserToRoom(userId, rid, channelType) } } ShowSearchMessageDialog { id: searchMessageDialog searchMessageModel: appid.searchMessageModel onSearchMessage: { rocketChatAccount.messageSearch(pattern, rid) } onClosed: { rocketChatAccount.clearSearchModel() } } JobErrorMessageDialog { id: jobErrorMessageDialog } SearchChannelDialog { id: searchChannelDialog searchChannelModel: rocketChatAccount.searchChannelFilterProxyModel() onSearchChannel: { rocketChatAccount.channelAndPrivateAutocomplete(pattern); } onOpenChannel: { if (channeltype === Channel.Room) { rocketChatAccount.openChannel(channelid) } else if (channeltype === Channel.PrivateChannel) { if (rocketChatAccount.userName !== channelid) { rocketChatAccount.openDirectChannel(channelid) } } else { console.log(RuqolaDebugCategorySingleton.category, "Unknown open channel type : " + channeltype + " channelid : " + channelid + " channelname : " + channelname) } } } TakeVideoMessageDialog { id: takeVideoMessage rcAccount: rocketChatAccount } BusyIndicator { id: busy anchors.centerIn: parent visible: rocketChatAccount.loginStatus === DDPClient.LoggingIn } RoomsComponent { id: roomsComponent } MainComponent { id: mainComponent } ChannelPasswordDialog { id: channelPasswordDialog onJoinRoom: { rocketChatAccount.joinRoom(roomId, password) } } Connections { target: rocketChatAccount onMissingChannelPassword: { channelPasswordDialog.roomId = roomId channelPasswordDialog.visible = true } onJobFailed: { jobErrorMessageDialog.jobMessageError = message jobErrorMessageDialog.open() } } onClosing: { Qt.quit(); } function toggleShow() { if (visible) { hide(); } else { show(); raise(); requestActivate(); } } Component.onCompleted: { systrayIcon.activateRequested.connect(toggleShow); } } diff --git a/src/apps/qml/FancyMessageDelegate.qml b/src/apps/qml/FancyMessageDelegate.qml index 0950adc2..5287d2ce 100644 --- a/src/apps/qml/FancyMessageDelegate.qml +++ b/src/apps/qml/FancyMessageDelegate.qml @@ -1,263 +1,263 @@ /* * Copyright 2016 Riccardo Iaconelli * Copyright (c) 2017-2019 Montel Laurent * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ import QtQuick 2.9 import KDE.Ruqola.RuqolaUtils 1.0 import KDE.Ruqola.Message 1.0 import QtQuick.Controls 2.2 -import org.kde.kirigami 2.4 as Kirigami +import org.kde.kirigami 2.7 as Kirigami import KDE.Ruqola.ExtraColors 1.0 import QtQuick.Layouts 1.1 import KDE.Ruqola.RocketChatAccount 1.0 import KDE.Ruqola.DebugCategory 1.0 Rectangle { id: messageMain property string i_messageID property string i_originalMessage property string i_messageText property string i_username property string i_usernameurl property bool i_systemMessage property string i_systemMessageType property string i_avatar property string i_aliasname property string i_editedByUserName property var i_timestamp property var i_messageType property var i_urls property var i_attachments property var i_reactions property var i_roles property string i_date property string i_own_username property bool i_can_editing_message property bool i_starred property bool i_user_ignored property bool i_pinned color: RuqolaSingleton.backgroundColor implicitHeight: 4*Kirigami.Units.smallSpacing + loaded.item.implicitHeight implicitWidth: 150 signal openDirectChannel(string userName) signal openChannel(string channel) signal jitsiCallConfActivated() signal deleteMessage(string messageId) signal downloadAttachment(string url) signal editMessage(string messageId, string messageStr) signal copyMessage(string messageId, string messageStr) signal replyMessage(string messageId) signal setFavoriteMessage(string messageId, bool starred) signal displayImage(url imageUrl, string title, bool isAnimatedImage) signal deleteReaction(string messageId, string emoji) signal ignoreUser(bool ignored) signal pinMessage(string messageId, bool pinned) Loader { id: loaded anchors.fill: parent Component.onCompleted: { if (i_messageType === Message.System) { if (i_systemMessageType === "jitsi_call_started") { console.log(RuqolaDebugCategorySingleton.category, "Jitsi"); setSource("messages/JitsiVideoMessage.qml", { i_messageText: i_messageText, i_username: i_username, i_aliasname: i_aliasname, i_timestamp: i_timestamp, i_systemMessageType: i_systemMessageType, i_messageID: i_messageID, i_avatar: i_avatar, i_date: i_date, rcAccount: appid.rocketChatAccount } ) } else { console.log(RuqolaDebugCategorySingleton.category, "System Message"); setSource("messages/SystemMessage.qml", { i_messageText: i_messageText, i_username: i_username, i_aliasname: i_aliasname, i_timestamp: i_timestamp, i_systemMessageType: i_systemMessageType, i_messageID: i_messageID, i_date: i_date, rcAccount: appid.rocketChatAccount } ) } } else if (i_messageType === Message.NormalText || i_messageType === Message.File) { console.log(RuqolaDebugCategorySingleton.category, "User Message"); setSource("messages/UserMessage.qml", { i_originalMessage: i_originalMessage, i_messageText: i_messageText, i_username: i_username, i_usernameurl: i_usernameurl, i_aliasname: i_aliasname, i_timestamp: i_timestamp, i_messageID: i_messageID, i_avatar: i_avatar, i_urls: i_urls, i_reactions: i_reactions, i_roles: i_roles, i_attachments: i_attachments, i_date: i_date, i_own_username: i_own_username, rcAccount: appid.rocketChatAccount, i_can_editing_message: i_can_editing_message, i_editedByUserName: i_editedByUserName, i_starred: i_starred, i_pinned: i_pinned, i_user_ignored : i_user_ignored } ) } else if (i_messageType === Message.Audio) { console.log(RuqolaDebugCategorySingleton.category, "Audio"); setSource("messages/AttachmentMessageAudio.qml", { i_messageText: i_messageText, i_username: i_username, i_usernameurl: i_usernameurl, i_aliasname: i_aliasname, i_timestamp: i_timestamp, i_messageID: i_messageID, i_avatar: i_avatar, i_reactions: i_reactions, i_roles: i_roles, i_urls: i_urls, i_attachments: i_attachments, i_date: i_date, i_editedByUserName: i_editedByUserName, rcAccount: appid.rocketChatAccount, i_editedByUserName: i_editedByUserName, i_starred: i_starred, i_pinned: i_pinned }) } else if (i_messageType === Message.Video) { console.log(RuqolaDebugCategorySingleton.category, "Video"); setSource("messages/AttachmentMessageVideo.qml", { i_messageText: i_messageText, i_username: i_username, i_usernameurl: i_usernameurl, i_aliasname: i_aliasname, i_timestamp: i_timestamp, i_messageID: i_messageID, i_avatar: i_avatar, i_reactions: i_reactions, i_roles: i_roles, i_urls: i_urls, i_attachments: i_attachments, i_date: i_date, i_editedByUserName: i_editedByUserName, rcAccount: appid.rocketChatAccount, i_editedByUserName: i_editedByUserName, i_starred: i_starred, i_pinned: i_pinned }) } else if (i_messageType === Message.Image) { console.log(RuqolaDebugCategorySingleton.category, "Image"); setSource("messages/AttachmentMessageImage.qml", { i_messageText: i_messageText, i_username: i_username, i_usernameurl: i_usernameurl, i_aliasname: i_aliasname, i_timestamp: i_timestamp, i_messageID: i_messageID, i_avatar: i_avatar, i_reactions: i_reactions, i_roles: i_roles, i_urls: i_urls, i_attachments: i_attachments, i_date: i_date, i_editedByUserName: i_editedByUserName, rcAccount: appid.rocketChatAccount, i_editedByUserName: i_editedByUserName, i_starred: i_starred, i_pinned: i_pinned }) } else { console.log(RuqolaDebugCategorySingleton.category, "Unknown message type: " + i_messageType) } } } Connections { target: loaded.item onLinkActivated: { var username = RuqolaUtils.extractRoomUserFromUrl(link); if (link.startsWith("ruqola:/room/")) { messageMain.openChannel(username) } else if (link.startsWith("ruqola:/user/")) { if (username !== appid.rocketChatAccount.userName) { messageMain.openDirectChannel(username) } } else { RuqolaUtils.openUrl(link); } } onJitsiCallConfActivated: { messageMain.jitsiCallConfActivated() } onDeleteMessage: { messageMain.deleteMessage(messageId) } onDownloadAttachment: { messageMain.downloadAttachment(url) } onEditMessage: { console.log(RuqolaDebugCategorySingleton.category, "i_messageText " + i_messageText); messageMain.editMessage(messageId, messageStr) } onCopyMessage: { console.log(RuqolaDebugCategorySingleton.category, "i_messageText " + i_messageText); messageMain.copyMessage(messageId, messageStr) } onReplyMessage: { messageMain.replyMessage(messageId) } onSetFavoriteMessage: { messageMain.setFavoriteMessage(messageId, starred) } onDisplayImage: { messageMain.displayImage(imageUrl, title, isAnimatedImage) } onDeleteReaction: { messageMain.deleteReaction(messageId, emoji) } onIgnoreUser: { messageMain.ignoreUser(ignored) } } } diff --git a/src/apps/qml/Login.qml b/src/apps/qml/Login.qml index 4a9aef83..1608658b 100644 --- a/src/apps/qml/Login.qml +++ b/src/apps/qml/Login.qml @@ -1,197 +1,197 @@ /* * Copyright 2016 Riccardo Iaconelli * Copyright (c) 2017-2019 Montel Laurent * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ import QtQuick 2.9 import QtQuick.Controls 1.3 import QtQuick.Controls 2.5 as QQC2 -import org.kde.kirigami 2.4 as Kirigami +import org.kde.kirigami 2.7 as Kirigami import KDE.Ruqola.DDPClient 1.0 import KDE.Ruqola.RocketChatAccount 1.0 import KDE.Ruqola.LoginMethodModel 1.0 Kirigami.Page { id: loginForm property QtObject rcAccount property alias username: usernameField.text; property alias password: passField.text; property alias serverUrl: urlField.text; property alias accountName: nameField.text; property string originalAccountName signal accepted() implicitHeight: 400 implicitWidth: 300 Column { id: form anchors.centerIn: parent width: 0.8*parent.width spacing: 3 QQC2.Label { id: loginLabel text: i18n("Ruqola Log in") color: "#555" font.pointSize: 40 horizontalAlignment: Text.AlignHCenter width: parent.width } Item { id: spacer width: 30 height: 30 } QQC2.Label { width: parent.width text: i18n("Account Name") } QQC2.TextField { id: nameField selectByMouse: true text: originalAccountName readOnly: originalAccountName !== "" width: parent.width placeholderText: i18n("Enter Account Name") } QQC2.Label { width: parent.width text: i18n("Rocket Chat Server") } QQC2.TextField { id: urlField selectByMouse: true width: parent.width placeholderText: i18n("Enter address of the server") } // QQC2.Label { width: parent.width text: i18n("Authentication Method") visible: loginMethodCombobox.visible } QQC2.ComboBox { id: loginMethodCombobox width: parent.width model: appid.rocketChatAccount.loginMethodModel() visible: count > 1 textRole: "name" currentIndex: model.currentLoginMethod onActivated: { appid.rocketChatAccount.changeDefaultAuthentication(index) } delegate: QQC2.ItemDelegate { width: loginMethodCombobox.width contentItem: Text { text: model.name font: loginMethodCombobox.font //TODO fix color. elide: Text.ElideRight verticalAlignment: Text.AlignVCenter } highlighted: loginMethodCombobox.highlightedIndex === index } } QQC2.Label { id:username width: parent.width text: i18n("Enter your username") } QQC2.TextField { selectByMouse: true width: parent.width id: usernameField placeholderText: i18n("Enter Username") } QQC2.Label { id: passLabel width: parent.width text: i18n("Enter your password") } PasswordLineEdit { id: passField width: parent.width onAccepted: { if (acceptingButton.enabled) { acceptingButton.clicked(); } } } Item { id: spacer2 width: 30 height: 30 } Button { id: acceptingButton width: parent.width text: i18n("Log in") enabled: (passField.text && urlField.text && usernameField.text && nameField.text) onClicked: loginForm.accepted() isDefault: true } Item { id: spacer3 width: 30 height: 30 } QQC2.Label { text: i18n("Login Failed"); horizontalAlignment: Text.AlignHCenter width: parent.width color: "#FF0000" font.bold: true visible: rcAccount.loginStatus === DDPClient.LoginFailed } } } diff --git a/src/apps/qml/MainComponent.qml b/src/apps/qml/MainComponent.qml index e6053fee..355a6a07 100644 --- a/src/apps/qml/MainComponent.qml +++ b/src/apps/qml/MainComponent.qml @@ -1,541 +1,541 @@ /* * Copyright 2016 Riccardo Iaconelli * Copyright (C) 2017-2019 Laurent Montel * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ import QtQuick 2.9 import QtQuick.Controls 1.4 import QtQuick.Window 2.2 import QtQuick.Dialogs 1.2 import QtQuick.Layouts 1.1 import QtQuick.Controls 2.5 as QQC2 import KDE.Ruqola.RuqolaUtils 1.0 import KDE.Ruqola.Ruqola 1.0 import KDE.Ruqola.Clipboard 1.0 import KDE.Ruqola.RoomFilterProxyModel 1.0 -import org.kde.kirigami 2.4 as Kirigami +import org.kde.kirigami 2.7 as Kirigami import KDE.Ruqola.DebugCategory 1.0 import KDE.Ruqola.ReceiveTypingNotificationManager 1.0 import KDE.Ruqola.DebugCategory 1.0 Component { id: mainComponent Kirigami.Page { id: mainWidget leftPadding: Kirigami.Units.smallSpacing rightPadding: Kirigami.Units.smallSpacing topPadding: Kirigami.Units.smallSpacing bottomPadding: Kirigami.Units.smallSpacing actions { contextualActions: [ Kirigami.Action { id: editAction iconName: "list-add" text: i18n("Open room"); onTriggered: { searchChannelDialog.initializeAndOpen(); } }, Kirigami.Action { iconName: "edit-symbolic" text: i18n("Edit room"); checkable: true onToggled: { appid.rocketChatAccount.switchEditingMode(checked); } }, Kirigami.Action { text: i18n("Create New Channel") onTriggered: { createNewChannelDialog.encryptedRoomEnabled = appid.rocketChatAccount.encryptedEnabled() createNewChannelDialog.initializeAndOpen() } }, Kirigami.Action { separator: true }, Kirigami.Action { text: i18n("Server Info") onTriggered: { serverinfodialog.rcAccount = appid.rocketChatAccount serverinfodialog.open(); } } ] } header: Column { RowLayout { anchors.left: parent.left anchors.right: parent.right anchors.leftMargin: 2*Kirigami.Units.smallSpacing visible: appid.selectedRoom ToolButton { iconName: "favorite" checkable: true Binding on checked { value: appid.selectedRoom && appid.selectedRoom.favorite } onCheckedChanged: { appid.rocketChatAccount.changeFavorite(appid.selectedRoomID, checked) } } Kirigami.Icon { source: "encrypted" //FIXME height: 22 width: 22 visible: appid.selectedRoom && appid.selectedRoom.encrypted } Kirigami.Heading { text: appid.selectedRoom ? appid.selectedRoom.displayRoomName : "" level: 3 font.bold: true } Item { Layout.fillWidth: true } ToolButton { id: showNotification iconName: "preferences-desktop-notification" onClicked: { notificationsDialog.roomInfo = appid.selectedRoom notificationsDialog.open() } } ToolButton { id: showUsersButton iconName: "system-users" checkable: true } ToolButton { id: searchMessage iconName: "edit-find" onClicked: { searchMessageDialog.roomId = appid.selectedRoomID searchMessageDialog.initializeAndOpen(); } } ToolButton { iconName: "settings-configure" onClicked: menu.open(); QQC2.Menu { id: menu y: parent.height QQC2.MenuItem { text: i18n("Channel Info") onTriggered: { var channelType = appid.selectedRoom.channelType; if (channelType === "c" || channelType === "p") { //Only for debug // if (channelType === "c") { // appid.rocketChatAccount.channelInfo(appid.selectedRoom.rid); // } else { // appid.rocketChatAccount.groupInfo(appid.selectedRoom.rid); // } //For testing channelInfoDialog.roomInfo = appid.selectedRoom channelInfoDialog.initializeAndOpen() } else if (channelType === "d") { privateChannelInfoDialog.roomInfo = appid.selectedRoom privateChannelInfoDialog.initializeAndOpen() } else { console.log(RuqolaDebugCategorySingleton.category,"channel type " + appid.selectedRoom.channelType) } } } //Hide it if direct channel RuqolaMenuSeparator { } QQC2.MenuItem { text: i18n("Mentions") onTriggered: { appid.rocketChatAccount.channelGetAllUserMentions(appid.selectedRoomID); showMentionsInRoomDialog.initializeAndOpen() } } RuqolaMenuSeparator { } QQC2.MenuItem { id: menuVideoChat text: i18n("Video Chat") onTriggered: { appid.rocketChatAccount.createJitsiConfCall(appid.selectedRoomID); } } RuqolaMenuSeparator { id: menuVideoChatSeparator } QQC2.MenuItem { text: i18n("Add User In Room") visible: appid.selectedRoom ? appid.selectedRoom.canBeModify : true onTriggered: { var channelType = appid.selectedRoom.channelType; if (channelType === "c" || channelType === "p") { addUserDialog.roomInfo = appid.selectedRoom addUserDialog.roomId = appid.selectedRoomID addUserDialog.initializeAndOpen() } } } RuqolaMenuSeparator { visible: appid.selectedRoom ? appid.selectedRoom.canBeModify : true } QQC2.MenuItem { text: i18n("Take a Video Message") onTriggered: { takeVideoMessage.open(); } } RuqolaMenuSeparator {} QQC2.MenuItem { text: i18n("Load Recent History") onTriggered: { appid.rocketChatAccount.loadHistory(appid.selectedRoomID); } } RuqolaMenuSeparator { } QQC2.MenuItem { text: i18n("Show Files Attachment In Room") onTriggered: { appid.rocketChatAccount.roomFiles(appid.selectedRoomID, appid.selectedRoom.channelType); showFilesInRoomDialog.initializeAndOpen() } } onAboutToShow: { menuVideoChat.visible = appid.rocketChatAccount.jitsiEnabled() menuVideoChatSeparator.visible = appid.rocketChatAccount.jitsiEnabled() } } } } QQC2.Label { visible: appid.selectedRoom && (appid.selectedRoom.topic !== "") text: appid.selectedRoom ? appid.selectedRoom.topic : "" font.italic: true anchors.right: parent.right anchors.left: parent.left anchors.margins: 2*Kirigami.Units.smallSpacing wrapMode: QQC2.Label.Wrap } QQC2.Label { visible: appid.selectedRoom && (appid.selectedRoom.announcement !== "") text: appid.selectedRoom ? appid.selectedRoom.announcement : "" anchors.right: parent.right anchors.left: parent.left anchors.margins: 2*Kirigami.Units.smallSpacing wrapMode: QQC2.Label.Wrap onLinkActivated: { RuqolaUtils.openUrl(link); } } Rectangle { color: Kirigami.Theme.textColor height:1 anchors.right: parent.right anchors.left: parent.left opacity: .5 visible: appid.selectedRoom } Flow { id: topBarUserList readonly property bool isActive: showUsersButton.checked anchors { left: parent.left right: parent.right margins: Kirigami.Units.smallSpacing } opacity: topBarUserList.isActive ? 1 : 0 Behavior on opacity { NumberAnimation { duration: 650; easing.type: Easing.InOutQuad } } Repeater { model: parent.opacity > 0.5 ? appid.userModel : 0 RowLayout { Kirigami.Icon { source: model.iconstatus //FIXME height: 22 width: 22 } UserMenu { id: userMenu userId: model.userid can_manage_users: appid.selectedRoom.canChangeRoles onKickUser: { appid.rocketChatAccount.kickUser(appid.selectedRoomID, userId, appid.selectedRoom.channelType) } onChangeRole: { appid.rocketChatAccount.changeRoles(appid.selectedRoomID, userId, appid.selectedRoom.channelType, type) } onIgnoreUser: { //TODO } onOpenConversation: { //TODO } onAboutToShow: { hasLeaderRole = appid.selectedRoom.userHasLeaderRole(model.userid) hasModeratorRole = appid.selectedRoom.userHasModeratorRole(model.userid) hasOwnerRole = appid.selectedRoom.userHasOwnerRole(model.userid) } } QQC2.Label { text: model.displayname onLinkActivated: { openDirectChannelDialog.username = link; openDirectChannelDialog.open() } MouseArea { anchors.fill: parent acceptedButtons: Qt.RightButton onClicked: { if (mouse.button === Qt.RightButton) { userMenu.x = mouse.x userMenu.y = mouse.y userMenu.open(); } } } } } } Item { width: parent.width height: topBarUserList.isActive ? 1 : 0 Rectangle { height: parent.height width: height > 0 ? parent.width : 0 anchors.centerIn: parent Behavior on width { NumberAnimation { duration: 650; easing.type: Easing.InOutQuad } } color: Kirigami.Theme.textColor } } } } Clipboard { id: clipboard } ActiveChat { id: activeChat model: appid.messageModel rcAccount: appid.rocketChatAccount roomId: appid.selectedRoomID anchors.fill: parent clip: true QQC2.ScrollBar.vertical: QQC2.ScrollBar { } onEditMessage: { userInputMessage.messageId = messageId; userInputMessage.setOriginalMessage(messageStr) //console.log(RuqolaDebugCategorySingleton.category, "edit! messageId : " + messageId + " messageStr " + messageStr) } onCopyMessage: { clipboard.text = messageStr //console.log(RuqolaDebugCategorySingleton.category, "copy! messageId : " + messageId + " messageStr " + messageStr) } onReplyMessage: { console.log(RuqolaDebugCategorySingleton.category, "Not implemented reply message : " + messageId) } onSetFavoriteMessage: { appid.rocketChatAccount.starMessage(messageId, starred) } onIgnoreUser: { appid.rocketChatAccount.ignoreUser(roomId, userId, ignored) } onOpenChannel: { openChannelDialog.channelName = channel openChannelDialog.open() } onOpenDirectChannel: { openDirectChannelDialog.username = userName; openDirectChannelDialog.open() } onJitsiCallConfActivated: { appid.rocketChatAccount.joinJitsiConfCall(roomId) } onDeleteMessage: { deleteMessageDialog.msgId = messageId deleteMessageDialog.open() } onDownloadAttachment: { downloadFileDialog.fileToSaveUrl = url downloadFileDialog.open() } onDisplayImage: { displayImageDialog.iUrl = imageUrl displayImageDialog.title = title displayImageDialog.isAnimatedImage = isAnimatedImage displayImageDialog.clearScaleAndOpen(); } onDeleteReaction: { appid.rocketChatAccount.reactOnMessage(messageId, emoji, false) } OpenChannelDialog { id: openChannelDialog onOpenChannel: { appid.rocketChatAccount.openChannel(channelName); } } OpenDirectChannelDialog { id: openDirectChannelDialog onOpenDirectChannel: { if (appid.rocketChatAccount.userName !== userName) { appid.rocketChatAccount.openDirectChannel(userName); } } } DeleteMessageDialog { id: deleteMessageDialog onDeleteMessage: { appid.rocketChatAccount.deleteMessage(messageId, appid.selectedRoomID) } } DownloadFileDialog { id: downloadFileDialog onAccepted: { if (fileUrl != "") { console.log(RuqolaDebugCategorySingleton.category, "You chose: " + fileUrl) appid.rocketChatAccount.downloadFile(fileToSaveUrl, fileUrl) } else { console.log(RuqolaDebugCategorySingleton.category, "No file selected"); } } } DisplayImageDialog { id: displayImageDialog } UploadFileDialog { id: uploadFileDialog onUploadFile: { appid.rocketChatAccount.uploadFile(appid.selectedRoomID, description, messageText, filename) } } ShowMentionsInRoomDialog { id: showMentionsInRoomDialog } ShowFilesInRoomDialog { id: showFilesInRoomDialog filesModel: appid.filesModel onDownloadFile: { downloadFileDialog.fileToSaveUrl = file downloadFileDialog.open() } onDeleteFile: { appid.rocketChatAccount.deleteFileMessage(appid.selectedRoomID, fileid, appid.selectedRoom.channelType) } } CreateNewChannelDialog { id: createNewChannelDialog onCreateNewChannel: { rocketChatAccount.createNewChannel(name, readOnly, privateRoom, usernames, encryptedRoom, password, broadcast); } } ServerInfoDialog { id: serverinfodialog } } Keys.onEscapePressed: { appid.rocketChatAccount.clearUnreadMessages(appid.selectedRoomID); } footer: ColumnLayout { anchors.bottom: mainWidget.bottom //anchors.margins: Kirigami.Units.smallSpacing QQC2.Label { id: channelInfo font.bold: true anchors { margins: Kirigami.Units.smallSpacing } Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft //FIXME visible: appid.selectedRoom && ((appid.selectedRoom.readOnly === true && !appid.selectedRoom.canChangeRoles) || (appid.selectedRoom.blocker === true) || (appid.selectedRoom.blocked === true)) text: appid.selectedRoom ? appid.selectedRoom.roomMessageInfo : "" } UserInput { id: userInputMessage rcAccount: appid.rocketChatAccount visible: appid.selectedRoom && (appid.selectedRoom.readOnly === false) && (appid.selectedRoom.blocker === false) && (appid.selectedRoom.blocked === false) messageLineText: rcAccount.getUserCurrentMessage(appid.selectedRoomID) onTextEditing: { rcAccount.textEditing(appid.selectedRoomID, str) appid.userInputMessageText = str; } onClearUnreadMessages: { rcAccount.clearUnreadMessages(appid.selectedRoomID) } onUploadFile: { uploadFileDialog.initializeAndOpen() } } QQC2.Label { id: typingInfo anchors.margins: 2*Kirigami.Units.smallSpacing text: "" } Connections { target: appid.rocketChatAccount.receiveTypingNotificationManager() onNotificationChanged: { //console.log(RuqolaDebugCategorySingleton.category, "Typing in roomId: " + roomId + " str " + notificationStr); if (appid.selectedRoomID === roomId) { typingInfo.text = notificationStr; } } onClearNotification: { typingInfo.text = ""; } } } }// mainWidget Item } diff --git a/src/apps/qml/MessageLine.qml b/src/apps/qml/MessageLine.qml index c1b8116b..ddf3ded6 100644 --- a/src/apps/qml/MessageLine.qml +++ b/src/apps/qml/MessageLine.qml @@ -1,147 +1,147 @@ /* * Copyright 2016 Riccardo Iaconelli * Copyright (C) 2017-2019 Laurent Montel * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ import QtQuick 2.9 import QtQuick.Controls 1.4 import QtQuick.Controls 2.5 as QQC2 import QtQuick.Layouts 1.1 import KDE.Ruqola.RocketChatAccount 1.0 import KDE.Ruqola.InputCompleterModel 1.0 import KDE.Ruqola.DDPClient 1.0 -import org.kde.kirigami 2.4 as Kirigami +import org.kde.kirigami 2.7 as Kirigami ColumnLayout { property alias messageLineText: messageLine.text property string savePreviousMessage readonly property int popupheight: 100 function setOriginalMessage(messageStr) { messageLine.text = messageStr savePreviousMessage = messageStr messageLine.selectAll() } TextField { id: messageLine //TODO add background style. //FIXME add multiline !!! inputMethodHints: Qt.ImhMultiLine Layout.fillWidth: true placeholderText: i18n("Enter message...") onTextChanged: { rcAccount.setInputTextChanged(text, cursorPosition); if (listView.count > 0) { showPopupCompleting() } else { popup.close() } footerItem.textEditing(text) } Keys.onDownPressed: { listView.incrementCurrentIndex() } Keys.onUpPressed: { listView.decrementCurrentIndex() } Keys.onTabPressed: { textSelected(listView.currentItem.myData.completername) } onAccepted: { if (text != "" && rcAccount.loginStatus === DDPClient.LoggedIn && (selectedRoomID !== "")) { if (messageId !== "") { if (text !== savePreviousMessage) { rcAccount.updateMessage(selectedRoomID, messageId, text); } savePreviousMessage = ""; messageId = ""; } else { rcAccount.sendMessage(selectedRoomID, text); } text = ""; } } QQC2.Popup { id: popup x: 0 y: -popupheight padding: 0 width: messageLine.width contentHeight: rect.height visible: listView.count > 0 Rectangle { id: rect anchors.top: popup.top anchors.left: popup.left height: popupheight width: popup.width ListView { id: listView height: popupheight width: parent.width interactive: true clip: true model: rcAccount.inputCompleterModel() delegate: Kirigami.BasicListItem { readonly property variant myData: model icon: model.iconname label: model.displayname onClicked: { listView.currentIndex = model.index textSelected(model.completername) } highlighted: focus && ListView.isCurrentItem } QQC2.ScrollIndicator.vertical: QQC2.ScrollIndicator { } } } } function showPopupCompleting() { if (!popup.visible) { popup.open() listView.currentIndex = 0 } } } function textSelected(completerName) { if (listView.currentItem) { messageLine.text = rcAccount.replaceWord(completerName + " ", messageLine.text, messageLine.cursorPosition) } popup.close() } Keys.onEscapePressed: { if (popup.visible) { popup.close() } else { clearUnreadMessages(); } } } diff --git a/src/apps/qml/PasswordLineEdit.qml b/src/apps/qml/PasswordLineEdit.qml index 43c2f15c..0aa73765 100644 --- a/src/apps/qml/PasswordLineEdit.qml +++ b/src/apps/qml/PasswordLineEdit.qml @@ -1,53 +1,53 @@ /* Copyright (c) 2018-2019 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.0 import QtQuick.Controls 1.3 import QtQuick.Controls 2.5 as QQC2 -import org.kde.kirigami 2.4 as Kirigami +import org.kde.kirigami 2.7 as Kirigami QQC2.TextField { id: passwordLineEdit property bool displayPassword: false selectByMouse: true echoMode: displayPassword ? TextInput.Normal : TextInput.Password inputMethodHints: Qt.ImhHiddenText placeholderText: i18n("Enter Password...") Kirigami.Icon { source: passwordLineEdit.displayPassword ? "visibility": "hint" anchors.right: parent.right anchors.top: parent.top height: parent.height width: parent.height MouseArea { anchors.fill: parent onPressed: { passwordLineEdit.displayPassword = true } onReleased: { passwordLineEdit.displayPassword = false } } } } diff --git a/src/apps/qml/PersonsListView.qml b/src/apps/qml/PersonsListView.qml index e910070e..8da30f29 100644 --- a/src/apps/qml/PersonsListView.qml +++ b/src/apps/qml/PersonsListView.qml @@ -1,79 +1,79 @@ /* Copyright (c) 2018-2019 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.9 import QtQuick.Layouts 1.12 import QtQuick.Controls 2.5 as QQC2 -import org.kde.kirigami 2.4 as Kirigami +import org.kde.kirigami 2.7 as Kirigami QQC2.ScrollView { property QtObject personsModel : undefined contentHeight: authorsColumn.height contentWidth: 300 ColumnLayout { Layout.fillHeight: true Layout.fillWidth: true Layout.topMargin: Kirigami.Units.smallSpacing spacing: Kirigami.Units.largeSpacing Column { id: authorsColumn spacing: Kirigami.Units.largeSpacing height: childrenRect.height Repeater { id: authorList model: personsModel Column { id: authorItem spacing: Kirigami.Units.smallSpacing QQC2.Label { text: "" + model.username + "" wrapMode: QQC2.Label.Wrap horizontalAlignment: Text.AlignHCenter renderType: Text.NativeRendering textFormat: Text.RichText font.bold: true } QQC2.Label { text: "" + model.task + "" wrapMode: QQC2.Label.Wrap renderType: Text.NativeRendering textFormat: Text.RichText } QQC2.Label { text: model.email wrapMode: QQC2.Label.Wrap horizontalAlignment: Text.AlignHCenter renderType: Text.NativeRendering textFormat: Text.RichText onLinkActivated: { aboutDialog.openurl(link); } } } } } } } diff --git a/src/apps/qml/RoomDelegate.qml b/src/apps/qml/RoomDelegate.qml index f1ae3c82..1d449e88 100644 --- a/src/apps/qml/RoomDelegate.qml +++ b/src/apps/qml/RoomDelegate.qml @@ -1,131 +1,131 @@ /* * Copyright 2016 Riccardo Iaconelli * Copyright 2017-2018 Montel Laurent * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ import QtQuick 2.9 -import org.kde.kirigami 2.4 as Kirigami +import org.kde.kirigami 2.7 as Kirigami import QtQuick.Layouts 1.1 import KDE.Ruqola.UsersModel 1.0 import QtQuick.Controls 2.5 as QQC2 Kirigami.BasicListItem { id: root property int d_unread: 0; property int d_userMentions: 0; property string d_name: "roomName"; property bool d_selected: false; property string d_roomID : ""; property string d_type: ""; property bool d_open: false; property bool d_alert: false; property var d_icon property bool d_editingMode: false; signal roomSelected(string roomID) signal leaveRoom(string roomID, string roomType) signal hideRoom(string roomID, string roomType) icon: d_icon topPadding: 0 bottomPadding: 0 implicitHeight: contentItem.implicitHeight separatorVisible: false visible: !d_name.empty && d_open font.bold: (d_unread > 0) || d_alert label: d_name checked: d_selected onClicked: { root.roomSelected(d_roomID); } function generateText() { var str = ""; if (d_userMentions > 0) { str = "@"; } //Add space after (...) str += i18n("(%1)", d_unread) + ' '; return str; } RowLayout { id: editingActions QQC2.Label { id: unreadMessage visible: !d_editingMode && d_unread > 0 height: parent.height width: height font.bold: true //FIX COLOR color: (d_unread != 0) ? "#FF0000" : "#FFFFFF" text: generateText() Layout.alignment: Qt.AlignVCenter | Qt.AlignRight } Kirigami.Icon { id: hideAction visible: d_editingMode source: "hide_table_row" height: parent.height width: height opacity: d_selected ? 1 : .5 MouseArea { anchors.fill: parent hoverEnabled: true onEntered: parent.active = true; onExited: parent.active = false; onClicked: { root.hideRoom(d_roomID, d_type) } } Layout.alignment: Qt.AlignVCenter | Qt.AlignRight } Kirigami.Icon { id: quitAction //We can leave only channel not private chat visible: d_editingMode && (d_type == "c" || d_type == "p") source: "dialog-close" height: parent.height width: height opacity: d_selected ? 1 : .5 MouseArea { anchors.fill: parent hoverEnabled: true onEntered: parent.active = true; onExited: parent.active = false; onClicked: { root.leaveRoom(d_roomID, d_type) } } Layout.alignment: Qt.AlignVCenter | Qt.AlignRight } } } diff --git a/src/apps/qml/RoomsComponent.qml b/src/apps/qml/RoomsComponent.qml index 8d2f09ae..088b45e0 100644 --- a/src/apps/qml/RoomsComponent.qml +++ b/src/apps/qml/RoomsComponent.qml @@ -1,121 +1,121 @@ /* * Copyright 2016 Riccardo Iaconelli * Copyright (C) 2017-2019 Laurent Montel * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ import QtQuick 2.9 import QtQuick.Controls 1.4 import QtQuick.Window 2.2 import QtQuick.Dialogs 1.2 import QtQuick.Layouts 1.1 import QtQuick.Controls 2.5 as QQC2 import KDE.Ruqola.RocketChatAccount 1.0 import KDE.Ruqola.Ruqola 1.0 import KDE.Ruqola.RoomFilterProxyModel 1.0 import KDE.Ruqola.UsersForRoomFilterProxyModel 1.0 -import org.kde.kirigami 2.4 as Kirigami +import org.kde.kirigami 2.7 as Kirigami import KDE.Ruqola.StatusModel 1.0 Component { id: roomsComponent Kirigami.ScrollablePage { id: roomsPage background: Rectangle { color: Kirigami.Theme.backgroundColor } header: Column { ColumnLayout { anchors.left: parent.left anchors.right: parent.right RowLayout { Layout.alignment: Qt.AlignLeft anchors.leftMargin: 2*Kirigami.Units.smallSpacing QQC2.Label { id: comboboxLabel text: i18n("Status:") } QQC2.ComboBox { id: statusCombobox Layout.alignment: Qt.AlignLeft model: appid.rocketChatAccount.statusModel() textRole: "statusi18n" onActivated: { appid.rocketChatAccount.changeDefaultStatus(index) } currentIndex: model.currentStatus delegate: Kirigami.BasicListItem { icon: model.icon label: model.statusi18n } } } QQC2.TextField { id: searchField focus: true Layout.minimumHeight: Layout.maximumHeight Layout.maximumHeight: Kirigami.Units.iconSizes.smallMedium + Kirigami.Units.smallSpacing * 2 Layout.fillWidth: true //width: parent.width placeholderText: i18n("Search room...") onTextChanged: { appid.rocketChatAccount.roomFilterProxyModel().setFilterString(text); //TODO filter list view } } } } mainItem: RoomsView { id: roomsList editingMode: appid.rocketChatAccount.editingMode implicitWidth: Kirigami.Units.gridUnit * 10 anchors.fill: parent model: appid.rocketChatAccount.roomFilterProxyModel() selectedRoomID: appid.selectedRoomID; onHideRoom: { rocketChatAccount.hideRoom(roomID, roomType) } onLeaveRoom: { //TODO move to desktop.qml leaveChannelDialog.rId = roomID leaveChannelDialog.channelType = roomType leaveChannelDialog.open() } onRoomSelected: { if (roomID == selectedRoomID) { return; } appid.rocketChatAccount.switchingToRoom(roomID) appid.rocketChatAccount.setUserCurrentMessage(appid.userInputMessageText, selectedRoomID) appid.selectedRoomID = roomID; appid.messageModel = appid.rocketChatAccount.messageModelForRoom(roomID) appid.selectedRoom = appid.rocketChatAccount.getRoomWrapper(roomID) appid.userModel = appid.rocketChatAccount.usersForRoomFilterProxyModel(roomID) appid.filesModel = appid.rocketChatAccount.filesForRoomFilterProxyModel(roomID) } } //RoomsView } } diff --git a/src/apps/qml/RoomsView.qml b/src/apps/qml/RoomsView.qml index 820b6fe5..b4e23757 100644 --- a/src/apps/qml/RoomsView.qml +++ b/src/apps/qml/RoomsView.qml @@ -1,84 +1,84 @@ /* * Copyright 2016 Riccardo Iaconelli * Copyright (c) 2017-2019 Montel Laurent * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ import QtQuick 2.9 -import org.kde.kirigami 2.4 as Kirigami +import org.kde.kirigami 2.7 as Kirigami import QtQuick.Layouts 1.1 import QtQuick.Controls 2.5 as QQC2 import KDE.Ruqola.RocketChatAccount 1.0 ListView { id: roomsList property string selectedRoomID; property bool editingMode: false; signal leaveRoom(string roomID, string roomType) signal hideRoom(string roomID, string roomType) signal roomSelected(string roomID) section { property: "sectionname" delegate: Kirigami.AbstractListItem { enabled: false RowLayout { anchors { left: parent.left right: parent.right leftMargin: Kirigami.Units.smallSpacing } QQC2.Label { id: sectionLabel text: section Layout.minimumHeight: Math.max(implicitHeight, Kirigami.Units.iconSizes.smallMedium) elide: Text.ElideRight Layout.alignment: Qt.AlignHCenter Component.onCompleted: font.bold = true } } } } delegate: RoomDelegate { d_name: name d_unread: unread d_userMentions: userMentions d_roomID: room_id d_type: type d_open: open d_alert: alert d_selected: selectedRoomID == room_id d_editingMode: editingMode d_icon: channelicon onRoomSelected : { roomsList.roomSelected(roomID) applicationWindow().pageStack.currentIndex = 1; } onHideRoom: { roomsList.hideRoom(roomID, roomType) } onLeaveRoom: { roomsList.leaveRoom(roomID, roomType) } } } diff --git a/src/apps/qml/SearchChannelDialog.qml b/src/apps/qml/SearchChannelDialog.qml index 73aeca86..eed4a642 100644 --- a/src/apps/qml/SearchChannelDialog.qml +++ b/src/apps/qml/SearchChannelDialog.qml @@ -1,97 +1,97 @@ /* Copyright (c) 2018-2019 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.9 import QtQuick.Layouts 1.12 import QtQuick.Controls 2.5 as QQC2 import QtQuick.Window 2.0 import KDE.Ruqola.RocketChatAccount 1.0 import KDE.Ruqola.SearchChannelFilterProxyModel 1.0 -import org.kde.kirigami 2.4 as Kirigami +import org.kde.kirigami 2.7 as Kirigami QQC2.Dialog { id: searchChannelDialog property QtObject searchChannelModel signal searchChannel(string pattern) signal openChannel(string channelname, string channelid, var channeltype) title: i18n("Search Channel") standardButtons: QQC2.Dialog.Close x: parent.width / 2 - width / 2 y: parent.height / 2 - height / 2 modal: true focus: true function initializeAndOpen() { channelnametext.text = ""; open(); } ColumnLayout { QQC2.TextField { id: channelnametext selectByMouse: true focus: true Layout.minimumHeight: Layout.maximumHeight Layout.maximumHeight: Kirigami.Units.iconSizes.smallMedium + Kirigami.Units.smallSpacing * 2 Layout.fillWidth: true placeholderText: i18n("Search Channel...") onAccepted: { searchChannelDialog.searchChannel(channelnametext.text) } } ListView { id: listview width: 300; height: 200 clip: true model: searchChannelModel delegate: RowLayout { Kirigami.Icon { source: "list-add" //FIXME height: 22 width: 22 MouseArea { anchors.fill: parent onClicked: { searchChannelDialog.openChannel(channelname, channelid, channeltype) } } } Kirigami.Icon { source: iconname //FIXME icon size height: 22 width: 22 } QQC2.Label { text: channelname } } } } } diff --git a/src/apps/qml/ShowFilesInRoomDialog.qml b/src/apps/qml/ShowFilesInRoomDialog.qml index 21e3c40b..ece77f50 100644 --- a/src/apps/qml/ShowFilesInRoomDialog.qml +++ b/src/apps/qml/ShowFilesInRoomDialog.qml @@ -1,109 +1,109 @@ /* Copyright (c) 2018-2019 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick.Layouts 1.12 import QtQuick.Controls 2.5 as QQC2 import QtQuick.Window 2.0 import QtQuick 2.9 import KDE.Ruqola.FilesForRoomFilterProxyModel 1.0 -import org.kde.kirigami 2.4 as Kirigami +import org.kde.kirigami 2.7 as Kirigami import "common" QQC2.Dialog { id: showFilesInRoomDialog title: i18n("Show Files In Room") signal downloadFile(string file) signal deleteFile(string fileid) property QtObject filesModel x: parent.width / 2 - width / 2 y: parent.height / 2 - height / 2 modal: true standardButtons: QQC2.Dialog.Close function initializeAndOpen() { searchField.text = ""; open(); } ColumnLayout { QQC2.TextField { id: searchField focus: true selectByMouse: true Layout.minimumHeight: Layout.maximumHeight Layout.maximumHeight: Kirigami.Units.iconSizes.smallMedium + Kirigami.Units.smallSpacing * 2 Layout.fillWidth: true placeholderText: i18n("Search File...") onTextChanged: { filesModel.setFilterString(text); } } QQC2.Label { text: i18np("%1 attachment in room", "%1 attachments in room", listview.count) } //Add scrollview ListView { id: listview width: 400 height: 200 clip: true // Scrollars QQC2.ScrollIndicator.vertical: QQC2.ScrollIndicator { } QQC2.ScrollIndicator.horizontal: QQC2.ScrollIndicator { } model: filesModel delegate: RowLayout { QQC2.Label { Layout.fillWidth: true //TODO improve it text: filename + '\n' + (description !== "" ? description + '\n' : "") + username + '\n' wrapMode: QQC2.Label.Wrap } DownloadButton { onDownloadButtonClicked: { showFilesInRoomDialog.downloadFile(url) } } DeleteButton { visible: canbedeleted onDeleteButtonClicked: { deleteFileAttachmentDialog.fileId = fileid; deleteFileAttachmentDialog.open(); } } } } } DeleteFileAttachmentDialog { id: deleteFileAttachmentDialog onDeleteAttachment: { showFilesInRoomDialog.deleteFile(fileId) } } } diff --git a/src/apps/qml/ShowMentionsInRoomDialog.qml b/src/apps/qml/ShowMentionsInRoomDialog.qml index 428a55bc..ddfe18ad 100644 --- a/src/apps/qml/ShowMentionsInRoomDialog.qml +++ b/src/apps/qml/ShowMentionsInRoomDialog.qml @@ -1,82 +1,82 @@ /* Copyright (c) 2019 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick.Layouts 1.12 import QtQuick.Controls 2.5 as QQC2 import QtQuick.Window 2.0 import QtQuick 2.9 import KDE.Ruqola.UsersForRoomFilterProxyModel 1.0 -import org.kde.kirigami 2.4 as Kirigami +import org.kde.kirigami 2.7 as Kirigami QQC2.Dialog { id: showMentionsInRoomDialog title: i18n("Mentions") signal searchMessage(string pattern, string rid) property QtObject mentionsModel property string roomId x: parent.width / 2 - width / 2 y: parent.height / 2 - height / 2 modal: true focus: true standardButtons: QQC2.Dialog.Close function initializeAndOpen() { searchField.text = ""; open(); } //Add menu here ColumnLayout { QQC2.TextField { id: searchField focus: true selectByMouse: true Layout.minimumHeight: Layout.maximumHeight Layout.maximumHeight: Kirigami.Units.iconSizes.smallMedium + Kirigami.Units.smallSpacing * 2 Layout.fillWidth: true placeholderText: i18n("Search Mentions...") //onAccepted: or onTextChanged: ???? onAccepted: { showMentionsInRoomDialog.searchMessage(text, roomId) } } ListView { id: listview width: 400; height: 200 clip: true // Scrollars QQC2.ScrollIndicator.vertical: QQC2.ScrollIndicator { } QQC2.ScrollIndicator.horizontal: QQC2.ScrollIndicator { } model: mentionsModel delegate: Kirigami.BasicListItem { label: messagetext reserveSpaceForIcon: false } } } } diff --git a/src/apps/qml/ShowSearchMessageDialog.qml b/src/apps/qml/ShowSearchMessageDialog.qml index e2039416..d325edc7 100644 --- a/src/apps/qml/ShowSearchMessageDialog.qml +++ b/src/apps/qml/ShowSearchMessageDialog.qml @@ -1,82 +1,82 @@ /* Copyright (c) 2018-2019 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick.Layouts 1.12 import QtQuick.Controls 2.5 as QQC2 import QtQuick.Window 2.0 import QtQuick 2.9 import KDE.Ruqola.UsersForRoomFilterProxyModel 1.0 -import org.kde.kirigami 2.4 as Kirigami +import org.kde.kirigami 2.7 as Kirigami QQC2.Dialog { id: showSearchMessageDialog title: i18n("Search Message") signal searchMessage(string pattern, string rid) property QtObject searchMessageModel property string roomId x: parent.width / 2 - width / 2 y: parent.height / 2 - height / 2 modal: true focus: true standardButtons: QQC2.Dialog.Close function initializeAndOpen() { searchField.text = ""; open(); } ColumnLayout { QQC2.TextField { id: searchField focus: true selectByMouse: true Layout.minimumHeight: Layout.maximumHeight Layout.maximumHeight: Kirigami.Units.iconSizes.smallMedium + Kirigami.Units.smallSpacing * 2 Layout.fillWidth: true placeholderText: i18n("Search Word...") //onAccepted: or onTextChanged: ???? onAccepted: { showSearchMessageDialog.searchMessage(text, roomId) } } ListView { id: listview width: 400; height: 200 clip: true // Scrollars QQC2.ScrollIndicator.vertical: QQC2.ScrollIndicator { } QQC2.ScrollIndicator.horizontal: QQC2.ScrollIndicator { } model: searchMessageModel delegate: Kirigami.BasicListItem { label: messagetext reserveSpaceForIcon: false } } } } diff --git a/src/apps/qml/TextFieldEditor.qml b/src/apps/qml/TextFieldEditor.qml index 23afa9b1..2d6f3836 100644 --- a/src/apps/qml/TextFieldEditor.qml +++ b/src/apps/qml/TextFieldEditor.qml @@ -1,74 +1,74 @@ /* Copyright (c) 2017-2019 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.9 import QtQuick.Layouts 1.12 import QtQuick.Controls 2.5 as QQC2 import QtQuick.Window 2.0 -import org.kde.kirigami 2.4 as Kirigami +import org.kde.kirigami 2.7 as Kirigami RowLayout { id: textFieldEditor signal updateValue(string newVal) property alias textField: channelNameField.text function setReadOnly(ro) { channelNameField.readOnly = ro; channelIcon.visible = !ro; } function clear() { channelNameField.clear() } QQC2.TextField { id: channelNameField selectByMouse: true onAccepted: { if (enabled) { textFieldEditor.updateValue(text) } } onFocusChanged: { if (enabled) { textFieldEditor.updateValue(channelNameField.text) } } } Kirigami.Icon { id: channelIcon source: "document-edit" width: 24 height: 24 MouseArea { anchors.fill: parent onClicked: { //TODO change edit mode //TODO change icon //TODO change setEnable //Add escape for cancel it. } } } } diff --git a/src/apps/qml/UploadFileDialog.qml b/src/apps/qml/UploadFileDialog.qml index b65adc7d..4c75207d 100644 --- a/src/apps/qml/UploadFileDialog.qml +++ b/src/apps/qml/UploadFileDialog.qml @@ -1,101 +1,101 @@ /* Copyright (c) 2018-2019 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick.Layouts 1.12 import QtQuick.Controls 2.5 as QQC2 import QtQuick.Window 2.0 import QtQuick 2.9 -import org.kde.kirigami 2.4 as Kirigami +import org.kde.kirigami 2.7 as Kirigami import QtQuick.Dialogs 1.2 QQC2.Dialog { id: uploadFileDialog title: i18n("Upload File") property string rId: "" x: parent.width / 2 - width / 2 y: parent.height / 2 - height / 2 modal: true focus: true signal uploadFile(string description, string messageText, url filename) standardButtons: QQC2.Dialog.Ok | QQC2.Dialog.Cancel function initializeAndOpen() { description.text = ""; message.text = ""; selectedFileNameField.text = ""; open(); } ColumnLayout { QQC2.TextField { id: description selectByMouse: true placeholderText: i18n("Description") } QQC2.TextField { id: message selectByMouse: true placeholderText: i18n("Message") } RowLayout { QQC2.TextField { id: selectedFileNameField selectByMouse: true placeholderText: i18n("Select File...") } Kirigami.Icon { source: "folder" width: 24 height: 24 MouseArea { anchors.fill: parent onClicked: { selectFileDialog.open() } } } } FileDialog { id: selectFileDialog title: i18n("Please choose a file") folder: shortcuts.documents selectFolder: false selectMultiple: false selectExisting: true onAccepted: { selectedFileNameField.text = fileUrl } } } onAccepted: { if (selectedFileNameField.text != "") { uploadFileDialog.uploadFile(description.text, message.text, selectedFileNameField.text) } } } diff --git a/src/apps/qml/UserInput.qml b/src/apps/qml/UserInput.qml index 97ef74e7..a85b6dd0 100644 --- a/src/apps/qml/UserInput.qml +++ b/src/apps/qml/UserInput.qml @@ -1,77 +1,77 @@ /* * Copyright 2016 Riccardo Iaconelli * Copyright (c) 2017-2019 Montel Laurent * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ import QtQuick 2.9 import QtQuick.Controls 1.4 import QtQuick.Layouts 1.1 import KDE.Ruqola.RocketChatAccount 1.0 -import org.kde.kirigami 2.4 as Kirigami +import org.kde.kirigami 2.7 as Kirigami RowLayout { id: footerItem property QtObject rcAccount property alias messageLineText: messageLine.messageLineText property string messageId signal textEditing(string str) signal uploadFile() signal clearUnreadMessages() height: 2*Kirigami.Units.largeSpacing function setOriginalMessage(messageStr) { messageLine.setOriginalMessage(messageStr) } Kirigami.Icon { id: attachment enabled: selectedRoomID !== "" source: "document-send-symbolic" width: height height: messageLine.height MouseArea { anchors.fill: parent onClicked: { footerItem.uploadFile() } } } MessageLine { id: messageLine } Kirigami.Icon { source: "mail-sent" width: height height: messageLine.height MouseArea { anchors.fill: parent onClicked: { messageLine.accepted() } } } } diff --git a/src/apps/qml/UserMenu.qml b/src/apps/qml/UserMenu.qml index d3202eca..a63e394e 100644 --- a/src/apps/qml/UserMenu.qml +++ b/src/apps/qml/UserMenu.qml @@ -1,130 +1,130 @@ /* Copyright (c) 2019 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.9 -import org.kde.kirigami 2.4 as Kirigami +import org.kde.kirigami 2.7 as Kirigami import QtQuick.Controls 2.5 as QQC2 import QtQuick.Layouts 1.1 import KDE.Ruqola.DebugCategory 1.0 import KDE.Ruqola.RocketChatAccount 1.0 QQC2.Menu { id: menu property bool can_manage_users: true property string userId property bool hasOwnerRole: true property bool hasModeratorRole: true property bool hasLeaderRole: true property bool userIsIgnored: false signal ignoreUser(string userId, bool ignore) signal kickUser(string userId) signal changeRole(string userId, int type) signal openConversation(string userId) //Hide it if direct channel function updateIgnoreMenuItemText() { return userIsIgnored ? i18n("Unignore") : i18n("Ignore") } function updateOwnerMenuItemText() { return hasOwnerRole ? i18n("Remove as Owner") : i18n("Add as Owner") } function updateLeaderMenuItemText() { return hasLeaderRole ? i18n("Remove as Leader") : i18n("Add as Leader") } function updateModeratorMenuItemText() { return hasModeratorRole ? i18n("Remove as Moderator") : i18n("Add as Moderator") } QQC2.MenuItem { id: conversationItem contentItem: QQC2.Label { text: i18n("Conversation") } onTriggered: { menu.openConversation(userId) } } QQC2.MenuItem { id: removeAsOwnerItem visible: can_manage_users contentItem: QQC2.Label { text: updateOwnerMenuItemText() } onTriggered: { menu.changeRole(userId, hasOwnerRole ? RocketChatAccount.RemoveOwner : RocketChatAccount.AddOwner); } } QQC2.MenuItem { id: removeAsLeaderItem visible: can_manage_users contentItem: QQC2.Label { text: updateLeaderMenuItemText() } onTriggered: { menu.changeRole(userId, hasLeaderRole ? RocketChatAccount.RemoveLeader : RocketChatAccount.AddLeader); } } QQC2.MenuItem { id: removeAsModeratorItem visible: can_manage_users contentItem: QQC2.Label { text: updateModeratorMenuItemText() } onTriggered: { menu.changeRole(userId, hasModeratorRole ? RocketChatAccount.RemoveModerator : RocketChatAccount.AddModerator); } } QQC2.MenuItem { id: ignoreItem contentItem: QQC2.Label { text: updateIgnoreMenuItemText(); } onTriggered: { menu.ignoreUser(userId, !userIsIgnored) } } RuqolaMenuSeparator { visible: can_manage_users } QQC2.MenuItem { id: kickItem visible: can_manage_users contentItem: QQC2.Label { text: i18n("Remove from Room") } onTriggered: { menu.kickUser(userId) } } onAboutToShow: { ignoreItem.text = updateIgnoreMenuItemText(); removeAsOwnerItem.text = updateOwnerMenuItemText(); removeAsLeaderItem.text = updateLeaderMenuItemText(); removeAsModeratorItem.text = updateModeratorMenuItemText(); } } diff --git a/src/apps/qml/common/AvatarImage.qml b/src/apps/qml/common/AvatarImage.qml index a152d004..9539380c 100644 --- a/src/apps/qml/common/AvatarImage.qml +++ b/src/apps/qml/common/AvatarImage.qml @@ -1,106 +1,106 @@ /* * Copyright (C) 2017-2019 Laurent Montel * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ import QtQuick 2.9 import QtQuick.Controls 2.5 as QQC2 -import org.kde.kirigami 2.4 as Kirigami +import org.kde.kirigami 2.7 as Kirigami import QtQuick.Layouts 1.1 import "../js/message.js" as MessageScript; import QtQuick.Window 2.2 import KDE.Ruqola.RocketChatAccount 1.0 import KDE.Ruqola.DebugCategory 1.0 Rectangle { id: avatarRect property string avatarurl property string aliasname property string username signal showUserInfo() Layout.alignment: Qt.AlignTop | Qt.AlignCenter Layout.fillHeight: false //Customize it. implicitWidth: /*textLabel.font.pixelSize * 3*/ 12 * 3 implicitHeight: /*textLabel.font.pixelSize * 3*/ 12 * 3 radius: 3 anchors.rightMargin: 2*Kirigami.Units.smallSpacing color: avatarurl !== "" ? "transparent" : MessageScript.stringToColour(username) Image { id: avatarImage anchors.fill: parent visible: avatarurl !== "" source: avatarurl fillMode: Image.PreserveAspectFit MouseArea { anchors.fill: parent onClicked: { console.log(RuqolaDebugCategorySingleton.category, "Clicked"); avatarRect.showUserInfo(); } } } QQC2.Label { id: avatarText visible: avatarurl == "" anchors.fill: parent anchors.margins: Kirigami.Units.smallSpacing renderType: Text.QtRendering color: "white" font.weight: Font.Bold font.pointSize: 100 fontSizeMode: Text.Fit horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter text: { //TODO verify if it works with non latin char. if (aliasname.length > 0) { var match = aliasname.match(/([a-zA-Z0-9])([a-zA-Z0-9])/); var abbrev = match[1].toUpperCase(); if (match.length > 2) { abbrev += match[2].toLowerCase(); } return abbrev; } return ""; } } Connections { target: appid.rocketChatAccount onFileDownloaded: { if (filePath === "/avatar/" + username) { avatarurl = cacheImageUrl } } } } diff --git a/src/apps/qml/common/DeleteButton.qml b/src/apps/qml/common/DeleteButton.qml index f533ae71..98a55473 100644 --- a/src/apps/qml/common/DeleteButton.qml +++ b/src/apps/qml/common/DeleteButton.qml @@ -1,42 +1,42 @@ /* * Copyright (C) 2018-2019 Laurent Montel * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ import QtQuick 2.9 import QtQuick.Layouts 1.1 -import org.kde.kirigami 2.4 as Kirigami +import org.kde.kirigami 2.7 as Kirigami Kirigami.Icon { id: deleteButton source: "edit-delete-shred" signal deleteButtonClicked() //TODO customize size. Avoid to hardcode it. width: 24 height: 24 MouseArea { anchors.fill: parent onClicked: { deleteButton.deleteButtonClicked(); } } } diff --git a/src/apps/qml/common/DownloadButton.qml b/src/apps/qml/common/DownloadButton.qml index 959f7d81..efb1fe24 100644 --- a/src/apps/qml/common/DownloadButton.qml +++ b/src/apps/qml/common/DownloadButton.qml @@ -1,41 +1,41 @@ /* * Copyright (C) 2017-2019 Laurent Montel * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ import QtQuick 2.9 import QtQuick.Layouts 1.1 -import org.kde.kirigami 2.4 as Kirigami +import org.kde.kirigami 2.7 as Kirigami Kirigami.Icon { id: download source: "cloud-download" signal downloadButtonClicked() //TODO customize size. Avoid to hardcode it. width: 24 height: 24 MouseArea { anchors.fill: parent onClicked: { download.downloadButtonClicked(); } } } diff --git a/src/apps/qml/messages/AttachmentMessageAudio.qml b/src/apps/qml/messages/AttachmentMessageAudio.qml index 48b58ecd..ccf56190 100644 --- a/src/apps/qml/messages/AttachmentMessageAudio.qml +++ b/src/apps/qml/messages/AttachmentMessageAudio.qml @@ -1,159 +1,159 @@ /* Copyright (c) 2017-2019 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.9 import QtMultimedia 5.8 import QtQuick.Controls 2.5 as QQC2 -import org.kde.kirigami 2.4 as Kirigami +import org.kde.kirigami 2.7 as Kirigami import QtQuick.Layouts 1.1 import KDE.Ruqola.DebugCategory 1.0 import "../js/convert.js" as ConvertScript; import "../common" MessageBase { id: attachmentAudio RowLayout { AvatarImage { id: avatarRect avatarurl: i_avatar aliasname: i_aliasname username: i_username } Repeater { id: repearterAttachments model: i_attachments MediaPlayer { id: audioPlayer autoPlay: false onPaused: { playerButton.source = "media-playback-start" } onPlaying: { playerButton.source = "media-playback-pause" } onStopped: { playerButton.source = "media-playback-start" playerSlider.value=0 } onPositionChanged: { playerSlider.sync = true playerSlider.value = audioPlayer.position / audioPlayer.duration playerSlider.sync = false timeLabel.text = ConvertScript.convertTimeString(audioPlayer.position) + "/" + ConvertScript.convertTimeString(audioPlayer.duration) } source: rcAccount.attachmentUrl(model.modelData.link) } ColumnLayout { Layout.fillWidth: true QQC2.Label { //TODO remove duplicate code text: model.modelData.title === "" ? "" : i18n("File Uploaded: %1", model.modelData.title) visible: model.modelData.title !== "" wrapMode: QQC2.Label.Wrap anchors.leftMargin: Kirigami.Units.smallSpacing anchors.rightMargin: Kirigami.Units.smallSpacing } RowLayout { Kirigami.Icon { id: playerButton source: "media-playback-start" width: 24 height: 24 MouseArea { anchors.fill: parent onClicked: { console.log(RuqolaDebugCategorySingleton.category, "Click on download audio file"); if (repearterAttachments.audioPlayer.source !== "") { if (repearterAttachments.audioPlayer.playbackState === MediaPlayer.PlayingState) { repearterAttachments.audioPlayer.pause() playerButton.source = "media-playback-start" } else { repearterAttachments.audioPlayer.play() playerButton.source = "media-playback-pause" } } else { console.log(RuqolaDebugCategorySingleton.category, "Audio file no found"); } } } } QQC2.Slider { id: playerSlider Layout.fillWidth: true property bool sync: false onValueChanged: { if (!sync) { audioPlayer.seek(value * audioPlayer.duration) } } } QQC2.Label { id: timeLabel //TODO display real value text: "00:00/00:00" } DownloadButton { id: download onDownloadButtonClicked: { messageMain.downloadAttachment(model.modelData.link) } } } QQC2.Label { text: model.modelData.description visible: model.modelData.description !== "" wrapMode: QQC2.Label.Wrap anchors.leftMargin: Kirigami.Units.smallSpacing anchors.rightMargin: Kirigami.Units.smallSpacing } } } RowLayout { RepeaterReactions { id: repearterReactions model: i_reactions onDeleteReaction: { attachmentAudio.deleteReaction(i_messageID, emoji) } } } TimestampText { id: timestampText timestamp: i_timestamp } } } diff --git a/src/apps/qml/messages/AttachmentMessageImage.qml b/src/apps/qml/messages/AttachmentMessageImage.qml index a11cd42a..a755c734 100644 --- a/src/apps/qml/messages/AttachmentMessageImage.qml +++ b/src/apps/qml/messages/AttachmentMessageImage.qml @@ -1,200 +1,200 @@ /* Copyright (c) 2017-2019 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.9 import QtQuick.Controls 2.5 as QQC2 -import org.kde.kirigami 2.4 as Kirigami +import org.kde.kirigami 2.7 as Kirigami import KDE.Ruqola.DebugCategory 1.0 import QtQuick.Layouts 1.1 import "../common" MessageBase { id: messageMain MessageMenu { id: menu can_editing_message: i_can_editing_message starred: i_starred pinned_message: i_pinned } RowLayout { AvatarImage { id: avatarRect avatarurl: i_avatar aliasname: i_aliasname username: i_username } ColumnLayout { Repeater { id: repearterAttachments model: i_attachments Row { Column { QQC2.Label { id: imageTitle text: model.modelData.title === "" ? "" : model.modelData.imageTitle visible: model.modelData.title !== "" wrapMode: QQC2.Label.Wrap anchors.leftMargin: Kirigami.Units.smallSpacing anchors.rightMargin: Kirigami.Units.smallSpacing renderType: Text.NativeRendering textFormat: Text.RichText onLinkActivated: { messageMain.displayImage(imageUrl.source, model.modelData.title, model.modelData.isAnimatedImage) } MouseArea { anchors.fill: parent acceptedButtons: Qt.RightButton onClicked: { if (mouse.button === Qt.RightButton) { menu.x = mouse.x menu.y = mouse.y menu.open(); } } } } Image { id: imageUrl visible: model.modelData.isAnimatedImage readonly property int imageHeight: model.modelData.imageHeight === -1 ? 200 : model.modelData.imageHeight source: rcAccount.attachmentUrl(model.modelData.link) asynchronous: true fillMode: Image.PreserveAspectFit //TODO customize it. width: model.modelData.imageWidth === -1 ? 200 : model.modelData.imageWidth height: 0 sourceSize.width: 200 sourceSize.height: 200 onStatusChanged: { if(status == Image.Error){ console.log(RuqolaDebugCategorySingleton.category, "Image load error! Trying to reload. " + source) } } MouseArea { anchors.fill: parent onClicked: { if(status === Image.Error) { console.log(RuqolaDebugCategorySingleton.category, "Image not loaded."); } else { messageMain.displayImage(imageUrl.source, imageTitle.text, model.modelData.isAnimatedImage) } } } } AnimatedImage { id: imageAnimatedUrl visible: model.modelData.isAnimatedImage readonly property int imageHeight: model.modelData.imageHeight === -1 ? 200 : model.modelData.imageHeight source: rcAccount.attachmentUrl(model.modelData.link) asynchronous: true fillMode: Image.PreserveAspectFit width: model.modelData.imageWidth === -1 ? 200 : model.modelData.imageWidth height: 0 //sourceSize.width: 200 //sourceSize.height: 200 onStatusChanged: { if(status == Image.Error){ console.log(RuqolaDebugCategorySingleton.category, "Image load error! Trying to reload. " + source) } } MouseArea { anchors.fill: parent onClicked: { if(status === Image.Error) { console.log(RuqolaDebugCategorySingleton.category, "Image not loaded."); } else { messageMain.displayImage(imageAnimatedUrl.source, imageTitle.text, model.modelData.isAnimatedImage) } } } } QQC2.Label { text: model.modelData.description wrapMode: QQC2.Label.Wrap anchors.leftMargin: Kirigami.Units.smallSpacing anchors.rightMargin: Kirigami.Units.smallSpacing visible: model.modelData.description !== "" MouseArea { anchors.fill: parent acceptedButtons: Qt.RightButton onClicked: { if (mouse.button === Qt.RightButton) { menu.x = mouse.x menu.y = mouse.y menu.open(); } } } } } ShowHideButton { targetAnimation: model.modelData.isAnimatedImage ? imageAnimatedUrl : imageUrl defaultHeight: model.modelData.isAnimatedImage ? imageAnimatedUrl.imageHeight : Url.imageHeight } DownloadButton { id: download onDownloadButtonClicked: { messageMain.downloadAttachment(model.modelData.link) } } Connections { target: rcAccount onFileDownloaded: { //console.log(RuqolaDebugCategorySingleton.category, " IMAGE SUPPORT: " + filePath + " cacheImageUrl :" + cacheImageUrl + " model.modelData.link: " + model.modelData.link) if (filePath === model.modelData.link) { console.log(RuqolaDebugCategorySingleton.category, "Image updated: " + cacheImageUrl) imageUrl.source = cacheImageUrl; imageAnimatedUrl.source = cacheImageUrl; } } } } } RowLayout { RepeaterReactions { id: repearterReactions model: i_reactions onDeleteReaction: { messageMain.deleteReaction(i_messageID, emoji) } } } } Item { Layout.fillWidth: true } TimestampText { id: timestampText timestamp: i_timestamp } } } diff --git a/src/apps/qml/messages/AttachmentMessageVideo.qml b/src/apps/qml/messages/AttachmentMessageVideo.qml index cc6aefb8..a86d25d3 100644 --- a/src/apps/qml/messages/AttachmentMessageVideo.qml +++ b/src/apps/qml/messages/AttachmentMessageVideo.qml @@ -1,176 +1,176 @@ /* Copyright (c) 2017-2019 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.9 import QtQuick.Controls 2.5 as QQC2 -import org.kde.kirigami 2.4 as Kirigami +import org.kde.kirigami 2.7 as Kirigami import QtMultimedia 5.8 import QtQuick.Layouts 1.1 import "../js/convert.js" as ConvertScript; import "../common" import KDE.Ruqola.DebugCategory 1.0 MessageBase { id: attachmentVideo MediaPlayer { id: videoPlayer autoPlay: false //It doesn't work. Perhaps we need to remove it function preview() { if (status === MediaPlayer.Loaded && playbackState === MediaPlayer.StoppedState) { seek(duration/2) } } onStatusChanged: { preview(); } onPlaybackStateChanged: { preview(); } } RowLayout { AvatarImage { id: avatarRect avatarurl: i_avatar aliasname: i_aliasname username: i_username } Repeater { id: repearterAttachments model: i_attachments RowLayout { ColumnLayout { Layout.fillWidth: true QQC2.Label { //TODO remove duplicate code text: model.modelData.title === "" ? "" : i18n("File Uploaded: %1", model.modelData.title) visible: model.modelData.title !== "" wrapMode: QQC2.Label.Wrap anchors.leftMargin: Kirigami.Units.smallSpacing anchors.rightMargin: Kirigami.Units.smallSpacing } VideoOutput { id: videoOutput property int videoHeight: 100 Layout.fillWidth: true source: videoPlayer width: 100 height: 0 } RowLayout { //Add video media Kirigami.Icon { id: playerButton source: "media-playback-start" width: 24 height: 24 MouseArea { anchors.fill: parent readonly property url link: rcAccount.attachmentUrl(model.modelData.link) onLinkChanged: { videoPlayer.source = link } onClicked: { console.log(RuqolaDebugCategorySingleton.category, "Click on video file!"); if (videoPlayer.playbackState === MediaPlayer.PlayingState) { videoPlayer.pause() playerButton.source = "media-playback-start" } else { videoPlayer.play() playerButton.source = "media-playback-pause" } //TODO stop ? if (videoPlayer.error !== MediaPlayer.NoError) { console.log(RuqolaDebugCategorySingleton.category, "Video file no found"); } } } } QQC2.Slider { id: playerSlider enabled: videoPlayer.playbackState === MediaPlayer.PlayingState Layout.fillWidth: true from: 0 to: videoPlayer.duration value: videoPlayer.position onMoved: { videoPlayer.seek(value) } } QQC2.Label { id: timeLabel text: ConvertScript.convertTimeString(playerSlider.value) + "/" + ConvertScript.convertTimeString(playerSlider.to)//"00:00/00:00" } DownloadButton { id: download onDownloadButtonClicked: { messageMain.downloadAttachment(videoPlayer.source) } } ShowHideButton { targetAnimation: videoOutput defaultHeight: videoOutput.videoHeight } } QQC2.Label { text: model.modelData.description visible: model.modelData.description !== "" wrapMode: QQC2.Label.Wrap anchors.leftMargin: Kirigami.Units.smallSpacing anchors.rightMargin: Kirigami.Units.smallSpacing } } } } RowLayout { RepeaterReactions { id: repearterReactions model: i_reactions onDeleteReaction: { attachmentVideo.deleteReaction(i_messageID, emoji) } } } TimestampText { id: timestampText timestamp: i_timestamp } } } diff --git a/src/apps/qml/messages/JitsiVideoMessage.qml b/src/apps/qml/messages/JitsiVideoMessage.qml index 34d1b14f..1dc89c7b 100644 --- a/src/apps/qml/messages/JitsiVideoMessage.qml +++ b/src/apps/qml/messages/JitsiVideoMessage.qml @@ -1,89 +1,89 @@ /* * Copyright (C) 2017-2019 Laurent Montel * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ import QtQuick 2.9 import QtQuick.Controls 2.5 as QQC2 -import org.kde.kirigami 2.4 as Kirigami +import org.kde.kirigami 2.7 as Kirigami import QtQuick.Layouts 1.1 import KDE.Ruqola.ExtraColors 1.0 import "../js/message.js" as MessageScript; import "../common" MessageBase { id: messageMain RowLayout { AvatarImage { id: avatarRect avatarurl: i_avatar aliasname: i_aliasname username: i_username } Item { Layout.fillWidth: true } Rectangle { Layout.alignment: Qt.AlignCenter width: textLabel.implicitWidth + 6*Kirigami.Units.smallSpacing height: textLabel.height color: Kirigami.Theme.disabledTextColor radius: 4*Kirigami.Units.smallSpacing QQC2.Label { id: textLabel color: Kirigami.Theme.textColor opacity: 1 anchors.centerIn: parent anchors.leftMargin: Kirigami.Units.smallSpacing anchors.rightMargin: Kirigami.Units.smallSpacing width: Math.min(implicitWidth, parent.width - Kirigami.Units.largeSpacing) text: i18n("Click To Join to Video") wrapMode: QQC2.Label.Wrap renderType: Text.NativeRendering MouseArea { anchors.fill: parent onClicked: { messageMain.jitsiCallConfActivated() } } } } Item { Layout.fillWidth: true } TimestampText { id: timestampText timestamp: i_timestamp } } } diff --git a/src/apps/qml/messages/MessageMenu.qml b/src/apps/qml/messages/MessageMenu.qml index 3afd146c..c2975220 100644 --- a/src/apps/qml/messages/MessageMenu.qml +++ b/src/apps/qml/messages/MessageMenu.qml @@ -1,136 +1,136 @@ /* Copyright (c) 2017-2019 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.9 -import org.kde.kirigami 2.4 as Kirigami +import org.kde.kirigami 2.7 as Kirigami import QtQuick.Controls 2.5 as QQC2 import QtQuick.Layouts 1.1 import KDE.Ruqola.DebugCategory 1.0 QQC2.Menu { id: menu property bool can_editing_message property bool user_ignored property bool starred property bool pinned_message function updateFavoriteLabelText() { return (starred === true) ? i18n("Remove as Favorite") : i18n("Set as Favorite") } function updateIgnoreLabelText() { return (user_ignored === true) ? i18n("Unignore") : i18n("Ignore") } function updatePinnedMessageLabelText() { return (pinned_message === true) ? i18n("Unpin Message") : i18n("Pin Message") } QQC2.MenuItem { id: copyMessageItem contentItem: QQC2.Label { text: i18n("Copy") } onTriggered: { messageMain.copyMessage(i_messageID, i_originalMessage); console.log(RuqolaDebugCategorySingleton.category, "Copy", i_messageID, i_originalMessage); } } QQC2.MenuItem { id: editMessageItem contentItem: QQC2.Label { text: i18n("Edit") } onTriggered: { messageMain.editMessage(i_messageID, i_originalMessage); console.log(RuqolaDebugCategorySingleton.category, "Edit", i_messageID, i_originalMessage); console.log(RuqolaDebugCategorySingleton.category, "User", i_own_username, i_username); } } QQC2.MenuItem { contentItem: QQC2.Label { text: i18n("Reply") } onTriggered: { console.log(RuqolaDebugCategorySingleton.category, "Reply to", i_messageID); messageMain.replyMessage(i_messageID); } } QQC2.MenuItem { id: starredMessageItem contentItem: QQC2.Label { id: favoriteLabel text: updateFavoriteLabelText() } onTriggered: { console.log(RuqolaDebugCategorySingleton.category, "Set as favorite", i_messageID); messageMain.setFavoriteMessage(i_messageID, !starred); } } QQC2.MenuItem { id: pinnedMessageItem contentItem: QQC2.Label { id: pinnedMessageLabel text: updatePinnedMessageLabelText() } onTriggered: { messageMain.pinMessage(i_messageID, !pinned_message); } } QQC2.MenuItem { id: deleteMessageItem visible: i_username === i_own_username && rcAccount.allowMessageDeletingEnabled() contentItem: QQC2.Label { text: i18n("Delete") } onTriggered: { messageMain.deleteMessage(i_messageID); } } QQC2.MenuItem { contentItem: QQC2.Label { id: ignoreLabel text: updateIgnoreLabelText() } onTriggered: { console.log(RuqolaDebugCategorySingleton.category, "Ignore", i_messageID); messageMain.ignoreUser(!user_ignored); } } onAboutToShow: { starredMessageItem.visible = rcAccount.allowMessageStarringEnabled() if (starredMessageItem.visible) { favoriteLabel.text = updateFavoriteLabelText() } pinnedMessageItem.visible = rcAccount.allowMessagePinningEnabled() if (pinnedMessageItem.visible) { pinnedMessageLabel.text = updatePinnedMessageLabelText(); } editMessageItem.visible = (i_username === i_own_username) && rcAccount.allowEditingMessages() && can_editing_message ignoreLabel.text = updateIgnoreLabelText() } } diff --git a/src/apps/qml/messages/RepeaterReactions.qml b/src/apps/qml/messages/RepeaterReactions.qml index bd09a73f..0fb0008e 100644 --- a/src/apps/qml/messages/RepeaterReactions.qml +++ b/src/apps/qml/messages/RepeaterReactions.qml @@ -1,49 +1,49 @@ /* * Copyright (C) 2018-2019 Laurent Montel * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ import QtQuick 2.9 -import org.kde.kirigami 2.4 as Kirigami +import org.kde.kirigami 2.7 as Kirigami import QtQuick.Controls 2.5 as QQC2 import QtQuick.Layouts 1.1 Repeater { id: repearterReactions signal deleteReaction(string emoji) Row { QQC2.Label { id: numberOfReact renderType: Text.NativeRendering textFormat: Text.RichText text: model.modelData.convertedReactionName wrapMode: QQC2.Label.Wrap anchors.leftMargin: Kirigami.Units.smallSpacing anchors.rightMargin: Kirigami.Units.smallSpacing MouseArea { anchors.fill: parent acceptedButtons: Qt.RightButton | Qt.LeftButton onClicked: { repearterReactions.deleteReaction(model.modelData.reactionName); } } } } } diff --git a/src/apps/qml/messages/RepeaterRoles.qml b/src/apps/qml/messages/RepeaterRoles.qml index b4a171d1..e791aa1d 100644 --- a/src/apps/qml/messages/RepeaterRoles.qml +++ b/src/apps/qml/messages/RepeaterRoles.qml @@ -1,43 +1,43 @@ /* * Copyright (C) 2018-2019 Laurent Montel * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ import QtQuick 2.9 -import org.kde.kirigami 2.4 as Kirigami +import org.kde.kirigami 2.7 as Kirigami import QtQuick.Controls 2.5 as QQC2 import QtQuick.Layouts 1.1 Repeater { id: repearterRoles Row { QQC2.Label { id: numberOfReact renderType: Text.NativeRendering textFormat: Text.RichText text: model.modelData wrapMode: QQC2.Label.Wrap anchors.leftMargin: Kirigami.Units.smallSpacing anchors.rightMargin: Kirigami.Units.smallSpacing Component.onCompleted: { font.italic = true } } } } diff --git a/src/apps/qml/messages/ShowHideButton.qml b/src/apps/qml/messages/ShowHideButton.qml index 1a175561..d9c05495 100644 --- a/src/apps/qml/messages/ShowHideButton.qml +++ b/src/apps/qml/messages/ShowHideButton.qml @@ -1,67 +1,67 @@ /* * Copyright (C) 2018-2019 Laurent Montel * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ import QtQuick 2.9 import QtQuick.Controls 2.5 as QQC2 -import org.kde.kirigami 2.4 as Kirigami +import org.kde.kirigami 2.7 as Kirigami import QtQuick.Layouts 1.1 Kirigami.Icon { property QtObject targetAnimation property int defaultHeight: 200 property bool isHidden: true source: isHidden ? "hint" : "visibility" width: 24 height: 24 MouseArea { anchors.fill: parent onClicked: { if (isHidden) { isHidden = false imageAnimationShow.running = true; } else { isHidden = true imageAnimationHide.running = true; } } } NumberAnimation { id: imageAnimationHide target: targetAnimation property: "height" duration: 500 easing.type: Easing.InOutQuad from: defaultHeight to: 0 } NumberAnimation { id: imageAnimationShow target: targetAnimation property: "height" duration: 500 easing.type: Easing.InOutQuad from: 0 to: defaultHeight } } diff --git a/src/apps/qml/messages/SystemMessage.qml b/src/apps/qml/messages/SystemMessage.qml index 9e969b77..4fc14cad 100644 --- a/src/apps/qml/messages/SystemMessage.qml +++ b/src/apps/qml/messages/SystemMessage.qml @@ -1,77 +1,77 @@ /* * Copyright 2016 Riccardo Iaconelli * Copyright (c) 2017-2019 Montel Laurent * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ import QtQuick 2.9 -import org.kde.kirigami 2.4 as Kirigami +import org.kde.kirigami 2.7 as Kirigami import QtQuick.Controls 2.5 as QQC2 import QtQuick.Layouts 1.1 import KDE.Ruqola.ExtraColors 1.0 import KDE.Ruqola.DebugCategory 1.0 MessageBase { id: messageMain property string i_systemMessageType RowLayout { Item { Layout.fillWidth: true } Rectangle { Layout.alignment: Qt.AlignCenter width: textLabel.implicitWidth + 6*Kirigami.Units.smallSpacing height: textLabel.height color: Kirigami.Theme.disabledTextColor radius: 4*Kirigami.Units.smallSpacing QQC2.Label { id: textLabel color: Kirigami.Theme.textColor opacity: 1 anchors.centerIn: parent anchors.leftMargin: Kirigami.Units.smallSpacing anchors.rightMargin: Kirigami.Units.smallSpacing width: Math.min(implicitWidth, parent.width - Kirigami.Units.largeSpacing) text: i_messageText wrapMode: QQC2.Label.Wrap renderType: Text.NativeRendering } } Item { Layout.fillWidth: true } TimestampText { id: timestampText timestamp: i_timestamp } } } diff --git a/src/apps/qml/messages/UserMessage.qml b/src/apps/qml/messages/UserMessage.qml index 596c8e0c..e8b0b8cc 100644 --- a/src/apps/qml/messages/UserMessage.qml +++ b/src/apps/qml/messages/UserMessage.qml @@ -1,210 +1,210 @@ /* * Copyright 2016 Riccardo Iaconelli * Copyright (c) 2017-2019 Montel Laurent * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ import QtQuick 2.9 -import org.kde.kirigami 2.4 as Kirigami +import org.kde.kirigami 2.7 as Kirigami import QtQuick.Controls 2.5 as QQC2 import QtQuick.Layouts 1.1 import KDE.Ruqola.RuqolaUtils 1.0 import KDE.Ruqola.ExtraColors 1.0 import KDE.Ruqola.DebugCategory 1.0 import "../js/message.js" as MessageScript; import "../common" MessageBase { property string i_messageID property var i_urls property var i_attachments property string i_own_username id: messageMain Layout.alignment: Qt.AlignTop MessageMenu { id: menu can_editing_message: i_can_editing_message user_ignored : i_user_ignored starred: i_starred pinned_message: i_pinned } RowLayout { AvatarImage { id: avatarRect avatarurl: i_avatar aliasname: i_aliasname username: i_username } ColumnLayout { Layout.fillHeight: true Kirigami.Heading { id: usernameLabel level: 5 Layout.alignment: Qt.AlignLeft font.bold: true text: i_aliasname + ' ' + i_usernameurl + (i_editedByUserName === "" ? "" : " " + i18n("(edited by %1)", i_editedByUserName)) height: avatarRect.height onLinkActivated: messageMain.linkActivated(link) MouseArea { anchors.fill: parent acceptedButtons: Qt.RightButton onClicked: { if (mouse.button === Qt.RightButton) { menu.x = mouse.x menu.y = mouse.y menu.open(); } } } } RowLayout { RepeaterRoles { id: repearterRoles model: i_roles Layout.fillWidth: true } } Column { id: fullTextColumn Layout.fillWidth: true QQC2.Label { width: parent.width id: textLabel renderType: Text.NativeRendering textFormat: Text.RichText text: i_messageText wrapMode: QQC2.Label.Wrap onLinkActivated: messageMain.linkActivated(link) MouseArea { anchors.fill: parent acceptedButtons: Qt.RightButton onClicked: { if (mouse.button === Qt.RightButton) { menu.x = mouse.x menu.y = mouse.y menu.open(); } } } } Column { id: urlColumn width: parent.width //TODO //Reactivate when we have a parsed url ! //see info about bugs // Repeater { // id: repeaterUrl // model: i_urls // Text { // //Display it only if url != text otherwise it's not necessary // visible: model.modelData.url !== i_originalMessage // width: urlColumn.width // text: model.modelData.description === "" ? // RuqolaUtils.markdownToRichText(model.modelData.url) : // RuqolaUtils.markdownToRichText(model.modelData.description) // wrapMode: QQC2.Label.Wrap // renderType: Text.NativeRendering // textFormat: Text.RichText // onLinkActivated: messageMain.linkActivated(link) // } // } RepeaterReactions { id: repearterReactions model: i_reactions onDeleteReaction: { messageMain.deleteReaction(i_messageID, emoji) } } Repeater { id: repearterAttachments model: i_attachments Column { Text { visible: model.modelData.authorName !== "" width: urlColumn.width text: model.modelData.authorName wrapMode: QQC2.Label.Wrap anchors.leftMargin: Kirigami.Units.smallSpacing anchors.rightMargin: Kirigami.Units.smallSpacing } Row { QQC2.Label { id: attachmentTitle renderType: Text.NativeRendering textFormat: Text.RichText visible: model.modelData.title !== "" width: urlColumn.width text: model.modelData.displayTitle wrapMode: QQC2.Label.Wrap anchors.leftMargin: Kirigami.Units.smallSpacing anchors.rightMargin: Kirigami.Units.smallSpacing onLinkActivated: { messageMain.linkActivated(link) } } DownloadButton { id: downloadButton visible: model.modelData.canDownloadAttachment onDownloadButtonClicked: { messageMain.downloadAttachment(model.modelData.link) } } Item { Layout.fillWidth: true } } QQC2.Label { visible: model.modelData.description !== "" width: urlColumn.width text: model.modelData.description wrapMode: QQC2.Label.Wrap anchors.leftMargin: Kirigami.Units.smallSpacing anchors.rightMargin: Kirigami.Units.smallSpacing } } } } } } TimestampText { id: timestampText timestamp: i_timestamp } } } diff --git a/tests/qml/ActiveChat.qml b/tests/qml/ActiveChat.qml index 010d36cf..2a109d55 100644 --- a/tests/qml/ActiveChat.qml +++ b/tests/qml/ActiveChat.qml @@ -1,62 +1,62 @@ /* Copyright (c) 2017-2019 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.9 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.2 import QtQuick.Window 2.2 import QtQuick.Dialogs 1.2 import QtQuick.Layouts 1.1 import Qt.labs.settings 1.0 import QtGraphicalEffects 1.0 import KDE.Ruqola.RoomFilterProxyModel 1.0 -import org.kde.kirigami 2.4 as Kirigami +import org.kde.kirigami 2.7 as Kirigami ListView { id: activeChat property QtObject roomModel model: roomModel onCountChanged: { positionViewAtIndex(count - 1, ListView.Beginning) } Component.onCompleted: positionViewAtIndex(count - 1, ListView.End) visible: count > 0 delegate: FancyMessageDelegate { width: parent.width i_messageText: messageConverted i_username: username i_usernameurl: usernameurl i_aliasname: alias i_systemMessageType: type i_timestamp: timestamp i_messageID: messageID i_messageType: messagetype i_avatar: avatar i_urls: urls i_attachments: attachments i_date: date } } diff --git a/tests/qml/aboutdata.qml b/tests/qml/aboutdata.qml index 614e0306..3eda427b 100644 --- a/tests/qml/aboutdata.qml +++ b/tests/qml/aboutdata.qml @@ -1,72 +1,72 @@ /* Copyright (c) 2018-2019 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.9 import QtQuick.Controls 1.4 import QtQuick.Window 2.2 import QtQuick.Dialogs 1.2 import QtQuick.Layouts 1.1 import QtQuick.Controls 2.5 as QQC2 -import org.kde.kirigami 2.4 as Kirigami +import org.kde.kirigami 2.7 as Kirigami ApplicationWindow { id: window width: 600 height: 800 visible: true title: "About Data Test" QQC2.Label { text: "click for show aboutdata" anchors.fill: parent horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter MouseArea { anchors.fill: parent onClicked: { aboutDataDialog.open(); } } } AboutDialog { id: aboutDataDialog applicationData: ruqolaAboutData onOpenurl: { console.log("url clicked : " + link); } } QQC2.Menu { id: contactMenu x: parent.width / 2 - width / 2 y: parent.height / 2 - height / 2 modal: true MenuItem { text: "AboutData" onTriggered: { } } } } diff --git a/tests/qml/messagemodelgui.qml b/tests/qml/messagemodelgui.qml index 6cd0652d..2a25cb80 100644 --- a/tests/qml/messagemodelgui.qml +++ b/tests/qml/messagemodelgui.qml @@ -1,45 +1,45 @@ /* Copyright (c) 2018-2019 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.9 import QtQuick.Controls 1.4 import QtQuick.Layouts 1.1 import KDE.Ruqola.RoomFilterProxyModel 1.0 -import org.kde.kirigami 2.4 as Kirigami +import org.kde.kirigami 2.7 as Kirigami Kirigami.ApplicationWindow { pageStack.initialPage: [roomsComponent] Component { id: roomsComponent Kirigami.ScrollablePage { id: mainWidget leftPadding: Kirigami.Units.smallSpacing rightPadding: Kirigami.Units.smallSpacing topPadding: Kirigami.Units.smallSpacing bottomPadding: Kirigami.Units.smallSpacing ActiveChat { id: activeChat model: messageModel } } } }