~ubuntu-branches/ubuntu/oneiric/kdepim/oneiric-updates

« back to all changes in this revision

Viewing changes to mobile/mail/EditorView.qml

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2011-06-28 19:33:24 UTC
  • mfrom: (0.2.13) (0.1.13 sid)
  • Revision ID: package-import@ubuntu.com-20110628193324-8yvjs8sdv9rdoo6c
Tags: 4:4.7.0-0ubuntu1
* New upstream release
  - update install files
  - add missing kdepim-doc package to control file
  - Fix Vcs lines
  - kontact breaks/replaces korganizer << 4:4.6.80
  - tighten the dependency of kdepim-dev on libkdepim4 to fix lintian error

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    Copyright (c) 2010 Volker Krause <vkrause@kde.org>
 
3
 
 
4
    This library is free software; you can redistribute it and/or modify it
 
5
    under the terms of the GNU Library General Public License as published by
 
6
    the Free Software Foundation; either version 2 of the License, or (at your
 
7
    option) any later version.
 
8
 
 
9
    This library is distributed in the hope that it will be useful, but WITHOUT
 
10
    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 
11
    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
 
12
    License for more details.
 
13
 
 
14
    You should have received a copy of the GNU Library General Public License
 
15
    along with this library; see the file COPYING.LIB.  If not, write to the
 
16
    Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 
17
    02110-1301, USA.
 
18
*/
 
19
 
 
20
import Qt 4.7
 
21
import org.kde 4.5
 
22
import org.kde.pim.mobileui 4.5 as KPIM
 
23
import org.kde.kpimidentities 4.5 as KPIMIdentities
 
24
import org.kde.messagecomposer 4.5 as MessageComposer
 
25
 
 
26
Item {
 
27
  property int contentHeight: subject.height + messageContent.height + bottomContainer.height + 20;
 
28
  anchors.topMargin: 12
 
29
  anchors.leftMargin: 48
 
30
  anchors.rightMargin: 2
 
31
 
 
32
  Text {
 
33
    id: subjectLabel
 
34
    text: KDE.i18n( "Subject:" );
 
35
    anchors.leftMargin: 48
 
36
    anchors.verticalCenter: subject.verticalCenter
 
37
    anchors.left: parent.left
 
38
  }
 
39
 
 
40
  Rectangle {
 
41
    id: subject
 
42
    anchors {
 
43
      left: subjectLabel.right
 
44
      top: parent.top
 
45
      right: parent.right
 
46
    }
 
47
    height: subjectInput.height + 8 // padding
 
48
    border { color: "grey"; width: 2; }
 
49
    radius: 8
 
50
 
 
51
    TextInput {
 
52
      id: subjectInput
 
53
      anchors.fill: parent
 
54
      anchors.margins: 4
 
55
      text: window.subject
 
56
    }
 
57
  }
 
58
 
 
59
  Binding { target: window; property: "subject"; value: subjectInput.text }
 
60
 
 
61
  Rectangle {
 
62
    id: cryptoIndicator
 
63
    visible: window.isSigned || window.isEncrypted
 
64
    anchors.top: subject.bottom
 
65
    anchors.topMargin: 2
 
66
    anchors.left: parent.left
 
67
    anchors.right: parent.right
 
68
    height: (window.isSigned || window.isEncrypted) ? 20 : 0
 
69
 
 
70
    Row {
 
71
      anchors.fill: parent
 
72
      spacing: 2
 
73
 
 
74
      Rectangle {
 
75
        id: signedIndicator
 
76
        visible: window.isSigned
 
77
        color: "#BAF9CE"
 
78
        width: (window.isEncrypted ? parent.width / 2 : parent.width)
 
79
        height: 20
 
80
 
 
81
        Text {
 
82
          anchors.fill: parent
 
83
          text: KDE.i18n( "Message will be signed" )
 
84
          horizontalAlignment: Text.AlignHCenter
 
85
        }
 
86
      }
 
87
 
 
88
      Rectangle {
 
89
        id: encryptedIndicator
 
90
        visible: window.isEncrypted
 
91
        color: "#0080FF"
 
92
        width: (window.isSigned ? parent.width / 2 : parent.width)
 
93
        height: 20
 
94
 
 
95
        Text {
 
96
          anchors.fill: parent
 
97
          text: KDE.i18n( "Message will be encrypted" )
 
98
          horizontalAlignment: Text.AlignHCenter
 
99
        }
 
100
      }
 
101
    }
 
102
  }
 
103
 
 
104
  MessageComposer.Editor {
 
105
    id: messageContent
 
106
    height: 344;
 
107
    anchors {
 
108
      top: cryptoIndicator.bottom
 
109
      left: parent.left
 
110
      right: parent.right
 
111
      topMargin: 2
 
112
    }
 
113
  }
 
114
 
 
115
  Item {
 
116
    id: bottomContainer;
 
117
    height: 80
 
118
    anchors {
 
119
        left: parent.left
 
120
        right: parent.right
 
121
        top: messageContent.bottom
 
122
    }
 
123
 
 
124
    Text {
 
125
      id: identityLabel
 
126
      anchors {
 
127
        left: parent.left
 
128
        bottom: parent.bottom
 
129
          top: parent.top
 
130
      }
 
131
      text: KDE.i18n( "Identity:" );
 
132
      verticalAlignment: "AlignVCenter"
 
133
    }
 
134
 
 
135
    KPIMIdentities.IdentityComboBox {
 
136
      id: identityCombo
 
137
      anchors {
 
138
        left: identityLabel.right
 
139
        top: parent.top
 
140
        bottom: parent.bottom
 
141
        right: cancelButton.left
 
142
      }
 
143
    }
 
144
 
 
145
    KPIM.Button2 {
 
146
      id: cancelButton
 
147
      anchors.bottom: parent.bottom;
 
148
      anchors.right: sendButton.left;
 
149
      width: height * 1.5;
 
150
      height: identityCombo.height
 
151
      icon: KDE.iconPath( "dialog-cancel", 64 );
 
152
      onClicked: window.close();
 
153
    }
 
154
 
 
155
    KPIM.Button2 {
 
156
      id: sendButton;
 
157
      anchors.bottom: parent.bottom;
 
158
      anchors.right: parent.right;
 
159
      width: height * 1.5;
 
160
      height: identityCombo.height
 
161
      icon: KDE.iconPath( "mail-folder-outbox", 64 );
 
162
      color: window.tooManyRecipients ? "red" : "#00000000"
 
163
      buttonText: window.recipientsCount == 0 ? "" : window.recipientsCount
 
164
      onClicked: window.send();
 
165
    }
 
166
  }
 
167
 
 
168
}