Statistics
| Branch: | Revision:

root / trunk / Pithos.Client.WPF / Preferences / PreferencesView.xaml @ 31c97141

History | View | Annotate | Download (15.7 kB)

1
<Window x:Class="Pithos.Client.WPF.Preferences.PreferencesView"
2
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"        
4
        xmlns:cal="http://www.caliburnproject.org"
5
        xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended"
6
        xmlns:Converters="clr-namespace:Pithos.Client.WPF.Converters" 
7
        x:Name="TheView"
8
        Title="Pithos Preferences" Height="436" Width="600" 
9
        ShowInTaskbar="true"
10
        WindowStartupLocation="CenterScreen"
11
        Icon="/Pithos.Client.WPF;component/Images/PithosTaskbar.png"
12
        Background="{StaticResource {x:Static SystemColors.ControlBrushKey}}">
13
        
14
    <Window.Resources>
15
        <ResourceDictionary>
16
        <ResourceDictionary.MergedDictionaries>
17
            <ResourceDictionary Source="..\PithosStyles.xaml" />
18
            </ResourceDictionary.MergedDictionaries>
19
            <Converters:NullToVisibilityConverter x:Key="NullToVisible" />
20
            <BooleanToVisibilityConverter x:Key="BoolToVisible" />
21
        </ResourceDictionary>
22
    </Window.Resources>
23
<!--    <Window.TaskbarItemInfo>
24
        <TaskbarItemInfo Description="{Binding StatusMessage}" >
25
            <TaskbarItemInfo.ThumbButtonInfos>
26
                <ThumbButtonInfo>
27
                    
28
                </ThumbButtonInfo>
29
            </TaskbarItemInfo.ThumbButtonInfos>
30
        </TaskbarItemInfo>
31
    </Window.TaskbarItemInfo>-->
32
    <Grid>
33
        <Grid.RowDefinitions>
34
            <RowDefinition Height="*"/>
35
            <RowDefinition Height="Auto"/>
36
        </Grid.RowDefinitions>
37

    
38
       
39
        <TabControl Grid.Row="0" x:Name="Tabs" >  
40
            <TabItem VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" x:Name="GeneralTab">
41
                <TabItem.Header>
42
                    <StackPanel>
43
                        <Image Source="/Pithos.Client.WPF;component/Images/General.png" Stretch="Uniform" Height="32"/>
44
                        <TextBlock Text="General"/>
45
                    </StackPanel>
46
                </TabItem.Header>
47
                <GroupBox  Height="66" VerticalAlignment="Top" Name="groupBox1" Margin="10,5">
48
                    <StackPanel>
49
                        <CheckBox Content="Show Desktop Notifications" Height="16" Name="Settings_ShowDesktopNotifications" Margin="5,10,5,0" />
50
                        <CheckBox Content="Start on System Startup" Height="16" Name="Settings_StartOnSystemStartup" Margin="5,5,5,0" />
51
                    </StackPanel>
52
                </GroupBox>
53
            </TabItem>
54
            <TabItem VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" x:Name="AccountTab" IsSelected="{Binding AccountTabSelected,Mode=OneWay}">
55
                <TabItem.Header>
56
                    <StackPanel>
57
                        <Image Source="/Pithos.Client.WPF;component/Images/Accounts.png" Stretch="Uniform" Height="32"/>
58
                        <TextBlock Text="Accounts"/>
59
                    </StackPanel>
60
                </TabItem.Header>
61
                <Grid VerticalAlignment="Stretch" >
62
                    <Grid.ColumnDefinitions>
63
                        <ColumnDefinition Width="Auto"/>
64
                        <ColumnDefinition Width="*"/>
65
                    </Grid.ColumnDefinitions>
66
                    <Grid Margin="5,10,5,5" Column="0" Width="250">
67
                        <Grid.RowDefinitions>
68
                            <RowDefinition Height="*"/>
69
                            <RowDefinition Height="Auto"/>
70
                        </Grid.RowDefinitions>
71
                        <ListBox Name="Accounts" Grid.Row="0" VerticalAlignment="Stretch" ItemsSource="{Binding Accounts,Mode=OneWay}" SelectedItem="{Binding CurrentAccount,Mode=TwoWay}" >
