Warning, /plasma-mobile/calindori/src/contents/ui/AttendeeRoleEditor.qml is written in an unsupported language. File is not indexed.

0001 /*
0002 * SPDX-FileCopyrightText: 2021 Dimitris Kardarakos <dimkard@posteo.net>
0003 *
0004 * SPDX-License-Identifier: GPL-3.0-or-later
0005 */
0006 
0007 import QtQuick 2.7
0008 import QtQuick.Controls 2.14 as Controls2
0009 import QtQuick.Layouts 1.3
0010 import org.kde.kirigami 2.12 as Kirigami
0011 import org.kde.calindori 0.1 as Calindori
0012 
0013 Kirigami.FormLayout {
0014     id: root
0015 
0016     property var attendeeModelRow
0017     property int incidenceRole: (attendeeModelRow !== undefined) ? attendeeModelRow.attendeeRole : -1
0018 
0019     Controls2.Label {
0020         text: attendeeModelRow && attendeeModelRow.email ? attendeeModelRow.email : ""
0021 
0022         Kirigami.FormData.label: i18n("Email:")
0023     }
0024 
0025     Controls2.Label {
0026         text: attendeeModelRow && attendeeModelRow.displayStatus ? attendeeModelRow.displayStatus : ""
0027 
0028         Kirigami.FormData.label: i18n("Status:")
0029     }
0030 
0031     ColumnLayout {
0032         Kirigami.FormData.label: i18n("Role:")
0033 
0034         Controls2.RadioButton {
0035             text: i18n("Required")
0036             checked: root.incidenceRole === Calindori.CalendarAttendee.ReqParticipant
0037 
0038             onToggled: if(checked && attendeeModelRow) { attendeeModelRow.attendeeRole = Calindori.CalendarAttendee.ReqParticipant }
0039         }
0040 
0041         Controls2.RadioButton {
0042             text: i18n("Optional")
0043             checked: root.incidenceRole === Calindori.CalendarAttendee.OptParticipant
0044 
0045             onToggled: if(checked && attendeeModelRow) { attendeeModelRow.attendeeRole = Calindori.CalendarAttendee.OptParticipant }
0046         }
0047 
0048         Controls2.RadioButton {
0049             text: i18n("Non-participant")
0050             checked: root.incidenceRole === Calindori.CalendarAttendee.NonParticipant
0051 
0052             onToggled: if(checked && attendeeModelRow) { attendeeModelRow.attendeeRole = Calindori.CalendarAttendee.NonParticipant }
0053         }
0054 
0055         Controls2.RadioButton {
0056             text: i18n("Chairperson")
0057             checked: root.incidenceRole === Calindori.CalendarAttendee.Chair
0058 
0059             onToggled: if(checked && attendeeModelRow) { attendeeModelRow.attendeeRole = Calindori.CalendarAttendee.Chair }
0060         }
0061     }
0062 }