Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remember last selected directory for extraction #13

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/RDAExplorerGUI/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
<setting name="Window_IsMaximized" serializeAs="String">
<value>True</value>
</setting>
<setting name="LastSelectedPathForExtraction" serializeAs="String">
<value />
</setting>
<setting name="SettingsUpgradeNeeded" serializeAs="String">
<value>True</value>
</setting>
</RDAExplorerGUI.Properties.Settings>
</userSettings>
</configuration>
18 changes: 17 additions & 1 deletion src/RDAExplorerGUI/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ public MainWindow()
private void Window_Loaded(object sender, RoutedEventArgs e)
{
NewFile();

if (Settings.Default.SettingsUpgradeNeeded)
{
Settings.Default.Upgrade();
Settings.Default.SettingsUpgradeNeeded = false;
Settings.Default.Save();
}
}

private void MainWindow_Closing(object sender, CancelEventArgs e)
Expand Down Expand Up @@ -125,7 +132,8 @@ private void _RebuildTreeView(BackgroundWorker wrk)
foreach (RDASkippedDataSection skippedBlock in CurrentReader.SkippedDataSections)
{
string title = skippedBlock.blockInfo.fileCount + " encrypted files";
treeView.Items.Add(new RDASkippedDataSectionTreeViewItem() {
treeView.Items.Add(new RDASkippedDataSectionTreeViewItem()
{
Section = skippedBlock,
Header = ControlExtension.BuildImageTextblock("pack://application:,,,/Images/Icons/error.png", title)
});
Expand Down Expand Up @@ -333,8 +341,12 @@ private void file_Exit_Click(object sender, RoutedEventArgs e)
private void archive_ExtractAll_Click(object sender, RoutedEventArgs e)
{
FolderBrowserDialog dlg = new FolderBrowserDialog();
dlg.SelectedPath = Settings.Default.LastSelectedPathForExtraction;
if (dlg.ShowDialog() != System.Windows.Forms.DialogResult.OK)
return;

Settings.Default.LastSelectedPathForExtraction = dlg.SelectedPath;//settings are saved when window is closing

BackgroundWorker wrk = new BackgroundWorker();
wrk.WorkerReportsProgress = true;
progressBar_Status.Visibility = Visibility.Visible;
Expand Down Expand Up @@ -366,8 +378,12 @@ private void archive_ExtractAll_Click(object sender, RoutedEventArgs e)
private void archive_ExtractSelected_Click(object sender, RoutedEventArgs e)
{
FolderBrowserDialog dlg = new FolderBrowserDialog();
dlg.SelectedPath = Settings.Default.LastSelectedPathForExtraction;
if (dlg.ShowDialog() != System.Windows.Forms.DialogResult.OK)
return;

Settings.Default.LastSelectedPathForExtraction = dlg.SelectedPath;//settings are saved when window is closing

BackgroundWorker wrk = new BackgroundWorker();
wrk.WorkerReportsProgress = true;
progressBar_Status.Visibility = Visibility.Visible;
Expand Down
24 changes: 24 additions & 0 deletions src/RDAExplorerGUI/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/RDAExplorerGUI/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,11 @@
<Setting Name="Window_IsMaximized" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="LastSelectedPathForExtraction" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="SettingsUpgradeNeeded" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
</Settings>
</SettingsFile>