Revision 81c5c310 trunk/Pithos.Client.WPF/Preferences/PreferencesViewModel.cs
b/trunk/Pithos.Client.WPF/Preferences/PreferencesViewModel.cs | ||
---|---|---|
230 | 230 |
public void RefreshApiKey() |
231 | 231 |
{ |
232 | 232 |
//_events.Publish(new Notification { Title = "Authorization failed", Message = "Your API Key has probably expired. You will be directed to a page where you can renew it", Level = TraceLevel.Error }); |
233 |
|
|
233 |
if (CurrentAccount == null) |
|
234 |
return; |
|
234 | 235 |
try |
235 | 236 |
{ |
236 | 237 |
|
237 |
var name = CurrentAccount != null ? CurrentAccount.AccountName : null; |
|
238 |
var credentials = PithosAccount.RetrieveCredentials(Settings.PithosLoginUrl,name); |
|
238 |
var name = CurrentAccount.AccountName; |
|
239 |
|
|
240 |
var loginUri = new Uri(new Uri(CurrentAccount.ServerUrl), "login"); |
|
241 |
var credentials = PithosAccount.RetrieveCredentials(loginUri.ToString(),name); |
|
239 | 242 |
if (credentials==null) |
240 | 243 |
return; |
241 | 244 |
//The server will return credentials for a different account, not just the current account |
... | ... | |
397 | 400 |
|
398 | 401 |
} |
399 | 402 |
|
403 |
/* |
|
400 | 404 |
public void AddPithosAccount() |
401 | 405 |
{ |
402 |
var credentials=PithosAccount.RetrieveCredentials(Settings.PithosLoginUrl);
|
|
406 |
var credentials=PithosAccount.RetrieveCredentials(null);
|
|
403 | 407 |
if (credentials == null) |
404 | 408 |
return; |
405 | 409 |
var account = Settings.Accounts.FirstOrDefault(act => act.AccountName == credentials.UserName); |
... | ... | |
423 | 427 |
NotifyOfPropertyChange(() => Accounts); |
424 | 428 |
NotifyOfPropertyChange(()=>Settings); |
425 | 429 |
} |
430 |
*/ |
|
426 | 431 |
|
427 | 432 |
|
428 | 433 |
readonly List<AccountSettings> _accountsToRemove = new List<AccountSettings>(); |
... | ... | |
572 | 577 |
SearchOption.AllDirectories)) |
573 | 578 |
File.Copy(newFilePath, newFilePath.Replace(oldPath, newPath)); |
574 | 579 |
|
580 |
Log.InfoFormat("Deleting account folder {0}",oldPath); |
|
575 | 581 |
Directory.Delete(oldPath, true); |
576 | 582 |
|
577 | 583 |
//We also need to change the path of the existing file states |
Also available in: Unified diff