Revision 2e3aee00
b/trunk/Pithos.Client.WPF/PithosAccount.cs | ||
---|---|---|
92 | 92 |
|
93 | 93 |
var receiveCredentials = ListenForRedirectAsync(port); |
94 | 94 |
|
95 |
var logoutUrl = loginUrl.Replace("login", "im/logout"); |
|
96 |
var logoutProcess=Process.Start(logoutUrl); |
|
97 |
TaskEx.Delay(100).Wait(); |
|
95 | 98 |
var uriBuilder=new UriBuilder(loginUrl); |
96 | 99 |
uriBuilder.Query="next=" + listenerUrl; |
97 | 100 |
|
b/trunk/Pithos.Client.WPF/Preferences/PreferencesView.xaml | ||
---|---|---|
104 | 104 |
<TextBox Name="CurrentAccount_ServerUrl" Grid.Column="1" Grid.Row="0" Margin="5"/> |
105 | 105 |
<Label Content="Account" Grid.Column="0" Grid.Row="1" Margin="0,5" HorizontalAlignment="Left"/> |
106 | 106 |
<TextBox Name="CurrentAccount_AccountName" Grid.Column="1" Grid.Row="1" Margin="5"/> |
107 |
<Label Content="API Key" Grid.Column="0" Grid.Row="2" Margin="0,5" HorizontalAlignment="Left"/> |
|
108 |
<TextBox Name="CurrentAccount_ApiKey" Grid.Column="1" Grid.Row="2" Margin="5"/> |
|
107 |
<Grid Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="2" > |
|
108 |
<Grid.ColumnDefinitions> |
|
109 |
<ColumnDefinition Width="Auto"/> |
|
110 |
<ColumnDefinition Width="*"/> |
|
111 |
<ColumnDefinition Width="Auto"/> |
|
112 |
</Grid.ColumnDefinitions> |
|
113 |
<Label Content="API Key" Grid.Column="0" Margin="0,5" HorizontalAlignment="Left"/> |
|
114 |
<TextBox Name="CurrentAccount_ApiKey" Grid.Column="1" Margin="5" /> |
|
115 |
<Button Name="RefreshApiKey" Grid.Column="2" Content="Refresh" Margin="5"/> |
|
116 |
</Grid> |
|
109 | 117 |
<Label Content="Folder" Grid.Column="0" Grid.Row="3" Margin="0,5" HorizontalAlignment="Left"/> |
110 | 118 |
<Grid Grid.Row="3" Grid.Column="1" > |
111 | 119 |
<Grid.ColumnDefinitions> |
b/trunk/Pithos.Client.WPF/Preferences/PreferencesViewModel.cs | ||
---|---|---|
47 | 47 |
using System.ComponentModel.Composition; |
48 | 48 |
using System.IO; |
49 | 49 |
using System.Net; |
50 |
using System.Threading.Tasks; |
|
50 | 51 |
using System.Windows; |
51 | 52 |
using System.Windows.Forms; |
52 | 53 |
using Caliburn.Micro; |
... | ... | |
193 | 194 |
|
194 | 195 |
} |
195 | 196 |
} |
197 |
|
|
198 |
public async Task RefreshApiKey() |
|
199 |
{ |
|
200 |
await Shell.TryAuthorize(CurrentAccount.AccountName, 3); |
|
201 |
NotifyOfPropertyChange(()=>CurrentAccount); |
|
202 |
} |
|
196 | 203 |
|
197 | 204 |
public void SaveChanges() |
198 | 205 |
{ |
b/trunk/Pithos.Client.WPF/Shell/ShellViewModel.cs | ||
---|---|---|
628 | 628 |
} |
629 | 629 |
|
630 | 630 |
|
631 |
private async Task TryAuthorize(string userName, int retries)
|
|
631 |
public async Task TryAuthorize(string userName, int retries)
|
|
632 | 632 |
{ |
633 | 633 |
_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 }); |
634 | 634 |
|
b/trunk/Pithos.Core/Agents/WorkflowAgent.cs | ||
---|---|---|
206 | 206 |
public void RestartInterruptedFiles(AccountInfo accountInfo) |
207 | 207 |
{ |
208 | 208 |
|
209 |
StatusNotification.NotifyChange("Restart processing interrupted files", TraceLevel.Verbose); |
|
210 | 209 |
|
211 | 210 |
using (log4net.ThreadContext.Stacks["Workflow"].Push("Restart")) |
212 | 211 |
{ |
... | ... | |
219 | 218 |
|
220 | 219 |
|
221 | 220 |
var account = accountInfo; |
222 |
var pendingEntries = from state in FileState.Queryable |
|
221 |
var pendingEntries = (from state in FileState.Queryable
|
|
223 | 222 |
where state.FileStatus != FileStatus.Unchanged && |
224 | 223 |
!state.FilePath.StartsWith(cachePath) && |
225 | 224 |
!state.FilePath.EndsWith(".ignore") && |
226 | 225 |
state.FilePath.StartsWith(account.AccountPath) |
227 |
select state; |
|
228 |
var pendingStates = new List<WorkflowState>(); |
|
229 |
foreach (var state in pendingEntries) |
|
230 |
{ |
|
231 |
pendingStates.Add(new WorkflowState(account, state)); |
|
232 |
} |
|
226 |
select state).ToList(); |
|
227 |
if (pendingEntries.Count>0) |
|
228 |
StatusNotification.NotifyChange("Restart processing interrupted files", TraceLevel.Verbose); |
|
229 |
|
|
230 |
var pendingStates = pendingEntries |
|
231 |
.Select(state => new WorkflowState(account, state)) |
|
232 |
.ToList(); |
|
233 |
|
|
233 | 234 |
if (Log.IsDebugEnabled) |
234 | 235 |
Log.DebugFormat("Found {0} interrupted files", pendingStates.Count); |
235 | 236 |
|
236 |
|
|
237 |
foreach (var entry in pendingStates) |
|
238 |
{ |
|
239 |
Post(entry); |
|
240 |
} |
|
237 |
pendingStates.ForEach(Post); |
|
241 | 238 |
} |
242 | 239 |
} |
243 | 240 |
|
Also available in: Unified diff