-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml
366 lines (343 loc) · 21.9 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
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
<Window x:Class="TVRename.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:self="clr-namespace:TVRename"
xmlns:conv="clr-namespace:TVRename.Converters"
xmlns:command="clr-namespace:TVRename.ViewModel.Commands"
mc:Ignorable="d"
Title="TV Rename v3" Height="450" Width="800" IsTabStop="False" Icon="app.ico">
<Window.CommandBindings>
<CommandBinding Command="command:CustomCommands.Exit" CanExecute="ExitCommand_CanExecute" Executed="ExitCommand_Executed" />
<CommandBinding Command="command:CustomCommands.ShowFilters" Executed="ShowFilters_OnExecuted" />
</Window.CommandBindings>
<Window.Resources>
</Window.Resources>
<DockPanel>
<Menu DockPanel.Dock="Top">
<MenuItem Header="_File">
<MenuItem Header="_Export" />
<MenuItem Header="_Save" />
<Separator />
<MenuItem Header="_Exit" />
</MenuItem>
<MenuItem Header="Options">
<MenuItem Header="Offline Operation" />
<MenuItem Header="Automatic Background Download" />
<Separator />
<MenuItem Header="Preferences" />
<MenuItem Header="Ignore List" />
<MenuItem Header="Filename Template Editor" />
<MenuItem Header="Search Engines" />
<MenuItem Header="Filename Processors" />
</MenuItem>
<MenuItem Header="Tools">
<MenuItem Header="Force Refresh All" />
<MenuItem Header="Background Download Now" />
<Separator />
<MenuItem Header="Bulk Add Shows..." />
<MenuItem Header="Duplicate Episode Finder..." />
<MenuItem Header="Quick Rename..." />
</MenuItem>
<MenuItem Header="View">
<MenuItem Header="Statistics..." />
<Separator />
<MenuItem Header="Show Summary..." />
<MenuItem Header="Actors Grid..." />
</MenuItem>
<MenuItem Header="Beta">
<MenuItem Header="Timezone Inconsistency (log)" />
<MenuItem Header="Episode File Quality Summary (log)" />
</MenuItem>
<MenuItem Header="Help">
<MenuItem Header="Quickstart Guide" />
<MenuItem Header="Visit Website" />
<MenuItem Header="Visit Support Forum" />
<MenuItem Header="Bug Report" />
<Separator />
<MenuItem Header="Buy Me A Drink" />
<Separator />
<MenuItem Header="Check For New Version" />
<Separator />
<MenuItem Header="Log" />
<MenuItem Header="About" />
</MenuItem>
</Menu>
<DockPanel>
<StatusBar x:Name="sbBottomStatusBar" DockPanel.Dock="Bottom">
<StatusBar.Resources>
<self:MainWindowViewModel x:Key="mainVM" />
</StatusBar.Resources>
<StatusBar.DataContext>
<Binding Source="{StaticResource mainVM}" />
</StatusBar.DataContext>
<StatusBar.ItemsPanel>
<ItemsPanelTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="100" />
</Grid.ColumnDefinitions>
</Grid>
</ItemsPanelTemplate>
</StatusBar.ItemsPanel>
<StatusBarItem>
<TextBlock Name="tsShowTxt" Text="{Binding Airing}" />
</StatusBarItem>
<Separator Grid.Column="1" />
<StatusBarItem Grid.Column="2">
<TextBlock Name="txtStatusLabel" Text="{Binding Downloading}" />
</StatusBarItem>
<Separator Grid.Column="3" />
<StatusBarItem Grid.Column="4">
<ProgressBar Value="{Binding Status}" Width="90" Height="16" />
</StatusBarItem>
</StatusBar>
<TabControl x:Name="tabControl1" Height="Auto" VerticalAlignment="Stretch" TabStripPlacement="Left">
<TabItem x:Name="tbMyShows">
<TabItem.Resources>
<self:ShowNameConverter x:Key="ShowNameConverter" />
<self:SeasonNameConverter x:Key="SeasonNameConverter" />
<self:ShowColourConverter x:Key="ShowColourConverter" />
<self:SeasonColourConverter x:Key="SeasonColourConverter" />
<conv:HTMLDetailsConverter x:Key="HTMLDetailsConverter" />
<conv:HTMLImageDetailsConverter x:Key="HTMLImageDetailsConverter" />
</TabItem.Resources>
<TabItem.Header>
<StackPanel Orientation="Vertical">
<Image Height="auto" Width="50" Source="Images/iconfinder_movie-alt_285640.png" />
<TextBlock Text="My Shows" HorizontalAlignment="Center" />
</StackPanel>
</TabItem.Header>
<DockPanel>
<ToolBarTray DockPanel.Dock="Top">
<ToolBar>
<Button Command="command:CustomCommands.ShowFilters" ToolTip="Filter">
<StackPanel Orientation="Vertical">
<Image Source="Images/1608702-64.png" Height="32" />
<TextBlock Text="Filter" HorizontalAlignment="Center" />
</StackPanel>
</Button>
<Button Command="New" Content="Expand/Contract" />
<Button Command="New" Content="Hide Preview" />
<Separator />
<Button Command="New" ToolTip="Add">
<StackPanel Orientation="Vertical">
<Image Source="Images/iconfinder_icon-81-document-add_314445.png" Height="32" />
<TextBlock Text="Add Show" HorizontalAlignment="Center" />
</StackPanel>
</Button>
<Button Command="New" ToolTip="Edit">
<StackPanel Orientation="Vertical">
<Image Source="Images/iconfinder_icon-136-document-edit_314251.png" Height="32" />
<TextBlock Text="Edit Show" HorizontalAlignment="Center" />
</StackPanel>
</Button>
<Button Command="Delete" ToolTip="Delete">
<StackPanel Orientation="Vertical">
<Image Source="Images/iconfinder_icon-27-trash-can_314282.png" Height="32" />
<TextBlock Text="Delete Show" HorizontalAlignment="Center" />
</StackPanel>
</Button>
<Separator />
<Button Command="New" ToolTip="Refresh">
<StackPanel Orientation="Vertical">
<Image Source="Images/iconfinder_53_Cloud_Reload_183466.png" Height="32" />
<TextBlock Text="Refresh" HorizontalAlignment="Center" />
</StackPanel>
</Button>
</ToolBar>
</ToolBarTray>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="300" />
<ColumnDefinition Width="5" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<DockPanel Grid.Column="0">
<DockPanel DockPanel.Dock="Top">
<Button DockPanel.Dock="Right">Clear</Button>
<TextBox x:Name="filterTextBox" Text="{Binding FilterText, UpdateSourceTrigger=PropertyChanged}" TextChanged="filterTextBox_TextChanged" />
</DockPanel>
<TreeView x:Name="MyShowTree" SelectedItemChanged="MyShowTree_OnSelectedItemChanged" DataContext="{Binding VisibleShows, Mode=OneWay}" ItemsSource="{Binding Mode=OneWay}">
<TreeView.Resources>
<HierarchicalDataTemplate DataType="{x:Type self:ShowModel}" ItemsSource="{Binding VisibleSeasons}">
<StackPanel Orientation="Horizontal">
<TextBlock
Text="{Binding Converter={StaticResource ShowNameConverter}}"
Foreground="{Binding Converter={StaticResource ShowColourConverter}}" />
</StackPanel>
</HierarchicalDataTemplate>
<DataTemplate DataType="{x:Type self:Season}">
<StackPanel Orientation="Horizontal">
<TextBlock
Text="{Binding Converter={StaticResource SeasonNameConverter}}" Foreground="{Binding Converter={StaticResource SeasonColourConverter}}"/>
</StackPanel>
</DataTemplate>
</TreeView.Resources>
</TreeView>
</DockPanel>
<GridSplitter x:Name="splitContainer1" Grid.Column="1" HorizontalAlignment="Stretch"/>
<TabControl x:Name="webTabs" Grid.Column="2">
<TabItem Header="Information" Margin="0,0,0,0">
<WebBrowser x:Name="webInformation"
self:WebBrowserUtility.BindableSource="{Binding SelectedShowOrSeason, Converter={StaticResource HTMLDetailsConverter} , UpdateSourceTrigger=PropertyChanged}" />
</TabItem>
<TabItem Header="Images" Margin="0,0,0,0">
<WebBrowser x:Name="webImages"
self:WebBrowserUtility.BindableSource="{Binding SelectedShowOrSeason, Converter={StaticResource HTMLImageDetailsConverter} , UpdateSourceTrigger=PropertyChanged}" />
</TabItem>
</TabControl>
</Grid>
</DockPanel>
</TabItem>
<TabItem x:Name="tbAllInOne" Margin="0,0,0,0">
<TabItem.Header>
<StackPanel Orientation="Vertical">
<Image Height="auto" Width="50" Source="Images/iconfinder_search_285651.png" />
<TextBlock Text="Scan" HorizontalAlignment="Center" />
</StackPanel>
</TabItem.Header>
<DockPanel>
<ToolBarTray DockPanel.Dock="Top">
<ToolBar>
<Button Command="New" ToolTip="Full">
<StackPanel Orientation="Vertical">
<Image Source="Images/iconfinder_icon-111-search_314384.png" Height="32" />
<TextBlock Text="Full" HorizontalAlignment="Center" />
</StackPanel>
</Button>
<Button Command="New" ToolTip="Recent">
<StackPanel Orientation="Vertical">
<Image Source="Images/iconfinder_icon-111-search_314384.png" Height="32" />
<TextBlock Text="Recent" HorizontalAlignment="Center" />
</StackPanel>
</Button>
<Button Command="New" ToolTip="Quick">
<StackPanel Orientation="Vertical">
<Image Source="Images/iconfinder_icon-111-search_314384.png" Height="32" />
<TextBlock Text="Quick" HorizontalAlignment="Center" />
</StackPanel>
</Button>
<Separator />
<Button Command="New" ToolTip="Preferences">
<StackPanel Orientation="Vertical">
<Image Source="Images/iconfinder_icon-86-document-list_314450.png" Height="32" />
<TextBlock Text="Preferences" HorizontalAlignment="Center" />
</StackPanel>
</Button>
<Separator />
<Button Command="New" Content="Do Checked" />
<Button Command="New" ToolTip="Search">
<StackPanel Orientation="Vertical">
<Image Source="Images/iconfinder_icon-74-document-search_314438.png"
Height="32" />
<TextBlock Text="Search" HorizontalAlignment="Center" />
</StackPanel>
</Button>
<Button Command="Save" Content="Ignore Selected" />
<Button Command="Save" Content="Remove Selected" />
</ToolBar>
</ToolBarTray>
<DataGrid x:Name="lvAction">
<DataGrid.Columns>
<DataGridTextColumn Binding="{x:Null}" ClipboardContentBinding="{x:Null}" Header="Show" />
<DataGridTextColumn Binding="{x:Null}" ClipboardContentBinding="{x:Null}"
Header="Season" />
<DataGridTextColumn Binding="{x:Null}" ClipboardContentBinding="{x:Null}"
Header="Episode" />
<DataGridTextColumn Binding="{x:Null}" ClipboardContentBinding="{x:Null}"
Header="Air Date" />
<DataGridTextColumn Binding="{x:Null}" ClipboardContentBinding="{x:Null}"
Header="Folder" />
<DataGridTextColumn Binding="{x:Null}" ClipboardContentBinding="{x:Null}"
Header="Filename" />
<DataGridTextColumn Binding="{x:Null}" ClipboardContentBinding="{x:Null}"
Header="Source" />
<DataGridTextColumn Binding="{x:Null}" ClipboardContentBinding="{x:Null}"
Header="Errors" />
</DataGrid.Columns>
</DataGrid>
</DockPanel>
</TabItem>
<TabItem x:Name="tbWTW" Margin="0,0,0,0">
<TabItem.Resources>
<self:WhenToWatchViewModel x:Key="wtwVM" />
</TabItem.Resources>
<TabItem.DataContext>
<Binding Source="{StaticResource wtwVM}" />
</TabItem.DataContext>
<TabItem.Header>
<StackPanel Orientation="Vertical">
<Image Height="auto" Width="50" Source="Images/iconfinder_calendar-clock_299096.png" />
<TextBlock Text="When to Watch" HorizontalAlignment="Center" />
</StackPanel>
</TabItem.Header>
<DockPanel Background="#FFE5E5E5">
<ToolBarTray DockPanel.Dock="Top">
<ToolBar>
<Button Command="New" ToolTip="Refresh">
<StackPanel Orientation="Vertical">
<Image Source="Images/iconfinder_53_Cloud_Reload_183466.png" Height="32" />
<TextBlock Text="Refresh" HorizontalAlignment="Center" />
</StackPanel>
</Button>
<Button Command="New" ToolTip="Search">
<StackPanel Orientation="Vertical">
<Image Source="Images/iconfinder_icon-74-document-search_314438.png"
Height="32" />
<TextBlock Text="Search" HorizontalAlignment="Center" />
</StackPanel>
</Button>
</ToolBar>
</ToolBarTray>
<DockPanel DockPanel.Dock="Bottom">
<Calendar x:Name="calCalendar" DockPanel.Dock="Right" SelectedDate="{Binding SelectedDateTime}"/>
<TextBox x:Name="txtWhenToWatchSynopsis" />
</DockPanel>
<DataGrid x:Name="lvWhenToWatch" ItemsSource="{Binding UpcomingEpisodes}" AutoGenerateColumns="False" GridLinesVisibility="None">
<DataGrid.GroupStyle>
<GroupStyle>
<GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}">
<Expander IsExpanded="True" Background="White">
<Expander.Header >
<StackPanel Orientation="Horizontal" >
<TextBlock Text="{Binding Name}" Foreground="Navy" Margin="5,0,0,0"/>
<Rectangle HorizontalAlignment="Stretch" VerticalAlignment="Center" Fill="Blue" Height="2"/>
</StackPanel>
</Expander.Header>
<ItemsPresenter />
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</GroupStyle.ContainerStyle>
</GroupStyle>
</DataGrid.GroupStyle>
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding ShowName}" Header="Show" />
<DataGridTextColumn Binding="{Binding AppropriateSeasonNumber}" Header="Season" />
<DataGridTextColumn Binding="{Binding AppropriateEpNum}" Header="Episode" />
<DataGridTextColumn Binding="{Binding AirDate,StringFormat={}{0:d}}" Header="Air Date" />
<DataGridTextColumn Binding="{Binding AirDate,StringFormat={}{0:t}}" Header="Time" />
<DataGridTextColumn Binding="{Binding AirDate,StringFormat={}{0:dddd}}" Header="Day" />
<DataGridTextColumn Binding="{Binding HowLong}" Header="How Long" />
<DataGridTextColumn Binding="{Binding Network}" Header="Network" />
<DataGridTextColumn Binding="{Binding Name}" Header="Episode Name" />
</DataGrid.Columns>
</DataGrid>
</DockPanel>
</TabItem>
</TabControl>
</DockPanel>
</DockPanel>
</Window>