Skip to content

Commit

Permalink
Merge pull request #187 from OliBomby/iptq/export-dialog-directory
Browse files Browse the repository at this point in the history
Make export dialogs start at the same directory as the import path
  • Loading branch information
OliBomby authored Dec 21, 2022
2 parents 798aa3c + 9c47fda commit 31548a0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
5 changes: 4 additions & 1 deletion Mapping_Tools/Viewmodels/HitsoundCopierVM.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text.Json.Serialization;
using Mapping_Tools.Classes;
using Mapping_Tools.Classes.BeatmapHelper;
Expand Down Expand Up @@ -233,7 +234,9 @@ public HitsoundCopierVm() {

ExportBrowseCommand = new CommandImplementation(
_ => {
string[] paths = IOHelper.BeatmapFileDialog(true, !SettingsManager.Settings.CurrentBeatmapDefaultFolder);
string pathFromDirectory = Directory.GetParent(PathFrom).FullName;
string[] paths = IOHelper.BeatmapFileDialog(pathFromDirectory, true);
if (paths.Length != 0) {
PathTo = string.Join("|", paths);
}
Expand Down
5 changes: 4 additions & 1 deletion Mapping_Tools/Viewmodels/MetadataManagerVM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Mapping_Tools.Classes.SystemTools;
using Mapping_Tools.Components.Domain;
using System;
using System.IO;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
Expand Down Expand Up @@ -84,7 +85,9 @@ public MetadataManagerVm() {

ExportBrowseCommand = new CommandImplementation(
_ => {
var paths = IOHelper.BeatmapFileDialog(true, !SettingsManager.Settings.CurrentBeatmapDefaultFolder);
string importPathDirectory = Directory.GetParent(ImportPath).FullName;
var paths = IOHelper.BeatmapFileDialog(importPathDirectory, true);
if( paths.Length != 0 ) {
ExportPath = string.Join("|", paths);
}
Expand Down
7 changes: 5 additions & 2 deletions Mapping_Tools/Viewmodels/TimingCopierVM.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.IO;
using Mapping_Tools.Classes.SystemTools;
using Mapping_Tools.Components.Domain;
using System.ComponentModel;
Expand Down Expand Up @@ -56,8 +57,10 @@ public TimingCopierVm() {

ExportBrowseCommand = new CommandImplementation(
_ => {
string[] paths = IOHelper.BeatmapFileDialog(true, !SettingsManager.Settings.CurrentBeatmapDefaultFolder);
if( paths.Length != 0 ) {
string importPathDirectory = Directory.GetParent(ImportPath).FullName;
string[] paths = IOHelper.BeatmapFileDialog(importPathDirectory, true);
if ( paths.Length != 0 ) {
ExportPath = string.Join("|", paths);
}
});
Expand Down

0 comments on commit 31548a0

Please sign in to comment.