-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
184 lines (184 loc) · 14.3 KB
/
Copy pathMainWindow.xaml
File metadata and controls
184 lines (184 loc) · 14.3 KB
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
<Window x:Class="ValheimSaveShield.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:ValheimSaveShield"
mc:Ignorable="d"
xmlns:ui="http://schemas.modernwpf.com/2019"
ui:WindowHelper.UseModernWindowStyle="True"
Title="Valheim Save Shield" Height="500" Width="800" Loaded="Window_Loaded" Icon="Resources/vss_32.png" Closing="Window_Closing" Closed="Window_Closed" Deactivated="Window_Deactivated" MinHeight="200" MinWidth="300" StateChanged="Window_StateChanged" IsVisibleChanged="Window_IsVisibleChanged" ContentRendered="Window_ContentRendered">
<Window.Resources>
<Image x:Key="Save" Source="Resources/Save_32x.png"/>
<Image x:Key="SaveGrey" Source="Resources/Save_grey_32x.png"/>
<Image x:Key="Restore" Source="Resources/Undo_32x.png"/>
<Image x:Key="RestoreGrey" Source="Resources/Undo_grey_32x.png"/>
<Image x:Key="StatusOK" Height="16" Width="16" Source="Resources/StatusOK_32x.png"/>
<Image x:Key="StatusNo" Height="16" Width="16" Source="Resources/StatusNo_32x.png"/>
<Image x:Key="Edit" Source="Resources/Edit_32x.png"/>
<Image x:Key="EditGrey" Source="Resources/Edit_grey_32x.png"/>
<Image x:Key="Remove" Source="Resources/Remove_32x.png"/>
<Image x:Key="RemoveGrey" Source="Resources/Remove_grey_32x.png"/>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition x:Name="ForBackups" Height="*" />
<RowDefinition x:Name="ForStatusbar" Height="Auto" />
</Grid.RowDefinitions>
<TabControl Grid.Row="0" TabIndex="5">
<TabItem x:Name="tabBackups" Header="Backups">
<DataGrid x:Name="dataBackups" SelectionMode="Single" CanUserDeleteRows="False" AutoGeneratingColumn="DataBackups_AutoGeneratingColumn" ContextMenuOpening="dataBackups_ContextMenuOpening">
<DataGrid.Columns>
<DataGridTextColumn Header="Label" Binding="{Binding Path=Label}"/>
<DataGridCheckBoxColumn Header="Keep" Binding="{Binding Path=Keep}"/>
<DataGridTextColumn Header="Name" IsReadOnly="True" Binding="{Binding Path=Name, Mode=OneWay}"/>
<DataGridTextColumn Header="Type" IsReadOnly="True" Binding="{Binding Path=Type, Mode=OneWay}"/>
<DataGridTextColumn Header="Save Date" IsReadOnly="True" Binding="{Binding Path=SaveDate, Mode=OneWay}"/>
<DataGridCheckBoxColumn Header="Active" IsReadOnly="True" Binding="{Binding Path=Active, Mode=OneWay}"/>
</DataGrid.Columns>
<DataGrid.ContextMenu>
<ContextMenu x:Name="menuBackups" Opened="menuBackups_Opened">
<MenuItem x:Name="menuBackupsRestore" Header="Restore" Click="menuBackupsRestore_Click">
<MenuItem.Icon>
<DynamicResource ResourceKey="Restore"/>
</MenuItem.Icon>
</MenuItem>
<MenuItem x:Name="menuBackupsViewMap" Header="View Map" Click="menuBackupsViewMap_Click">
<MenuItem.Icon>
<Image Source="Resources/MapTileLayer_32x.png"/>
</MenuItem.Icon>
</MenuItem>
<MenuItem x:Name="menuBackupsDelete" Header="Delete" Click="menuBackupsDelete_Click">
<MenuItem.Icon>
<Image Source="Resources/Trash_32x.png"/>
</MenuItem.Icon>
</MenuItem>
</ContextMenu>
</DataGrid.ContextMenu>
</DataGrid>
</TabItem>
<TabItem x:Name="tabSettings" Header="Settings">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<CheckBox x:Name="chkAutoBackup" Content="Automatically backup save files" ToolTip="Monitor save files and back them up when they're changed" HorizontalAlignment="Left" Margin="10,2,0,2" VerticalAlignment="Top" Click="ChkAutoBackup_Click" Grid.Row="0" Checked="ChkAutoBackup_Click" Unchecked="ChkAutoBackup_Click"/>
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBox x:Name="txtBackupMins" HorizontalAlignment="Left" Margin="10,2,0,2" TextWrapping="Wrap" VerticalAlignment="Center" Grid.Row="0" Grid.Column="0" Width="64" LostFocus="TxtBackupMins_LostFocus" KeyUp="TxtBackupMins_KeyUp"/>
<Label Content="Minutes between backups" ToolTip="Minimum amount of time that must have passed since last backup before a new backup is made" HorizontalAlignment="Left" Margin="10,2,0,2" VerticalAlignment="Center" Grid.Row="0" Grid.Column="1"/>
<TextBox x:Name="txtBackupLimit" HorizontalAlignment="Left" Margin="10,2,0,2" TextWrapping="Wrap" VerticalAlignment="Center" Width="64" Grid.Row="1" Grid.Column="0" KeyUp="TxtBackupLimit_KeyUp" LostFocus="TxtBackupLimit_LostFocus"/>
<Label Content="Backups to keep (0 for unlimited)" ToolTip="When the number of backups for a world or character reaches this number, backups will automatically be deleted starting with the oldest" HorizontalAlignment="Left" Margin="10,2,0,2" VerticalAlignment="Center" Grid.Row="1" Grid.Column="1" />
</Grid>
<Grid Grid.Row="2">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Label x:Name="lblSaveFolders" Content="Save Folder" ToolTip="Only change if you know what you're doing." HorizontalAlignment="Center" Margin="10" VerticalAlignment="Top" Grid.Row="0" Grid.Column="0" />
<ListBox x:Name="lstSaveFolders" Margin="0,2,10,2" VerticalAlignment="Center" Height="Auto" ToolTip="Where your Valheim saves are located. Right-click for more options." Grid.Row="0" Grid.Column="1" ContextMenuOpening="lstSaveFolders_ContextMenuOpening">
<ListBox.ContextMenu>
<ContextMenu x:Name="menuSaveFolders">
<MenuItem x:Name="menuSavePathOpen2" Header="Open in Windows Explorer" Click="menuSavePathOpen_Click">
<MenuItem.Icon>
<Image Source="Resources/OpenFolder_32x.png"/>
</MenuItem.Icon>
</MenuItem>
<MenuItem x:Name="menuSavePathAdd" Header="Add save folder" Click="menuSavePathAdd_Click">
<MenuItem.Icon>
<Image Source="Resources/Add_32x.png"/>
</MenuItem.Icon>
</MenuItem>
<Separator/>
<MenuItem x:Name="menuSavePathEdit" Header="Edit save folder" Click="menuSavePathEdit_Click">
<MenuItem.Icon>
<DynamicResource ResourceKey="EditGrey"/>
</MenuItem.Icon>
</MenuItem>
<MenuItem x:Name="menuSavePathRemove" Header="Remove save folder" Click="menuSavePathRemove_Click">
<MenuItem.Icon>
<DynamicResource ResourceKey="RemoveGrey"/>
</MenuItem.Icon>
</MenuItem>
</ContextMenu>
</ListBox.ContextMenu>
</ListBox>
<Button x:Name="btnBackupFolder" Content="Backup Folder" HorizontalAlignment="Left" Margin="10,2,10,2" VerticalAlignment="Center" Click="BtnBackupFolder_Click" Grid.Row="1" Grid.Column="0" />
<TextBox x:Name="txtBackupFolder" ToolTip="Where your save backups are stored" Margin="0,2,10,2" TextWrapping="Wrap" VerticalAlignment="Center" IsReadOnly="True" TabIndex="-1" IsTabStop="False" Grid.Row="1" Grid.Column="1">
<TextBox.ContextMenu>
<ContextMenu>
<MenuItem x:Name="menuBackupPathOpen" Header="Open in Windows Explorer" Click="menuBackupPathOpen_Click">
<MenuItem.Icon>
<Image Source="Resources/OpenFolder_32x.png"/>
</MenuItem.Icon>
</MenuItem>
</ContextMenu>
</TextBox.ContextMenu>
</TextBox>
<Button x:Name="btnFtpImport" Content="FTP Import" HorizontalAlignment="Stretch" Margin="10,2,10,2" VerticalAlignment="Center" ToolTip="Copy remote world files via FTP to a local save folder" Click="btnFtpImport_Click" Grid.Row="2" Grid.Column="0"/>
<TextBox x:Name="txtFtpImport" Margin="0,2,10,2" TextWrapping="Wrap" VerticalAlignment="Center" IsTabStop="False" IsReadOnly="True" ToolTip="If you have a remote dedicated server with FTP access, you can back up that server's saves" Grid.Row="2" Grid.Column="1"/>
</Grid>
<Grid Grid.Row="3">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<CheckBox x:Name="chkCreateLogFile" Content="Create log file" ToolTip="Whether a log.txt file should be created" HorizontalAlignment="Left" Margin="10,2,0,2" VerticalAlignment="Center" Grid.Row="0" Grid.Column="0" Checked="chkCreateLogFile_Click" Unchecked="chkCreateLogFile_Click"/>
<CheckBox x:Name="chkStartMinimized" Content="Start minimized" ToolTip="Minimize app on startup" HorizontalAlignment="Left" Margin="10,2,0,2" VerticalAlignment="Center" Grid.Row="0" Grid.Column="1" Checked="chkStartMinimized_Checked" Unchecked="chkStartMinimized_Checked"/>
<CheckBox x:Name="chkAutoCheckUpdate" Content="Automatically check for update" HorizontalAlignment="Left" Margin="10,5" VerticalAlignment="Center" Grid.Row="1" Grid.Column="0" Checked="chkAutoCheckUpdate_Click"/>
<Button x:Name="btnAppUpdate" Content="Check Now" ToolTip="Check to see if there's a new version of this program available" HorizontalAlignment="Left" Margin="10,5,0,5" VerticalAlignment="Center" Click="btnAppUpdate_Click" Grid.Row="1" Grid.Column="1" />
</Grid>
<Button x:Name="btnExtraWorldFiles" Content="Extra world files" ToolTip="Back up additional files from your /worlds_local folder" HorizontalAlignment="Left" Margin="10,5" Grid.Row="4" Click="btnExtraWorldFiles_Click"/>
</Grid>
</TabItem>
<TabItem x:Name="tabLog" Header="Log">
<Grid>
<RichTextBox x:Name="txtLog" VerticalScrollBarVisibility="Auto" IsReadOnly="True"/>
</Grid>
</TabItem>
</TabControl>
<StatusBar Grid.Row="1">
<StatusBarItem HorizontalAlignment="Left">
<Label x:Name="lblStatus" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="5,0" ToolTip="Not backed up" Height="26" VerticalContentAlignment="Center">
<DynamicResource ResourceKey="StatusNo"/>
</Label>
</StatusBarItem>
<StatusBarItem HorizontalAlignment="Left">
<Button x:Name="btnBackup" Click="BtnBackup_Click" ToolTip="Backup current saves" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="5,0" Height="26" VerticalContentAlignment="Center">
<DynamicResource ResourceKey="Save"/>
</Button>
</StatusBarItem>
<StatusBarItem HorizontalAlignment="Left">
<Button x:Name="btnReportBug" Height="26" ToolTip="Report a bug" Click="btnReportBug_Click">
<Button.Content>
<Image Source="Resources\Bug_32x.png"/>
</Button.Content>
</Button>
</StatusBarItem>
<StatusBarItem HorizontalAlignment="Right">
<Label x:Name="lblLastMessage" Content="" HorizontalAlignment="Left" VerticalContentAlignment="Center" Margin="5,0"/>
</StatusBarItem>
</StatusBar>
</Grid>
</Window>