~bobo-324/dekko/customScheme

« back to all changes in this revision

Viewing changes to qml/Composer/ComposePageHeadConfiguration.qml

  • Committer: Dan Chapman
  • Date: 2014-11-07 19:41:38 UTC
  • mfrom: (148.1.15 removeQtWebkit)
  • Revision ID: dpniel@ubuntu.com-20141107194138-n95ozzhrcu2rg5ib
Finally webkit has been nuked from dekko!! Thanks for your work on this boren

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (C) 2014 Dan Chapman <dpniel@ubuntu.com>
 
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
*/
 
18
import QtQuick 2.0
 
19
import Ubuntu.Components 1.1
 
20
import Ubuntu.Components.Popups 1.0
 
21
import "../Components"
 
22
import "../Dialogs"
 
23
 
 
24
PageHeadConfiguration {
 
25
    id: topContainer
 
26
 
 
27
    // Signals
 
28
    signal sendClicked
 
29
    signal cancelClicked
 
30
    signal loseFocus
 
31
    signal draftsClicked
 
32
 
 
33
    Action {
 
34
        id: draftsAction
 
35
        text: i18n.tr("Drafts")
 
36
        onTriggered: {
 
37
            draftsClicked()
 
38
        }
 
39
        iconName: "edit"
 
40
    }
 
41
 
 
42
    Action {
 
43
        id: sendAction
 
44
        text: i18n.tr("Send")
 
45
        onTriggered: {
 
46
            sendClicked()
 
47
        }
 
48
 
 
49
        iconSource: Qt.resolvedUrl("../../icons/email.svg")
 
50
    }
 
51
 
 
52
    Action {
 
53
        id: addAttachmentAction
 
54
        text: i18n.tr("Add attachment")
 
55
        iconName: "attachment"
 
56
        onTriggered: {
 
57
            var contentDialog = PopupUtils.open(Qt.resolvedUrl("../Dialogs/ContentPickerDialog.qml"), dekko, {
 
58
                                                    isExport: false
 
59
                                                });
 
60
            contentDialog.filesImported.connect(
 
61
                function(files) {
 
62
                    for (var i in files) {
 
63
                        submissionManager.attachmentsModel.addAttachment(files[i].url.toString().replace("file://", ""));
 
64
                    }
 
65
                }
 
66
            );
 
67
        }
 
68
    }
 
69
 
 
70
    Action {
 
71
        id: closeAction
 
72
        text: i18n.tr("Cancel")
 
73
        onTriggered: {
 
74
            cancelClicked()
 
75
        }
 
76
        iconName: "close"
 
77
    }
 
78
 
 
79
    backAction: closeAction
 
80
    actions: [
 
81
        sendAction,
 
82
        draftsAction,
 
83
        addAttachmentAction
 
84
    ]
 
85
}