diff --git a/src/accountview/qml/accounts.qml b/src/accountview/qml/accounts.qml index d97d82b1..5f956493 100644 --- a/src/accountview/qml/accounts.qml +++ b/src/accountview/qml/accounts.qml @@ -1,178 +1,178 @@ /*************************************************************************** * 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.8 import org.kde.kirigami 2.5 as Kirigami import QtQuick.Controls 2.0 import QtQuick.Layouts 1.0 import Ring 1.0 import org.kde.playground.kquickitemviews 1.0 as KQuickItemViews import net.lvindustries.ringqtquick 1.0 as RingQtQuick ListView { id: accountList property QtObject selectedAccount: null spacing : 10 - model: ProfileModel + model: RingSession.profileModel delegate: codecDelegate Component { id: codecDelegate Kirigami.Card { id: card x: 5 width: accountList.width - 10 height: content.height + 20 implicitHeight: content.height + 20 - property var pModel : ProfileModel.profilesForPerson(model.object) + property var pModel : RingSession.profileModel.profilesForPerson(model.object) ColumnLayout { id: content height: implicitHeight width: parent.width Kirigami.Heading { text: model.display level:4 } ListView { id: profileList interactive: false model: pModel implicitHeight: contentHeight height: contentHeight width: parent.width delegate: Kirigami.SwipeListItem { id: listItem width: card.width background: Rectangle { id: background property var listItem: parent color: listItem.checked || listItem.highlighted || ( listItem.supportsMouseEvents && listItem.pressed && !listItem.checked && !listItem.sectionDelegate ) ? listItem.activeBackgroundColor : listItem.backgroundColor visible: listItem.ListView.view ? listItem.ListView.view.highlight === null : true Rectangle { id: internal property bool indicateActiveFocus: listItem.pressed || listItem.activeFocus || (listItem.ListView.view ? listItem.ListView.view.activeFocus : false) anchors.fill: parent visible: !listItem.supportsMouseEvents color: listItem.activeBackgroundColor opacity: (listItem.hovered || listItem.highlighted || listItem.activeFocus) && !listItem.pressed ? 0.5 : 0 Behavior on opacity { NumberAnimation { duration: Kirigami.Units.longDuration } } } Rectangle { opacity: 0.9 anchors.fill: parent color: object == accountList.selectedAccount ? activePalette.highlight : registrationStateColor } KQuickItemViews.DecorationAdapter { width: check.implicitHeight height: check.implicitHeight anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter pixmap: securityLevelIcon } readonly property bool __separatorVisible: listItem.separatorVisible on__SeparatorVisibleChanged: { if (__separatorVisible) { var newObject = Qt.createQmlObject('import QtQuick 2.0; import org.kde.kirigami 2.4; Separator {anchors {left: parent.left; right: parent.right; bottom: parent.top} visible: listItem.separatorVisible}', background); newObject = Qt.createQmlObject('import QtQuick 2.0; import org.kde.kirigami 2.4; Separator {anchors {left: parent.left; right: parent.right; bottom: parent.bottom} visible: listItem.separatorVisible}', background); } } } RowLayout { width: parent.width height: check.implicitHeight*2 CheckBox { id: check width: height checked: model.enabled } KQuickItemViews.DecorationAdapter { height: check.implicitHeight width: check.implicitHeight pixmap: decoration } Label { text: alias Layout.fillWidth: true } } actions: [ Kirigami.Action { text: i18n("Remove") iconName: "list-remove" onTriggered: {} } ] onPressedChanged: { //TODO add a popup if (accountList.selectedAccount) { accountList.selectedAccount.performAction( RingQtQuick.Account.CANCEL ) } accountList.selectedAccount = object } } } } } } RingQtQuick.AccountBuilder { id: accountBuilder } footer: OutlineButtons { function callback(index) { selectedAccount = accountBuilder.buildFor(index) } width: accountList.width rows: 2 padding: 5 model: accountBuilder action: callback } Component.onCompleted: { accountList.selectedAccount = RingSession.availableAccountModel.currentDefaultAccount() } } diff --git a/src/accountview/qml/pages/basic.qml b/src/accountview/qml/pages/basic.qml index 2335fda5..1d7b22a2 100644 --- a/src/accountview/qml/pages/basic.qml +++ b/src/accountview/qml/pages/basic.qml @@ -1,121 +1,121 @@ /*************************************************************************** * Copyright (C) 2018 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.8 import org.kde.kirigami 2.5 as Kirigami import QtQuick.Controls 2.0 import QtQuick.Layouts 1.0 import net.lvindustries.ringqtquick 1.0 as RingQtQuick import org.kde.playground.kquickitemviews 1.0 as KQuickItemViews /** * This page contains the most basic elements necessary to create a SIP or * Ring/Jami account. */ Page { Kirigami.FormLayout { anchors.fill: parent TextField { id: alias KQuickItemViews.RoleBinder.modelRole: "alias" KQuickItemViews.RoleBinder.objectProperty: "text" RingQtQuick.FieldStatus.name: "alias" visible: RingQtQuick.FieldStatus.available Kirigami.FormData.label: i18n("Alias") readOnly: RingQtQuick.FieldStatus.readOnly } KQuickItemViews.ComboBoxView { // KQuickItemViews.RoleBinder.modelRole: "profile" // KQuickItemViews.RoleBinder.objectProperty: "text" id: profile -// model: ProfileModel +// model: RingSession.profileModel Kirigami.FormData.label: i18n("Profile") // textRole: "display" - selectionModel: ProfileModel.getAccountSelectionModel(object) + selectionModel: RingSession.profileModel.getAccountSelectionModel(object) } KQuickItemViews.ComboBoxView { id: protocol // KQuickItemViews.RoleBinder.modelRole: "protocol" // KQuickItemViews.RoleBinder.objectProperty: "text" // model: object.protocolModel Kirigami.FormData.label: i18n("Protocol") // editable: RingQtQuick.FieldStatus.readOnly selectionModel: protocolModel.selectionModel } TextField { id: registeredname KQuickItemViews.RoleBinder.modelRole: "registeredName" KQuickItemViews.RoleBinder.objectProperty: "text" RingQtQuick.FieldStatus.name: "registeredName" visible: RingQtQuick.FieldStatus.available Kirigami.FormData.label: i18n("Registered name") readOnly: RingQtQuick.FieldStatus.readOnly } TextField { id: displayname KQuickItemViews.RoleBinder.modelRole: "displayName" KQuickItemViews.RoleBinder.objectProperty: "text" RingQtQuick.FieldStatus.name: "displayName" visible: RingQtQuick.FieldStatus.available Kirigami.FormData.label: i18n("Display name") readOnly: RingQtQuick.FieldStatus.readOnly } TextField { id: name Kirigami.FormData.label: i18n("Username") RingQtQuick.FieldStatus.name: "username" visible: RingQtQuick.FieldStatus.available KQuickItemViews.RoleBinder.modelRole: "username" KQuickItemViews.RoleBinder.objectProperty: "text" readOnly: RingQtQuick.FieldStatus.readOnly } TextField { Kirigami.FormData.label: i18n("Password") id: password RingQtQuick.FieldStatus.name: "password" visible: RingQtQuick.FieldStatus.available KQuickItemViews.RoleBinder.modelRole: "password" KQuickItemViews.RoleBinder.objectProperty: "text" readOnly: RingQtQuick.FieldStatus.readOnly } TextField { Kirigami.FormData.label: i18n("Hostname") id: server RingQtQuick.FieldStatus.name: "hostname" visible: RingQtQuick.FieldStatus.available KQuickItemViews.RoleBinder.modelRole: "hostname" KQuickItemViews.RoleBinder.objectProperty: "text" readOnly: RingQtQuick.FieldStatus.readOnly } // } // server // name // password // autoAnswer } } diff --git a/src/actioncollection.cpp b/src/actioncollection.cpp index 5d618e8d..a516d452 100644 --- a/src/actioncollection.cpp +++ b/src/actioncollection.cpp @@ -1,500 +1,500 @@ /*************************************************************************** * Copyright (C) 2009-2015 by Savoir-Faire Linux * * 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 . * **************************************************************************/ #include "actioncollection.h" //Qt #include #include #include #include #include //KDE #include #include #include #include #include #include #include #include //Ring #include "globalinstances.h" #include "ringapplication.h" #include "icons/icons.h" #include "klib/kcfg_settings.h" #include #include #include #include #include #include