72
                            <ListBox.ItemTemplate>
73
                                <DataTemplate>
74
                                    <StackPanel Orientation="Horizontal">
75
                                    <Image Visibility="{Binding Converter={StaticResource BoolToVisible}, Path=IsExpired,Mode=OneWay}" Source="/Pithos.Client.WPF;component/Images/SmallWarning.png" Margin="2,0"/>
76
                                    <TextBlock Text="{Binding AccountName}" />
77
                                    </StackPanel>
78
                                </DataTemplate>
79
                            </ListBox.ItemTemplate>
80
                        </ListBox>
81
                        <StackPanel Orientation="Horizontal" Grid.Row="1">
82
                            <Button Name="AddAccount" Content="Add " ToolTip="Enter account details manually" Style="{StaticResource ButtonStyle}" Width="75"/>
83
                            <Button Name="RemoveAccount" Content="Remove" Style="{StaticResource ButtonStyle}" Width="75"/>                            
84
                        </StackPanel>
85
                    </Grid>
86
                    <GroupBox Header="Account" Padding="5" Margin="5" Height="231" HorizontalAlignment="Stretch" VerticalAlignment="Top" Grid.Column="1" Visibility="{Binding Path=CurrentAccount, Converter={StaticResource NullToVisible},ConverterParameter='Invert'}"
87
                              HorizontalContentAlignment="Center" VerticalContentAlignment="Center">
88
                        <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" TextWrapping="Wrap" >
89
                            No account is selected. Please select an account or add a new one.
90
                        </TextBlock>    
91
                    </GroupBox>
92
                    <GroupBox Header="Account" Padding="5" Margin="5,5,5,0" Height="266" HorizontalAlignment="Stretch" VerticalAlignment="Top" Grid.Column="1" Visibility="{Binding Path=CurrentAccount, Converter={StaticResource NullToVisible}}">
93
                            <Grid>
94
                            <Grid.ColumnDefinitions>
95
                                <ColumnDefinition Width="Auto"/>
96
                                <ColumnDefinition Width="91*"/>
97
                            </Grid.ColumnDefinitions>
98
                            <Grid.RowDefinitions>
99
                                <RowDefinition Height="Auto"/>
100
                                <RowDefinition Height="Auto"/>
101
                                <RowDefinition Height="Auto"/>
102
                                <RowDefinition Height="Auto"/>
103
                                <RowDefinition Height="Auto"/>
104
                                <RowDefinition Height="Auto"/>
105
                                <RowDefinition />
106
                            </Grid.RowDefinitions>
107
                            <Label Content="Server" Grid.Column="0" Grid.Row="0" Margin="0,5" HorizontalAlignment="Left"/>
108
                            <TextBox Name="CurrentAccount_ServerUrl" Grid.Column="1" Grid.Row="0" Margin="5"/>
109
                            <Label Content="Account" Grid.Column="0" Grid.Row="1" Margin="0,5" HorizontalAlignment="Left"/>
110
                            <TextBox Name="CurrentAccount_AccountName" Grid.Column="1" Grid.Row="1" Margin="5"/>
111
                            <Grid Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="2" >
112
                                <Grid.ColumnDefinitions>
113
                                    <ColumnDefinition Width="Auto"/>
114
                                    <ColumnDefinition Width="*"/>
115
                                    <ColumnDefinition Width="Auto"/>
116
                                </Grid.ColumnDefinitions>
117
                                <Label Content="API Key" Grid.Column="0"  Margin="0,5" HorizontalAlignment="Left"/>
118
                                <TextBox  Name="CurrentAccount_ApiKey" Grid.Column="1" Margin="5" />
119
                                <Button Name="RefreshApiKey" Grid.Column="2" Content="Refresh" Margin="5"/>
120
                            </Grid>
121
                            <Label Content="Folder" Grid.Column="0" Grid.Row="3" Margin="0,5" HorizontalAlignment="Left"/>
122
                            <Grid Grid.Row="3" Grid.Column="1" >
123
                                <Grid.ColumnDefinitions>
124
                                    <ColumnDefinition Width="*"/>
