PageRenderTime 6ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/CBR/CBR/Views/File/ConvertView.xaml

#
XAML | 149 lines | 116 code | 25 blank | 8 comment | 0 complexity | b4e41cf78bc79d9cf01eed6385ad02ea MD5 | raw file
  1<UserControl x:Class="CBR.Views.ConvertView"
  2             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
  5             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
  6             mc:Ignorable="d"
  7             xmlns:Fluent="clr-namespace:Fluent;assembly=Fluent"
  8             xmlns:Files="clr-namespace:CBR.Core.Files;assembly=CBR.Core"
  9             xmlns:Converters="clr-namespace:CBR.Components.Converters" Loaded="UserControl_Loaded">
 10    
 11    <UserControl.Resources>
 12
 13        <DataTemplate x:Key="BookTypeTemplate" DataType="{x:Type Files:FileExtension }">
 14        	<Grid Margin="3" >
 15        		<Grid.ColumnDefinitions>
 16        			<ColumnDefinition Width="1*"/>
 17        			<ColumnDefinition Width="3*"/>
 18        		</Grid.ColumnDefinitions>
 19				<Image Width="24" Margin="1,1,10,1" Source="{Binding Type, Converter={x:Static Converters:TypeToImageConverter.Instance}}" />
 20				<StackPanel Grid.Column="1" Margin="2">
 21					<TextBlock Text="{Binding Extension}" />
 22					<TextBlock Text="{Binding DialogDescription}" />
 23				</StackPanel>
 24        	</Grid>
 25        </DataTemplate>
 26        
 27    </UserControl.Resources>
 28    
 29    <Grid Margin="15" HorizontalAlignment="Left" VerticalAlignment="Top">
 30        <Grid.ColumnDefinitions>
 31            <ColumnDefinition Width="2*" />
 32            <ColumnDefinition Width="20" />
 33            <ColumnDefinition Width="2*" />
 34            <ColumnDefinition Width="20" />
 35            <ColumnDefinition Width="Auto" />
 36        </Grid.ColumnDefinitions>
 37        <Grid.RowDefinitions>
 38            <RowDefinition Height="Auto" />
 39            <RowDefinition Height="Auto" />
 40            <RowDefinition Height="Auto" />
 41        </Grid.RowDefinitions>
 42
 43        <StackPanel Grid.ColumnSpan="5">
 44            <TextBlock Style="{StaticResource TitleLabel}" Margin="5" Text="{LocalizationExtension ResModul=CBR.Backstage, Key=ConvertView.Title, DefaultValue=Convert}"></TextBlock>
 45            <Line Style="{StaticResource DashedSeparator}" X1="0" X2="1" />
 46        </StackPanel>
 47
 48        <StackPanel Grid.Row="1" Orientation="Vertical" Margin="10" Name="stack1">
 49            <TextBlock Style="{StaticResource SubTitleLabel}" Margin="5"
 50                       Text="{LocalizationExtension ResModul=CBR.Backstage, Key=ConvertView.LblSource, DefaultValue=Source(s)}"></TextBlock>
 51            <RadioButton GroupName="Source" Margin="5" Name="rbOneSource" Click="rbSource_Click" Content="{LocalizationExtension ResModul=CBR.Backstage, Key=ConvertView.LblSingleFile, DefaultValue=Single file}" />
 52            <Grid IsEnabled="{Binding ElementName=rbOneSource, Path=IsChecked}" Margin="5">
 53                <Grid.ColumnDefinitions>
 54                    <ColumnDefinition Width="*" />
 55                    <ColumnDefinition Width="Auto" />
 56                </Grid.ColumnDefinitions>
 57                <TextBox Name="tbSingleFileSource"></TextBox>
 58                <Button  HorizontalAlignment="Right" Grid.Column="1" Name="btSingleSource" Width="22" Click="btSingleSource_Click">...</Button>
 59            </Grid>
 60            <RadioButton GroupName="Source" Margin="5" Name="rbMultipleSource" Click="rbSource_Click"
 61                         Content="{LocalizationExtension ResModul=CBR.Backstage, Key=ConvertView.LblFolder, DefaultValue=Folder content (recursively)}" />
 62            <Grid IsEnabled="{Binding ElementName=rbMultipleSource, Path=IsChecked}" Margin="5">
 63                <Grid.ColumnDefinitions>
 64                    <ColumnDefinition Width="*" />
 65                    <ColumnDefinition Width="Auto" />
 66                </Grid.ColumnDefinitions>
 67                <TextBox HorizontalAlignment="Stretch" Grid.Column="0" Name="tbFolderSource"></TextBox>
 68                <Button HorizontalAlignment="Right" Grid.Column="1" Name="btFolderSource" Width="22" Click="btFolderSource_Click">...</Button>
 69            </Grid>
 70
 71
 72            <Line Style="{StaticResource DashedSeparator}" X1="0" X2="1" />
 73
 74            <TextBlock Style="{StaticResource SubTitleLabel}" Margin="5"
 75                       Text="{LocalizationExtension ResModul=CBR.Backstage, Key=ConvertView.LblFormat, DefaultValue=Format}" />
 76
 77            <ComboBox Name="comboBoxImputFormat" Margin="5" ItemTemplate="{StaticResource BookTypeTemplate}" Height="45" 
 78					  IsEnabled="{Binding ElementName=rbMultipleSource, Path=IsChecked}"
 79					  SelectionChanged="comboBoxImputFormat_SelectionChanged" />
 80            
 81            <!--<RadioButton GroupName="InputFormat" Margin="5" Name="rbInputFiles" IsEnabled="{Binding ElementName=rbMultipleSource, Path=IsChecked}">Image files</RadioButton>
 82            <RadioButton GroupName="InputFormat" Margin="5" Name="rbInputPDF" IsEnabled="{Binding ElementName=rbMultipleSource, Path=IsChecked}">PDF files</RadioButton>
 83            <RadioButton GroupName="InputFormat" Margin="5" Name="rbInputRAR" IsEnabled="{Binding ElementName=rbMultipleSource, Path=IsChecked}">RAR/CBR files</RadioButton>
 84            <RadioButton GroupName="InputFormat" Margin="5" Name="rbInputZIP" IsEnabled="{Binding ElementName=rbMultipleSource, Path=IsChecked}">ZIP/CBZ files</RadioButton>
 85            <RadioButton GroupName="InputFormat" Margin="5" Name="rbInputXPS" IsEnabled="{Binding ElementName=rbMultipleSource, Path=IsChecked}">XPS files</RadioButton>-->
 86            
 87        </StackPanel>
 88
 89        <Line Grid.Column="1" Grid.Row="1" Style="{StaticResource VerticalSeparator}" />
 90
 91        <StackPanel Grid.Column="2" Grid.Row="1" Margin="10" Name="stack2">
 92            
 93            <TextBlock Style="{StaticResource SubTitleLabel}" Margin="5"
 94                Text="{LocalizationExtension ResModul=CBR.Backstage, Key=ConvertView.LblDestination, DefaultValue=Destination(s)}" />
 95            
 96            <RadioButton GroupName="Destination" Margin="5" Name="rbSameAsSource" Click="rbSameAsSource_Click"
 97                         Content="{LocalizationExtension ResModul=CBR.Backstage, Key=ConvertView.LblOutSame, DefaultValue=Same_as_the_source}" />
 98            <RadioButton GroupName="Destination" Margin="5" Name="rbInOneFolder"
 99                         Content="{LocalizationExtension ResModul=CBR.Backstage, Key=ConvertView.LblOutUnique, DefaultValue=In a unique folder to define below :}" />
