summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/Views/LogView.xaml
blob: 34dc9c433d311cad0edc2eb938b1e4cab2e96518 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<Window x:Class="HandBrakeWPF.Views.LogView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:cal="http://www.caliburnproject.org"
        xmlns:Properties="clr-namespace:HandBrakeWPF.Properties"
        xmlns:converters="clr-namespace:HandBrakeWPF.Converters"
        Title="{Binding Title}"
        Width="625"
        Height="650"
        MinWidth="625"
        MinHeight="600"
        WindowStartupLocation="CenterScreen"
        TextOptions.TextFormattingMode="Display">

    <Window.Resources>
        <converters:ThemeImageConverter x:Key="themeConverter" />
    </Window.Resources>

    <Grid>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
                       
            <ToolBar Grid.Row="0"
                     ToolBar.OverflowMode="Never" 
                     ToolBarTray.IsLocked="True"
                     Loaded="ToolBarLoaded"
                     >

                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="Choose Log File: " Margin="5,0,5,0"></TextBlock>
                    <ComboBox ItemsSource="{Binding LogFiles}" SelectedItem="{Binding SelectedLogFile}" Width="195" />
                </StackPanel>

                <Button cal:Message.Attach="[Event Click] = [Action CopyLog]" Margin="10,0,0,0" 
                        AutomationProperties.Name="{x:Static Properties:Resources.LogView_CopyClipboard}" >
                    <StackPanel Orientation="Horizontal">
                        <Image Width="16" Source="{Binding Converter={StaticResource themeConverter}, ConverterParameter='../Views/Images/Copy.png'}" />
                        <TextBlock Margin="2,0,0,0" Text="{x:Static Properties:Resources.LogView_CopyClipboard}" />
                    </StackPanel>
                </Button>
                <Button Margin="5,0,0,0" cal:Message.Attach="[Event Click] = [Action OpenLogDirectory]"
                        AutomationProperties.Name="{x:Static Properties:Resources.LogView_OpenLogDir}" >
                    <StackPanel Orientation="Horizontal">
                        <Image Width="16" Source="{Binding Converter={StaticResource themeConverter}, ConverterParameter='Folder.png'}" />
                        <TextBlock Margin="2,0,0,0" Text="{x:Static Properties:Resources.LogView_OpenLogDir}" />
                    </StackPanel>
                </Button>

            </ToolBar>

            <TextBox Grid.Row="2" ScrollViewer.VerticalScrollBarVisibility="Visible" TextWrapping="Wrap" x:Name="logText" VerticalContentAlignment="Top">

                <TextBox.ContextMenu>
                    <ContextMenu>
                        <MenuItem Header="{x:Static Properties:Resources.LogView_CopyClipboard}" cal:Message.Attach="[Event Click] = [Action CopyLog]" >
                            <MenuItem.Icon>
                                <Image Width="16" Source="{Binding Converter={StaticResource themeConverter}, ConverterParameter='../Views/Images/Copy.png'}" />
                            </MenuItem.Icon>
                        </MenuItem>
                        <MenuItem Header="{x:Static Properties:Resources.LogView_OpenLogDir}" cal:Message.Attach="[Event Click] = [Action OpenLogDirectory]">
                            <MenuItem.Icon>
                                <Image Width="16" Source="{Binding Converter={StaticResource themeConverter}, ConverterParameter='../Views/Images/Folder.png'}" />
                            </MenuItem.Icon>
                        </MenuItem>
                        <Separator />
                        <MenuItem Header="Auto Scroll" IsCheckable="True" IsChecked="True" x:Name="AutoScroll" />
                        
                    </ContextMenu>
                </TextBox.ContextMenu>
            </TextBox>

        </Grid>

    </Grid>
</Window>