/// This property defines if we trust every ssl connection also when
/// this connection has not a valid cert
/// </summary>
- public Boolean TrustEverySSLConnection { get; set; }
+ public Boolean TrustEverySSLConnection { get; set; }
+
+ public string LatestVersion { get; set; }
/// <summary>
/// ctor which needs the appcast url
// check if update is required
NetSparkleAppCastItem latestVersion = null;
bUpdateRequired = IsUpdateRequired(config, out latestVersion);
+ this.LatestVersion = latestVersion.Version;
if (!bUpdateRequired)
goto WaitSection;
{
get
{
- return "Pithos Log Console";
+ return "Pithos+ Log Console";
}
set
{
>
<StackPanel >
- <Label Content="Pithos Server" Target="{Binding ElementName=Servers}" />
+ <Label Content="Pithos+ Server" Target="{Binding ElementName=Servers}" />
<ComboBox x:Name="Servers" IsEditable="True" ItemsSource="{Binding Servers}"
Text="{Binding CurrentServer,ValidatesOnExceptions=True, Mode=TwoWay}" >
<Validation.ErrorTemplate>
<Image Grid.Column="0" Width="16" Height="16" Source="/PithosPlus;component/Images/Tray.ico" />
<TextBlock Text="URL:" Grid.Column="1" Margin="5,0,5,0" VerticalAlignment="Center"/>
<TextBox Text="{Binding Path=Uri,ElementName=TheView}" Grid.Column="2" Margin="5,0,5,0" IsReadOnly="true"/>
- <Button Content="Retry" Grid.Column="3"/>
+ <Button Content="Retry" Grid.Column="3" x:Name="Retry" Click="Retry_Click" Padding="2"/>
</Grid>
<WebBrowser Grid.Row="1" HorizontalAlignment="Stretch" Margin="5" Name="LoginBrowser" VerticalAlignment="Stretch" Navigating="LoginBrowser_Navigating" />
</Grid>
}
public event PropertyChangedEventHandler PropertyChanged;
+
+ private void Retry_Click(object sender, RoutedEventArgs e)
+ {
+ LoginBrowser.Navigate(Uri);
+ }
}
}
xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended"
xmlns:Converters="clr-namespace:Pithos.Client.WPF.Converters"
x:Name="TheView"
- Title="Pithos Preferences" Height="436" Width="600"
+ Title="Pithos+ Preferences" Height="436" Width="600"
ShowInTaskbar="true"
WindowStartupLocation="CenterScreen"
Icon="/PithosPlus;component/Images/PithosTaskbar.png"
{
// ReSharper disable DoNotCallOverridableMethodsInConstructor
//Caliburn.Micro uses DisplayName for the view's title
- DisplayName = "Pithos Preferences";
+ DisplayName = "Pithos+ Preferences";
// ReSharper restore DoNotCallOverridableMethodsInConstructor
_windowManager = windowManager;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
-[assembly: AssemblyTitle("Pithos Client for Windows")]
-[assembly: AssemblyDescription("Pithos Client for Windows")]
+[assembly: AssemblyTitle("Pithos+ Client for Windows")]
+[assembly: AssemblyDescription("Pithos+ Client for Windows")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("GRNET")]
-[assembly: AssemblyProduct("Pithos Client for Windows")]
+[assembly: AssemblyProduct("Pithos+ Client for Windows")]
[assembly: AssemblyCopyright("Copyright © GRNet 2011-2012")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
+ <RowDefinition Height="Auto"/>
+ <RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Image Grid.Row="0" Source="/PithosPlus;component/Images/SmallLogo.png" />
- <TextBlock Grid.Row="0" Text="Pithos " HorizontalAlignment="Center" FontSize="28" FontWeight="Bold" FontFamily="Segoe UI" Width="200" TextWrapping="WrapWithOverflow" TextAlignment="Center" VerticalAlignment="Center"/>
+ <TextBlock Grid.Row="0" Text="Pithos+ " HorizontalAlignment="Center" FontSize="28" FontWeight="Bold" FontFamily="Segoe UI" Width="200" TextWrapping="WrapWithOverflow" TextAlignment="Center" VerticalAlignment="Center"/>
<StackPanel Grid.Row="1" Orientation="Horizontal" Margin="10,0">
<TextBlock Text="Version" VerticalAlignment="Center"/>
<TextBlock x:Name="Version" Text="0.0.0.0" FontWeight="Bold" Margin="5" VerticalAlignment="Center"/>
<TextBlock Text="Released" VerticalAlignment="Center"/>
<TextBlock x:Name="Released" FontWeight="Bold" Margin="5" VerticalAlignment="Center"/>
</StackPanel>
- <TextBlock Grid.Row="3" Margin="10,0">
+ <StackPanel Grid.Row="3" Orientation="Horizontal" Margin="10,0">
+ <TextBlock Text="Latest Published Version" VerticalAlignment="Center"/>
+ <TextBlock x:Name="LatestVersion" Text="0.0.0.0" FontWeight="Bold" Margin="5" VerticalAlignment="Center"/>
+ </StackPanel>
+ <TextBlock Grid.Row="4" Margin="10,0">
<Run>Visit the </Run>
<Hyperlink NavigateUri="http://code.grnet.gr/projects/pithos-ms-client" >Development Web Site</Hyperlink>
</TextBlock>
- <Button x:Name="CloseAbout" Content="OK" Grid.Row="4" HorizontalAlignment="Center" Width="75" Margin="5" />
+ <TextBlock Grid.Row="5" Margin="10,0" TextWrapping="Wrap">
+ <Bold>Support</Bold><LineBreak/>
+ For help visit the
+ <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>
</Window>
public class AboutViewModel:Screen
{
public string Version { get; set; }
+
+ public string LatestVersion { get; set; }
+ public string LatestRelease { get; set; }
public DateTime Released { get; set; }
</Grid.RowDefinitions>
<StackPanel Grid.Row="0">
- <TextBlock Text="Pithos is currently in alpha test and we would appreciate any kind of feedback. We welcome any suggestions, questions and bug reports you may have" TextWrapping="Wrap" Margin="5,10" />
+ <TextBlock Text="Pithos+ is currently in alpha test and we would appreciate any kind of feedback. We welcome any suggestions, questions and bug reports you may have" TextWrapping="Wrap" Margin="5,10" />
<TextBlock Text="Please describe your problem here providing as many details as possible" Margin="5,10" FontWeight="Bold" TextWrapping="Wrap"/>
</StackPanel>
<TextBox x:Name="Message" Grid.Row="1" HorizontalAlignment="Stretch" TextWrapping="Wrap" AcceptsReturn="True" Height="100" />
var builder = new StringBuilder();
- builder.AppendLine("Pithos Windows Client")
+ builder.AppendLine("Pithos+ Windows Client")
.Append('-', 30)
.AppendLine()
.AppendFormat("Released: {0}\r\n", released)
public void Send()
{
- var message = "Pithos Windows Client Feedback:\r\n" +Message;
+ var message = "Pithos+ Windows Client Feedback:\r\n" +Message;
var fields = new Dictionary<string, string> { { "feedback-msg", message }, { "feedback-data", Data } };
string token="0007";
if (Settings.Default.Accounts.Count>0)
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- Title="Pithos Status" Height="100" Width="250" WindowStyle="ToolWindow" Topmost="True" Icon="/PithosPlus;component/Images/PithosTaskbar.png" WindowStartupLocation="CenterOwner">
+ Title="Pithos+ Status" Height="100" Width="250" WindowStyle="ToolWindow" Topmost="True" Icon="/PithosPlus;component/Images/PithosTaskbar.png" WindowStartupLocation="CenterOwner">
<Border HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" CornerRadius="2">
<Grid>
{
get
{
- return "Pithos Status";
+ return "Pithos+ Status";
}
set
{
<tb:TaskbarIcon x:Name="TaskbarView"
IconSource="{Binding StatusIcon}"
- ToolTipText="{Binding StatusMessage}"
+ ToolTipText="{Binding TooltipMessage}"
MenuActivation="LeftOrRightClick"
DoubleClickCommand="{Binding OpenPithosFolderCommand}"
>
BorderBrush="Black"
BorderThickness="1"
CornerRadius="2">
- <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding StatusMessage}" Margin="5"></TextBlock>
+ <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding TooltipMessage}" Margin="5"></TextBlock>
</Border>
</tb:TaskbarIcon.TrayToolTip>
</tb:TaskbarIcon>
//Logging in the Pithos client is provided by log4net
private static readonly log4net.ILog Log = log4net.LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
- //Lazily initialized File Version info. This is done once and lazily to avoid blocking the UI
- private readonly Lazy<FileVersionInfo> _fileVersion;
-
private readonly PollAgent _pollAgent;
{
_miniStatus = value;
_miniStatus.Shell = this;
+ _miniStatus.Deactivated += (sender, arg) =>
+ {
+ _statusVisible = false;
+ NotifyOfPropertyChange(()=>MiniStatusCaption);
+ };
}
}
? "No Accounts added. Please add an account"
: "Starting";
- _fileVersion= new Lazy<FileVersionInfo>(() =>
- {
- Assembly assembly = Assembly.GetExecutingAssembly();
- var fileVersion = FileVersionInfo.GetVersionInfo(assembly.Location);
- return fileVersion;
- });
_accounts.CollectionChanged += (sender, e) =>
{
NotifyOfPropertyChange(() => OpenFolderCaption);
NotifyOfPropertyChange(() => HasAccounts);
};
+ Assembly assembly = Assembly.GetExecutingAssembly();
+ var fileVersion = FileVersionInfo.GetVersionInfo(assembly.Location);
+ VersionMessage = String.Format("Pithos+ {0}", fileVersion.FileVersion);
+
}
catch (Exception exc)
{
{
_statusMessage = value;
NotifyOfPropertyChange(() => StatusMessage);
+ NotifyOfPropertyChange(() => TooltipMessage);
}
}
- private readonly ObservableConcurrentCollection<AccountInfo> _accounts = new ObservableConcurrentCollection<AccountInfo>();
+ public string VersionMessage { get; set; }
+
+ private string _tooltipMessage;
+ public string TooltipMessage
+ {
+ get
+ {
+ return String.Format("{0}\r\n{1}",VersionMessage,StatusMessage);
+ }
+ }
+
+ private readonly ObservableConcurrentCollection<AccountInfo> _accounts = new ObservableConcurrentCollection<AccountInfo>();
public ObservableConcurrentCollection<AccountInfo> Accounts
{
get { return _accounts; }
public void AboutPithos()
{
- var about = new AboutViewModel();
+ var about = IoC.Get<AboutViewModel>();
+ about.LatestVersion=_sparkle.LatestVersion;
_windowManager.ShowWindow(about);
}
}
public void ShowMiniStatus()
- {
+ {
if (!_statusVisible)
_windowManager.ShowWindow(MiniStatus);
else
- {
- MiniStatus.TryClose();
+ {
+ if (MiniStatus.IsActive)
+ MiniStatus.TryClose();
}
_statusVisible=!_statusVisible;
{
StatusMessage = status;
- _events.Publish(new Notification { Title = "Pithos", Message = status, Level = level });
+ _events.Publish(new Notification { Title = "Pithos+", Message = status, Level = level });
}
public void NotifyChangedFile(string filePath)
StatusMessage = message;
- _events.Publish(new Notification { Title = "Pithos", Message = message, Level = level});
+ _events.Publish(new Notification { Title = "Pithos+", Message = message, Level = level});
}
public void Notify(Notification notification)
if (!_pollStarted)
return;
_pollStarted= false;
- notification.Title = "Pithos";
+ notification.Title = "Pithos+";
notification.Message = "Start Synchronisation";
}
}
var progress = notification as ProgressNotification;
- if (progress != null)
+
+
+ if (progress != null)
{
- StatusMessage = String.Format("Pithos {0}\r\n{1} {2:p2} of {3} - {4}",
- _fileVersion.Value.FileVersion,
+ StatusMessage = String.Format("{0} {1:p2} of {2} - {3}",
progress.Action,
progress.Block/(double)progress.TotalBlocks,
progress.FileSize.ToByteSize(),
var info = notification as StatusNotification;
if (info != null)
{
- StatusMessage = String.Format("Pithos {0}\r\n{1}",
- _fileVersion.Value.FileVersion,
- info.Title);
+ StatusMessage = info.Title;
return;
}
if (String.IsNullOrWhiteSpace(notification.Message) && String.IsNullOrWhiteSpace(notification.Title))
var batch = new FileEventIdleBatch(100, dict => events = dict);
batch.Post(new FileSystemEventArgs(WatcherChangeTypes.Created, "path1", "file1"));
batch.Post(new FileSystemEventArgs(WatcherChangeTypes.Changed, "path1", "file1"));
- batch.Post(new RenamedEventArgs(WatcherChangeTypes.Renamed, "path1", "file2", "file1"));
+ batch.Post(new MovedEventArgs("path1", "file2", "path1", "file1"));
Thread.Sleep(500);
Assert.That(events.ContainsKey("path1\\file1"), Is.False);
Dictionary<string, FileSystemEventArgs[]> events = null;
var batch = new FileEventIdleBatch(100, dict => events = dict);
batch.Post(new FileSystemEventArgs(WatcherChangeTypes.Changed, "path1", "file1"));
- batch.Post(new RenamedEventArgs(WatcherChangeTypes.Renamed, "path1", "file2","file1"));
+ batch.Post(new MovedEventArgs("path1", "file2","path1","file1"));
batch.Post(new FileSystemEventArgs(WatcherChangeTypes.Changed, "path1", "file2"));
Thread.Sleep(500);
Dictionary<string, FileSystemEventArgs[]> events = null;
var batch = new FileEventIdleBatch(100, dict => events = dict);
batch.Post(new FileSystemEventArgs(WatcherChangeTypes.Created, "path1", "file1"));
- batch.Post(new RenamedEventArgs(WatcherChangeTypes.Renamed, "path1", "file2","file1"));
+ batch.Post(new MovedEventArgs("path1", "file2", "path1", "file1"));
batch.Post(new FileSystemEventArgs(WatcherChangeTypes.Changed, "path1", "file2"));
Thread.Sleep(500);
Dictionary<string, FileSystemEventArgs[]> events = null;
var batch = new FileEventIdleBatch(100, dict => events = dict);
batch.Post(new FileSystemEventArgs(WatcherChangeTypes.Created, "path1", "file1"));
- batch.Post(new RenamedEventArgs(WatcherChangeTypes.Renamed, "path1", "file2","file1"));
+ batch.Post(new MovedEventArgs("path1", "file2", "path1", "file1"));
batch.Post(new FileSystemEventArgs(WatcherChangeTypes.Changed, "path1", "file2"));
batch.Post(new FileSystemEventArgs(WatcherChangeTypes.Deleted, "path1", "file2"));
Thread.Sleep(500);
batch.Post(new FileSystemEventArgs(WatcherChangeTypes.Created, "path1", "file1"));
batch.Post(new FileSystemEventArgs(WatcherChangeTypes.Changed, "path1", "file1"));
- batch.Post(new RenamedEventArgs(WatcherChangeTypes.Renamed, "path1", "file3","file2"));
+ batch.Post(new MovedEventArgs("path1", "file3", "path1", "file2"));
Thread.Sleep(500);
{
if (change.ChangeType == WatcherChangeTypes.Renamed)
{
- var rename = (RenamedEventArgs) change;
+ var rename = (MovedEventArgs) change;
_agent.Post(new WorkflowState
{
AccountInfo = AccountInfo,
OldPath = rename.OldFullPath,
- OldFileName = rename.OldName,
+ OldFileName = Path.GetFileName(rename.OldName),
Path = rename.FullPath,
- FileName = rename.Name,
+ FileName = Path.GetFileName(rename.Name),
TriggeringChange = rename.ChangeType
});
}
{
AccountInfo = AccountInfo,
Path = change.FullPath,
- FileName = change.Name,
+ FileName = Path.GetFileName(change.Name),
TriggeringChange = change.ChangeType
});
}
#endregion
using System;
using System.Collections.Generic;
+using System.Diagnostics.Contracts;
using System.IO;
using System.Linq;
using System.Reflection;
public void Post(FileSystemEventArgs arg)
{
+ if (arg is RenamedEventArgs)
+ throw new ArgumentException("arg");
+ Contract.EndContractBlock();
if (Log.IsDebugEnabled)
Log.DebugFormat("Batch Post {0}:{1}", arg.ChangeType.ToString("g"), arg.FullPath);
dict[arg.FullPath] = new[] { arg };
else if (arg.ChangeType == WatcherChangeTypes.Renamed)
{
- var renamedArg = (RenamedEventArgs)arg;
+ var renamedArg = (MovedEventArgs)arg;
FileSystemEventArgs[] oldValue;
if (dict.TryGetValue(renamedArg.OldFullPath, out oldValue))
{
get { return _cachedDeletedFullPath; }\r
set\r
{\r
- Debug.Assert(Path.IsPathRooted(CachedDeletedFullPath));\r
- if (!Path.IsPathRooted(CachedDeletedFullPath))\r
+ Debug.Assert(Path.IsPathRooted(value));\r
+ if (!Path.IsPathRooted(value))\r
Log.WarnFormat("Storing a relative CachedDeletedFullPath: {0}",value);\r
_cachedDeletedFullPath = value;\r
}\r
try\r
{\r
\r
- Moved(sender, new MovedEventArgs(e.FullPath,e.Name,e.OldFullPath,e.OldName));\r
+ Moved(sender, new MovedEventArgs(Path.GetDirectoryName(e.FullPath),Path.GetFileName(e.Name),Path.GetDirectoryName(e.OldFullPath),Path.GetFileName(e.OldName)));\r
}\r
catch (Exception exc)\r
{\r
catch (WebException exc)
{
var response=(exc.Response as HttpWebResponse);
+ if (response == null)
+ throw;
if (response.StatusCode == HttpStatusCode.Forbidden)
{
StatusKeeper.SetFileState(fileInfo.FullName,FileStatus.Forbidden, FileOverlayStatus.Conflict);