Revision 6aa29f4f trunk/Pithos.Client.WPF/Shell/ShellViewModel.cs
b/trunk/Pithos.Client.WPF/Shell/ShellViewModel.cs | ||
---|---|---|
105 | 105 |
|
106 | 106 |
StatusMessage = "In Synch"; |
107 | 107 |
|
108 |
_accounts.CollectionChanged += (sender, e) => |
|
109 |
{ |
|
110 |
NotifyOfPropertyChange(() => OpenFolderCaption); |
|
111 |
NotifyOfPropertyChange(() => HasAccounts); |
|
112 |
}; |
|
113 |
|
|
108 | 114 |
} |
109 | 115 |
catch (Exception exc) |
110 | 116 |
{ |
... | ... | |
113 | 119 |
} |
114 | 120 |
} |
115 | 121 |
|
122 |
|
|
116 | 123 |
protected override void OnActivate() |
117 | 124 |
{ |
118 | 125 |
base.OnActivate(); |
... | ... | |
208 | 215 |
|
209 | 216 |
protected override void OnViewLoaded(object view) |
210 | 217 |
{ |
211 |
var window = (Window)view; |
|
212 |
window.Hide(); |
|
213 | 218 |
UpdateStatus(); |
219 |
var window = (Window)view; |
|
220 |
TaskEx.Delay(1000).ContinueWith(t => Execute.OnUIThread(window.Hide)); |
|
214 | 221 |
base.OnViewLoaded(view); |
215 | 222 |
} |
216 | 223 |
|
... | ... | |
228 | 235 |
} |
229 | 236 |
} |
230 | 237 |
|
231 |
private ObservableConcurrentCollection<AccountInfo> _accounts = new ObservableConcurrentCollection<AccountInfo>(); |
|
238 |
private readonly ObservableConcurrentCollection<AccountInfo> _accounts = new ObservableConcurrentCollection<AccountInfo>();
|
|
232 | 239 |
public ObservableConcurrentCollection<AccountInfo> Accounts |
233 | 240 |
{ |
234 | 241 |
get { return _accounts; } |
235 | 242 |
} |
236 | 243 |
|
244 |
public bool HasAccounts |
|
245 |
{ |
|
246 |
get { return _accounts.Count > 0; } |
|
247 |
} |
|
248 |
|
|
237 | 249 |
|
238 |
private string _pauseSyncCaption="Pause Syncing"; |
|
250 |
public string OpenFolderCaption |
|
251 |
{ |
|
252 |
get |
|
253 |
{ |
|
254 |
return (_accounts.Count == 0) |
|
255 |
? "No Accounts Defined" |
|
256 |
: "Open Pithos Folder"; |
|
257 |
} |
|
258 |
} |
|
259 |
|
|
260 |
private string _pauseSyncCaption="Pause Synching"; |
|
239 | 261 |
public string PauseSyncCaption |
240 | 262 |
{ |
241 | 263 |
get { return _pauseSyncCaption; } |
... | ... | |
253 | 275 |
} |
254 | 276 |
|
255 | 277 |
|
256 |
private string _statusIcon="../Images/Tray.ico";
|
|
278 |
private string _statusIcon="../Images/Pithos.ico";
|
|
257 | 279 |
public string StatusIcon |
258 | 280 |
{ |
259 | 281 |
get { return _statusIcon; } |
260 | 282 |
set |
261 | 283 |
{ |
262 |
_statusIcon = value; |
|
284 |
//_statusIcon = value;
|
|
263 | 285 |
NotifyOfPropertyChange(() => StatusIcon); |
264 | 286 |
} |
265 | 287 |
} |
... | ... | |
304 | 326 |
} |
305 | 327 |
|
306 | 328 |
|
329 |
public void GoToSite() |
|
330 |
{ |
|
331 |
var site = Properties.Settings.Default.PithosSite; |
|
332 |
Process.Start(site); |
|
333 |
} |
|
334 |
|
|
307 | 335 |
public void GoToSite(AccountInfo account) |
308 | 336 |
{ |
309 | 337 |
var site = String.Format("{0}/ui/?token={1}&user={2}", |
... | ... | |
621 | 649 |
if (String.IsNullOrWhiteSpace(accountName)) |
622 | 650 |
return; |
623 | 651 |
|
652 |
var accountInfo=_accounts.FirstOrDefault(account => account.UserName == accountName); |
|
653 |
_accounts.TryRemove(accountInfo); |
|
654 |
|
|
624 | 655 |
PithosMonitor monitor; |
625 | 656 |
if (Monitors.TryGetValue(accountName, out monitor)) |
626 | 657 |
{ |
Also available in: Unified diff