Dekko
Loading...
Searching...
No Matches
EmailSelectionDialog.qml
1/* Copyright (C) 2025 CIT-Services <info@cit-services.eu>
2
3 This file is part of Dekko email client for Ubuntu devices
4
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License as
7 published by the Free Software Foundation; either version 2 of
8 the License or (at your option) version 3
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18import QtQuick 2.4
19import Lomiri.Components 1.3
20import Lomiri.Components.Popups 1.3
21import Dekko.Lomiri.Constants 1.0
22
23Dialog {
24 id: chooseEmailDialog
25 title: qsTr("Select Email")
26
27 property var emailList: []
28 property int recipientType: 0
29 signal emailSelected(string email, int type)
30
31 ListView {
32 id: emailListView
33 width: parent.width
34 implicitHeight: Math.min(contentHeight, units.gu(40))
35 model: chooseEmailDialog.emailList
36 delegate: ListItem {
37 width: emailListView.width
38 height: layout.height + (Style.smallSpacing * 2)
39 ListItemLayout {
40 id: layout
41 title.text: modelData
42 title.elide: Text.ElideRight
43 }
44 onClicked: {
45 chooseEmailDialog.emailSelected(modelData, chooseEmailDialog.recipientType)
46 PopupUtils.close(chooseEmailDialog)
47 }
48 }
49 }
50
51 Button {
52 text: qsTr("Cancel")
53 onClicked: PopupUtils.close(chooseEmailDialog)
54 }
55}