Added Check for Updates button to AboutView.xaml
authorpkanavos <pkanavos@gmail.com>
Fri, 16 Mar 2012 16:38:51 +0000 (18:38 +0200)
committerpkanavos <pkanavos@gmail.com>
Fri, 16 Mar 2012 16:38:51 +0000 (18:38 +0200)
Renamed Check for Upgrades to Check for updates

trunk/Pithos.Client.WPF/Shell/AboutView.xaml
trunk/Pithos.Client.WPF/Shell/AboutViewModel.cs
trunk/Pithos.Client.WPF/Shell/ShellView.xaml
trunk/Pithos.Client.WPF/Shell/ShellViewModel.cs

index d326a36..710c8b6 100644 (file)
             <Hyperlink NavigateUri="https://cms.okeanos.grnet.gr/services/pithos/" >Support Site</Hyperlink> or <LineBreak/>send an email to the 
             <Hyperlink NavigateUri="email:support@okeanos.grnet.gr">Support Address</Hyperlink>
         </TextBlock>
-        <Button x:Name="CloseAbout" Content="OK" Grid.Row="6" HorizontalAlignment="Center" Width="75" Margin="5" />
+        <Grid Grid.Row="6" >
+            <Grid.ColumnDefinitions>
+                <ColumnDefinition Width="Auto"/>
+                <ColumnDefinition Width="*"/>
+                <ColumnDefinition Width="Auto"/>
+                
+            </Grid.ColumnDefinitions>
+            <Button x:Name="CheckForUpdates" Content="Check For Upates" Grid.Column="0" HorizontalAlignment="Center" Width="110" Margin="5" />
+            <Button x:Name="CloseAbout" Content="OK" Grid.Column="2" HorizontalAlignment="Center" Width="75" Margin="5" />
+        </Grid>
     </Grid>
 </Window>
index e0b74b7..ccb57d7 100644 (file)
@@ -68,6 +68,9 @@ namespace Pithos.Client.WPF.Shell
 
         public string Bits { get; set; }
 
+        [Import]
+        public ShellViewModel Shell { get; set; }
+        
         public AboutViewModel()
         {
             Assembly assembly = Assembly.GetExecutingAssembly();
@@ -86,5 +89,10 @@ namespace Pithos.Client.WPF.Shell
         {
             this.TryClose();
         }
+
+        public void CheckForUpdates()
+        {
+            Shell.CheckForUpgrade();    
+        }
     }
 }
index 4fab0c5..8394e66 100644 (file)
                             <Image Source="/PithosPlus;component/Images/Feedback.ico" />
                         </MenuItem.Icon>
                     </MenuItem>
-                    <MenuItem  Header="About Pithos" x:Name="AboutPithos" cal:Message.Attach="AboutPithos">
-                        <MenuItem.Icon>
-                            <Image Source="/PithosPlus;component/Images/About.ico" />
-                        </MenuItem.Icon>
-                    </MenuItem>
-                    <MenuItem  Header="Check For Upgrade" x:Name="CheckForUpgrade" cal:Message.Attach="CheckForUpgrade"/>
+                    <MenuItem  Header="Check For Updates" x:Name="CheckForUpgrade" cal:Message.Attach="CheckForUpgrade"/>
                     <MenuItem  Header="{Binding MiniStatusCaption}" x:Name="ShowMiniStatus" cal:Message.Attach="ShowMiniStatus"/>
                     <MenuItem x:Name="GoToSiteRootMenu"  cal:Message.Attach="[Event MouseLeftButtonUp]=[Action GoToSite()]"
                               cal:Action.TargetWithoutContext="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=MenuItem, AncestorLevel=1}, Path=DataContext}" >
                             <Image Source="/PithosPlus;component/Images/Web.ico" />
                         </MenuItem.Icon>
                     </MenuItem>
+                    <MenuItem  Header="About Pithos" x:Name="AboutPithos" cal:Message.Attach="AboutPithos">
+                        <MenuItem.Icon>
+                            <Image Source="/PithosPlus;component/Images/About.ico" />
+                        </MenuItem.Icon>
+                    </MenuItem>
                     <Separator  />
                     <MenuItem  Header="Exit" Name="ExitPithos" cal:Message.Attach="ExitPithos" />
                 </ContextMenu>
index ce2eb94..0a0ce39 100644 (file)
@@ -84,7 +84,7 @@ namespace Pithos.Client.WPF {
        /// * ShowFilePropertiesEvent: Raised when a shell command requests the display of the file/container properties dialog
        ///</remarks>           
        //TODO: CODE SMELL Why does the shell handle the SelectiveSynchChanges?
-       [Export(typeof(IShell))]
+    [Export(typeof(IShell)), Export(typeof(ShellViewModel))]
        public class ShellViewModel : Screen, IStatusNotification, IShell,
                IHandle<Notification>, IHandle<SelectiveSynchChanges>, IHandle<ShowFilePropertiesEvent>
        {
@@ -228,7 +228,7 @@ namespace Pithos.Client.WPF {
                 if (!updaterequired)
                     //Sparkle raises events on a background thread
                     Execute.OnUIThread(()=>
-                        ShowBalloonFor(new Notification{Title="Pithos+ is up to date",Message="You have the latest Pitsos+ version. No update is required"}));
+                        ShowBalloonFor(new Notification{Title="Pithos+ is up to date",Message="You have the latest Pithos+ version. No update is required"}));
             }
            }