Added splash gradient
authorPanagiotis Kanavos <pkanavos@gmail.com>
Wed, 7 Dec 2011 19:42:03 +0000 (21:42 +0200)
committerPanagiotis Kanavos <pkanavos@gmail.com>
Wed, 7 Dec 2011 19:42:03 +0000 (21:42 +0200)
Added icons to taskbar menu
Replaced box icon with pithos icon at 16x16
"Open Pithos Folder" menu is disabled if no accounts are entered
"Go To Account site" menu is hidden if no accounts are entered

trunk/Pithos.Client.WPF/Images/About.ico [new file with mode: 0644]
trunk/Pithos.Client.WPF/Images/Feedback.ico [new file with mode: 0644]
trunk/Pithos.Client.WPF/Images/Folder.ico [new file with mode: 0644]
trunk/Pithos.Client.WPF/Images/Pithos.ico [moved from trunk/Pithos.Client.WPF/Images/favicon.ico with 100% similarity]
trunk/Pithos.Client.WPF/Images/Web.ico [new file with mode: 0644]
trunk/Pithos.Client.WPF/Pithos.Client.WPF.csproj
trunk/Pithos.Client.WPF/Preferences/PreferencesViewModel.cs
trunk/Pithos.Client.WPF/Shell/ShellView.xaml
trunk/Pithos.Client.WPF/Shell/ShellViewModel.cs
trunk/Pithos.Network/AccountInfo.cs

diff --git a/trunk/Pithos.Client.WPF/Images/About.ico b/trunk/Pithos.Client.WPF/Images/About.ico
new file mode 100644 (file)
index 0000000..3ebdee9
Binary files /dev/null and b/trunk/Pithos.Client.WPF/Images/About.ico differ
diff --git a/trunk/Pithos.Client.WPF/Images/Feedback.ico b/trunk/Pithos.Client.WPF/Images/Feedback.ico
new file mode 100644 (file)
index 0000000..0a82bd9
Binary files /dev/null and b/trunk/Pithos.Client.WPF/Images/Feedback.ico differ
diff --git a/trunk/Pithos.Client.WPF/Images/Folder.ico b/trunk/Pithos.Client.WPF/Images/Folder.ico
new file mode 100644 (file)
index 0000000..b22d441
Binary files /dev/null and b/trunk/Pithos.Client.WPF/Images/Folder.ico differ
diff --git a/trunk/Pithos.Client.WPF/Images/Web.ico b/trunk/Pithos.Client.WPF/Images/Web.ico
new file mode 100644 (file)
index 0000000..40db0fc
Binary files /dev/null and b/trunk/Pithos.Client.WPF/Images/Web.ico differ
index 806dcac..769621d 100644 (file)
   <ItemGroup>
     <Resource Include="Images\logo.png" />
   </ItemGroup>
+  <ItemGroup>
+    <Resource Include="Images\Folder.ico" />
+    <Resource Include="Images\Web.ico" />
+  </ItemGroup>
+  <ItemGroup>
+    <Resource Include="Images\Pithos.ico" />
+  </ItemGroup>
+  <ItemGroup>
+    <Resource Include="Images\About.ico" />
+    <Resource Include="Images\Feedback.ico" />
+  </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
        Other similar extension points exist, see Microsoft.Common.targets.
index a923730..1a9602f 100644 (file)
@@ -284,6 +284,8 @@ namespace Pithos.Client.WPF
             //Accounts = Settings.Accounts;
             //Settings.Save();            
             Shell.RemoveMonitor(accountName);
+            NotifyOfPropertyChange(() => Accounts);
+            NotifyOfPropertyChange(() => Settings);                       
             
             //NotifyOfPropertyChange("Settings.Accounts");
         }
index 86f5b8a..d9cc8f2 100644 (file)
@@ -3,14 +3,21 @@
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:tb="clr-namespace:Hardcodet.Wpf.TaskbarNotification;assembly=Hardcodet.Wpf.TaskbarNotification" 
         xmlns:cal="http://www.caliburnproject.org"
-        x:Name="TheView"
-         >
+        x:Name="TheView" WindowStartupLocation="CenterScreen" WindowStyle="None"
+        Width="700" Height="200" SizeToContent="Width">
 
+    <Window.Background>
+        <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
+            <GradientStop Color="#4085A5" Offset="0"/>
+            <GradientStop Color="#D7E8F0" Offset="1"/>
+        </LinearGradientBrush>
+    </Window.Background>    
     <Window.Resources>
         <ResourceDictionary>
             <ResourceDictionary.MergedDictionaries>
                 <ResourceDictionary Source="../PithosStyles.xaml" />
             </ResourceDictionary.MergedDictionaries>
