(fix) many adjustments regarding auxiliary accounts
This commit is contained in:
parent
6d64242382
commit
f515543e33
|
@ -56,7 +56,7 @@ static SoProduct *preferencesProduct = nil;
|
||||||
|
|
||||||
- (WOResponse *) jsonDefaultsAction
|
- (WOResponse *) jsonDefaultsAction
|
||||||
{
|
{
|
||||||
NSMutableDictionary *values;
|
NSMutableDictionary *values, *account;
|
||||||
SOGoUserDefaults *defaults;
|
SOGoUserDefaults *defaults;
|
||||||
NSMutableArray *accounts;
|
NSMutableArray *accounts;
|
||||||
NSArray *categoryLabels;
|
NSArray *categoryLabels;
|
||||||
|
@ -208,15 +208,27 @@ static SoProduct *preferencesProduct = nil;
|
||||||
if ([[defaults source] dirty])
|
if ([[defaults source] dirty])
|
||||||
[defaults synchronize];
|
[defaults synchronize];
|
||||||
|
|
||||||
|
//
|
||||||
// We inject our default mail account, something we don't want to do before we
|
// We inject our default mail account, something we don't want to do before we
|
||||||
// call -synchronize on our defaults.
|
// call -synchronize on our defaults.
|
||||||
|
//
|
||||||
values = [[[[defaults source] values] mutableCopy] autorelease];
|
values = [[[[defaults source] values] mutableCopy] autorelease];
|
||||||
|
|
||||||
accounts = [NSMutableArray arrayWithArray: [values objectForKey: @"AuxiliaryMailAccounts"]];
|
accounts = [NSMutableArray arrayWithArray: [values objectForKey: @"AuxiliaryMailAccounts"]];
|
||||||
[accounts insertObject: [[[context activeUser] mailAccounts] objectAtIndex: 0]
|
account = [[[context activeUser] mailAccounts] objectAtIndex: 0];
|
||||||
atIndex: 0];
|
if (![account objectForKey: @"receipts"])
|
||||||
|
{
|
||||||
|
[account setObject: [NSDictionary dictionaryWithObjectsAndKeys: @"ignore", @"receiptAction",
|
||||||
|
@"ignore", @"receiptNonRecipientAction",
|
||||||
|
@"ignore", @"receiptOutsideDomainAction",
|
||||||
|
@"ignore", @"receiptAnyAction", nil]
|
||||||
|
forKey: @"receipts"];
|
||||||
|
}
|
||||||
|
|
||||||
|
[accounts insertObject: account atIndex: 0];
|
||||||
[values setObject: accounts forKey: @"AuxiliaryMailAccounts"];
|
[values setObject: accounts forKey: @"AuxiliaryMailAccounts"];
|
||||||
|
|
||||||
|
|
||||||
return [self _makeResponse: values];
|
return [self _makeResponse: values];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,9 +32,9 @@
|
||||||
ng-readonly="accountId == 0" ng-model="account.port"/>
|
ng-readonly="accountId == 0" ng-model="account.port"/>
|
||||||
</md-input-container>
|
</md-input-container>
|
||||||
|
|
||||||
<md-radio-group ng-model="account.encryption">
|
|
||||||
<label><var:string label:value="Encryption:"/></label>
|
<label><var:string label:value="Encryption:"/></label>
|
||||||
<md-radio-button ng-disabled="accountId == 0" value="none"><var:string label:value="None"/></md-radio-button>
|
<md-radio-group ng-model="account.encryption">
|
||||||
|
<md-radio-button ng-disabled="accountId == 0" value="none" class="md-primary"><var:string label:value="None"/></md-radio-button>
|
||||||
<md-radio-button ng-disabled="accountId == 0" value="ssl"><var:string label:value="SSL"/></md-radio-button>
|
<md-radio-button ng-disabled="accountId == 0" value="ssl"><var:string label:value="SSL"/></md-radio-button>
|
||||||
<md-radio-button ng-disabled="accountId == 0" value="tls"><var:string label:value="TLS"/></md-radio-button>
|
<md-radio-button ng-disabled="accountId == 0" value="tls"><var:string label:value="TLS"/></md-radio-button>
|
||||||
</md-radio-group>
|
</md-radio-group>
|
||||||
|
@ -47,7 +47,7 @@
|
||||||
|
|
||||||
<md-input-container>
|
<md-input-container>
|
||||||
<label><var:string label:value="Password:"/></label>
|
<label><var:string label:value="Password:"/></label>
|
||||||
<input type="password" ng-readonly="account.isDefault == 1"
|
<input type="password" ng-readonly="accountId == 0"
|
||||||
ng-model="account.password"/>
|
ng-model="account.password"/>
|
||||||
</md-input-container>
|
</md-input-container>
|
||||||
|
|
||||||
|
|
|
@ -99,11 +99,24 @@
|
||||||
$scope.addMailAccount = function(ev) {
|
$scope.addMailAccount = function(ev) {
|
||||||
$scope.preferences.defaults.AuxiliaryMailAccounts.push({});
|
$scope.preferences.defaults.AuxiliaryMailAccounts.push({});
|
||||||
var account = _.last($scope.preferences.defaults.AuxiliaryMailAccounts);
|
var account = _.last($scope.preferences.defaults.AuxiliaryMailAccounts);
|
||||||
|
account['name'] = "New account";
|
||||||
|
account['identities'] = [];
|
||||||
|
account['identities'][0] = {};
|
||||||
|
account['identities'][0]['fullName'] = "";
|
||||||
|
account['identities'][0]['email'] = "";
|
||||||
|
account['receipts'] = {};
|
||||||
|
account['receipts']['receiptAction'] = "ignore";
|
||||||
|
account['receipts']['receiptNonRecipientAction'] = "ignore";
|
||||||
|
account['receipts']['receiptOutsideDomainAction'] = "ignore";
|
||||||
|
account['receipts']['receiptAnyAction'] = "ignore";
|
||||||
|
|
||||||
$mdDialog.show({
|
$mdDialog.show({
|
||||||
controller: AccountDialogCtrl,
|
controller: AccountDialogCtrl,
|
||||||
templateUrl: 'editAccount?account=new',
|
templateUrl: 'editAccount?account=new',
|
||||||
targetEvent: ev,
|
targetEvent: ev,
|
||||||
locals: { account: account }
|
locals: { account: account,
|
||||||
|
accountId: ($scope.preferences.defaults.AuxiliaryMailAccounts.length-1),
|
||||||
|
mailCustomFromEnabled: window.mailCustomFromEnabled}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue