diff --git a/App.config b/App.config index cabd6c76..ab74339d 100644 --- a/App.config +++ b/App.config @@ -64,6 +64,9 @@ + + + diff --git a/GarCreate.cs b/GarCreate.cs index 5ef87d45..9023f4e1 100644 --- a/GarCreate.cs +++ b/GarCreate.cs @@ -33,6 +33,7 @@ using System.Windows; using System.Windows.Input; using GameRes; using GARbro.GUI.Strings; +using GARbro.GUI.Properties; using Ookii.Dialogs.Wpf; namespace GARbro.GUI @@ -71,18 +72,22 @@ namespace GARbro.GUI public GarCreate (MainWindow parent) { m_main = parent; + m_arc_name = Settings.Default.appLastCreatedArchive; } public bool Run () { Directory.SetCurrentDirectory (m_main.CurrentPath); - var items = m_main.CurrentDirectory.SelectedItems.Cast(); - m_arc_name = Path.GetFileName (m_main.CurrentPath); - if (!items.Skip (1).Any()) // items.Count() == 1 + var items = m_main.CurrentDirectory.SelectedItems.Cast (); + if (string.IsNullOrEmpty (m_arc_name)) { - var item = items.First(); - if (item.IsDirectory) - m_arc_name = Path.GetFileNameWithoutExtension (item.Name); + m_arc_name = Path.GetFileName (m_main.CurrentPath); + if (!items.Skip (1).Any()) // items.Count() == 1 + { + var item = items.First(); + if (item.IsDirectory) + m_arc_name = Path.GetFileNameWithoutExtension (item.Name); + } } var dialog = new CreateArchiveDialog (m_arc_name); @@ -181,6 +186,7 @@ namespace GARbro.GUI m_progress_dialog.Dispose(); if (null == m_pending_error) { + Settings.Default.appLastCreatedArchive = m_arc_name; m_main.Dispatcher.Invoke (() => { m_main.SaveCurrentPosition(); m_main.SetCurrentPosition (new DirectoryPosition (m_arc_name)); diff --git a/Properties/Settings.Designer.cs b/Properties/Settings.Designer.cs index 67124233..63ff8bdf 100644 --- a/Properties/Settings.Designer.cs +++ b/Properties/Settings.Designer.cs @@ -249,5 +249,17 @@ namespace GARbro.GUI.Properties { this["appRecentFiles"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string appLastCreatedArchive { + get { + return ((string)(this["appLastCreatedArchive"])); + } + set { + this["appLastCreatedArchive"] = value; + } + } } } diff --git a/Properties/Settings.settings b/Properties/Settings.settings index 66fc299a..e201a32f 100644 --- a/Properties/Settings.settings +++ b/Properties/Settings.settings @@ -59,5 +59,8 @@ + + + \ No newline at end of file