|
1 | 1 | <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
2 | 2 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
3 |
| - Title="pyRevit Settings" Height="630" Width="700" ShowInTaskbar="False" ResizeMode="CanResizeWithGrip" |
| 3 | + Title="pyRevit Settings" Height="660" Width="700" ShowInTaskbar="False" ResizeMode="CanResizeWithGrip" |
4 | 4 | WindowStartupLocation="CenterScreen" HorizontalContentAlignment="Center">
|
| 5 | + <Window.Resources> |
| 6 | + <Style x:Key="AnimatedSwitch" TargetType="{x:Type ToggleButton}"> |
| 7 | + <Setter Property="Foreground" Value="Black" /> |
| 8 | + <Setter Property="Background" Value="#FAFAFB" /> |
| 9 | + <Setter Property="BorderBrush" Value="#CCCCCC" /> |
| 10 | + <Setter Property="Template"> |
| 11 | + <Setter.Value> |
| 12 | + <ControlTemplate TargetType="ToggleButton"> |
| 13 | + <Viewbox Stretch="Uniform"> |
| 14 | + <Canvas Name="Layer_1" Width="20" Height="20" Canvas.Left="10" Canvas.Top="0"> |
| 15 | + <Ellipse Canvas.Left="0" Width="20" Height="20" Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1"/> |
| 16 | + <Ellipse Canvas.Left="15" Width="20" Height="20" Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1"/> |
| 17 | + <Border Canvas.Left="10" Width="15" Height="20" Name="rect416927" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0,1,0,1"/> |
| 18 | + <Ellipse x:Name="ellipse" Canvas.Left="0" Width="20" Height="20" Fill="White" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1"> |
| 19 | + <Ellipse.RenderTransform> |
| 20 | + <TranslateTransform X="0" Y="0" /> |
| 21 | + </Ellipse.RenderTransform> |
| 22 | + </Ellipse> |
| 23 | + </Canvas> |
| 24 | + </Viewbox> |
| 25 | + <ControlTemplate.Triggers> |
| 26 | + <Trigger Property="IsChecked" Value="True" > |
| 27 | + <Trigger.EnterActions> |
| 28 | + <BeginStoryboard> |
| 29 | + <Storyboard> |
| 30 | + <ColorAnimation Storyboard.TargetProperty="Background.Color" To="#52D468" Duration="0:0:0.2" /> |
| 31 | + <ColorAnimation Storyboard.TargetProperty="BorderBrush.Color" To="#41C955" Duration="0:0:0.2" /> |
| 32 | + <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Ellipse.RenderTransform).(TranslateTransform.X)" Storyboard.TargetName="ellipse"> |
| 33 | + <SplineDoubleKeyFrame KeyTime="0" Value="0"/> |
| 34 | + <SplineDoubleKeyFrame KeyTime="0:0:0.4" Value="15" KeySpline="0, 1, 0.6, 1"/> |
| 35 | + </DoubleAnimationUsingKeyFrames> |
| 36 | + </Storyboard> |
| 37 | + </BeginStoryboard> |
| 38 | + </Trigger.EnterActions> |
| 39 | + <Trigger.ExitActions> |
| 40 | + <BeginStoryboard> |
| 41 | + <Storyboard> |
| 42 | + <ColorAnimation Storyboard.TargetProperty="Background.Color" To="#FAFAFB" Duration="0:0:0.2" /> |
| 43 | + <ColorAnimation Storyboard.TargetProperty="BorderBrush.Color" To="#CCCCCC" Duration="0:0:0.2" /> |
| 44 | + <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Ellipse.RenderTransform).(TranslateTransform.X)" Storyboard.TargetName="ellipse"> |
| 45 | + <SplineDoubleKeyFrame KeyTime="0" Value="15"/> |
| 46 | + <SplineDoubleKeyFrame KeyTime="0:0:0.3" Value="0" KeySpline="0, 0.5, 0.5, 1"/> |
| 47 | + </DoubleAnimationUsingKeyFrames> |
| 48 | + </Storyboard> |
| 49 | + </BeginStoryboard> |
| 50 | + </Trigger.ExitActions> |
| 51 | + </Trigger> |
| 52 | + </ControlTemplate.Triggers> |
| 53 | + </ControlTemplate> |
| 54 | + </Setter.Value> |
| 55 | + </Setter> |
| 56 | + </Style> |
| 57 | + <Style TargetType="{x:Type TextBox}"> |
| 58 | + <Style.Triggers> |
| 59 | + <Trigger Property="IsReadOnly" Value="True"> |
| 60 | + <Setter Property="Background" Value="#d4d9d0" /> |
| 61 | + <Setter Property="Foreground" Value="#4f693a" /> |
| 62 | + </Trigger> |
| 63 | + </Style.Triggers> |
| 64 | + </Style> |
| 65 | + </Window.Resources> |
5 | 66 | <ScrollViewer>
|
6 | 67 | <StackPanel>
|
7 | 68 | <Expander Header="pyRevit Core Settings:" IsExpanded="False" Margin="10px">
|
8 | 69 | <StackPanel Margin="10px">
|
9 | 70 | <GroupBox Header="Version Control:">
|
10 | 71 | <StackPanel>
|
11 |
| - <CheckBox x:Name="checkupdates_cb" Margin="10,10,0,10" IsChecked="True">Check updates at startup</CheckBox> |
| 72 | + <WrapPanel Margin="10,10,0,10"> |
| 73 | + <ToggleButton Style="{StaticResource AnimatedSwitch}" Height="24" x:Name="checkupdates_cb" IsChecked="False"/> |
| 74 | + <TextBlock Margin="30,4,0,0">Check updates at startup</TextBlock> |
| 75 | + </WrapPanel> |
12 | 76 | <TextBlock TextWrapping="WrapWithOverflow" Margin="10,0,10,10">If activated, pyRevit will check updates for all installed extensions
|
13 | 77 | at Revit startup. If no internet connection is detected, update check will be skipped.</TextBlock>
|
14 | 78 | </StackPanel>
|
|
24 | 88 | <RadioButton x:Name="verbose_rb" GroupName="reporting_level" Margin="10,15,0,5" IsChecked="True">Verbose (logging.INFO and above)</RadioButton>
|
25 | 89 | <TextBlock TextWrapping="WrapWithOverflow" Margin="10,0,10,0">Verbose reporting opens the output window and only prints the info messages.
|
26 | 90 | These messages are meant to provide the most basic necessary information about
|
27 |
| - the current pyRevit session to the user.</TextBlock> |
| 91 | + the current pyRevit session to the user.</TextBlock> |
28 | 92 |
|
29 | 93 | <WrapPanel Margin="10,15,0,5">
|
30 | 94 | <Label>If no errors, close startup window after</Label>
|
31 |
| - <TextBox x:Name="startup_log_timeout" Width="50px" Height="25px"/> |
| 95 | + <TextBox x:Name="startup_log_timeout" Width="50px" Height="25px" IsEnabled="{Binding ElementName=verbose_rb, Path=IsChecked}"/> |
32 | 96 | <Label>seconds. (Set to 0 to keep it open anyways)</Label>
|
33 | 97 | </WrapPanel>
|
34 | 98 |
|
|
73 | 137 | <GroupBox Header="Development:" Margin="0,10,0,0">
|
74 | 138 | <StackPanel>
|
75 | 139 | <TextBlock TextWrapping="WrapWithOverflow" Margin="10,10,10,0">Misc options for pyRevit development </TextBlock>
|
76 |
| - <CheckBox x:Name="loadbetatools_cb" Margin="10,10,0,10" IsChecked="False">Load Beta Tools (Ignores beta parameters in scripts, Reload is required)</CheckBox> |
| 140 | + <WrapPanel Margin="10,10,0,10"> |
| 141 | + <ToggleButton Style="{StaticResource AnimatedSwitch}" Height="24" x:Name="loadbetatools_cb" IsChecked="False"/> |
| 142 | + <TextBlock Margin="30,4,0,0">Load Beta Tools (Ignores beta parameters in scripts, Reload is required)</TextBlock> |
| 143 | + </WrapPanel> |
77 | 144 | </StackPanel>
|
78 | 145 | </GroupBox>
|
79 | 146 | </StackPanel>
|
|
96 | 163 | are available to scripts. They're used as global flags for setting
|
97 | 164 | reporting mode, and also by scripts (e.g. Sync Views) to set their current toggle state.
|
98 | 165 | These variables are accessible by scripts through scriptutils module.</TextBlock>
|
99 |
| - <ListView x:Name="envvars_lb" Margin="0,10,0,0" Height="100"> |
| 166 | + <ListView x:Name="envvars_lb" Margin="0,10,0,0" Height="150"> |
| 167 | + <ListView.Resources> |
| 168 | + <ContextMenu x:Key="ItemContextMenu"> |
| 169 | + <MenuItem x:Name="menuItem_CopyValue" |
| 170 | + Click="copy_envvar_value" |
| 171 | + Header="Copy Variable Value"> |
| 172 | + </MenuItem> |
| 173 | + <MenuItem x:Name="menuItem_CopyId" |
| 174 | + Click="copy_envvar_id" |
| 175 | + Header="Copy Variable Name"> |
| 176 | + </MenuItem> |
| 177 | + </ContextMenu> |
| 178 | + </ListView.Resources> |
| 179 | + <ListView.ItemContainerStyle> |
| 180 | + <Style TargetType="{x:Type ListViewItem}"> |
| 181 | + <Setter Property="ContextMenu" Value="{StaticResource ItemContextMenu}"/> |
| 182 | + </Style> |
| 183 | + </ListView.ItemContainerStyle> |
100 | 184 | <ListView.View>
|
101 | 185 | <GridView>
|
102 |
| - <GridViewColumn Header="Variable Name" Width="410" DisplayMemberBinding="{Binding Id}"/> |
103 |
| - <GridViewColumn Header="Value" Width="100" DisplayMemberBinding="{Binding Value}"/> |
| 186 | + <GridViewColumn Header="Variable Name" Width="180" DisplayMemberBinding="{Binding Id}"/> |
| 187 | + <GridViewColumn Header="Value" DisplayMemberBinding="{Binding Value}"/> |
104 | 188 | </GridView>
|
105 | 189 | </ListView.View>
|
106 | 190 | </ListView>
|
107 | 191 | </StackPanel>
|
108 | 192 | </Expander>
|
109 | 193 | <Separator Margin="10,0,10,0" Background="#dfdfdf"/>
|
| 194 | + <Expander Header="Usage Logging:" IsExpanded="False" Margin="10px"> |
| 195 | + <StackPanel Margin="10px"> |
| 196 | + <TextBlock TextWrapping="WrapWithOverflow" Margin="10,0,10,0">Usage logging system, records each use of tools under any of the pyRevit extensions. |
| 197 | + You can activate usage logging to a local or network folder, or logging to an outside |
| 198 | + webserver, or both. If activated, the system will log usage to any of the outputs provided |
| 199 | + here. Leave any of the fields blank to disable logging to that destination.</TextBlock> |
| 200 | + <TextBlock TextWrapping="WrapWithOverflow" Margin="10,10,10,0">pyRevit creates a new log file for every sesssion to avoid creating large log files that |
| 201 | + would potentially slow down the logger. Log files are written in *.JSON format.</TextBlock> |
| 202 | + <StackPanel > |
| 203 | + <WrapPanel Margin="10,10,10,0"> |
| 204 | + <ToggleButton Style="{StaticResource AnimatedSwitch}" Height="24" x:Name="usagelogging_cb" IsChecked="False"/> |
| 205 | + <TextBlock Margin="30,4,0,0">Log Tool Usage</TextBlock> |
| 206 | + </WrapPanel> |
| 207 | + <DockPanel Margin="10,10,10,0" IsEnabled="{Binding ElementName=usagelogging_cb, Path=IsChecked}"> |
| 208 | + <TextBlock DockPanel.Dock="Left">Current usage log file:</TextBlock> |
| 209 | + <WrapPanel DockPanel.Dock="Right"> |
| 210 | + <Button Content="Open Folder" Width="86" Margin="6,0,0,0" Click="open_usagelog_folder" ToolTip="Open the current usage log folder"/> |
| 211 | + </WrapPanel> |
| 212 | + <TextBox x:Name="cur_usagelogfile_tb" FontFamily="Courier New" Margin="15,0,0,0" Height="20"/> |
| 213 | + </DockPanel> |
| 214 | + <DockPanel Margin="10,10,10,0" IsEnabled="{Binding ElementName=usagelogging_cb, Path=IsChecked}"> |
| 215 | + <TextBlock DockPanel.Dock="Left">Log usage to folder (e.g. C:\pyRevitUsageLogs):</TextBlock> |
| 216 | + <WrapPanel DockPanel.Dock="Right"> |
| 217 | + <Button Content="..." Width="40" Margin="6,0,3,0" Click="pick_usagelog_folder" ToolTip="Pick a folder for usage logging"/> |
| 218 | + <Button Content="Reset" Width="40" Margin="3,0,0,0" Click="reset_usagelog_folder" ToolTip="Reset usage logging folder back to default"/> |
| 219 | + </WrapPanel> |
| 220 | + <TextBox x:Name="usagelogfile_tb" FontFamily="Courier New" Margin="15,0,0,0" Height="20"/> |
| 221 | + </DockPanel> |
| 222 | + <DockPanel Margin="10,10,10,0" IsEnabled="{Binding ElementName=usagelogging_cb, Path=IsChecked}"> |
| 223 | + <TextBlock DockPanel.Dock="Left">Current usage server url:</TextBlock> |
| 224 | + <TextBox x:Name="cur_usageserverurl_tb" FontFamily="Courier New" Margin="15,0,0,0" Height="20"/> |
| 225 | + </DockPanel> |
| 226 | + <DockPanel Margin="10,10,10,0" IsEnabled="{Binding ElementName=usagelogging_cb, Path=IsChecked}"> |
| 227 | + <TextBlock DockPanel.Dock="Left">Log usage to webserver (e.g. http://logserver.io):</TextBlock> |
| 228 | + <TextBox x:Name="usagelogserver_tb" FontFamily="Courier New" Margin="15,0,0,0" Height="20"/> |
| 229 | + </DockPanel> |
| 230 | + </StackPanel> |
| 231 | + </StackPanel> |
| 232 | + </Expander> |
| 233 | + <Separator Margin="10,0,10,0" Background="#dfdfdf"/> |
110 | 234 | <Expander Header="Custom user extension folders:" IsExpanded="True" Margin="10px">
|
111 | 235 | <StackPanel Margin="10px">
|
112 | 236 | <TextBlock TextWrapping="WrapWithOverflow" Margin="10,0,10,0">pyRevit can search in custom folders for extensions.
|
|
0 commit comments