Revision eae84ae8 trunk/Pithos.Client.WPF/Shell/ShellViewModel.cs

b/trunk/Pithos.Client.WPF/Shell/ShellViewModel.cs
651 651
				return;
652 652
			//TODO: What happens to an existing account whose Token has changed?
653 653
			account.SiteUri= String.Format("{0}/ui/?token={1}&user={2}",
654
				account.SiteUri, Uri.EscapeUriString(account.Token),
655
				Uri.EscapeUriString(account.UserName));
654
				account.SiteUri, Uri.EscapeDataString(account.Token),
655
                Uri.EscapeDataString(account.UserName));
656 656

  
657 657
			if (Accounts.All(item => item.UserName != account.UserName))
658 658
				Accounts.TryAdd(account);
......
750 750
		}
751 751

  
752 752

  
753
	    private bool _pollStarted = false;
754

  
753 755
        //SMELL: Doing so much work for notifications in the shell is wrong
754 756
        //The notifications should be moved to their own view/viewmodel pair
755 757
        //and different templates should be used for different message types
......
761 763

  
762 764
			if (!Settings.ShowDesktopNotifications)
763 765
				return;
766

  
767
            if (notification is PollNotification)
768
            {
769
                _pollStarted = true;
770
                return;
771
            }
772
            if (notification is CloudNotification)
773
            {
774
                if (!_pollStarted) 
775
                    return;
776
                _pollStarted= false;
777
                notification.Title = "Pithos";
778
                notification.Message = "Start Synchronisation";
779
            }
780

  
764 781
			BalloonIcon icon;
765 782
			switch (notification.Level)
766 783
			{
......
778 795
					icon = BalloonIcon.None;
779 796
					break;
780 797
			}
781

  
798
            
782 799
			if (Settings.ShowDesktopNotifications)
783 800
			{
784
				var tv = (ShellView) GetView();
801
				var tv = (ShellView) GetView();                
785 802
				tv.TaskbarView.ShowBalloonTip(notification.Title, notification.Message, icon);
786 803
			}
787 804
		}

Also available in: Unified diff