-
Notifications
You must be signed in to change notification settings - Fork 1
/
MainWindow.xaml
335 lines (335 loc) · 19.7 KB
/
MainWindow.xaml
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
<Window x:Class="FLogS.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:FLogS"
d:DataContext="{d:DesignInstance Type=local:ContextSettings}"
mc:Ignorable="d"
Loaded="MainGrid_Loaded"
Title="FLogS" Height="700" Width="800" ResizeMode="NoResize">
<Grid x:Name="MainGrid" Tag="MainGrid" Background="DarkGray" MouseMove="MainGrid_MouseMove">
<TabControl Background="DarkGray" BorderThickness="0" SelectionChanged="ActiveMenuChanged">
<TabItem Header="File">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="3*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid Tag="PanelGrid" Background="Beige" Margin="2,0">
<StackPanel Background="LightGray" Margin="2,2">
<ListBox Width="350" Height="430" Margin="0,21" FontSize="14" BorderThickness="1">
<ListBoxItem Content="{Binding LogHeader}"/>
<ListBoxItem Margin="10" Visibility="Hidden"/>
<ListBoxItem FontWeight="Bold" Content="{Binding IntactMessages}"/>
<ListBoxItem Content="{Binding CorruptedTimestamps}"/>
<ListBoxItem Content="{Binding TruncatedMessages}"/>
<ListBoxItem Content="{Binding EmptyMessages}"/>
<ListBoxItem Content="{Binding UnreadData}"/>
<ListBoxItem Margin="10" Visibility="Hidden"/>
<ListBoxItem Tag="WarningLabel" Content="{Binding Exception}"/>
</ListBox>
</StackPanel>
</Grid>
<Grid Tag="PanelGrid" Grid.Column="1" Background="Beige" Margin="2,0">
<StackPanel Tag="Enableable" Background="LightGray" Margin="2,2">
<Button Height="25" Width="40" HorizontalAlignment="Right" Margin="10,10" Content="{Binding ThemeLabel}" Click="ThemeSelector_Click"/>
<Label FontSize="14" Width="300" Height="30" HorizontalContentAlignment="Center" Margin="15,0,0,0" Content="Path to Source Log File"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<Button Width="20" Height="20" Margin="-15,0,10,0" Click="SingleSource_Click" Content="..."/>
<TextBox x:Name="F_Source" Width="300" Height="20" BorderThickness="1"/>
</StackPanel>
<Label FontSize="14" Width="300" Height="30" HorizontalContentAlignment="Center" Margin="15,20,0,0" Content="Path to Destination Log File"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<Button Width="20" Height="20" Margin="-15,0,10,0" Click="SingleDest_Click" Content="..."/>
<TextBox x:Name="F_Output" Width="300" Height="20" BorderThickness="1"/>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="20,10,0,0">
<StackPanel>
<Label Height="26" Margin="0,30,0,0" Content="Select messages after..."/>
<DatePicker x:Name="F_AfterDate" Width="120" SelectedDate="{Binding AfterDate}"/>
</StackPanel>
<StackPanel Margin="25,0,0,0">
<Label Height="26" Margin="0,30,0,0" Content="Select messages before..."/>
<DatePicker x:Name="F_BeforeDate" Width="120" SelectedDate="{Binding BeforeDate}"/>
</StackPanel>
</StackPanel>
<Grid HorizontalAlignment="Center" Margin="0,25,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Label Margin="0,5,10,5" Content="Divide logs by date?"/>
<Label Grid.Row="1" Margin="0,5,10,5" Content="Save non-intact messages?"/>
<Label Grid.Row="2" Margin="0,5,10,5" Content="Save to HTML?"/>
<CheckBox Grid.Column="1" IsChecked="{Binding DivideLogs}" Tag="Enableable"/>
<CheckBox Grid.Column="1" Grid.Row="1" IsChecked="{Binding SaveTruncated}" Tag="Enableable"/>
<CheckBox Grid.Column="1" Grid.Row="2" IsChecked="{Binding SaveHTML}" Tag="Enableable"/>
</Grid>
</StackPanel>
</Grid>
<Grid Tag="PanelGrid" Grid.Row="1" Grid.ColumnSpan="2" Background="Beige" Margin="2,4,2,2">
<StackPanel Tag="Enableable" Background="LightGray" Margin="2,2">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<Label VerticalAlignment="Center" Tag="WarningLabel" FontSize="14" FontStyle="Italic" Content="{Binding WarningText}"/>
<Button Grid.Column="1" Width="100" Height="25" Margin="0,20" IsEnabled="{Binding CanRun}" Click="RunButton_Click" Content="{Binding RunLabel}" Tag="F_"/>
<ProgressBar Grid.Row="1" Grid.ColumnSpan="4" Maximum="{Binding ProgressMax}" Value="{Binding Progress}"/>
</Grid>
</StackPanel>
</Grid>
<Label Grid.Column="1" Grid.Row="1" Style="{StaticResource Version}" Content="{Binding VersionString}" Margin="10,10"/>
</Grid>
</TabItem>
<TabItem Header="Directory">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="3*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid Tag="PanelGrid" Background="Beige" Margin="2,0">
<StackPanel Background="LightGray" Margin="2,2">
<ListBox Width="350" Height="430" Margin="0,21" FontSize="14" BorderThickness="1">
<ListBoxItem Content="{Binding LogHeader}"/>
<ListBoxItem Margin="10" Visibility="Hidden"/>
<ListBoxItem FontWeight="Bold" Content="{Binding IntactMessages}"/>
<ListBoxItem Content="{Binding CorruptedTimestamps}"/>
<ListBoxItem Content="{Binding TruncatedMessages}"/>
<ListBoxItem Content="{Binding EmptyMessages}"/>
<ListBoxItem Content="{Binding UnreadData}"/>
<ListBoxItem Margin="10" Visibility="Hidden"/>
<ListBoxItem Tag="WarningLabel" Content="{Binding Exception}"/>
</ListBox>
</StackPanel>
</Grid>
<Grid Tag="PanelGrid" Grid.Column="1" Background="Beige" Margin="2,0">
<StackPanel Tag="Enableable" Background="LightGray" Margin="2,2">
<Button Height="25" Width="40" HorizontalAlignment="Right" Margin="10,10" Content="{Binding ThemeLabel}" Click="ThemeSelector_Click"/>
<Label FontSize="14" Width="300" Height="30" HorizontalContentAlignment="Center" Margin="15,0,0,0" Content="Path to Source Log Files"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<Button Width="20" Height="20" Margin="-15,0,10,0" Click="MultiSource_Click" Content="..."/>
<TextBox x:Name="D_Source" Width="300" Height="20" BorderThickness="1"/>
</StackPanel>
<Label FontSize="14" Width="300" Height="30" HorizontalContentAlignment="Center" Margin="15,20,0,0" Content="Path to Destination Log Directory"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<Button Width="20" Height="20" Margin="-15,0,10,0" Click="MultiDest_Click" Content="..."/>
<TextBox x:Name="D_Output" Width="300" Height="20" BorderThickness="1"/>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="20,10,0,0">
<StackPanel>
<Label Height="26" Margin="0,30,0,0" Content="Select messages after..."/>
<DatePicker x:Name="D_AfterDate" Width="120" SelectedDate="{Binding AfterDate}"/>
</StackPanel>
<StackPanel Margin="25,0,0,0">
<Label Height="26" Margin="0,30,0,0" Content="Select messages before..."/>
<DatePicker x:Name="D_BeforeDate" Width="120" SelectedDate="{Binding BeforeDate}"/>
</StackPanel>
</StackPanel>
<Grid HorizontalAlignment="Center" Margin="0,25,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Label Margin="0,5,10,5" Content="Divide logs by date?"/>
<Label Grid.Row="1" Margin="0,5,10,5" Content="Save non-intact messages?"/>
<Label Grid.Row="2" Margin="0,5,10,5" Content="Save to HTML?"/>
<CheckBox Grid.Column="1" IsChecked="{Binding DivideLogs}" Tag="Enableable"/>
<CheckBox Grid.Column="1" Grid.Row="1" IsChecked="{Binding SaveTruncated}" Tag="Enableable"/>
<CheckBox Grid.Column="1" Grid.Row="2" IsChecked="{Binding SaveHTML}" Tag="Enableable"/>
</Grid>
</StackPanel>
</Grid>
<Grid Tag="PanelGrid" Grid.Row="1" Grid.ColumnSpan="2" Background="Beige" Margin="2,4,2,2">
<StackPanel Tag="Enableable" Background="LightGray" Margin="2,2">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<Label VerticalAlignment="Center" Tag="WarningLabel" FontSize="14" FontStyle="Italic" Content="{Binding WarningText}"/>
<Button Grid.Column="1" Width="100" Height="25" Margin="0,20" IsEnabled="{Binding CanRun}" Click="RunButton_Click" Content="{Binding RunLabel}" Tag="D_"/>
<ProgressBar Grid.Row="1" Grid.ColumnSpan="4" Maximum="{Binding ProgressMax}" Value="{Binding Progress}"/>
</Grid>
</StackPanel>
</Grid>
<Label Grid.Column="1" Grid.Row="1" Style="{StaticResource Version}" Content="{Binding VersionString}" Margin="10,10"/>
</Grid>
</TabItem>
<TabItem Header="Phrase">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="3*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid Tag="PanelGrid" Background="Beige" Margin="2,0">
<StackPanel Background="LightGray" Margin="2,2">
<ListBox Width="350" Height="430" Margin="0,21" FontSize="14" BorderThickness="1">
<ListBoxItem Content="{Binding LogHeader}"/>
<ListBoxItem Margin="10" Visibility="Hidden"/>
<ListBoxItem FontWeight="Bold" Content="{Binding IntactMessages}"/>
<ListBoxItem Content="{Binding CorruptedTimestamps}"/>
<ListBoxItem Content="{Binding TruncatedMessages}"/>
<ListBoxItem Content="{Binding EmptyMessages}"/>
<ListBoxItem Content="{Binding UnreadData}"/>
<ListBoxItem Margin="10" Visibility="Hidden"/>
<ListBoxItem Tag="WarningLabel" Content="{Binding Exception}"/>
</ListBox>
</StackPanel>
</Grid>
<Grid Tag="PanelGrid" Grid.Column="1" Background="Beige" Margin="2,0">
<StackPanel Tag="Enableable" Background="LightGray" Margin="2,2">
<Button Height="25" Width="40" HorizontalAlignment="Right" Margin="10,10" Content="{Binding ThemeLabel}" Click="ThemeSelector_Click"/>
<Label FontSize="14" Width="300" Height="30" HorizontalContentAlignment="Center" Margin="15,0,0,0" Content="Path to Source Log Files"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<Button Width="20" Height="20" Margin="-15,0,10,0" Click="MultiSource_Click" Content="..."/>
<TextBox x:Name="P_Source" Width="300" Height="20" BorderThickness="1"/>
</StackPanel>
<Label FontSize="14" Width="300" Height="30" HorizontalContentAlignment="Center" Margin="15,20,0,0" Content="Path to Destination Log Directory"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<Button Width="20" Height="20" Margin="-15,0,10,0" Click="MultiDest_Click" Content="..."/>
<TextBox x:Name="P_Output" Width="300" Height="20" BorderThickness="1"/>
</StackPanel>
<Label x:Name="P_SearchLabel" FontSize="14" Width="300" Height="30" HorizontalContentAlignment="Center" Margin="15,20,0,0" Content="Target Word or Phrase"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<CheckBox Width="16" Height="16" Margin="-12,0,10,0" IsChecked="{Binding Regex}" ToolTip="Regex search?"/>
<TextBox x:Name="P_Search" Width="300" Height="20" Margin="2,0,0,0" BorderThickness="1"/>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="20,5,0,0">
<StackPanel>
<Label Height="26" Margin="0,30,0,0" Content="Select messages after..."/>
<DatePicker x:Name="P_AfterDate" Width="120" SelectedDate="{Binding AfterDate}"/>
</StackPanel>
<StackPanel Margin="25,0,0,0">
<Label Height="26" Margin="0,30,0,0" Content="Select messages before..."/>
<DatePicker x:Name="P_BeforeDate" Width="120" SelectedDate="{Binding BeforeDate}"/>
</StackPanel>
</StackPanel>
<Grid HorizontalAlignment="Center" Margin="0,25,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Label Margin="0,5,10,5" Content="Divide logs by date?"/>
<Label Grid.Row="1" Margin="0,5,10,5" Content="Save non-intact messages?"/>
<Label Grid.Row="2" Margin="0,5,10,5" Content="Save to HTML?"/>
<CheckBox Grid.Column="1" IsChecked="{Binding DivideLogs}" Tag="Enableable"/>
<CheckBox Grid.Column="1" Grid.Row="1" IsChecked="{Binding SaveTruncated}" Tag="Enableable"/>
<CheckBox Grid.Column="1" Grid.Row="2" IsChecked="{Binding SaveHTML}" Tag="Enableable"/>
</Grid>
</StackPanel>
</Grid>
<Grid Tag="PanelGrid" Grid.Row="1" Grid.ColumnSpan="2" Background="Beige" Margin="2,4,2,2">
<StackPanel Tag="Enableable" Background="LightGray" Margin="2,2">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<Label VerticalAlignment="Center" Tag="WarningLabel" FontSize="14" FontStyle="Italic" Content="{Binding WarningText}"/>
<Button Grid.Column="1" Width="100" Height="25" Margin="0,20" IsEnabled="{Binding CanRun}" Click="RunButton_Click" Content="{Binding RunLabel}" Tag="P_"/>
<ProgressBar Grid.Row="1" Grid.ColumnSpan="4" Maximum="{Binding ProgressMax}" Value="{Binding Progress}"/>
</Grid>
</StackPanel>
</Grid>
<Label Grid.Column="1" Grid.Row="1" Style="{StaticResource Version}" Content="{Binding VersionString}" Margin="10,10"/>
</Grid>
</TabItem>
<TabItem Header="Help">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid Tag="PanelGrid" Grid.RowSpan="2" Background="Beige" Margin="2,0,2,2">
<StackPanel Grid.RowSpan="2" Background="LightGray" Margin="2,2">
<Label FontSize="24" FontFamily="Century" FontWeight="Bold" Margin="0,10" Content="What is this program for?"/>
<TextBlock TextWrapping="WrapWithOverflow" HorizontalAlignment="Left" FontSize="14" FontFamily="Calibri" Margin="10,20">
In brief, <Bold>FLogS</Bold> is designed for the salvaging of data from F-Chat™ binary log files that have been corrupted or damaged.<LineBreak/>
Many F-Chat users accrue very large log files over the course of years of tenure on F-Chat.
As file sizes increase, so too does the sentimenal value of those logs.
As technology evolves, computers are bought and replaced, and files make the transition from drive to drive, corruption is bound to happen sooner or later.<LineBreak/>
Oftentimes the corruption is severe enough that F-Chat's native clients cannot read the logs, and since a client can't export logs it can't read, the data is lost.<LineBreak/>
<Bold>FLogS</Bold> cannot repair log corruption, but is capable of scanning a user's logs and picking out messages that remain intact, saving them elsewhere in plaintext format.<LineBreak/><LineBreak/>
<Bold>FLogS</Bold> does not distinguish partially from fully corrupted data.
An option is provided to save corrupted data in case it contains something readable, but by default, <Bold>FLogS</Bold> will only save what is entirely clean.<LineBreak/>
Viewing HTML output can be very resource-intensive if the source file is particularly large. Take caution when translating very old logs to HTML format.<LineBreak/><LineBreak/>
<Span Tag="WarningLabel"><Bold>FLogS</Bold> is not a substitute for ADL:</Span> Plaintext logs generated by this program <Italic>cannot</Italic> be accepted by F-List staff in case of a dispute, even if the source file is completely intact.
</TextBlock>
</StackPanel>
</Grid>
<Grid Tag="PanelGrid" Grid.Column="1" Grid.RowSpan="2" Background="Beige" Margin="2,0,2,2">
<StackPanel Background="LightGray" Margin="2,2">
<Label FontSize="24" FontFamily="Century" FontWeight="Bold" Margin="0,10" Content="How do I use this program?"/>
<TextBlock TextWrapping="WrapWithOverflow" HorizontalAlignment="Left" FontSize="14" FontFamily="Calibri" Margin="10,20">
It's as simple as one, two, three, four!<LineBreak/><LineBreak/>
<Bold>For file processing:</Bold><LineBreak/>
Click on the <Bold>File</Bold> tab at the top to export a single log file, or <Bold>Directory</Bold> to export many files at once.<LineBreak/>
Select one or more F-Chat log files by clicking the first button labelled "..." and following the prompt.
Or, you may enter a path manually.<LineBreak/>
Select a destination file or folder by clicking the second "..." button or entering a manual path.<LineBreak/>
You may optionally enter an inclusive range of dates to scan for messages - <Bold>FLogS</Bold> will discard messages outside this range.<LineBreak/>
You may also choose whether to save to plaintext or to HTML format.<LineBreak/>
<LineBreak/>
<Bold>For advanced searching:</Bold><LineBreak/>
Select the <Bold>Phrase</Bold> tab at the top.<LineBreak/>
Follow the above procedure, and enter a word or phrase to search for in the labelled text box.<LineBreak/>
Check the box next to the phrase text to search using <Hyperlink x:Name="RegExLink" Foreground="DarkBlue" NavigateUri="https://learn.microsoft.com/en-us/dotnet/standard/base-types/regular-expression-language-quick-reference" RequestNavigate="Hyperlink_RequestNavigate">.NET regular expressions.</Hyperlink><LineBreak/>
<Bold>FLogS</Bold> will output only messages containing the text (or matching the pattern) that you enter.
</TextBlock>
</StackPanel>
</Grid>
<Label Style="{StaticResource Version}" Grid.Row="1" Grid.Column="1" Content="{Binding VersionString}" Margin="10,10"/>
</Grid>
</TabItem>
</TabControl>
</Grid>
</Window>