125
                                    <ColumnDefinition Width="Auto"/>
126
                                </Grid.ColumnDefinitions>
127
                                <TextBox  Name="CurrentAccount_RootPath" Margin="5" HorizontalAlignment="Stretch" Grid.Column="0"/>
128
                                <Button Name="MoveAccountFolder" Content="Move ..." Width="60" Height="30" Grid.Column="1" />
129
                            </Grid>
130
                            <CheckBox Name="CurrentAccount_IsActive" Content="Account is Active" Grid.Column="1" Grid.Row="4" Margin="5"/>
131
                            <Button Name="SelectiveSyncFolders" Content="Selective Sync" Width="Auto" HorizontalAlignment="Left" Style="{StaticResource ButtonStyle}" Grid.Column="1" Grid.Row="6"/>
132
                            
133
                        </Grid>
134
                        
135
                    </GroupBox>
136
                    
137
                </Grid>
138
            </TabItem>
139
            <TabItem VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" Visibility="Collapsed" x:Name="RateTab">
140
                <TabItem.Header>
141
                    <StackPanel>
142
                        <Image Source="/Pithos.Client.WPF;component/Images/Bandwidth.png" Stretch="Uniform" Height="32"/>
143
                        <TextBlock Text="Bandwidth"/>
144
                    </StackPanel>
145
                </TabItem.Header>
146
                <StackPanel>
147
                    <GroupBox Header="Download Rate" Height="100"   Margin="10,5" VerticalAlignment="Top">
148
                        <Grid />
149
                    </GroupBox>
150
                    <GroupBox Header="Upload Rate" Height="100"   Margin="10,5" VerticalAlignment="Top">
151
                        <Grid />
152
                    </GroupBox>
153
                </StackPanel>
154
            </TabItem>
155
            <TabItem VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" x:Name="ProxyTab">
156
                <TabItem.Header>
157
                    <StackPanel>
158
                        <Image Source="/Pithos.Client.WPF;component/Images/Network.png" Stretch="Uniform" Height="32"/>
159
                        <TextBlock Text="Proxy"/>
160
                    </StackPanel>
161
                </TabItem.Header>
162
                    <Grid Margin="10,5">
163
                        <RadioButton Name="Settings_UseDefaultProxy" Content="Use System Defaults" Margin="5,6,5,0" Height="16" VerticalAlignment="Top"/>
164
                    <RadioButton Name="Settings_UseNoProxy" Content="No Proxy" Margin="5,25,5,0" Height="16" VerticalAlignment="Top"/>
165
                    <RadioButton Name="Settings_UseManualProxy" Content="Manual" Margin="5,44,5,0" Height="16" VerticalAlignment="Top"/>
166
                        <Label Content="Server" Height="28" HorizontalAlignment="Left" Margin="5,63,0,0" Name="label2" VerticalAlignment="Top" />
167
                        <TextBox Height="23" HorizontalAlignment="Left" Margin="76,67,0,0" Name="Settings_ProxyServer" VerticalAlignment="Top" Width="162" IsEnabled="{Binding ElementName=Settings_UseManualProxy, Path=IsChecked}"/>
168
                        <TextBlock Height="23" HorizontalAlignment="Left" Margin="244,67,0,0" Name="textBlock1" Text=":" VerticalAlignment="Top" />
169
                        <TextBox Height="23" HorizontalAlignment="Left" Margin="254,67,0,0" Name="Settings_ProxyPort" VerticalAlignment="Top" Width="65" IsEnabled="{Binding ElementName=Settings_UseManualProxy, Path=IsChecked}"/>
170

    
171
                        <GroupBox Height="109" HorizontalAlignment="Left" Margin="5,96,0,0" Name="groupBox2" VerticalAlignment="Top" Width="373" IsEnabled="{Binding ElementName=Settings_UseManualProxy, Path=IsChecked}">
172
                            <GroupBox.Header>
173
                                <CheckBox Content="Proxy requires authentication" Height="16" VerticalAlignment="Top" Name="Settings_ProxyAuthentication" />
174
                            </GroupBox.Header>
175
                            <Grid >
176
                            <Grid.RowDefinitions>