100            
101            <Grid IsEnabled="{Binding ElementName=rbInOneFolder, Path=IsChecked}" Margin="5">
102                <Grid.ColumnDefinitions>
103                    <ColumnDefinition Width="*" />
104                    <ColumnDefinition Width="Auto" />
105                </Grid.ColumnDefinitions>
106                <TextBox HorizontalAlignment="Stretch" Grid.Column="0" Name="tbDestinationFolder"></TextBox>
107                <Button HorizontalAlignment="Right" Grid.Column="1" Name="btFolderDestination" Width="22" Click="btFolderDestination_Click">...</Button>
108            </Grid>
109            <Line Style="{StaticResource DashedSeparator}" X1="0" X2="1" />
110
111            <TextBlock Style="{StaticResource SubTitleLabel}" Margin="5" Text="{LocalizationExtension ResModul=CBR.Backstage, Key=ConvertView.LblFormat, DefaultValue=Format}" />
112            <ComboBox Name="comboBoxOuputFormat" Margin="5" ItemTemplate="{StaticResource BookTypeTemplate}" Height="45" />
113            
114            <!--<RadioButton GroupName="OutputFormat" Margin="5" Name="rbOutputFile">Image files</RadioButton>
115            <RadioButton GroupName="OutputFormat" Margin="5" Name="rbOutputCBZ" >CBZ files</RadioButton>
116            <RadioButton GroupName="OutputFormat" Margin="5" Name="rbOutputXPS">XPS files</RadioButton>-->
117
118            <Line Style="{StaticResource DashedSeparator}" X1="0" X2="1" />
119        
120            <TextBlock Style="{StaticResource SubTitleLabel}" Margin="5"
121                       Text="{LocalizationExtension ResModul=CBR.Backstage, Key=ConvertView.LblControl, DefaultValue=Control}" />
122            <CheckBox Margin="5" Name="chkVerify"
123                      Content="{LocalizationExtension ResModul=CBR.Backstage, Key=ConvertView.chkVerify, DefaultValue=Verify page/image count}" />
124            <CheckBox Margin="5" Name="chkUpdate" IsEnabled="{Binding ElementName=rbOutputFile, Path=IsChecked, Converter={x:Static Converters:InvertBooleanConverter.Instance}}"
125                      Content="{LocalizationExtension ResModul=CBR.Backstage, Key=ConvertView.chkUpdateLib, DefaultValue=Update library}" />
126
127        </StackPanel>
128
129        <Line Grid.Column="3" Grid.Row="1" Grid.RowSpan="2" Style="{StaticResource VerticalSeparator}" />
130
131        <StackPanel Grid.Row="1" Grid.Column="5" Orientation="Vertical" Margin="10" >
132            <Button Style="{StaticResource CBROnWhiteButtonStyle}" Width="80" Height="80" Margin="10" Name="btnConvert"
133                    ToolTip="{LocalizationExtension ResModul=CBR.Backstage, Key=ConvertView.BtnConvertTooltip, DefaultValue=Convert_with_the_selected_parameters}" 
134                    Content="{LocalizationExtension ResModul=CBR.Backstage, Key=ConvertView.BtnConvert, DefaultValue=Convert}" Click="btnConvert_Click" />
135            <Button Style="{StaticResource CBROnWhiteButtonStyle}" Width="80" Height="80" Margin="10" Name="btnCancel"
136                    ToolTip="{LocalizationExtension ResModul=CBR.Backstage, Key=ConvertView.BtnCancelTooltip, DefaultValue=Cancel_the_running_convertion}"
137                    Content="{LocalizationExtension ResModul=CBR.Backstage, Key=ConvertView.BtnCancel, DefaultValue=Cancel}" Click="btnCancel_Click" Visibility="Hidden" />
138        </StackPanel>
139
140        <StackPanel Grid.Row="2" Grid.ColumnSpan="3">
141            <TextBlock Style="{StaticResource SubTitleLabel}" Margin="5" Text="{LocalizationExtension ResModul=CBR.Backstage, Key=ConvertView.LblResults, DefaultValue=Result(s)}" />
142            <TextBlock Margin="5" TextWrapping="WrapWithOverflow" TextTrimming="WordEllipsis" Foreground="Red" ForceCursor="True"
143                       Text="{LocalizationExtension ResModul=CBR.Backstage, Key=ConvertView.LblResultsWarning, DefaultValue=Before_deleting_your_files_allways_check_the_resulting_files}" />
144            <TextBlock Margin="5" Text="{LocalizationExtension ResModul=CBR.Backstage, Key=ConvertView.LblResultsSteps, DefaultValue=Current conversion step}" />
145            <ListBox Margin="10" Height="120" Name="lbResults"></ListBox>
146            <ProgressBar Height="22" Name="progressResults" Visibility="Hidden" IsIndeterminate="True"></ProgressBar>
147        </StackPanel>
148    </Grid>
149</UserControl>