Revision 8e89b160 trunk/Pithos.Client.WPF/Preferences/PreferencesViewModel.cs
b/trunk/Pithos.Client.WPF/Preferences/PreferencesViewModel.cs | ||
---|---|---|
278 | 278 |
|
279 | 279 |
private void DoSave() |
280 | 280 |
{ |
281 |
Settings.Save(); |
|
282 | 281 |
//SetStartupMode(); |
283 | 282 |
|
283 |
//Ensure we save the settings changes first |
|
284 | 284 |
foreach (var account in _accountsToRemove) |
285 | 285 |
{ |
286 | 286 |
Settings.Accounts.Remove(account); |
287 |
} |
|
288 |
|
|
289 |
foreach (var account in _accountsToAdd) |
|
290 |
{ |
|
291 |
Settings.Accounts.Add(account); |
|
292 |
} |
|
293 |
|
|
294 |
Settings.Save(); |
|
295 |
|
|
296 |
|
|
297 |
foreach (var account in _accountsToRemove) |
|
298 |
{ |
|
287 | 299 |
Shell.RemoveMonitor(account.AccountName); |
288 | 300 |
} |
289 | 301 |
|
... | ... | |
320 | 332 |
} |
321 | 333 |
*/ |
322 | 334 |
|
323 |
|
|
324 | 335 |
|
336 |
readonly List<AccountSettings> _accountsToAdd=new List<AccountSettings>(); |
|
325 | 337 |
public void AddAccount() |
326 | 338 |
{ |
327 | 339 |
var wizard = new AddAccountViewModel(); |
... | ... | |
344 | 356 |
RootPath = actualRootPath, |
345 | 357 |
IsActive=wizard.IsAccountActive |
346 | 358 |
}; |
347 |
Settings.Accounts.Add(newAccount);
|
|
359 |
_accountsToAdd.Add(newAccount);
|
|
348 | 360 |
var accountVm = new AccountViewModel(newAccount); |
349 | 361 |
(Accounts as IProducerConsumerCollection<AccountViewModel>).TryAdd(accountVm); |
350 | 362 |
CurrentAccount = accountVm; |
... | ... | |
385 | 397 |
readonly List<AccountSettings> _accountsToRemove = new List<AccountSettings>(); |
386 | 398 |
public void RemoveAccount() |
387 | 399 |
{ |
388 |
var accountName = CurrentAccount.AccountName; |
|
389 |
|
|
390 | 400 |
Accounts.TryRemove(CurrentAccount); |
391 | 401 |
_accountsToRemove.Add(CurrentAccount.Account); |
392 | 402 |
|
Also available in: Unified diff