Revision 6aa29f4f

b/trunk/Pithos.Client.WPF/Pithos.Client.WPF.csproj
457 457
  <ItemGroup>
458 458
    <Resource Include="Images\logo.png" />
459 459
  </ItemGroup>
460
  <ItemGroup>
461
    <Resource Include="Images\Folder.ico" />
462
    <Resource Include="Images\Web.ico" />
463
  </ItemGroup>
464
  <ItemGroup>
465
    <Resource Include="Images\Pithos.ico" />
466
  </ItemGroup>
467
  <ItemGroup>
468
    <Resource Include="Images\About.ico" />
469
    <Resource Include="Images\Feedback.ico" />
470
  </ItemGroup>
460 471
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
461 472
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
462 473
       Other similar extension points exist, see Microsoft.Common.targets.
b/trunk/Pithos.Client.WPF/Preferences/PreferencesViewModel.cs
284 284
            //Accounts = Settings.Accounts;
285 285
            //Settings.Save();            
286 286
            Shell.RemoveMonitor(accountName);
287
            NotifyOfPropertyChange(() => Accounts);
288
            NotifyOfPropertyChange(() => Settings);                       
287 289
            
288 290
            //NotifyOfPropertyChange("Settings.Accounts");
289 291
        }
b/trunk/Pithos.Client.WPF/Shell/ShellView.xaml
3 3
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4 4
        xmlns:tb="clr-namespace:Hardcodet.Wpf.TaskbarNotification;assembly=Hardcodet.Wpf.TaskbarNotification" 
5 5
        xmlns:cal="http://www.caliburnproject.org"
6
        x:Name="TheView"
7
         >
6
        x:Name="TheView" WindowStartupLocation="CenterScreen" WindowStyle="None"
7
        Width="700" Height="200" SizeToContent="Width">
8 8

  
9
    <Window.Background>
10
        <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
11
            <GradientStop Color="#4085A5" Offset="0"/>
12
            <GradientStop Color="#D7E8F0" Offset="1"/>
13
        </LinearGradientBrush>
14
    </Window.Background>    
9 15
    <Window.Resources>
10 16
        <ResourceDictionary>
11 17
            <ResourceDictionary.MergedDictionaries>
12 18
                <ResourceDictionary Source="../PithosStyles.xaml" />
13 19
            </ResourceDictionary.MergedDictionaries>
20
            <BooleanToVisibilityConverter x:Key="BooleanToVisible" />
14 21
        </ResourceDictionary>
15 22
    </Window.Resources>
16 23
    <Grid>
......
27 34
                        >
28 35
            <tb:TaskbarIcon.ContextMenu>
29 36
                <ContextMenu x:Name="TaskbarMenu" >
30
                    <MenuItem Header="Open PITHOS Folder" x:Name="OpenPithosFolder" ItemsSource="{Binding Accounts}" >
37
                    <MenuItem Header="{Binding OpenFolderCaption}" IsEnabled="{Binding HasAccounts}" x:Name="OpenPithosFolder" ItemsSource="{Binding Accounts}" >
31 38
                        <MenuItem.ItemTemplate>
32 39
                            <DataTemplate>
33
                                <TextBlock x:Name="AccountLink" Text="{Binding Path=UserName}" cal:Message.Attach="[Event MouseLeftButtonUp]=[Action OpenPithosFolder($dataContext)]" 
40
                                <TextBlock x:Name="AccountLink"  Text="{Binding Path=UserName}" cal:Message.Attach="[Event MouseLeftButtonUp]=[Action OpenPithosFolder($dataContext)]" 
34 41
                                           cal:Action.TargetWithoutContext="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=MenuItem, AncestorLevel=2}, Path=DataContext}" />
35 42
                            </DataTemplate>
36
                        </MenuItem.ItemTemplate>                        
37
                        </MenuItem> 
38
                    <MenuItem Header="Go to Account Site" x:Name="GoToSiteMenu" ItemsSource="{Binding Accounts}" >
43
                        </MenuItem.ItemTemplate>
44
                        <MenuItem.Icon>
45
                            <Image Source="/Pithos.Client.WPF;component/Images/Folder.ico" />
