xmlns:tb="clr-namespace:Hardcodet.Wpf.TaskbarNotification;assembly=Hardcodet.Wpf.TaskbarNotification"
xmlns:cal="http://www.caliburnproject.org"
x:Name="TheView"
- Title="Pithos Preferences" Height="381" Width="548"
+ Title="Pithos Preferences" Height="381" Width="600"
ShowInTaskbar="true"
WindowStartupLocation="CenterScreen"
Icon="/Pithos.Client.WPF;component/Images/Tray.ico"
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
- <Grid Margin="5,10,5,5" Column="0" Width="150">
+ <Grid Margin="5,10,5,5" Column="0" Width="250">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</ListBox.ItemTemplate>
</ListBox>
<StackPanel Orientation="Horizontal" Grid.Row="1">
- <Button Name="AddPithosAccount" Content="Add" Style="{StaticResource ButtonStyle}" Width="50"/>
+ <Button Name="AddPithosAccount" Content="Add Pithos" Style="{StaticResource ButtonStyle}" Width="70"/>
+ <Button Name="AddAccount" Content="Add Manual" Style="{StaticResource ButtonStyle}" Width="70"/>
<Button Name="RemoveAccount" Content="Remove" Style="{StaticResource ButtonStyle}" Width="50"/>
</StackPanel>
</Grid>
*/
public void AddAccount()
{
- var newAccount = new AccountSettings();
+ var newAccount = new AccountSettings{AccountName="New Account"};
Settings.Accounts.Add(newAccount);
- //SelectedAccountIndex= Settings.Accounts.Count-1;
+ (Accounts as IProducerConsumerCollection<AccountSettings>).TryAdd(newAccount);
CurrentAccount = newAccount;
NotifyOfPropertyChange(() => Accounts);
NotifyOfPropertyChange(()=>Settings);
StatusKeeper.SetFileOverlayStatus(fullFileName, FileOverlayStatus.Modified);
//And then upload it
- //If the file is larger than the block size, try a hashmap PUT
+ //Upload even small files using the Hashmap. The server may already containt
+ //the relevant folder
+/*
if (fileInfo.Length > accountInfo.BlockSize )
{
+*/
//To upload using a hashmap
//First, calculate the tree hash
var treeHash = Signature.CalculateTreeHashAsync(fileInfo.FullName, accountInfo.BlockSize,
yield return Task.Factory.Iterate(UploadWithHashMap(accountInfo,cloudFile,fileInfo,url,treeHash));
+/*
}
else
{
//Otherwise do a regular PUT
yield return client.PutObject(account, container, url, fullFileName, hash);
}
+*/
//If everything succeeds, change the file and overlay status to normal
this.StatusKeeper.SetFileState(fullFileName, FileStatus.Unchanged, FileOverlayStatus.Normal);
}