177
                                <RowDefinition/>
178
                                <RowDefinition/>
179
                                <RowDefinition/>
180
                            </Grid.RowDefinitions>
181
                            <Grid.ColumnDefinitions>
182
                                <ColumnDefinition/>
183
                                <ColumnDefinition/>
184
                            </Grid.ColumnDefinitions>
185
                                <Label Content="Username" Height="28" HorizontalAlignment="Left" Grid.Row="0" Grid.Column="0" VerticalAlignment="Top" />
186
                            <Label Content="Password" Height="28" HorizontalAlignment="Left" Grid.Row="1" Grid.Column="0" VerticalAlignment="Top" />
187
                            <Label Content="Domain" Height="28" HorizontalAlignment="Left" Grid.Row="2" Grid.Column="0"  VerticalAlignment="Top" />
188
                            <TextBox Height="23" HorizontalAlignment="Left" Grid.Row="0" Grid.Column="1" Name="Settings_ProxyUsername" VerticalAlignment="Top" Width="157" IsEnabled="{Binding IsChecked,ElementName=Settings_ProxyAuthentication}"/>
189
                            <TextBox Height="23" HorizontalAlignment="Left" Grid.Row="1" Grid.Column="1" Name="Settings_ProxyPassword" VerticalAlignment="Top" Width="157" IsEnabled="{Binding IsChecked,ElementName=Settings_ProxyAuthentication}"/>
190
                            <TextBox Height="23" HorizontalAlignment="Left" Grid.Row="2" Grid.Column="1" Name="Settings_ProxyDomain" VerticalAlignment="Top" Width="157" IsEnabled="{Binding IsChecked,ElementName=Settings_ProxyAuthentication}"/>
191
                            </Grid>
192
                        </GroupBox>
193
                    </Grid>
194
            </TabItem>
195
            <TabItem VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" x:Name="AdvancedTab">
196
                <TabItem.Header>
197
                    <StackPanel>
198
                        <Image Source="/Pithos.Client.WPF;component/Images/Advanced.png" Stretch="Uniform" Height="32"/>
199
                        <TextBlock Text="Advanced"/>                        
200
                    </StackPanel>
201
                </TabItem.Header>
202
                <StackPanel>
203
                    <CheckBox Content="Activate Shell Extensions" Height="16" HorizontalAlignment="Left" Margin="5" Name="ExtensionsActivated" VerticalAlignment="Top" />
204
                    <Button Content="Refresh Overlays" Name="RefreshOverlays" HorizontalAlignment="Left" Margin="5" Style="{StaticResource ButtonStyle}" Width="Auto" />
205
                    <TextBlock Text="Polling Interval (secs)" Margin="5"/>
206
                    <extToolkit:IntegerUpDown x:Name="Settings_PollingInterval" HorizontalAlignment="Left" Width="100" Margin="5,0" Watermark="Enter seconds" Minimum="10" />                    
207
                    <TextBlock Text="Hashing Parallelism" Margin="5"/>
208
                    <extToolkit:IntegerUpDown x:Name="Settings_HashingParallelism" HorizontalAlignment="Left" Width="100" Margin="5,0" Watermark="Enter number of tasks" Minimum="1" />                    
209
                    <TextBlock Text="Startup Delay (minutes)" Margin="5"/>
210
                    <extToolkit:IntegerUpDown x:Name="StartupDelay" HorizontalAlignment="Left" Width="100" Margin="5,0" Watermark="Enter number of tasks" Minimum="0" />                    
211
                </StackPanel>
212
            </TabItem>
213
        </TabControl>
214

    
215
        <StackPanel Orientation="Horizontal" Grid.Row="1" HorizontalAlignment="Right">
216
            <Button Name="SaveChanges" Content="OK" Margin="5,5,10,5" Style="{StaticResource ButtonStyle}"/>
217
            <Button Name="RejectChanges" Content="Cancel" Margin="5,5,10,5" Style="{StaticResource ButtonStyle}"/>
218
            <Button Name="ApplyChanges" Content="Apply" Style="{StaticResource ButtonStyle}" />
219
        </StackPanel>
220
    </Grid>
221
</Window>