+            <BooleanToVisibilityConverter x:Key="BooleanToVisible" />
         </ResourceDictionary>
     </Window.Resources>
     <Grid>
                         >
             <tb:TaskbarIcon.ContextMenu>
                 <ContextMenu x:Name="TaskbarMenu" >
-                    <MenuItem Header="Open PITHOS Folder" x:Name="OpenPithosFolder" ItemsSource="{Binding Accounts}" >
+                    <MenuItem Header="{Binding OpenFolderCaption}" IsEnabled="{Binding HasAccounts}" x:Name="OpenPithosFolder" ItemsSource="{Binding Accounts}" >
                         <MenuItem.ItemTemplate>
                             <DataTemplate>
-                                <TextBlock x:Name="AccountLink" Text="{Binding Path=UserName}" cal:Message.Attach="[Event MouseLeftButtonUp]=[Action OpenPithosFolder($dataContext)]" 
+                                <TextBlock x:Name="AccountLink"  Text="{Binding Path=UserName}" cal:Message.Attach="[Event MouseLeftButtonUp]=[Action OpenPithosFolder($dataContext)]" 
                                            cal:Action.TargetWithoutContext="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=MenuItem, AncestorLevel=2}, Path=DataContext}" />
                             </DataTemplate>
-                        </MenuItem.ItemTemplate>                        
-                        </MenuItem> 
-                    <MenuItem Header="Go to Account Site" x:Name="GoToSiteMenu" ItemsSource="{Binding Accounts}" >
+                        </MenuItem.ItemTemplate>
+                        <MenuItem.Icon>
+                            <Image Source="/Pithos.Client.WPF;component/Images/Folder.ico" />
+                        </MenuItem.Icon>
+                    </MenuItem>
+                    <MenuItem Header="Go to Account Site" x:Name="GoToSiteMenu" ItemsSource="{Binding Accounts}" Visibility="{Binding Path=HasAccounts, Converter={StaticResource BooleanToVisible}}" >
                         <MenuItem.ItemTemplate>
                             <DataTemplate>
                                 <TextBlock x:Name="AccountLink" Text="{Binding Path=UserName}" cal:Message.Attach="[Event MouseLeftButtonUp]=[Action GoToSite($dataContext)]" 
                                            cal:Action.TargetWithoutContext="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=MenuItem, AncestorLevel=2}, Path=DataContext}" />
                             </DataTemplate>
                         </MenuItem.ItemTemplate>
+                        <MenuItem.Icon>
+                            <Image Source="/Pithos.Client.WPF;component/Images/Web.ico" />
+                        </MenuItem.Icon>
                     </MenuItem>
 
                     <MenuItem Header="Recently Changed Files" x:Name="RecentFiles" ItemsSource="{Binding RecentFiles}">
                     <Separator  />
                     <MenuItem  Header="Preferences ..." x:Name="ShowPreferences" cal:Message.Attach="ShowPreferences"  />
                     <Separator  />
-                    <MenuItem  Header="Send Feedback " x:Name="SendFeedback" cal:Message.Attach="SendFeedback"  />
-                    <MenuItem  Header="About Pithos" x:Name="AboutPithos" cal:Message.Attach="AboutPithos"  />
+                    <MenuItem  Header="Send Feedback" x:Name="SendFeedback" cal:Message.Attach="SendFeedback">
+                        <MenuItem.Icon>
+                            <Image Source="/Pithos.Client.WPF;component/Images/Feedback.ico" />
+                        </MenuItem.Icon>
+                    </MenuItem>
+                    <MenuItem  Header="About Pithos" x:Name="AboutPithos" cal:Message.Attach="AboutPithos">
+                        <MenuItem.Icon>
+                            <Image Source="/Pithos.Client.WPF;component/Images/About.ico" />
+                        </MenuItem.Icon>
+                    </MenuItem>
+                    <MenuItem x:Name="GoToSiteRootMenu"  cal:Message.Attach="[Event MouseLeftButtonUp]=[Action GoToSite()]"
+                              cal:Action.TargetWithoutContext="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=MenuItem, AncestorLevel=1}, Path=DataContext}" >
+                        <MenuItem.HeaderTemplate>
+                            <DataTemplate>
+                                <TextBlock x:Name="SiteLink" Text="Go To Pithos Site" cal:Message.Attach="[Event MouseLeftButtonUp]=[Action GoToSite()]" 
+                                           cal:Action.TargetWithoutContext="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=MenuItem, AncestorLevel=1}, Path=DataContext}" />
+                            </DataTemplate>
+                        </MenuItem.HeaderTemplate>
+                        <MenuItem.Icon>
+                            <Image Source="/Pithos.Client.WPF;component/Images/Web.ico" />
+                        </MenuItem.Icon>
+                    </MenuItem>
                     <Separator  />
                     <MenuItem  Header="Exit" Name="ExitPithos" cal:Message.Attach="ExitPithos" />
                 </ContextMenu>
             </tb:TaskbarIcon.ContextMenu>
         </tb:TaskbarIcon>
