Merge ~radonapps/dekko:fix-1341547 into dekko:master
- Git
- lp:~radonapps/dekko
- fix-1341547
- Merge into master
Status: | Approved |
---|---|
Approved by: | Dan Chapman |
Approved revision: | 240d9603c7e6a5297bc0487fe46c8230433367d2 |
Proposed branch: | ~radonapps/dekko:fix-1341547 |
Merge into: | dekko:master |
Diff against target: |
379 lines (+110/-14) 13 files modified
qml/Settings/user/NewIdentityPage.qml (+27/-10) qml/Settings/user/SenderIdentityInput.qml (+9/-0) qml/SetupWizard/IdentityInput.qml (+15/-2) qml/SetupWizard/ManualSetup.qml (+11/-0) qml/SetupWizard/SetupWizard.qml (+4/-0) src/3rdParty/trojita/Common/SettingsNames.cpp (+1/-0) src/3rdParty/trojita/Common/SettingsNames.h (+1/-1) src/app/Accounts/SenderIdentity.cpp (+14/-0) src/app/Accounts/SenderIdentity.h (+16/-0) src/app/Accounts/SenderIdentityModel.cpp (+9/-0) src/app/Accounts/SenderIdentityModel.h (+1/-0) src/app/Settings/SettingsNames.cpp (+1/-0) src/app/Settings/SettingsNames.h (+1/-1) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Dan Chapman (community) | Approve | ||
Review via email: mp+281487@code.launchpad.net |
Commit message
Description of the change
Implemented a Reply-To field as part of an Identity
This patch implements the skeleton required for future use of a reply-to
email by adding the GUI necessary for a user to configure their reply-to
email address.
fixes: bug 1341547
Dan Chapman (dpniel) wrote : | # |
Good start. See comments inline
- 240d960... by Daniyaal Rasheed
-
Fixed invalid email popup's title and message.
Dan Chapman (dpniel) wrote : | # |
Looks good to me. Nice job
I'll get this new field added to the message headers in the next couple of days while i finish off this smtp owrk.
Thanks again!
Unmerged commits
- 240d960... by Daniyaal Rasheed
-
Fixed invalid email popup's title and message.
- 6f6affa... by Daniyaal Rasheed
-
Implemented a Reply-To field as part of an Identity
This patch implements the skeleton required for future use of a reply-to
email by adding the GUI necessary for a user to configure their reply-to
email address.fixes: bug 1341547
- d498ade... by Daniyaal Rasheed
-
Merge branch 'fix-1522549'
Preview Diff
1 | diff --git a/qml/Settings/user/NewIdentityPage.qml b/qml/Settings/user/NewIdentityPage.qml | |||
2 | index 9d51aea..990e7a7 100644 | |||
3 | --- a/qml/Settings/user/NewIdentityPage.qml | |||
4 | +++ b/qml/Settings/user/NewIdentityPage.qml | |||
5 | @@ -1,5 +1,6 @@ | |||
6 | 1 | import QtQuick 2.4 | 1 | import QtQuick 2.4 |
7 | 2 | import Ubuntu.Components 1.2 | 2 | import Ubuntu.Components 1.2 |
8 | 3 | import Ubuntu.Components.Popups 1.0 | ||
9 | 3 | import DekkoCore 0.2 | 4 | import DekkoCore 0.2 |
10 | 4 | import "../../Components" | 5 | import "../../Components" |
11 | 5 | 6 | ||
12 | @@ -14,11 +15,24 @@ Page { | |||
13 | 14 | if (edit) { | 15 | if (edit) { |
14 | 15 | input.nameField = identity.name | 16 | input.nameField = identity.name |
15 | 16 | input.emailField = identity.email | 17 | input.emailField = identity.email |
16 | 18 | input.replyToField = identity.replyTo | ||
17 | 17 | input.organizationField = identity.organization | 19 | input.organizationField = identity.organization |
18 | 18 | input.signatureField = identity.signature | 20 | input.signatureField = identity.signature |
19 | 19 | } | 21 | } |
20 | 20 | } | 22 | } |
21 | 21 | 23 | ||
22 | 24 | function validateAddress(address) { | ||
23 | 25 | if (address && !EmailValidator.validate(address)) { | ||
24 | 26 | var msg = qsTr("%1 is not a valid email address").arg(address) | ||
25 | 27 | PopupUtils.open(Qt.resolvedUrl("../../Dialogs/InfoDialog.qml"), dekko, { | ||
26 | 28 | title: qsTr("Invaid address"), | ||
27 | 29 | text: msg | ||
28 | 30 | }) | ||
29 | 31 | return false | ||
30 | 32 | } | ||
31 | 33 | return true | ||
32 | 34 | } | ||
33 | 35 | |||
34 | 22 | DekkoHeader { | 36 | DekkoHeader { |
35 | 23 | id: header | 37 | id: header |
36 | 24 | title: edit ? qsTr("Edit identity") : qsTr("New identity") | 38 | title: edit ? qsTr("Edit identity") : qsTr("New identity") |
37 | @@ -30,16 +44,19 @@ Page { | |||
38 | 30 | id: saveAction | 44 | id: saveAction |
39 | 31 | iconName: "ok" | 45 | iconName: "ok" |
40 | 32 | onTriggered: { | 46 | onTriggered: { |
48 | 33 | if (edit) { | 47 | if (validateAddress(input.emailField) && validateAddress(input.replyToField)) { |
49 | 34 | identity.name = input.nameField | 48 | if (edit) { |
50 | 35 | identity.email = input.emailField | 49 | identity.name = input.nameField |
51 | 36 | identity.organization = input.organizationField | 50 | identity.email = input.emailField |
52 | 37 | identity.signature = input.signatureField | 51 | identity.replyTo = input.replyToField |
53 | 38 | } else { | 52 | identity.organization = input.organizationField |
54 | 39 | model.appendRow(newIdentity) | 53 | identity.signature = input.signatureField |
55 | 54 | } else { | ||
56 | 55 | model.appendRow(newIdentity) | ||
57 | 56 | } | ||
58 | 57 | closing() | ||
59 | 58 | rootPageStack.pop() | ||
60 | 40 | } | 59 | } |
61 | 41 | closing() | ||
62 | 42 | rootPageStack.pop() | ||
63 | 43 | } | 60 | } |
64 | 44 | } | 61 | } |
65 | 45 | } | 62 | } |
66 | @@ -52,9 +69,9 @@ Page { | |||
67 | 52 | id: newIdentity | 69 | id: newIdentity |
68 | 53 | name: input.nameField | 70 | name: input.nameField |
69 | 54 | email: input.emailField | 71 | email: input.emailField |
70 | 72 | replyTo: input.replyToField | ||
71 | 55 | organization: input.organizationField | 73 | organization: input.organizationField |
72 | 56 | signature: input.signatureField | 74 | signature: input.signatureField |
73 | 57 | |||
74 | 58 | } | 75 | } |
75 | 59 | Flickable { | 76 | Flickable { |
76 | 60 | anchors { | 77 | anchors { |
77 | diff --git a/qml/Settings/user/SenderIdentityInput.qml b/qml/Settings/user/SenderIdentityInput.qml | |||
78 | index 6818ac5..e92cf7a 100644 | |||
79 | --- a/qml/Settings/user/SenderIdentityInput.qml | |||
80 | +++ b/qml/Settings/user/SenderIdentityInput.qml | |||
81 | @@ -27,6 +27,7 @@ Column { | |||
82 | 27 | 27 | ||
83 | 28 | property alias nameField: nameField.text | 28 | property alias nameField: nameField.text |
84 | 29 | property alias emailField: emailField.text | 29 | property alias emailField: emailField.text |
85 | 30 | property alias replyToField: replyToField.text | ||
86 | 30 | property alias organizationField: organizationField.text | 31 | property alias organizationField: organizationField.text |
87 | 31 | property alias signatureField: signatureField.text | 32 | property alias signatureField: signatureField.text |
88 | 32 | property alias signatureFieldVisible: signatureField.visible | 33 | property alias signatureFieldVisible: signatureField.visible |
89 | @@ -61,6 +62,14 @@ Column { | |||
90 | 61 | inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText | Qt.ImhEmailCharactersOnly | 62 | inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText | Qt.ImhEmailCharactersOnly |
91 | 62 | sendTabEventOnEnter: true | 63 | sendTabEventOnEnter: true |
92 | 63 | KeyNavigation.priority: KeyNavigation.BeforeItem | 64 | KeyNavigation.priority: KeyNavigation.BeforeItem |
93 | 65 | KeyNavigation.tab: replyToField.textFieldFocusHandle | ||
94 | 66 | } | ||
95 | 67 | TitledTextField { | ||
96 | 68 | id: replyToField | ||
97 | 69 | title: qsTr("Reply-To") | ||
98 | 70 | inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText | Qt.ImhEmailCharactersOnly | ||
99 | 71 | sendTabEventOnEnter: true | ||
100 | 72 | KeyNavigation.priority: KeyNavigation.BeforeItem | ||
101 | 64 | KeyNavigation.tab: organizationField.textFieldFocusHandle | 73 | KeyNavigation.tab: organizationField.textFieldFocusHandle |
102 | 65 | } | 74 | } |
103 | 66 | TitledTextField { | 75 | TitledTextField { |
104 | diff --git a/qml/SetupWizard/IdentityInput.qml b/qml/SetupWizard/IdentityInput.qml | |||
105 | index 4809ca2..f7ad072 100644 | |||
106 | --- a/qml/SetupWizard/IdentityInput.qml | |||
107 | +++ b/qml/SetupWizard/IdentityInput.qml | |||
108 | @@ -32,6 +32,7 @@ Item { | |||
109 | 32 | property alias name: input.nameField | 32 | property alias name: input.nameField |
110 | 33 | property alias email: input.emailField | 33 | property alias email: input.emailField |
111 | 34 | property alias organization: input.organizationField | 34 | property alias organization: input.organizationField |
112 | 35 | property alias replyTo: input.replyToField | ||
113 | 35 | 36 | ||
114 | 36 | DekkoHeader { | 37 | DekkoHeader { |
115 | 37 | id: header | 38 | id: header |
116 | @@ -50,6 +51,18 @@ Item { | |||
117 | 50 | } | 51 | } |
118 | 51 | } | 52 | } |
119 | 52 | 53 | ||
120 | 54 | function validateAddress(address) { | ||
121 | 55 | if (address && !EmailValidator.validate(address)) { | ||
122 | 56 | var msg = qsTr("%1 is not a valid email address").arg(address) | ||
123 | 57 | PopupUtils.open(Qt.resolvedUrl("../../Dialogs/InfoDialog.qml"), dekko, { | ||
124 | 58 | title: qsTr("Invaid address"), | ||
125 | 59 | text: msg | ||
126 | 60 | }) | ||
127 | 61 | return false | ||
128 | 62 | } | ||
129 | 63 | return true | ||
130 | 64 | } | ||
131 | 65 | |||
132 | 53 | Action { | 66 | Action { |
133 | 54 | id: nextAction | 67 | id: nextAction |
134 | 55 | iconName: "next" | 68 | iconName: "next" |
135 | @@ -58,8 +71,7 @@ Item { | |||
136 | 58 | input.showMissingFields = true | 71 | input.showMissingFields = true |
137 | 59 | return | 72 | return |
138 | 60 | } | 73 | } |
141 | 61 | if (!EmailValidator.validate(email)) { | 74 | if (!validateAddress(email) || !validateAddress(replyTo)) { |
140 | 62 | PopupUtils.open(Qt.resolvedUrl("../Dialogs/InfoDialog.qml"), wizard, {title: qsTr("Invalid address"), text: qsTr("%1 is not a valid email address").arg(email)}) | ||
142 | 63 | return | 75 | return |
143 | 64 | } | 76 | } |
144 | 65 | inputComplete() | 77 | inputComplete() |
145 | @@ -80,6 +92,7 @@ Item { | |||
146 | 80 | nameField: wizard.identity.name | 92 | nameField: wizard.identity.name |
147 | 81 | emailField: EmailValidator.validate(wizard.account.smtpSettings.username) ? wizard.account.smtpSettings.username : wizard.identity.email | 93 | emailField: EmailValidator.validate(wizard.account.smtpSettings.username) ? wizard.account.smtpSettings.username : wizard.identity.email |
148 | 82 | organizationField: wizard.identity.organization | 94 | organizationField: wizard.identity.organization |
149 | 95 | replyToField: wizard.identity.replyTo | ||
150 | 83 | } | 96 | } |
151 | 84 | } | 97 | } |
152 | 85 | } | 98 | } |
153 | diff --git a/qml/SetupWizard/ManualSetup.qml b/qml/SetupWizard/ManualSetup.qml | |||
154 | index 5da64b9..2393723 100644 | |||
155 | --- a/qml/SetupWizard/ManualSetup.qml | |||
156 | +++ b/qml/SetupWizard/ManualSetup.qml | |||
157 | @@ -41,6 +41,7 @@ Column { | |||
158 | 41 | property alias smtpPort: smtpPortField.text | 41 | property alias smtpPort: smtpPortField.text |
159 | 42 | function parsedSmtpPort(){ return parseInt(smtpPortField.text)} | 42 | function parsedSmtpPort(){ return parseInt(smtpPortField.text)} |
160 | 43 | property alias smtpUsername: smtpEmailField.text | 43 | property alias smtpUsername: smtpEmailField.text |
161 | 44 | property alias smtpReplyTo: smtpReplyToField.text | ||
162 | 44 | property alias smtpPassword: smtpPasswordField.text | 45 | property alias smtpPassword: smtpPasswordField.text |
163 | 45 | readonly property bool isImap: serverInput.state === "imap" | 46 | readonly property bool isImap: serverInput.state === "imap" |
164 | 46 | readonly property bool isSmtp: serverInput.state === "smtp" | 47 | readonly property bool isSmtp: serverInput.state === "smtp" |
165 | @@ -219,6 +220,16 @@ Column { | |||
166 | 219 | sendTabEventOnEnter: true | 220 | sendTabEventOnEnter: true |
167 | 220 | requiredField: internal.invalidFields | 221 | requiredField: internal.invalidFields |
168 | 221 | KeyNavigation.priority: KeyNavigation.BeforeItem | 222 | KeyNavigation.priority: KeyNavigation.BeforeItem |
169 | 223 | KeyNavigation.tab: smtpReplyToField.textFieldFocusHandle | ||
170 | 224 | } | ||
171 | 225 | |||
172 | 226 | TitledTextField { | ||
173 | 227 | id: smtpReplyToField | ||
174 | 228 | title: qsTr("Reply-To") | ||
175 | 229 | visible: !isImap | ||
176 | 230 | inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhEmailCharactersOnly | Qt.ImhNoPredictiveText | ||
177 | 231 | sendTabEventOnEnter: true | ||
178 | 232 | KeyNavigation.priority: KeyNavigation.BeforeItem | ||
179 | 222 | KeyNavigation.tab: smtpPasswordField.textFieldFocusHandle | 233 | KeyNavigation.tab: smtpPasswordField.textFieldFocusHandle |
180 | 223 | } | 234 | } |
181 | 224 | 235 | ||
182 | diff --git a/qml/SetupWizard/SetupWizard.qml b/qml/SetupWizard/SetupWizard.qml | |||
183 | index 8925a7b..af07c85 100644 | |||
184 | --- a/qml/SetupWizard/SetupWizard.qml | |||
185 | +++ b/qml/SetupWizard/SetupWizard.qml | |||
186 | @@ -80,6 +80,10 @@ Item { | |||
187 | 80 | when: identityInput.active | 80 | when: identityInput.active |
188 | 81 | value: loader.item.organization | 81 | value: loader.item.organization |
189 | 82 | } | 82 | } |
190 | 83 | Binding on replyTo { | ||
191 | 84 | when: identityInput.active | ||
192 | 85 | value: loader.item.replyTo | ||
193 | 86 | } | ||
194 | 83 | } | 87 | } |
195 | 84 | 88 | ||
196 | 85 | // For now let's just create seperate ones | 89 | // For now let's just create seperate ones |
197 | diff --git a/src/3rdParty/trojita/Common/SettingsNames.cpp b/src/3rdParty/trojita/Common/SettingsNames.cpp | |||
198 | index 8b803bc..ce7286b 100644 | |||
199 | --- a/src/3rdParty/trojita/Common/SettingsNames.cpp | |||
200 | +++ b/src/3rdParty/trojita/Common/SettingsNames.cpp | |||
201 | @@ -29,6 +29,7 @@ const QString SettingsNames::realNameKey = QLatin1String("realName"); | |||
202 | 29 | const QString SettingsNames::addressKey = QLatin1String("address"); | 29 | const QString SettingsNames::addressKey = QLatin1String("address"); |
203 | 30 | const QString SettingsNames::organisationKey = QLatin1String("organisation"); | 30 | const QString SettingsNames::organisationKey = QLatin1String("organisation"); |
204 | 31 | const QString SettingsNames::signatureKey = QLatin1String("signature"); | 31 | const QString SettingsNames::signatureKey = QLatin1String("signature"); |
205 | 32 | const QString SettingsNames::replyToKey = QLatin1String("replyTo"); | ||
206 | 32 | const QString SettingsNames::obsRealNameKey = QLatin1String("identity.realName"); | 33 | const QString SettingsNames::obsRealNameKey = QLatin1String("identity.realName"); |
207 | 33 | const QString SettingsNames::obsAddressKey = QLatin1String("identity.address"); | 34 | const QString SettingsNames::obsAddressKey = QLatin1String("identity.address"); |
208 | 34 | const QString SettingsNames::msaMethodKey = QLatin1String("msa.method"); | 35 | const QString SettingsNames::msaMethodKey = QLatin1String("msa.method"); |
209 | diff --git a/src/3rdParty/trojita/Common/SettingsNames.h b/src/3rdParty/trojita/Common/SettingsNames.h | |||
210 | index 1a47a70..7a52e40 100644 | |||
211 | --- a/src/3rdParty/trojita/Common/SettingsNames.h | |||
212 | +++ b/src/3rdParty/trojita/Common/SettingsNames.h | |||
213 | @@ -28,7 +28,7 @@ namespace Common | |||
214 | 28 | { | 28 | { |
215 | 29 | 29 | ||
216 | 30 | struct SettingsNames { | 30 | struct SettingsNames { |
218 | 31 | static const QString identitiesKey, realNameKey, addressKey, organisationKey, signatureKey, obsRealNameKey, obsAddressKey; | 31 | static const QString identitiesKey, realNameKey, addressKey, organisationKey, signatureKey, replyToKey, obsRealNameKey, obsAddressKey; |
219 | 32 | static const QString msaMethodKey, methodSMTP, methodSSMTP, methodSENDMAIL, methodImapSendmail, smtpHostKey, | 32 | static const QString msaMethodKey, methodSMTP, methodSSMTP, methodSENDMAIL, methodImapSendmail, smtpHostKey, |
220 | 33 | smtpPortKey, smtpAuthKey, smtpStartTlsKey, smtpUserKey, | 33 | smtpPortKey, smtpAuthKey, smtpStartTlsKey, smtpUserKey, |
221 | 34 | sendmailKey, sendmailDefaultCmd; | 34 | sendmailKey, sendmailDefaultCmd; |
222 | diff --git a/src/app/Accounts/SenderIdentity.cpp b/src/app/Accounts/SenderIdentity.cpp | |||
223 | index aa293ac..0a98a82 100644 | |||
224 | --- a/src/app/Accounts/SenderIdentity.cpp | |||
225 | +++ b/src/app/Accounts/SenderIdentity.cpp | |||
226 | @@ -85,6 +85,20 @@ void SenderIdentity::setSignature(const QString &signature) | |||
227 | 85 | emit dataChanged(); | 85 | emit dataChanged(); |
228 | 86 | } | 86 | } |
229 | 87 | 87 | ||
230 | 88 | QString SenderIdentity::replyTo() const | ||
231 | 89 | { | ||
232 | 90 | return m_replyTo; | ||
233 | 91 | } | ||
234 | 92 | |||
235 | 93 | void SenderIdentity::setReplyTo(const QString &replyTo) | ||
236 | 94 | { | ||
237 | 95 | if (replyTo == m_replyTo) { | ||
238 | 96 | return; | ||
239 | 97 | } | ||
240 | 98 | m_replyTo = replyTo; | ||
241 | 99 | emit dataChanged(); | ||
242 | 100 | } | ||
243 | 101 | |||
244 | 88 | QString SenderIdentity::getDefaultSignature() const | 102 | QString SenderIdentity::getDefaultSignature() const |
245 | 89 | { | 103 | { |
246 | 90 | return QString(tr("Sent using Dekko from my Ubuntu device")); | 104 | return QString(tr("Sent using Dekko from my Ubuntu device")); |
247 | diff --git a/src/app/Accounts/SenderIdentity.h b/src/app/Accounts/SenderIdentity.h | |||
248 | index 0b814e0..a3ce49c 100644 | |||
249 | --- a/src/app/Accounts/SenderIdentity.h | |||
250 | +++ b/src/app/Accounts/SenderIdentity.h | |||
251 | @@ -38,6 +38,7 @@ class SenderIdentity : public QObject | |||
252 | 38 | Q_PROPERTY(QString email READ email WRITE setEmail NOTIFY dataChanged) | 38 | Q_PROPERTY(QString email READ email WRITE setEmail NOTIFY dataChanged) |
253 | 39 | Q_PROPERTY(QString organization READ organization WRITE setOrganization NOTIFY dataChanged) | 39 | Q_PROPERTY(QString organization READ organization WRITE setOrganization NOTIFY dataChanged) |
254 | 40 | Q_PROPERTY(QString signature READ signature WRITE setSignature NOTIFY dataChanged) | 40 | Q_PROPERTY(QString signature READ signature WRITE setSignature NOTIFY dataChanged) |
255 | 41 | Q_PROPERTY(QString replyTo READ replyTo WRITE setReplyTo NOTIFY dataChanged) | ||
256 | 41 | Q_PROPERTY(bool useDefaultSignature READ useDefaultSignature WRITE setUseDefaultSignature NOTIFY dataChanged) | 42 | Q_PROPERTY(bool useDefaultSignature READ useDefaultSignature WRITE setUseDefaultSignature NOTIFY dataChanged) |
257 | 42 | public: | 43 | public: |
258 | 43 | /*! | 44 | /*! |
259 | @@ -113,6 +114,20 @@ public: | |||
260 | 113 | /*! | 114 | /*! |
261 | 114 | \brief | 115 | \brief |
262 | 115 | 116 | ||
263 | 117 | \fn replyTo | ||
264 | 118 | \return QString | ||
265 | 119 | */ | ||
266 | 120 | QString replyTo() const; | ||
267 | 121 | /*! | ||
268 | 122 | \breif | ||
269 | 123 | |||
270 | 124 | \fn setReplyTo | ||
271 | 125 | \param replyTo | ||
272 | 126 | */ | ||
273 | 127 | void setReplyTo(const QString &replyTo); | ||
274 | 128 | /*! | ||
275 | 129 | \brief | ||
276 | 130 | |||
277 | 116 | \fn useDefaultSignature | 131 | \fn useDefaultSignature |
278 | 117 | \return bool | 132 | \return bool |
279 | 118 | */ | 133 | */ |
280 | @@ -146,6 +161,7 @@ private: | |||
281 | 146 | QString m_email; /*!< TODO */ | 161 | QString m_email; /*!< TODO */ |
282 | 147 | QString m_organization; /*!< TODO */ | 162 | QString m_organization; /*!< TODO */ |
283 | 148 | QString m_signature; /*!< TODO */ | 163 | QString m_signature; /*!< TODO */ |
284 | 164 | QString m_replyTo; | ||
285 | 149 | bool m_useDefaultSignature; /*!< TODO */ | 165 | bool m_useDefaultSignature; /*!< TODO */ |
286 | 150 | 166 | ||
287 | 151 | /*! | 167 | /*! |
288 | diff --git a/src/app/Accounts/SenderIdentityModel.cpp b/src/app/Accounts/SenderIdentityModel.cpp | |||
289 | index 5dbfae4..7e4bcc8 100644 | |||
290 | --- a/src/app/Accounts/SenderIdentityModel.cpp | |||
291 | +++ b/src/app/Accounts/SenderIdentityModel.cpp | |||
292 | @@ -56,6 +56,7 @@ void SenderIdentityModel::reloadIdentities() | |||
293 | 56 | identity->setOrganization(settings.value(Common::SettingsNames::organisationKey).toString()); | 56 | identity->setOrganization(settings.value(Common::SettingsNames::organisationKey).toString()); |
294 | 57 | identity->setUseDefaultSignature(settings.value("useDefaultSignature", true).toBool()); | 57 | identity->setUseDefaultSignature(settings.value("useDefaultSignature", true).toBool()); |
295 | 58 | identity->setSignature(settings.value(Common::SettingsNames::signatureKey).toString()); | 58 | identity->setSignature(settings.value(Common::SettingsNames::signatureKey).toString()); |
296 | 59 | identity->setReplyTo(settings.value(Common::SettingsNames::replyToKey).toString()); | ||
297 | 59 | appendRow(identity); | 60 | appendRow(identity); |
298 | 60 | } | 61 | } |
299 | 61 | settings.endArray(); | 62 | settings.endArray(); |
300 | @@ -75,6 +76,7 @@ void SenderIdentityModel::saveIdentites() | |||
301 | 75 | settings.setValue(Common::SettingsNames::organisationKey, m_identities[i]->organization()); | 76 | settings.setValue(Common::SettingsNames::organisationKey, m_identities[i]->organization()); |
302 | 76 | settings.setValue("useDefaultSignature", m_identities[i]->useDefaultSignature()); | 77 | settings.setValue("useDefaultSignature", m_identities[i]->useDefaultSignature()); |
303 | 77 | settings.setValue(Common::SettingsNames::signatureKey, m_identities[i]->signature()); | 78 | settings.setValue(Common::SettingsNames::signatureKey, m_identities[i]->signature()); |
304 | 79 | settings.setValue(Common::SettingsNames::replyToKey, m_identities[i]->replyTo()); | ||
305 | 78 | } | 80 | } |
306 | 79 | settings.endArray(); | 81 | settings.endArray(); |
307 | 80 | settings.endGroup(); | 82 | settings.endGroup(); |
308 | @@ -87,6 +89,7 @@ QHash<int, QByteArray> SenderIdentityModel::roleNames() const | |||
309 | 87 | roles[IdentityEmailRole] = "email"; | 89 | roles[IdentityEmailRole] = "email"; |
310 | 88 | roles[IdentityOrganizationRole] = "organization"; | 90 | roles[IdentityOrganizationRole] = "organization"; |
311 | 89 | roles[IdentitySignatureRole] = "signature"; | 91 | roles[IdentitySignatureRole] = "signature"; |
312 | 92 | roles[IdentityReplyToRole] = "replyTo"; | ||
313 | 90 | roles[IdentityRecipientStringRole] = "formattedString"; | 93 | roles[IdentityRecipientStringRole] = "formattedString"; |
314 | 91 | roles[IdentityUseDefaultSignature] = "useDefaultSignature"; | 94 | roles[IdentityUseDefaultSignature] = "useDefaultSignature"; |
315 | 92 | return roles; | 95 | return roles; |
316 | @@ -106,6 +109,8 @@ QVariant SenderIdentityModel::data(const QModelIndex &index, int role) const | |||
317 | 106 | return m_identities[index.row()]->organization(); | 109 | return m_identities[index.row()]->organization(); |
318 | 107 | case IdentitySignatureRole: | 110 | case IdentitySignatureRole: |
319 | 108 | return m_identities[index.row()]->signature(); | 111 | return m_identities[index.row()]->signature(); |
320 | 112 | case IdentityReplyToRole: | ||
321 | 113 | return m_identities[index.row()]->replyTo(); | ||
322 | 109 | case IdentityUseDefaultSignature: | 114 | case IdentityUseDefaultSignature: |
323 | 110 | return m_identities[index.row()]->useDefaultSignature(); | 115 | return m_identities[index.row()]->useDefaultSignature(); |
324 | 111 | case IdentityRecipientStringRole: | 116 | case IdentityRecipientStringRole: |
325 | @@ -173,6 +178,7 @@ QVariant SenderIdentityModel::get(int index) | |||
326 | 173 | identityData.insert(QString("email"), identity->email()); | 178 | identityData.insert(QString("email"), identity->email()); |
327 | 174 | identityData.insert(QString("organization"), identity->organization()); | 179 | identityData.insert(QString("organization"), identity->organization()); |
328 | 175 | identityData.insert(QString("signature"), identity->signature()); | 180 | identityData.insert(QString("signature"), identity->signature()); |
329 | 181 | identityData.insert(QString("replyTo"), identity->replyTo()); | ||
330 | 176 | identityData.insert(QString("formattedString"), identity->toFormattedString()); | 182 | identityData.insert(QString("formattedString"), identity->toFormattedString()); |
331 | 177 | identityData.insert(QString("useDefaultSignature"), identity->useDefaultSignature()); | 183 | identityData.insert(QString("useDefaultSignature"), identity->useDefaultSignature()); |
332 | 178 | return identityData; | 184 | return identityData; |
333 | @@ -202,6 +208,9 @@ bool SenderIdentityModel::setData(const QModelIndex &index, const QVariant &valu | |||
334 | 202 | case IdentitySignatureRole: | 208 | case IdentitySignatureRole: |
335 | 203 | m_identities[index.row()]->setSignature(value.toString()); | 209 | m_identities[index.row()]->setSignature(value.toString()); |
336 | 204 | break; | 210 | break; |
337 | 211 | case IdentityReplyToRole: | ||
338 | 212 | m_identities[index.row()]->setReplyTo(value.toString()); | ||
339 | 213 | break; | ||
340 | 205 | case IdentityUseDefaultSignature: | 214 | case IdentityUseDefaultSignature: |
341 | 206 | m_identities[index.row()]->setUseDefaultSignature(value.toBool()); | 215 | m_identities[index.row()]->setUseDefaultSignature(value.toBool()); |
342 | 207 | break; | 216 | break; |
343 | diff --git a/src/app/Accounts/SenderIdentityModel.h b/src/app/Accounts/SenderIdentityModel.h | |||
344 | index 08544f8..dbaaf5e 100644 | |||
345 | --- a/src/app/Accounts/SenderIdentityModel.h | |||
346 | +++ b/src/app/Accounts/SenderIdentityModel.h | |||
347 | @@ -63,6 +63,7 @@ public: | |||
348 | 63 | IdentityEmailRole, | 63 | IdentityEmailRole, |
349 | 64 | IdentityOrganizationRole, | 64 | IdentityOrganizationRole, |
350 | 65 | IdentitySignatureRole, | 65 | IdentitySignatureRole, |
351 | 66 | IdentityReplyToRole, | ||
352 | 66 | IdentityUseDefaultSignature, | 67 | IdentityUseDefaultSignature, |
353 | 67 | IdentityRecipientStringRole | 68 | IdentityRecipientStringRole |
354 | 68 | }; | 69 | }; |
355 | diff --git a/src/app/Settings/SettingsNames.cpp b/src/app/Settings/SettingsNames.cpp | |||
356 | index f457612..720c66a 100644 | |||
357 | --- a/src/app/Settings/SettingsNames.cpp | |||
358 | +++ b/src/app/Settings/SettingsNames.cpp | |||
359 | @@ -7,6 +7,7 @@ const QString SettingsNames::realNameKey = QLatin1String("realName"); | |||
360 | 7 | const QString SettingsNames::addressKey = QLatin1String("address"); | 7 | const QString SettingsNames::addressKey = QLatin1String("address"); |
361 | 8 | const QString SettingsNames::organisationKey = QLatin1String("organisation"); | 8 | const QString SettingsNames::organisationKey = QLatin1String("organisation"); |
362 | 9 | const QString SettingsNames::signatureKey = QLatin1String("signature"); | 9 | const QString SettingsNames::signatureKey = QLatin1String("signature"); |
363 | 10 | const QString SettingsNames::replyToKey = QLatin1String("replyTo"); | ||
364 | 10 | const QString SettingsNames::obsRealNameKey = QLatin1String("identity.realName"); | 11 | const QString SettingsNames::obsRealNameKey = QLatin1String("identity.realName"); |
365 | 11 | const QString SettingsNames::obsAddressKey = QLatin1String("identity.address"); | 12 | const QString SettingsNames::obsAddressKey = QLatin1String("identity.address"); |
366 | 12 | const QString SettingsNames::msaMethodKey = QLatin1String("msa.method"); | 13 | const QString SettingsNames::msaMethodKey = QLatin1String("msa.method"); |
367 | diff --git a/src/app/Settings/SettingsNames.h b/src/app/Settings/SettingsNames.h | |||
368 | index 28f4260..12ed3e0 100644 | |||
369 | --- a/src/app/Settings/SettingsNames.h | |||
370 | +++ b/src/app/Settings/SettingsNames.h | |||
371 | @@ -6,7 +6,7 @@ | |||
372 | 6 | namespace Dekko { | 6 | namespace Dekko { |
373 | 7 | 7 | ||
374 | 8 | struct SettingsNames { | 8 | struct SettingsNames { |
376 | 9 | static const QString identitiesKey, realNameKey, addressKey, organisationKey, signatureKey, obsRealNameKey, obsAddressKey; | 9 | static const QString identitiesKey, realNameKey, addressKey, organisationKey, signatureKey, replyToKey, obsRealNameKey, obsAddressKey; |
377 | 10 | static const QString msaMethodKey, methodSMTP, methodSSMTP, methodSENDMAIL, methodImapSendmail, smtpHostKey, | 10 | static const QString msaMethodKey, methodSMTP, methodSSMTP, methodSENDMAIL, methodImapSendmail, smtpHostKey, |
378 | 11 | smtpPortKey, smtpAuthKey, smtpStartTlsKey, smtpUserKey, smtpAuthType, | 11 | smtpPortKey, smtpAuthKey, smtpStartTlsKey, smtpUserKey, smtpAuthType, |
379 | 12 | sendmailKey, sendmailDefaultCmd; | 12 | sendmailKey, sendmailDefaultCmd; |
Both NotificationWorker classes are not supposed to be there, when I pulled in the new code it apparently made changes to this file, which I blindly staged because everything above it was right. I don't how I can "uncommit" this but still have the changes I've made to all the other files inside my local repository.