aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/HotFolderConfigurationView.xaml
blob: be43b3218fe504bf35f7bd9f6f7c8d436100c9be (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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<UserControl x:Class="Tango.FSE.UI.Dialogs.HotFolderConfigurationView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:controls="clr-namespace:Tango.FSE.Common.Controls;assembly=Tango.FSE.Common"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:material="http://materialdesigninxaml.net/winfx/xaml/themes"
             xmlns:local="clr-namespace:Tango.FSE.UI.Dialogs"
             xmlns:hotFolder="clr-namespace:Tango.FSE.Common.HotFolder;assembly=Tango.FSE.Common"
             mc:Ignorable="d" 
             Width="600" Height="500" d:DataContext="{d:DesignInstance Type=local:HotFolderConfigurationViewVM, IsDesignTimeCreatable=False}" Background="{StaticResource FSE_PrimaryBackgroundLightBrush}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}">
    <DockPanel Margin="10">

        <StackPanel DockPanel.Dock="Top" Orientation="Horizontal">
            <Image Source="/Images/hot_folder.png" Width="42" Height="42" VerticalAlignment="Center" RenderOptions.BitmapScalingMode="Fant" />
            <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" FontSize="{StaticResource FSE_LargeFontSize}">
                <Run>Hot Folder</Run>
            </TextBlock>
        </StackPanel>

        <Grid Margin="0 20 0 0" DockPanel.Dock="Top">
            <DockPanel>
                <TextBlock DockPanel.Dock="Top" TextWrapping="Wrap">Hot folder allows dropping job files to a predefined folder that will automatically be uploaded to the connected machine.</TextBlock>
                <Grid Margin="0 20 0 0">
                    <DockPanel>
                        <StackPanel DockPanel.Dock="Top">
                            <CheckBox IsChecked="{Binding HotFolderService.Enabled}">Enabled</CheckBox>

                            <TextBlock Margin="0 20 0 0" FontSize="{StaticResource FSE_SmallFontSize}">Hot Folder Path</TextBlock>
                            <DockPanel>
                                <Button ToolTip="Select hot folder" DockPanel.Dock="Right" Margin="10 0 0 0" Style="{StaticResource FSE_FlatButton_OpacityHover}" Padding="0" Command="{Binding BrowseHotFolderCommand}">
                                    <material:PackIcon Kind="FolderOpenOutline" Width="20" Height="20" />
                                </Button>
                                <TextBox Style="{StaticResource FSE_Rounded_Corners_TextBox}" FontSize="{StaticResource FSE_SmallFontSize}" Text="{Binding HotFolderService.HotFolderPath}" IsReadOnly="True"></TextBox>
                            </DockPanel>
                        </StackPanel>

                        <GroupBox Padding="4" Margin="0 10 0 0" Style="{StaticResource FSE_Game_GroupBox}">
                            <GroupBox.Header>
                                <TextBlock>Outbox</TextBlock>
                            </GroupBox.Header>


                            <ListBox ItemsSource="{Binding HotFolderService.Items}" Background="{StaticResource FSE_Panel_BackgroundBrush}" HorizontalContentAlignment="Stretch">
                                <ListBox.ItemTemplate>
                                    <DataTemplate>
                                        <DockPanel VerticalAlignment="Top" HorizontalAlignment="Stretch">
                                            <Grid>
                                                <material:PackIcon Width="24">
                                                    <material:PackIcon.Style>
                                                        <Style TargetType="material:PackIcon">
                                                            <Setter Property="Visibility" Value="Visible"></Setter>
                                                            <Style.Triggers>
                                                                <DataTrigger Binding="{Binding Status}" Value="{x:Static hotFolder:HotFolderItemStatus.Pending}">
                                                                    <Setter Property="Visibility" Value="Hidden"></Setter>
                                                                </DataTrigger>
                                                                <DataTrigger Binding="{Binding Status}" Value="{x:Static hotFolder:HotFolderItemStatus.Uploading}">
                                                                    <Setter Property="Visibility" Value="Hidden"></Setter>
                                                                </DataTrigger>
                                                                <DataTrigger Binding="{Binding Status}" Value="{x:Static hotFolder:HotFolderItemStatus.Completed}">
                                                                    <Setter Property="Kind" Value="Check"></Setter>
                                                                    <Setter Property="Foreground" Value="{StaticResource FSE_SuccessBrush}"></Setter>
                                                                </DataTrigger>
                                                                <DataTrigger Binding="{Binding Status}" Value="{x:Static hotFolder:HotFolderItemStatus.Failed}">
                                                                    <Setter Property="Kind" Value="Alert"></Setter>
                                                                    <Setter Property="Foreground" Value="{StaticResource FSE_ErrorBrush}"></Setter>
                                                                </DataTrigger>
                                                                <DataTrigger Binding="{Binding Status}" Value="{x:Static hotFolder:HotFolderItemStatus.CompletedWithError}">
                                                                    <Setter Property="Kind" Value="Alert"></Setter>
                                                                    <Setter Property="Foreground" Value="{StaticResource FSE_WarningBrush}"></Setter>
                                                                </DataTrigger>
                                                            </Style.Triggers>
                                                        </Style>
                                                    </material:PackIcon.Style>
                                                </material:PackIcon>
                                                <controls:ProgressRing IsIndeterminate="True" Maximum="100" Value="50" Width="18" Height="18">
                                                    <controls:ProgressRing.Style>
                                                        <Style TargetType="controls:ProgressRing" BasedOn="{StaticResource {x:Type controls:ProgressRing}}">
                                                            <Setter Property="Visibility" Value="Hidden"></Setter>
                                                            <Style.Triggers>
                                                                <DataTrigger Binding="{Binding Status}" Value="{x:Static hotFolder:HotFolderItemStatus.Pending}">
                                                                    <Setter Property="Visibility" Value="Visible"></Setter>
                                                                    <Setter Property="Foreground" Value="{StaticResource FSE_GrayBrush}"></Setter>
                                                                </DataTrigger>
                                                                <DataTrigger Binding="{Binding Status}" Value="{x:Static hotFolder:HotFolderItemStatus.Uploading}">
                                                                    <Setter Property="Visibility" Value="Visible"></Setter>
                                                                </DataTrigger>
                                                            </Style.Triggers>
                                                        </Style>
                                                    </controls:ProgressRing.Style>
                                                </controls:ProgressRing>
                                            </Grid>

                                            <Button Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.RetryCommand}" CommandParameter="{Binding}" DockPanel.Dock="Right" Style="{StaticResource FSE_RaisedButton_Dark_Hover}" FontSize="{StaticResource FSE_SmallFontSize}" VerticalAlignment="Top" Visibility="{Binding Status,Converter={StaticResource EnumToVisibilityConverter},ConverterParameter='Failed'}">
                                                Retry
                                            </Button>

                                            <StackPanel Margin="10 0 0 0" Orientation="Vertical">
                                                <TextBlock Text="{Binding Name}" FontSize="{StaticResource FSE_SmallFontSize}"></TextBlock>
                                                <TextBlock FontSize="{StaticResource FSE_SmallerFontSize}" Foreground="{StaticResource FSE_GrayBrush}" Text="{Binding Message}" TextWrapping="Wrap" Margin="0 0 10 0"></TextBlock>
                                            </StackPanel>
                                        </DockPanel>
                                    </DataTemplate>
                                </ListBox.ItemTemplate>
                            </ListBox>
                        </GroupBox>
                    </DockPanel>
                </Grid>
            </DockPanel>
        </Grid>
    </DockPanel>
</UserControl>