-        <Image Source="/Pithos.Client.WPF;component/Images/logo.png"/>
+        <Image Margin="0,0,10,5" Source="/Pithos.Client.WPF;component/Images/logo.png" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Stretch="None"/>
     </Grid>
 </Window>
index 2099e38..3a1f7ba 100644 (file)
@@ -105,6 +105,12 @@ namespace Pithos.Client.WPF {
 
                 StatusMessage = "In Synch";
 
+                _accounts.CollectionChanged += (sender, e) =>
+                                                   {
+                                                       NotifyOfPropertyChange(() => OpenFolderCaption);
+                                                       NotifyOfPropertyChange(() => HasAccounts);
+                                                   };
+
             }
             catch (Exception exc)
             {
@@ -113,6 +119,7 @@ namespace Pithos.Client.WPF {
             }
         }
 
+
         protected override void OnActivate()
         {
             base.OnActivate();
@@ -208,9 +215,9 @@ namespace Pithos.Client.WPF {
 
         protected override void OnViewLoaded(object view)
         {
-            var window = (Window)view;
-            window.Hide();
             UpdateStatus();
+            var window = (Window)view;            
+            TaskEx.Delay(1000).ContinueWith(t => Execute.OnUIThread(window.Hide));
             base.OnViewLoaded(view);
         }
 
@@ -228,14 +235,29 @@ namespace Pithos.Client.WPF {
             }
         }
 
-        private ObservableConcurrentCollection<AccountInfo> _accounts = new ObservableConcurrentCollection<AccountInfo>();
+        private readonly ObservableConcurrentCollection<AccountInfo> _accounts = new ObservableConcurrentCollection<AccountInfo>();
         public ObservableConcurrentCollection<AccountInfo> Accounts
         {
             get { return _accounts; }
         }
 
+           public bool HasAccounts
+           {
+            get { return _accounts.Count > 0; }
+           }
+
 
-        private string _pauseSyncCaption="Pause Syncing";
+        public string OpenFolderCaption
+        {
+            get
+            {
+                return (_accounts.Count == 0)
+                        ? "No Accounts Defined"
+                        : "Open Pithos Folder";
+            }
+        }
+
+        private string _pauseSyncCaption="Pause Synching";
         public string PauseSyncCaption
         {
             get { return _pauseSyncCaption; }
@@ -253,13 +275,13 @@ namespace Pithos.Client.WPF {
         }
 
 
-        private string _statusIcon="../Images/Tray.ico";
+        private string _statusIcon="../Images/Pithos.ico";
         public string StatusIcon
         {
             get { return _statusIcon; }
             set
             {
-                _statusIcon = value;
+                //_statusIcon = value;
                 NotifyOfPropertyChange(() => StatusIcon);
             }
         }
@@ -304,6 +326,12 @@ namespace Pithos.Client.WPF {
         }
 
         
+        public void GoToSite()
+        {            
+            var site = Properties.Settings.Default.PithosSite;
+            Process.Start(site);            
+        }
+
         public void GoToSite(AccountInfo account)
         {
             var site = String.Format("{0}/ui/?token={1}&user={2}",
@@ -621,6 +649,9 @@ namespace Pithos.Client.WPF {
             if (String.IsNullOrWhiteSpace(accountName))
                 return;
 
+            var accountInfo=_accounts.FirstOrDefault(account => account.UserName == accountName);
+            _accounts.TryRemove(accountInfo);
+
             PithosMonitor monitor;
             if (Monitors.TryGetValue(accountName, out monitor))
             {
index c404bf5..94b0cdf 100644 (file)
@@ -24,7 +24,6 @@ namespace Pithos.Network
 
         public long BytesUsed { get; set; }
 
-
         public string Usage
         {
             get