46
                        </MenuItem.Icon>
47
                    </MenuItem>
48
                    <MenuItem Header="Go to Account Site" x:Name="GoToSiteMenu" ItemsSource="{Binding Accounts}" Visibility="{Binding Path=HasAccounts, Converter={StaticResource BooleanToVisible}}" >
39 49
                        <MenuItem.ItemTemplate>
40 50
                            <DataTemplate>
41 51
                                <TextBlock x:Name="AccountLink" Text="{Binding Path=UserName}" cal:Message.Attach="[Event MouseLeftButtonUp]=[Action GoToSite($dataContext)]" 
42 52
                                           cal:Action.TargetWithoutContext="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=MenuItem, AncestorLevel=2}, Path=DataContext}" />
43 53
                            </DataTemplate>
44 54
                        </MenuItem.ItemTemplate>
55
                        <MenuItem.Icon>
56
                            <Image Source="/Pithos.Client.WPF;component/Images/Web.ico" />
57
                        </MenuItem.Icon>
45 58
                    </MenuItem>
46 59

  
47 60
                    <MenuItem Header="Recently Changed Files" x:Name="RecentFiles" ItemsSource="{Binding RecentFiles}">
......
70 83
                    <Separator  />
71 84
                    <MenuItem  Header="Preferences ..." x:Name="ShowPreferences" cal:Message.Attach="ShowPreferences"  />
72 85
                    <Separator  />
73
                    <MenuItem  Header="Send Feedback " x:Name="SendFeedback" cal:Message.Attach="SendFeedback"  />
74
                    <MenuItem  Header="About Pithos" x:Name="AboutPithos" cal:Message.Attach="AboutPithos"  />
86
                    <MenuItem  Header="Send Feedback" x:Name="SendFeedback" cal:Message.Attach="SendFeedback">
87
                        <MenuItem.Icon>
88
                            <Image Source="/Pithos.Client.WPF;component/Images/Feedback.ico" />
89
                        </MenuItem.Icon>
90
                    </MenuItem>
91
                    <MenuItem  Header="About Pithos" x:Name="AboutPithos" cal:Message.Attach="AboutPithos">
92
                        <MenuItem.Icon>
93
                            <Image Source="/Pithos.Client.WPF;component/Images/About.ico" />
94
                        </MenuItem.Icon>
95
                    </MenuItem>
96
                    <MenuItem x:Name="GoToSiteRootMenu"  cal:Message.Attach="[Event MouseLeftButtonUp]=[Action GoToSite()]"
97
                              cal:Action.TargetWithoutContext="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=MenuItem, AncestorLevel=1}, Path=DataContext}" >
98
                        <MenuItem.HeaderTemplate>
99
                            <DataTemplate>
100
                                <TextBlock x:Name="SiteLink" Text="Go To Pithos Site" cal:Message.Attach="[Event MouseLeftButtonUp]=[Action GoToSite()]" 
101
                                           cal:Action.TargetWithoutContext="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=MenuItem, AncestorLevel=1}, Path=DataContext}" />
102
                            </DataTemplate>
103
                        </MenuItem.HeaderTemplate>
104
                        <MenuItem.Icon>
105
                            <Image Source="/Pithos.Client.WPF;component/Images/Web.ico" />
106
                        </MenuItem.Icon>
107
                    </MenuItem>
75 108
                    <Separator  />
76 109
                    <MenuItem  Header="Exit" Name="ExitPithos" cal:Message.Attach="ExitPithos" />
77 110
                </ContextMenu>
78 111
            </tb:TaskbarIcon.ContextMenu>
79 112
        </tb:TaskbarIcon>
80
        <Image Source="/Pithos.Client.WPF;component/Images/logo.png"/>
113
        <Image Margin="0,0,10,5" Source="/Pithos.Client.WPF;component/Images/logo.png" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Stretch="None"/>
81 114
    </Grid>
82 115
</Window>
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
            {
b/trunk/Pithos.Network/AccountInfo.cs
24 24

  
25 25
        public long BytesUsed { get; set; }
26 26

  
27

  
28 27
        public string Usage
29 28
        {
30 29
            get

Also available in: Unified diff