commit 280763648c2698a0000dfbd2c12fc2f7835a60ec
Author: Panagiotis Kanavos <pkanavos@gmail.com>
Date:   Mon Feb 6 14:51:54 2012 +0200

    Fixed missing icons

diff --git a/trunk/Pithos.Client.WPF/Images/Error.png b/trunk/Pithos.Client.WPF/Images/Error.png
new file mode 100644
index 0000000..d985fff
Binary files /dev/null and b/trunk/Pithos.Client.WPF/Images/Error.png differ
diff --git a/trunk/Pithos.Client.WPF/Images/Warning.png b/trunk/Pithos.Client.WPF/Images/Warning.png
new file mode 100644
index 0000000..4e84b7e
Binary files /dev/null and b/trunk/Pithos.Client.WPF/Images/Warning.png differ
diff --git a/trunk/Pithos.Client.WPF/PithosAccount.cs b/trunk/Pithos.Client.WPF/PithosAccount.cs
index 8ae22b3..50be7e7 100644
--- a/trunk/Pithos.Client.WPF/PithosAccount.cs
+++ b/trunk/Pithos.Client.WPF/PithosAccount.cs
@@ -75,6 +75,8 @@ namespace Pithos.Client.WPF
                 throw new ArgumentException("The pithosSite parameter must be a valid absolute URL", "loginUrl");
             
             int port = GetFreePort();
+            
+            //TODO:Force logout here to take care of existing cookies
 
 
             var listenerUrl = String.Format("http://127.0.0.1:{0}/", port);
@@ -160,12 +162,7 @@ namespace Pithos.Client.WPF
                         Log.InfoFormat("[RETRIEVE] Got Connection {0}", request);
 
 
-                        var parts=request.Split(' ');
-                        var query = parts[1].TrimStart('/','?');
-
-                        var items = query.Split('&')
-                            .Select(pair => pair.Split('='))
-                            .ToDictionary(arr => arr[0].ToLower(), arr => Uri.UnescapeDataString(arr[1]));
+                        var items = ParseResponse(request);
 
                         var userName = items["user"];
                         var token = items["token"];
@@ -192,6 +189,16 @@ namespace Pithos.Client.WPF
             }
         }
 
+        private static Dictionary<string, string> ParseResponse(string request)
+        {
+            var parts = request.Split(' ');
+            var query = parts[1].TrimStart('/', '?');
+
+            var items = query.Split('&')
+                .Select(pair => pair.Split('='))
+                .ToDictionary(arr => arr[0].ToLower(), arr => Uri.UnescapeDataString(arr[1]));
+            return items;
+        }
 
 
         private static void Respond(HttpListenerContext context,string title,string message)
diff --git a/trunk/Pithos.Client.WPF/Shell/BalloonIconConverter.cs b/trunk/Pithos.Client.WPF/Shell/BalloonIconConverter.cs
new file mode 100644
index 0000000..10ac7a8
--- /dev/null
+++ b/trunk/Pithos.Client.WPF/Shell/BalloonIconConverter.cs
@@ -0,0 +1,39 @@
+﻿// -----------------------------------------------------------------------
+// <copyright file="BalloonIconConverter.cs" company="Microsoft">
+// TODO: Update copyright text.
+// </copyright>
+// -----------------------------------------------------------------------
+
+using System.Globalization;
+using System.Windows.Data;
+using System.Windows.Media.Imaging;
+using Hardcodet.Wpf.TaskbarNotification;
+
+namespace Pithos.Client.WPF.Shell
+{
+    using System;
+    using System.Collections.Generic;
+    using System.Linq;
+    using System.Text;
+
+    /// <summary>
+    /// Convert a BalloonIcon value to an Image
+    /// </summary>
+    public class BalloonIconConverter:IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+
+            var balloon = (BalloonIcon) value;
+            var balloonName = Enum.GetName(typeof (BalloonIcon), balloon);
+            var imageUrl = new Uri(String.Format("/Pithos.Client.WPF;component:/{0}.png", balloonName),UriKind.Relative);
+            var image = new BitmapImage(imageUrl);
+            return image;
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            throw new NotImplementedException();
+        }
+    }
+}
