diff --git a/src/accountview/qml/accountdialog.qml b/src/accountview/qml/accountdialog.qml index 061d101a..9d123b78 100644 --- a/src/accountview/qml/accountdialog.qml +++ b/src/accountview/qml/accountdialog.qml @@ -1,135 +1,135 @@ /*************************************************************************** * Copyright (C) 2017 by Bluesystems * * Author : Emmanuel Lepage Vallee * * * * 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 3 of the License, or * * (at your option) any later version. * * * * 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.7 import org.kde.kirigami 2.2 as Kirigami -import QtQuick.Controls 2.2 +import QtQuick.Controls 2.2 as Controls import QtQuick.Layouts 1.0 import net.lvindustries.ringqtquick 1.0 as RingQtQuick import org.kde.playground.kquickitemviews 1.0 as KQuickItemViews import net.lvindustries.ringqtquick 1.0 as RingQtQuick import org.kde.ringkde.jamiaccountview 1.0 as JamiAccountView import org.kde.ringkde.jamiaccountview.pages 1.0 as JamiAccountPages -Dialog { +Controls.Dialog { id: accountDialog - standardButtons: Dialog.Save | Dialog.Cancel + standardButtons: Controls.Dialog.Save | Controls.Dialog.Cancel property var profilePage: undefined parent: applicationWindow().contentItem x: applicationWindow().contentItem.width / 2 - width/2 y: applicationWindow().contentItem.height / 2 - height/2 width: applicationWindow().contentItem.width * 0.85 height: applicationWindow().contentItem.height * 0.85 onAccepted: { if (accountTree.selectedAccount) { if (profilePage) profilePage.save() accountTree.selectedAccount.performAction(RingQtQuick.Account.SAVE) } } onRejected: { if (accountTree.selectedAccount) { accountTree.selectedAccount.performAction(RingQtQuick.Account.CANCEL) } } RowLayout { anchors.fill: parent JamiAccountView.Accounts { id: accountTree Layout.fillHeight: true Layout.preferredWidth: 300 Layout.maximumWidth: 300 } KQuickItemViews.IndexView { Layout.fillHeight: true Layout.fillWidth: true modelIndex: accountTree.selectedAccount ? accountTree.selectedAccount.index : undefined clip: true delegate: RingQtQuick.AccountFields { anchors.fill: parent account: object ColumnLayout { anchors.fill: parent - TabBar { + Controls.TabBar { id: pageTabs Layout.fillWidth: true - TabButton { + Controls.TabButton { text: i18n("Basic") } - TabButton { + Controls.TabButton { text: i18n("Profile") } - TabButton { + Controls.TabButton { text: i18n("Advanced") } - TabButton { + Controls.TabButton { text: i18n("Network") } - TabButton { + Controls.TabButton { text: i18n("Devices") } - TabButton { + Controls.TabButton { text: i18n("Codecs") } - TabButton { + Controls.TabButton { text: i18n("Credentials") } - TabButton { + Controls.TabButton { text: i18n("Security") } - TabButton { + Controls.TabButton { text: i18n("Ringtones") } } - SwipeView { + Controls.SwipeView { currentIndex: pageTabs.currentIndex interactive : false Layout.fillHeight: true Layout.fillWidth: true JamiAccountPages.Basic {} JamiAccountPages.Profiles { id: prof Component.onCompleted: { accountDialog.profilePage = prof } } JamiAccountPages.Advanced {} JamiAccountPages.Network {} JamiAccountPages.Devices {} JamiAccountPages.Codecs {} JamiAccountPages.Credentials {} JamiAccountPages.Security {} JamiAccountPages.Ringtones {} } } } } } } diff --git a/src/jamivideoview/jamivideo.qrc b/src/jamivideoview/jamivideo.qrc index 1048ce1d..c2ac17f8 100644 --- a/src/jamivideoview/jamivideo.qrc +++ b/src/jamivideoview/jamivideo.qrc @@ -1,11 +1,12 @@ qml/videowidget.qml qml/videocontroltoolbar.qml qml/screensharing.qml qml/canvaspopup.qml qml/videosource.qml + qml/settingpopup.qml qml/streaming.qml qml/devicesetting.qml diff --git a/src/jamivideoview/plugin.cpp b/src/jamivideoview/plugin.cpp index 800d9c75..d7e73cd8 100644 --- a/src/jamivideoview/plugin.cpp +++ b/src/jamivideoview/plugin.cpp @@ -1,54 +1,55 @@ /************************************************************************************ * Copyright (C) 2018 by BlueSystems GmbH * * Author : Emmanuel Lepage Vallee * * * * This library is free software; you can redistribute it and/or * * modify it under the terms of the GNU Lesser General Public * * License as published by the Free Software Foundation; either * * version 2.1 of the License, or (at your option) 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 * * Lesser General Public License for more details. * * * * You should have received a copy of the GNU Lesser General Public * * License along with this library; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * ***********************************************************************************/ #include "plugin.h" // Qt #include #include // QRC #include // VideoView #include "snapshotadapter.h" #include "imageprovider.h" void JamiVideoView::registerTypes(const char *uri) { Q_ASSERT(uri == QByteArray("org.kde.ringkde.jamivideoview")); qmlRegisterType(uri, 1, 0, "SnapshotAdapter"); qmlRegisterType(QStringLiteral("qrc:/jamivideoview/qml/videowidget.qml"), uri, 1, 0, "VideoWidget"); qmlRegisterType(QStringLiteral("qrc:/jamivideoview/qml/videocontroltoolbar.qml"), uri, 1, 0, "VideoControlToolbar"); qmlRegisterType(QStringLiteral("qrc:/jamivideoview/qml/devicesetting.qml"), uri, 1, 0, "DeviceSetting"); + qmlRegisterType(QStringLiteral("qrc:/jamivideoview/qml/settingpopup.qml"), uri, 1, 0, "SettingPopup"); qmlRegisterType(QStringLiteral("qrc:/jamivideoview/qml/videosource.qml"), uri, 1, 0, "VideoSource"); qmlRegisterType(QStringLiteral("qrc:/jamivideoview/qml/canvaspopup.qml"), uri, 1, 0, "CanvasPopup"); qmlRegisterType(QStringLiteral("qrc:/jamivideoview/qml/screensharing.qml"), uri, 1, 0, "ScreenSharing"); qmlRegisterType(QStringLiteral("qrc:/jamivideoview/qml/streaming.qml"), uri, 1, 0, "Streaming"); } void JamiVideoView::initializeEngine(QQmlEngine *engine, const char *uri) { Q_UNUSED(engine) Q_UNUSED(uri) auto p = new ImageProvider(); engine->addImageProvider( QStringLiteral("VideoFrame"), p ); } diff --git a/src/jamivideoview/qml/settingpopup.qml b/src/jamivideoview/qml/settingpopup.qml new file mode 100644 index 00000000..a555b231 --- /dev/null +++ b/src/jamivideoview/qml/settingpopup.qml @@ -0,0 +1,55 @@ +/*************************************************************************** + * Copyright (C) 2019 by Bluesystems * + * Author : Emmanuel Lepage Vallee * + * * + * 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 3 of the License, or * + * (at your option) any later version. * + * * + * 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.7 +import QtQuick.Layouts 1.0 +import QtQuick.Controls 2.2 as Controls +import org.kde.ringkde.jamivideoview 1.0 as JamiVideoView +import org.kde.ringkde.jamicallview 1.0 as JamiCallView + +Controls.Dialog { + standardButtons: Controls.Dialog.Save | Controls.Dialog.Cancel + + parent: applicationWindow().contentItem + x: applicationWindow().contentItem.width / 2 - width/2 + y: applicationWindow().contentItem.height / 2 - height/2 + + width: applicationWindow().contentItem.width * 0.85 + height: applicationWindow().contentItem.height * 0.85 + + contentItem: JamiVideoView.VideoWidget { + id: videoWidget + JamiVideoView.DeviceSetting { + anchors.fill: parent + } + } + + Component.onCompleted: { + RingSession.previewManager.startPreview() + videoWidget.started = true + } + + onAccepted: { + RingSession.previewManager.stopPreview() + videoWidget.started = false + } + + onRejected: { + videoWidget.started = false + RingSession.previewManager.stopPreview() + } +} diff --git a/views/basic/qml/actioncollection.qml b/views/basic/qml/actioncollection.qml index 056b9ee2..7e1cc9d4 100644 --- a/views/basic/qml/actioncollection.qml +++ b/views/basic/qml/actioncollection.qml @@ -1,144 +1,146 @@ /* * Copyright 2018 Fabian Riethmayer * Copyright 2019 Emmanuel Lepage * * This program 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 3, or * (at your option) any later version. * * 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 Library General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.0 import org.kde.kirigami 2.4 as Kirigami import QtQuick.Controls.Material 2.3 QtObject { readonly property Kirigami.Action mailAction: Kirigami.Action { iconName: "mail-message" text: i18n("Write mail") } readonly property Kirigami.Action videoCallAction: Kirigami.Action { iconName: "camera-web" text: i18n("Video call") enabled: availabilityTracker.canVideoCall onTriggered: { showCallPage() callpage.visible = true callpage.videoCall() } } readonly property Kirigami.Action shareScreenAction: Kirigami.Action { iconName: ":/sharedassets/outline/screen.svg" text: i18n("Cast screen") enabled: availabilityTracker.canVideoCall onTriggered: { showCallPage() callpage.visible = true callpage.screencast() } } readonly property Kirigami.Action audioCallAction: Kirigami.Action { iconName: "call-start" text: i18n("Audio call") enabled: availabilityTracker.canCall onTriggered: { showCallPage() callpage.visible = true callpage.audioCall() } } readonly property Kirigami.Action chatAction: Kirigami.Action { iconName: "kmouth-phrase-new" text: i18n("Chat") onTriggered: { hideCall() showChat() } } readonly property Kirigami.Action bookmarkAction: Kirigami.Action { iconName: "favorite" text: i18n("Select as favorite") } readonly property Kirigami.Action shareAction: Kirigami.Action { iconName: "document-share" text: i18n("Share") } readonly property Kirigami.Action editAction: Kirigami.Action { iconName: "document-edit" text: i18n("Edit") } readonly property Kirigami.Action photoAction: Kirigami.Action { iconName: "edit-image-face-add" text: i18n("Choose photo") } readonly property Kirigami.Action banAction: Kirigami.Action { iconName: "im-kick-user" text: i18n("Block number") } readonly property Kirigami.Action deleteAction: Kirigami.Action { iconName: "delete" text: i18n("Delete contact") } readonly property Kirigami.Action clearAction: Kirigami.Action { iconName: "edit-clear-history" text: i18n("Delete history") } readonly property Kirigami.Action newContactAction: Kirigami.Action { iconName: "contact-new" text: "Create contact" } - readonly property Kirigami.Action darkMode: Kirigami.Action { - iconName: "mail-message" - text: i18n("Dark mode") - onTriggered: { - console.log("Enable dark mode", Material.Dark, Material.Blue) - root.Material.theme = Material.Dark - root.Material.accent = Material.Blue - } - } - - readonly property Kirigami.Action lightMode: Kirigami.Action { - iconName: "mail-message" - text: i18n("Light mode") - onTriggered: { - console.log("Enable light mode", Material.Light, Material.Purple) - root.Material.theme = Material.Light - root.Material.accent = Material.Purple - } + readonly property Kirigami.Action quitAction: Kirigami.Action { + iconName: "application-exit" + text: i18n("Exit") + onTriggered: Qt.quit() } readonly property Kirigami.Action settings: Kirigami.Action { text: i18n("Settings") + iconName: "configure" + + Kirigami.Action { + text: i18n("Export account") + iconName: "document-export" + } + + Kirigami.Action { + text: i18n("Add a Jami account") + iconName: "tools-wizard" + onTriggered: events.requestsWizard() + } Kirigami.Action { - text: i18n("Settings") + text: i18n("Configure accounts") + iconName: "configure" + onTriggered: events.requestsConfigureAccounts() } Kirigami.Action { - text: i18n("Settings") + text: i18n("Video settings") + iconName: "camera-web" + onTriggered: events.configureVideo() } } } diff --git a/views/basic/qml/basic.qml b/views/basic/qml/basic.qml index 5b777402..873d4c5d 100644 --- a/views/basic/qml/basic.qml +++ b/views/basic/qml/basic.qml @@ -1,217 +1,219 @@ /* * Copyright 2018 Fabian Riethmayer * Copyright 2019 Emmanuel Lepage * * This program 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 3, or * (at your option) any later version. * * 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 Library General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.6 import QtQuick.Controls 2.2 import QtQuick.Layouts 1.2 import org.kde.kirigami 2.6 as Kirigami import net.lvindustries.ringqtquick.media 1.0 as RingQtMedia import net.lvindustries.ringqtquick 1.0 as RingQtQuick import org.kde.ringkde.basicview 1.0 as BasicView import org.kde.ringkde.jamicontactview 1.0 as JamiContactView import org.kde.ringkde.jamiwizard 1.0 as JamiWizard import org.kde.ringkde.jamikdeintegration 1.0 as JamiKDEIntegration import QtQuick.Controls.Material 2.3 Kirigami.ApplicationWindow { width: 1024 height: 768 id: root // Localization is currently broken with the Material theme function i18n(t) {return t;} function showCallPage() { callpage.visible = true if (pageStack.currentItem == callpage) return showChat() for (var i = 0; i < pageStack.depth; i++) { if (pageStack.get(i) == callpage) { pageStack.currentIndex = i return } } pageStack.push(callpage) } function hideCall() { for (var i = 0; i < pageStack.depth; i++) { if (pageStack.get(i) == callpage) { pageStack.pop(callpage) pageStack.currentIndex = 0 return } } } function showChat() { if (pageStack.currentItem == callpage) return for (var i = 0; i < pageStack.depth; i++) { if (pageStack.get(i) == chat) { pageStack.currentIndex = Kirigami.Settings.isMobile ? 1 : 0 return } } pageStack.push(chat) pageStack.currentIndex = Kirigami.Settings.isMobile ? 1 : 0 } // Check the network status and other sources to ensure actions *can* work RingQtMedia.AvailabilityTracker { id: availabilityTracker individual: mainPage.currentIndividual } // Allows to free resources when viewing other individuals RingQtQuick.SharedModelLocker { id: mainPage onCallChanged: { if (!call) hideCall() else showCallPage() } onIndividualChanged: { list.currentIndex = RingSession.peersTimelineModel.individualIndex( currentIndividual ).row } } BasicView.ActionCollection { id: actionCollection } BasicView.Contacts { id : mydata Component.onCompleted: { chat.model = mydata.get(3) } } pageStack.initialPage: [list, chat] pageStack.globalToolBar.style: Kirigami.ApplicationHeaderStyle.ToolBar pageStack.globalToolBar.preferredHeight: Kirigami.Units.gridUnit * 3 pageStack.defaultColumnWidth: root.width < 320 ? root.width : 320 BasicView.ListPage { id: list } BasicView.ChatPage { id: chat } BasicView.CallPage { id: callpage visible: false } contextDrawer: Kirigami.ContextDrawer { id: contextDrawer } globalDrawer: BasicView.GlobalDrawer { id: globalDrawer handleVisible: !wizardLoader.active } JamiKDEIntegration.WindowEvent { id: events - onRequestsConfigureAccounts: { - var component = Qt.createComponent("qrc:/account/qml/accountdialog.qml") + function showDialog(path) { + var component = Qt.createComponent(path) if (component.status == Component.Ready) { var window = component.createObject(applicationWindow().contentItem) window.open() } else console.log("ERROR", component.status, component.errorString()) - } + onRequestsConfigureAccounts: showDialog("qrc:/account/qml/accountdialog.qml") + onRequestsVideo: showDialog("qrc:/jamivideoview/qml/settingpopup.qml") + onRequestsHideWindow: { hide() } onRequestsWizard: { globalDrawer.drawerOpen = false wizardLoader.visible = true wizardLoader.active = true } } /** * Display the wizard when all accounts are deleted. */ JamiWizard.Policies { id: wizardPolicies } Loader { id: wizardLoader active: false anchors.fill: parent z: 999999 onActiveChanged: { if ( list.displayWelcome && !active) list.search() } sourceComponent: JamiWizard.Wizard { anchors.fill: parent z: 999999 onVisibleChanged: { if (!visible) { wizardLoader.visible = false wizardLoader.active = false } } onWizardFinished: { wizardLoader.active = false list.search() } } } Timer { interval: 0 running: true repeat: false onTriggered: { if (wizardPolicies.displayWizard) wizardLoader.active = true else if (list.displayWelcome) list.search() } } }