Improved settings

This commit is contained in:
Robert McRackan 2019-12-13 16:11:55 -05:00
parent 2fa5170f28
commit 95ae8335a1
36 changed files with 1755 additions and 805 deletions

View File

@ -50,7 +50,7 @@ namespace FileLiberator
if (aaxFilename == null)
return new StatusHandler { "aaxFilename parameter is null" };
if (!FileUtility.FileExists(aaxFilename))
if (!File.Exists(aaxFilename))
return new StatusHandler { $"Cannot find AAX file: {aaxFilename}" };
if (AudibleFileStorage.Audio.Exists(libraryBook.Book.AudibleProductId))
return new StatusHandler { "Cannot find decrypt. Final audio file already exists" };

View File

@ -39,7 +39,7 @@ namespace FileManager
Configuration.Instance.DecryptInProgressEnum = "WinTemp";
var M4bRootDir
= Configuration.Instance.DecryptInProgressEnum == "WinTemp" // else "LibationFiles"
? Configuration.Instance.WinTemp
? Configuration.WinTemp
: Configuration.Instance.LibationFiles;
DecryptInProgress = Path.Combine(M4bRootDir, "DecryptInProgress");
Directory.CreateDirectory(DecryptInProgress);
@ -50,7 +50,7 @@ namespace FileManager
Configuration.Instance.DownloadsInProgressEnum = "WinTemp";
var AaxRootDir
= Configuration.Instance.DownloadsInProgressEnum == "WinTemp" // else "LibationFiles"
? Configuration.Instance.WinTemp
? Configuration.WinTemp
: Configuration.Instance.LibationFiles;
DownloadsInProgress = Path.Combine(AaxRootDir, "DownloadsInProgress");
Directory.CreateDirectory(DownloadsInProgress);

View File

@ -4,6 +4,8 @@ using System.ComponentModel;
using System.IO;
using System.Linq;
using Dinah.Core;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace FileManager
{
@ -31,12 +33,18 @@ namespace FileManager
*/
#endregion
private PersistentDictionary persistentDictionary { get; }
private PersistentDictionary persistentDictionary;
[Description("Location of the configuration file where these settings are saved. Please do not edit this file directly while Libation is running.")]
public string Filepath => Path.Combine(Path.GetDirectoryName(Exe.FileLocationOnDisk), "Settings.json");
public bool IsComplete
=> File.Exists(APPSETTINGS_JSON)
&& Directory.Exists(LibationFiles)
&& Directory.Exists(Books)
&& File.Exists(SettingsJsonPath)
&& !string.IsNullOrWhiteSpace(LocaleCountryCode)
&& !string.IsNullOrWhiteSpace(DownloadsInProgressEnum)
&& !string.IsNullOrWhiteSpace(DecryptInProgressEnum);
[Description("[Advanced. Leave alone in most cases.] Your user-specific key used to decrypt your audible files (*.aax) into audio files you can use anywhere (*.m4b)")]
[Description("Your user-specific key used to decrypt your audible files (*.aax) into audio files you can use anywhere (*.m4b). Leave alone in most cases")]
public string DecryptKey
{
get => persistentDictionary[nameof(DecryptKey)];
@ -50,17 +58,21 @@ namespace FileManager
set => persistentDictionary[nameof(Books)] = value;
}
public string WinTemp { get; } = Path.Combine(Path.GetTempPath(), "Libation");
public static string AppDir { get; } = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(Exe.FileLocationOnDisk), LIBATION_FILES));
public static string MyDocs { get; } = Path.GetFullPath(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), LIBATION_FILES));
public static string WinTemp { get; } = Path.GetFullPath(Path.Combine(Path.GetTempPath(), "Libation"));
[Description("Location for storage of program-created files")]
public string LibationFiles
private Dictionary<string, string> wellKnownPaths { get; } = new Dictionary<string, string>
{
get => persistentDictionary[nameof(LibationFiles)];
set => persistentDictionary[nameof(LibationFiles)] = value;
}
["AppDir"] = AppDir,
["MyDocs"] = MyDocs,
["WinTemp"] = WinTemp
};
private Dictionary<string, string> cache { get; } = new Dictionary<string, string>();
// default setting and directory creation occur in class responsible for files.
// config class is only responsible for path. not responsible for setting defaults, dir validation, or dir creation
// exceptions: appsettings.json, LibationFiles dir, Settings.json
// temp/working dir(s) should be outside of dropbox
[Description("Temporary location of files while they're in process of being downloaded.\r\nWhen download is complete, the final file will be in [LibationFiles]\\DownloadsFinal")]
@ -78,49 +90,114 @@ namespace FileManager
set => persistentDictionary[nameof(DecryptInProgressEnum)] = value;
}
public string LocaleCountryCode
{
get => persistentDictionary[nameof(LocaleCountryCode)];
set => persistentDictionary[nameof(LocaleCountryCode)] = value;
}
public string LocaleCountryCode
{
get => persistentDictionary[nameof(LocaleCountryCode)];
set => persistentDictionary[nameof(LocaleCountryCode)] = value;
}
// note: any potential file manager static ctors can't compensate if storage dir is changed at run time via settings. this is partly bad architecture. but the side effect is desirable. if changing LibationFiles location: restart app
// singleton stuff
public static Configuration Instance { get; } = new Configuration();
private Configuration()
{
// load json values into memory
persistentDictionary = new PersistentDictionary(Filepath);
ensureDictionaryEntries();
private Configuration() { }
// don't create dir. dir creation is the responsibility of places that use the dir
if (string.IsNullOrWhiteSpace(LibationFiles))
LibationFiles = Path.Combine(Path.GetDirectoryName(Exe.FileLocationOnDisk), "Libation");
private const string APPSETTINGS_JSON = "appsettings.json";
private const string LIBATION_FILES = "LibationFiles";
[Description("Location for storage of program-created files")]
public string LibationFiles
=> cache.ContainsKey(LIBATION_FILES)
? cache[LIBATION_FILES]
: getLibationFiles();
private string getLibationFiles()
{
var value = getLiberationFilesSettingFromJson();
if (wellKnownPaths.ContainsKey(value))
value = wellKnownPaths[value];
// must write here before SettingsJsonPath in next step tries to read from dictionary
cache[LIBATION_FILES] = value;
// load json values into memory. create if not exists
persistentDictionary = new PersistentDictionary(SettingsJsonPath);
persistentDictionary.EnsureEntries<Configuration>();
return value;
}
private string getLiberationFilesSettingFromJson()
{
static string createSettingsJson()
{
var dir = "AppDir";
File.WriteAllText(APPSETTINGS_JSON, new JObject { { LIBATION_FILES, dir } }.ToString(Formatting.Indented));
return dir;
}
if (!File.Exists(APPSETTINGS_JSON))
return createSettingsJson();
var appSettingsContents = File.ReadAllText(APPSETTINGS_JSON);
JObject jObj;
try
{
jObj = JObject.Parse(appSettingsContents);
}
catch
{
return createSettingsJson();
}
if (!jObj.ContainsKey(LIBATION_FILES))
return createSettingsJson();
var value = jObj[LIBATION_FILES].Value<string>();
return value;
}
private string SettingsJsonPath => Path.Combine(LibationFiles, "Settings.json");
public static string GetDescription(string propertyName)
{
var attribute = typeof(Configuration)
.GetProperty(propertyName)
?.GetCustomAttributes(typeof(DescriptionAttribute), true)
.SingleOrDefault()
as DescriptionAttribute;
var attribute = typeof(Configuration)
.GetProperty(propertyName)
?.GetCustomAttributes(typeof(DescriptionAttribute), true)
.SingleOrDefault()
as DescriptionAttribute;
return attribute?.Description;
}
private void ensureDictionaryEntries()
{
var stringProperties = getDictionaryProperties().Select(p => p.Name).ToList();
var missingKeys = stringProperties.Except(persistentDictionary.Keys).ToArray();
persistentDictionary.AddKeys(missingKeys);
return attribute?.Description;
}
private IEnumerable<System.Reflection.PropertyInfo> dicPropertiesCache;
private IEnumerable<System.Reflection.PropertyInfo> getDictionaryProperties()
public bool TrySetLibationFiles(string directory)
{
if (dicPropertiesCache == null)
dicPropertiesCache = PersistentDictionary.GetPropertiesToPersist(this.GetType());
return dicPropertiesCache;
if (!Directory.Exists(directory) && !wellKnownPaths.ContainsKey(directory))
return false;
// if moving from default, delete old settings file and dir (if empty)
if (LibationFiles.EqualsInsensitive(AppDir))
{
File.Delete(SettingsJsonPath);
System.Threading.Thread.Sleep(100);
if (!Directory.EnumerateDirectories(AppDir).Any() && !Directory.EnumerateFiles(AppDir).Any())
Directory.Delete(AppDir);
}
cache.Remove(LIBATION_FILES);
var contents = File.ReadAllText(APPSETTINGS_JSON);
var jObj = JObject.Parse(contents);
jObj[LIBATION_FILES] = directory;
var output = JsonConvert.SerializeObject(jObj, Formatting.Indented);
File.WriteAllText(APPSETTINGS_JSON, output);
return true;
}
}
}

View File

@ -23,7 +23,7 @@ namespace FileManager
static FilePathCache()
{
// load json into memory. if file doesn't exist, nothing to do. save() will create if needed
if (FileUtility.FileExists(JsonFile))
if (File.Exists(JsonFile))
{
var list = JsonConvert.DeserializeObject<List<CacheEntry>>(File.ReadAllText(JsonFile));
cache = new Cache<CacheEntry>(list);
@ -39,7 +39,7 @@ namespace FileManager
if (entry == null)
return null;
if (!FileUtility.FileExists(entry.Path))
if (!File.Exists(entry.Path))
{
remove(entry);
return null;
@ -56,7 +56,7 @@ namespace FileManager
public static void Upsert(string id, FileType type, string path)
{
if (!FileUtility.FileExists(path))
if (!File.Exists(path))
throw new FileNotFoundException("Cannot add path to cache. File not found");
var entry = cache.SingleOrDefault(i => i.Id == id && i.FileType == type);

View File

@ -1,32 +1,10 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace FileManager
{
public static class FileUtility
{
// a replacement for File.Exists() which allows long paths
// not needed in .net-core
public static bool FileExists(string path)
{
var basic = File.Exists(path);
if (basic)
return true;
// character cutoff is usually 269 but this isn't a hard number. there are edgecases which shorted the threshold
if (path.Length < 260)
return false;
// try long name prefix:
// \\?\
// https://blogs.msdn.microsoft.com/jeremykuhne/2016/06/21/more-on-new-net-path-handling/
path = @"\\?\" + path;
return File.Exists(path);
}
public static string GetValidFilename(string dirFullPath, string filename, string extension, params string[] metadataSuffixes)
{
if (string.IsNullOrWhiteSpace(dirFullPath))
@ -51,7 +29,7 @@ namespace FileManager
// ensure uniqueness
var fullfilename = Path.Combine(dirFullPath, filename + extension);
var i = 0;
while (FileExists(fullfilename))
while (File.Exists(fullfilename))
fullfilename = Path.Combine(dirFullPath, filename + $" ({++i})" + extension);
return fullfilename;

View File

@ -35,6 +35,9 @@ namespace FileManager
// not found. create blank file
if (!File.Exists(Filepath))
{
// will create any missing directories, incl subdirectories. if all already exist: no action
Directory.CreateDirectory(Path.GetDirectoryName(filepath));
File.WriteAllText(Filepath, "{}");
// give system time to create file before first use
@ -44,14 +47,19 @@ namespace FileManager
settingsDic = JsonConvert.DeserializeObject<Dictionary<string, string>>(File.ReadAllText(Filepath));
}
public IEnumerable<string> Keys => settingsDic.Keys.Cast<string>();
public void AddKeys(params string[] keys)
public void EnsureEntries<T>()
{
if (keys == null || keys.Length == 0)
var stringProperties =
GetPropertiesToPersist(typeof(T))
.Select(p => p.Name)
.ToList();
var keys = settingsDic.Keys.Cast<string>().ToList();
var missingKeys = stringProperties.Except(keys).ToList();
if (!missingKeys.Any())
return;
foreach (var key in keys)
foreach (var key in missingKeys)
settingsDic.Add(key, null);
save();
}

View File

@ -47,7 +47,7 @@ namespace FileManager
{
var path = getPath(def);
cache[def]
= FileUtility.FileExists(path)
= File.Exists(path)
? File.ReadAllBytes(path)
: null;
}

View File

@ -22,7 +22,7 @@ namespace FileManager
static QuickFilters()
{
// load json into memory. if file doesn't exist, nothing to do. save() will create if needed
if (FileUtility.FileExists(JsonFile))
if (File.Exists(JsonFile))
inMemoryState = JsonConvert.DeserializeObject<FilterState>(File.ReadAllText(JsonFile));
}

View File

@ -53,7 +53,7 @@ namespace FileManager
{
if (cache is null)
lock (locker)
cache = !FileUtility.FileExists(TagsFile)
cache = !File.Exists(TagsFile)
? new Dictionary<string, string>()
: JsonConvert.DeserializeObject<Dictionary<string, string>>(File.ReadAllText(TagsFile));
}

View File

@ -17,10 +17,4 @@
<ProjectReference Include="..\LibationWinForms\LibationWinForms.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

View File

@ -1,10 +1,13 @@
using System;
using System.IO;
using System.Windows.Forms;
using Dinah.Core.Logging;
using FileManager;
using LibationWinForms;
using LibationWinForms.Dialogs;
using Microsoft.Extensions.Configuration;
using Serilog;
using WinFormsDesigner.Dialogs;
namespace LibationLauncher
{
@ -17,35 +20,49 @@ namespace LibationLauncher
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
if (!createSettings())
return;
createSettings();
initLogging();
Application.Run(new Form1());
}
private static bool createSettings()
private static void createSettings()
{
if (!string.IsNullOrWhiteSpace(Configuration.Instance.Books))
return true;
var config = Configuration.Instance;
if (config.IsComplete)
return;
var welcomeText = @"
This appears to be your first time using Libation. Welcome.
Please fill in a few settings on the following page. You can also change these settings later.
var isAdvanced = false;
After you make your selections, get started by importing your library.
Go to Import > Scan Library
".Trim();
MessageBox.Show(welcomeText, "Welcome to Libation", MessageBoxButtons.OK);
var dialogResult = new SettingsDialog().ShowDialog();
if (dialogResult != DialogResult.OK)
var setupDialog = new SetupDialog();
setupDialog.NoQuestionsBtn_Click += (_, __) =>
{
MessageBox.Show("Initial set up cancelled.", "Cancelled", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return false;
config.DecryptKey ??= "";
config.LocaleCountryCode ??= "us";
config.DownloadsInProgressEnum ??= "WinTemp";
config.DecryptInProgressEnum ??= "WinTemp";
config.Books ??= Configuration.AppDir;
};
// setupDialog.BasicBtn_Click += (_, __) => // no action needed
setupDialog.AdvancedBtn_Click += (_, __) => isAdvanced = true;
setupDialog.ShowDialog();
if (isAdvanced)
{
var dialog = new LibationFilesDialog();
if (dialog.ShowDialog() != DialogResult.OK)
MessageBox.Show("Libation Files location not changed");
}
return true;
if (config.IsComplete)
return;
if (new SettingsDialog().ShowDialog() == DialogResult.OK)
return;
MessageBox.Show("Initial set up cancelled.", "Cancelled", MessageBoxButtons.OK, MessageBoxIcon.Warning);
Application.Exit();
Environment.Exit(0);
}
private static void initLogging()
@ -58,7 +75,7 @@ Go to Import > Scan Library
var code_outputTemplate = "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] (at {Caller}) {Message:lj}{NewLine}{Exception}";
var logPath = System.IO.Path.Combine(Configuration.Instance.LibationFiles, "Log.log");
var logPath = Path.Combine(Configuration.Instance.LibationFiles, "Log.log");
//var configuration = new ConfigurationBuilder()
// .AddJsonFile("appsettings.json")

View File

@ -1,11 +0,0 @@
{
"Logging": {
"LogLevel": {
"Default": "Debug"
}
},
"Serilog": {
"MinimumLevel": "Debug",
"Enrich": "WithCaller"
}
}

View File

@ -23,12 +23,30 @@
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Update="UNTESTED\Dialogs\LibationFilesDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="UNTESTED\Dialogs\LibationFilesDialog.Designer.cs">
<DependentUpon>LibationFilesDialog.cs</DependentUpon>
</Compile>
<Compile Update="UNTESTED\Dialogs\SettingsDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="UNTESTED\Dialogs\SettingsDialog.Designer.cs">
<DependentUpon>SettingsDialog.cs</DependentUpon>
</Compile>
<Compile Update="UNTESTED\Dialogs\IndexLibraryDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="UNTESTED\Dialogs\IndexLibraryDialog.Designer.cs">
<DependentUpon>IndexLibraryDialog.cs</DependentUpon>
</Compile>
<Compile Update="UNTESTED\Dialogs\SetupDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="UNTESTED\Dialogs\SetupDialog.Designer.cs">
<DependentUpon>SetupDialog.cs</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
@ -36,6 +54,15 @@
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="UNTESTED\Dialogs\LibationFilesDialog.resx">
<DependentUpon>LibationFilesDialog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Update="UNTESTED\Dialogs\SettingsDialog.resx">
<DependentUpon>SettingsDialog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Update="UNTESTED\Dialogs\SetupDialog.resx">
<DependentUpon>SetupDialog.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
</Project>

View File

@ -1,4 +1,4 @@
namespace LibationWinForms
namespace LibationWinForms.Dialogs
{
partial class EditTagsDialog
{

View File

@ -1,7 +1,7 @@
using System;
using System.Windows.Forms;
namespace LibationWinForms
namespace LibationWinForms.Dialogs
{
public partial class EditTagsDialog : Form
{

View File

@ -1,4 +1,4 @@
namespace LibationWinForms
namespace LibationWinForms.Dialogs
{
partial class IndexLibraryDialog
{

View File

@ -1,8 +1,9 @@
using System;
using System.Windows.Forms;
using ApplicationServices;
using LibationWinForms.Login;
namespace LibationWinForms
namespace LibationWinForms.Dialogs
{
public partial class IndexLibraryDialog : Form
{
@ -19,7 +20,7 @@ namespace LibationWinForms
{
try
{
(TotalBooksProcessed, NewBooksAdded) = await LibraryCommands.ImportLibraryAsync(new Login.WinformResponder());
(TotalBooksProcessed, NewBooksAdded) = await LibraryCommands.ImportLibraryAsync(new WinformResponder());
}
catch (Exception ex)
{

View File

@ -0,0 +1,161 @@
namespace WinFormsDesigner.Dialogs
{
partial class LibationFilesDialog
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.libationFilesDescLbl = new System.Windows.Forms.Label();
this.libationFilesCustomBtn = new System.Windows.Forms.Button();
this.libationFilesCustomTb = new System.Windows.Forms.TextBox();
this.libationFilesCustomRb = new System.Windows.Forms.RadioButton();
this.libationFilesMyDocsRb = new System.Windows.Forms.RadioButton();
this.libationFilesRootRb = new System.Windows.Forms.RadioButton();
this.cancelBtn = new System.Windows.Forms.Button();
this.saveBtn = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// libationFilesDescLbl
//
this.libationFilesDescLbl.AutoSize = true;
this.libationFilesDescLbl.Location = new System.Drawing.Point(12, 9);
this.libationFilesDescLbl.Name = "libationFilesDescLbl";
this.libationFilesDescLbl.Size = new System.Drawing.Size(36, 13);
this.libationFilesDescLbl.TabIndex = 0;
this.libationFilesDescLbl.Text = "[desc]";
//
// libationFilesCustomBtn
//
this.libationFilesCustomBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.libationFilesCustomBtn.Location = new System.Drawing.Point(753, 95);
this.libationFilesCustomBtn.Name = "libationFilesCustomBtn";
this.libationFilesCustomBtn.Size = new System.Drawing.Size(35, 23);
this.libationFilesCustomBtn.TabIndex = 5;
this.libationFilesCustomBtn.Text = "...";
this.libationFilesCustomBtn.UseVisualStyleBackColor = true;
this.libationFilesCustomBtn.Click += new System.EventHandler(this.libationFilesCustomBtn_Click);
//
// libationFilesCustomTb
//
this.libationFilesCustomTb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.libationFilesCustomTb.Location = new System.Drawing.Point(35, 97);
this.libationFilesCustomTb.Name = "libationFilesCustomTb";
this.libationFilesCustomTb.Size = new System.Drawing.Size(712, 20);
this.libationFilesCustomTb.TabIndex = 4;
//
// libationFilesCustomRb
//
this.libationFilesCustomRb.AutoSize = true;
this.libationFilesCustomRb.Location = new System.Drawing.Point(15, 100);
this.libationFilesCustomRb.Name = "libationFilesCustomRb";
this.libationFilesCustomRb.Size = new System.Drawing.Size(14, 13);
this.libationFilesCustomRb.TabIndex = 3;
this.libationFilesCustomRb.TabStop = true;
this.libationFilesCustomRb.UseVisualStyleBackColor = true;
//
// libationFilesMyDocsRb
//
this.libationFilesMyDocsRb.AutoSize = true;
this.libationFilesMyDocsRb.CheckAlign = System.Drawing.ContentAlignment.TopLeft;
this.libationFilesMyDocsRb.Location = new System.Drawing.Point(15, 61);
this.libationFilesMyDocsRb.Name = "libationFilesMyDocsRb";
this.libationFilesMyDocsRb.Size = new System.Drawing.Size(111, 30);
this.libationFilesMyDocsRb.TabIndex = 2;
this.libationFilesMyDocsRb.TabStop = true;
this.libationFilesMyDocsRb.Text = "[desc]\r\n[myDocs\\Libation]";
this.libationFilesMyDocsRb.UseVisualStyleBackColor = true;
//
// libationFilesRootRb
//
this.libationFilesRootRb.AutoSize = true;
this.libationFilesRootRb.CheckAlign = System.Drawing.ContentAlignment.TopLeft;
this.libationFilesRootRb.Location = new System.Drawing.Point(15, 25);
this.libationFilesRootRb.Name = "libationFilesRootRb";
this.libationFilesRootRb.Size = new System.Drawing.Size(113, 30);
this.libationFilesRootRb.TabIndex = 1;
this.libationFilesRootRb.TabStop = true;
this.libationFilesRootRb.Text = "[desc]\r\n[exeRoot\\Libation]";
this.libationFilesRootRb.UseVisualStyleBackColor = true;
//
// cancelBtn
//
this.cancelBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.cancelBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelBtn.Location = new System.Drawing.Point(713, 124);
this.cancelBtn.Name = "cancelBtn";
this.cancelBtn.Size = new System.Drawing.Size(75, 23);
this.cancelBtn.TabIndex = 10;
this.cancelBtn.Text = "Cancel";
this.cancelBtn.UseVisualStyleBackColor = true;
this.cancelBtn.Click += new System.EventHandler(this.cancelBtn_Click);
//
// saveBtn
//
this.saveBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.saveBtn.Location = new System.Drawing.Point(612, 124);
this.saveBtn.Name = "saveBtn";
this.saveBtn.Size = new System.Drawing.Size(75, 23);
this.saveBtn.TabIndex = 9;
this.saveBtn.Text = "Save";
this.saveBtn.UseVisualStyleBackColor = true;
this.saveBtn.Click += new System.EventHandler(this.saveBtn_Click);
//
// LibationFilesDialog
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 159);
this.Controls.Add(this.cancelBtn);
this.Controls.Add(this.saveBtn);
this.Controls.Add(this.libationFilesDescLbl);
this.Controls.Add(this.libationFilesCustomBtn);
this.Controls.Add(this.libationFilesCustomTb);
this.Controls.Add(this.libationFilesRootRb);
this.Controls.Add(this.libationFilesCustomRb);
this.Controls.Add(this.libationFilesMyDocsRb);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Name = "LibationFilesDialog";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Libation Files location";
this.Load += new System.EventHandler(this.LibationFilesDialog_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label libationFilesDescLbl;
private System.Windows.Forms.Button libationFilesCustomBtn;
private System.Windows.Forms.TextBox libationFilesCustomTb;
private System.Windows.Forms.RadioButton libationFilesCustomRb;
private System.Windows.Forms.RadioButton libationFilesMyDocsRb;
private System.Windows.Forms.RadioButton libationFilesRootRb;
private System.Windows.Forms.Button cancelBtn;
private System.Windows.Forms.Button saveBtn;
}
}

View File

@ -0,0 +1,67 @@
using System;
using System.Windows.Forms;
using FileManager;
namespace WinFormsDesigner.Dialogs
{
public partial class LibationFilesDialog : Form
{
Configuration config { get; } = Configuration.Instance;
Func<string, string> desc { get; } = Configuration.GetDescription;
public LibationFilesDialog()
{
InitializeComponent();
this.libationFilesCustomTb.TextChanged += (_, __) =>
{
if (!string.IsNullOrWhiteSpace(libationFilesCustomTb.Text))
this.libationFilesCustomRb.Checked = true;
};
}
private void LibationFilesDialog_Load(object sender, EventArgs e)
{
libationFilesDescLbl.Text = desc(nameof(config.LibationFiles));
this.libationFilesRootRb.Text = "In the same folder that Libation is running from\r\n" + Configuration.AppDir;
this.libationFilesMyDocsRb.Text = "In My Documents\r\n" + Configuration.MyDocs;
if (config.LibationFiles == Configuration.AppDir)
libationFilesRootRb.Checked = true;
else if (config.LibationFiles == Configuration.MyDocs)
libationFilesMyDocsRb.Checked = true;
else
{
libationFilesCustomRb.Checked = true;
libationFilesCustomTb.Text = config.LibationFiles;
}
}
private void libationFilesCustomBtn_Click(object sender, EventArgs e) => selectFolder("Search for Libation Files location", this.libationFilesCustomTb);
private static void selectFolder(string desc, TextBox textbox)
{
using var dialog = new FolderBrowserDialog { Description = desc, SelectedPath = "" };
dialog.ShowDialog();
if (!string.IsNullOrWhiteSpace(dialog.SelectedPath))
textbox.Text = dialog.SelectedPath;
}
private void saveBtn_Click(object sender, EventArgs e)
{
var libationDir
= libationFilesRootRb.Checked ? Configuration.AppDir
: libationFilesMyDocsRb.Checked ? Configuration.MyDocs
: libationFilesCustomTb.Text;
if (!config.TrySetLibationFiles(libationDir))
{
MessageBox.Show("Not saving change to Libation Files location. This folder does not exist:\r\n" + libationDir);
return;
}
this.DialogResult = DialogResult.OK;
this.Close();
}
private void cancelBtn_Click(object sender, EventArgs e) => this.Close();
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -1,354 +1,238 @@
namespace LibationWinForms
namespace LibationWinForms.Dialogs
{
partial class SettingsDialog
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
partial class SettingsDialog
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.settingsFileLbl = new System.Windows.Forms.Label();
this.settingsFileTb = new System.Windows.Forms.TextBox();
this.decryptKeyLbl = new System.Windows.Forms.Label();
this.decryptKeyTb = new System.Windows.Forms.TextBox();
this.booksLocationLbl = new System.Windows.Forms.Label();
this.booksLocationTb = new System.Windows.Forms.TextBox();
this.booksLocationSearchBtn = new System.Windows.Forms.Button();
this.settingsFileDescLbl = new System.Windows.Forms.Label();
this.decryptKeyDescLbl = new System.Windows.Forms.Label();
this.booksLocationDescLbl = new System.Windows.Forms.Label();
this.libationFilesGb = new System.Windows.Forms.GroupBox();
this.libationFilesDescLbl = new System.Windows.Forms.Label();
this.libationFilesCustomBtn = new System.Windows.Forms.Button();
this.libationFilesCustomTb = new System.Windows.Forms.TextBox();
this.libationFilesCustomRb = new System.Windows.Forms.RadioButton();
this.libationFilesMyDocsRb = new System.Windows.Forms.RadioButton();
this.libationFilesRootRb = new System.Windows.Forms.RadioButton();
this.downloadsInProgressGb = new System.Windows.Forms.GroupBox();
this.downloadsInProgressLibationFilesRb = new System.Windows.Forms.RadioButton();
this.downloadsInProgressWinTempRb = new System.Windows.Forms.RadioButton();
this.downloadsInProgressDescLbl = new System.Windows.Forms.Label();
this.decryptInProgressGb = new System.Windows.Forms.GroupBox();
this.decryptInProgressLibationFilesRb = new System.Windows.Forms.RadioButton();
this.decryptInProgressWinTempRb = new System.Windows.Forms.RadioButton();
this.decryptInProgressDescLbl = new System.Windows.Forms.Label();
this.saveBtn = new System.Windows.Forms.Button();
this.cancelBtn = new System.Windows.Forms.Button();
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.decryptKeyLbl = new System.Windows.Forms.Label();
this.decryptKeyTb = new System.Windows.Forms.TextBox();
this.booksLocationLbl = new System.Windows.Forms.Label();
this.booksLocationTb = new System.Windows.Forms.TextBox();
this.booksLocationSearchBtn = new System.Windows.Forms.Button();
this.decryptKeyDescLbl = new System.Windows.Forms.Label();
this.booksLocationDescLbl = new System.Windows.Forms.Label();
this.downloadsInProgressGb = new System.Windows.Forms.GroupBox();
this.downloadsInProgressLibationFilesRb = new System.Windows.Forms.RadioButton();
this.downloadsInProgressWinTempRb = new System.Windows.Forms.RadioButton();
this.downloadsInProgressDescLbl = new System.Windows.Forms.Label();
this.decryptInProgressGb = new System.Windows.Forms.GroupBox();
this.decryptInProgressLibationFilesRb = new System.Windows.Forms.RadioButton();
this.decryptInProgressWinTempRb = new System.Windows.Forms.RadioButton();
this.decryptInProgressDescLbl = new System.Windows.Forms.Label();
this.saveBtn = new System.Windows.Forms.Button();
this.cancelBtn = new System.Windows.Forms.Button();
this.audibleLocaleLbl = new System.Windows.Forms.Label();
this.audibleLocaleCb = new System.Windows.Forms.ComboBox();
this.libationFilesGb.SuspendLayout();
this.downloadsInProgressGb.SuspendLayout();
this.decryptInProgressGb.SuspendLayout();
this.SuspendLayout();
//
// settingsFileLbl
//
this.settingsFileLbl.AutoSize = true;
this.settingsFileLbl.Location = new System.Drawing.Point(7, 15);
this.settingsFileLbl.Name = "settingsFileLbl";
this.settingsFileLbl.Size = new System.Drawing.Size(61, 13);
this.settingsFileLbl.TabIndex = 0;
this.settingsFileLbl.Text = "Settings file";
//
// settingsFileTb
//
this.settingsFileTb.Location = new System.Drawing.Point(90, 12);
this.settingsFileTb.Name = "settingsFileTb";
this.settingsFileTb.ReadOnly = true;
this.settingsFileTb.Size = new System.Drawing.Size(698, 20);
this.settingsFileTb.TabIndex = 1;
//
// decryptKeyLbl
//
this.decryptKeyLbl.AutoSize = true;
this.decryptKeyLbl.Location = new System.Drawing.Point(7, 59);
this.decryptKeyLbl.Name = "decryptKeyLbl";
this.decryptKeyLbl.Size = new System.Drawing.Size(64, 13);
this.decryptKeyLbl.TabIndex = 3;
this.decryptKeyLbl.Text = "Decrypt key";
//
// decryptKeyTb
//
this.decryptKeyTb.Location = new System.Drawing.Point(90, 56);
this.decryptKeyTb.Name = "decryptKeyTb";
this.decryptKeyTb.Size = new System.Drawing.Size(100, 20);
this.decryptKeyTb.TabIndex = 4;
//
// booksLocationLbl
//
this.booksLocationLbl.AutoSize = true;
this.booksLocationLbl.Location = new System.Drawing.Point(7, 125);
this.booksLocationLbl.Name = "booksLocationLbl";
this.booksLocationLbl.Size = new System.Drawing.Size(77, 13);
this.booksLocationLbl.TabIndex = 8;
this.booksLocationLbl.Text = "Books location";
//
// booksLocationTb
//
this.booksLocationTb.Location = new System.Drawing.Point(90, 122);
this.booksLocationTb.Name = "booksLocationTb";
this.booksLocationTb.Size = new System.Drawing.Size(657, 20);
this.booksLocationTb.TabIndex = 9;
//
// booksLocationSearchBtn
//
this.booksLocationSearchBtn.Location = new System.Drawing.Point(753, 120);
this.booksLocationSearchBtn.Name = "booksLocationSearchBtn";
this.booksLocationSearchBtn.Size = new System.Drawing.Size(35, 23);
this.booksLocationSearchBtn.TabIndex = 10;
this.booksLocationSearchBtn.Text = "...";
this.booksLocationSearchBtn.UseVisualStyleBackColor = true;
this.booksLocationSearchBtn.Click += new System.EventHandler(this.booksLocationSearchBtn_Click);
//
// settingsFileDescLbl
//
this.settingsFileDescLbl.AutoSize = true;
this.settingsFileDescLbl.Location = new System.Drawing.Point(87, 35);
this.settingsFileDescLbl.Name = "settingsFileDescLbl";
this.settingsFileDescLbl.Size = new System.Drawing.Size(36, 13);
this.settingsFileDescLbl.TabIndex = 2;
this.settingsFileDescLbl.Text = "[desc]";
//
// decryptKeyDescLbl
//
this.decryptKeyDescLbl.AutoSize = true;
this.decryptKeyDescLbl.Location = new System.Drawing.Point(87, 79);
this.decryptKeyDescLbl.Name = "decryptKeyDescLbl";
this.decryptKeyDescLbl.Size = new System.Drawing.Size(36, 13);
this.decryptKeyDescLbl.TabIndex = 5;
this.decryptKeyDescLbl.Text = "[desc]";
//
// booksLocationDescLbl
//
this.booksLocationDescLbl.AutoSize = true;
this.booksLocationDescLbl.Location = new System.Drawing.Point(87, 145);
this.booksLocationDescLbl.Name = "booksLocationDescLbl";
this.booksLocationDescLbl.Size = new System.Drawing.Size(36, 13);
this.booksLocationDescLbl.TabIndex = 11;
this.booksLocationDescLbl.Text = "[desc]";
//
// libationFilesGb
//
this.libationFilesGb.Controls.Add(this.libationFilesDescLbl);
this.libationFilesGb.Controls.Add(this.libationFilesCustomBtn);
this.libationFilesGb.Controls.Add(this.libationFilesCustomTb);
this.libationFilesGb.Controls.Add(this.libationFilesCustomRb);
this.libationFilesGb.Controls.Add(this.libationFilesMyDocsRb);
this.libationFilesGb.Controls.Add(this.libationFilesRootRb);
this.libationFilesGb.Location = new System.Drawing.Point(12, 161);
this.libationFilesGb.Name = "libationFilesGb";
this.libationFilesGb.Size = new System.Drawing.Size(776, 131);
this.libationFilesGb.TabIndex = 12;
this.libationFilesGb.TabStop = false;
this.libationFilesGb.Text = "Libation files";
//
// libationFilesDescLbl
//
this.libationFilesDescLbl.AutoSize = true;
this.libationFilesDescLbl.Location = new System.Drawing.Point(6, 16);
this.libationFilesDescLbl.Name = "libationFilesDescLbl";
this.libationFilesDescLbl.Size = new System.Drawing.Size(36, 13);
this.libationFilesDescLbl.TabIndex = 0;
this.libationFilesDescLbl.Text = "[desc]";
//
// libationFilesCustomBtn
//
this.libationFilesCustomBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.libationFilesCustomBtn.Location = new System.Drawing.Point(741, 102);
this.libationFilesCustomBtn.Name = "libationFilesCustomBtn";
this.libationFilesCustomBtn.Size = new System.Drawing.Size(35, 23);
this.libationFilesCustomBtn.TabIndex = 5;
this.libationFilesCustomBtn.Text = "...";
this.libationFilesCustomBtn.UseVisualStyleBackColor = true;
this.libationFilesCustomBtn.Click += new System.EventHandler(this.libationFilesCustomBtn_Click);
//
// libationFilesCustomTb
//
this.libationFilesCustomTb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.libationFilesCustomTb.Location = new System.Drawing.Point(29, 104);
this.libationFilesCustomTb.Name = "libationFilesCustomTb";
this.libationFilesCustomTb.Size = new System.Drawing.Size(706, 20);
this.libationFilesCustomTb.TabIndex = 4;
this.libationFilesCustomTb.TextChanged += new System.EventHandler(this.libationFiles_Changed);
//
// libationFilesCustomRb
//
this.libationFilesCustomRb.AutoSize = true;
this.libationFilesCustomRb.Location = new System.Drawing.Point(9, 107);
this.libationFilesCustomRb.Name = "libationFilesCustomRb";
this.libationFilesCustomRb.Size = new System.Drawing.Size(14, 13);
this.libationFilesCustomRb.TabIndex = 3;
this.libationFilesCustomRb.TabStop = true;
this.libationFilesCustomRb.UseVisualStyleBackColor = true;
//
// libationFilesMyDocsRb
//
this.libationFilesMyDocsRb.AutoSize = true;
this.libationFilesMyDocsRb.CheckAlign = System.Drawing.ContentAlignment.TopLeft;
this.libationFilesMyDocsRb.Location = new System.Drawing.Point(9, 68);
this.libationFilesMyDocsRb.Name = "libationFilesMyDocsRb";
this.libationFilesMyDocsRb.Size = new System.Drawing.Size(111, 30);
this.libationFilesMyDocsRb.TabIndex = 2;
this.libationFilesMyDocsRb.TabStop = true;
this.libationFilesMyDocsRb.Text = "[desc]\r\n[myDocs\\Libation]";
this.libationFilesMyDocsRb.UseVisualStyleBackColor = true;
this.libationFilesMyDocsRb.CheckedChanged += new System.EventHandler(this.libationFiles_Changed);
//
// libationFilesRootRb
//
this.libationFilesRootRb.AutoSize = true;
this.libationFilesRootRb.CheckAlign = System.Drawing.ContentAlignment.TopLeft;
this.libationFilesRootRb.Location = new System.Drawing.Point(9, 32);
this.libationFilesRootRb.Name = "libationFilesRootRb";
this.libationFilesRootRb.Size = new System.Drawing.Size(113, 30);
this.libationFilesRootRb.TabIndex = 1;
this.libationFilesRootRb.TabStop = true;
this.libationFilesRootRb.Text = "[desc]\r\n[exeRoot\\Libation]";
this.libationFilesRootRb.UseVisualStyleBackColor = true;
this.libationFilesRootRb.CheckedChanged += new System.EventHandler(this.libationFiles_Changed);
//
// downloadsInProgressGb
//
this.downloadsInProgressGb.Controls.Add(this.downloadsInProgressLibationFilesRb);
this.downloadsInProgressGb.Controls.Add(this.downloadsInProgressWinTempRb);
this.downloadsInProgressGb.Controls.Add(this.downloadsInProgressDescLbl);
this.downloadsInProgressGb.Location = new System.Drawing.Point(12, 298);
this.downloadsInProgressGb.Name = "downloadsInProgressGb";
this.downloadsInProgressGb.Size = new System.Drawing.Size(776, 117);
this.downloadsInProgressGb.TabIndex = 13;
this.downloadsInProgressGb.TabStop = false;
this.downloadsInProgressGb.Text = "Downloads in progress";
//
// downloadsInProgressLibationFilesRb
//
this.downloadsInProgressLibationFilesRb.AutoSize = true;
this.downloadsInProgressLibationFilesRb.CheckAlign = System.Drawing.ContentAlignment.TopLeft;
this.downloadsInProgressLibationFilesRb.Location = new System.Drawing.Point(9, 81);
this.downloadsInProgressLibationFilesRb.Name = "downloadsInProgressLibationFilesRb";
this.downloadsInProgressLibationFilesRb.Size = new System.Drawing.Size(193, 30);
this.downloadsInProgressLibationFilesRb.TabIndex = 2;
this.downloadsInProgressLibationFilesRb.TabStop = true;
this.downloadsInProgressLibationFilesRb.Text = "[desc]\r\n[libationFiles\\DownloadsInProgress]";
this.downloadsInProgressLibationFilesRb.UseVisualStyleBackColor = true;
//
// downloadsInProgressWinTempRb
//
this.downloadsInProgressWinTempRb.AutoSize = true;
this.downloadsInProgressWinTempRb.CheckAlign = System.Drawing.ContentAlignment.TopLeft;
this.downloadsInProgressWinTempRb.Location = new System.Drawing.Point(9, 45);
this.downloadsInProgressWinTempRb.Name = "downloadsInProgressWinTempRb";
this.downloadsInProgressWinTempRb.Size = new System.Drawing.Size(182, 30);
this.downloadsInProgressWinTempRb.TabIndex = 1;
this.downloadsInProgressWinTempRb.TabStop = true;
this.downloadsInProgressWinTempRb.Text = "[desc]\r\n[winTemp\\DownloadsInProgress]";
this.downloadsInProgressWinTempRb.UseVisualStyleBackColor = true;
//
// downloadsInProgressDescLbl
//
this.downloadsInProgressDescLbl.AutoSize = true;
this.downloadsInProgressDescLbl.Location = new System.Drawing.Point(6, 16);
this.downloadsInProgressDescLbl.Name = "downloadsInProgressDescLbl";
this.downloadsInProgressDescLbl.Size = new System.Drawing.Size(38, 26);
this.downloadsInProgressDescLbl.TabIndex = 0;
this.downloadsInProgressDescLbl.Text = "[desc]\r\n[line 2]";
//
// decryptInProgressGb
//
this.decryptInProgressGb.Controls.Add(this.decryptInProgressLibationFilesRb);
this.decryptInProgressGb.Controls.Add(this.decryptInProgressWinTempRb);
this.decryptInProgressGb.Controls.Add(this.decryptInProgressDescLbl);
this.decryptInProgressGb.Location = new System.Drawing.Point(12, 421);
this.decryptInProgressGb.Name = "decryptInProgressGb";
this.decryptInProgressGb.Size = new System.Drawing.Size(776, 117);
this.decryptInProgressGb.TabIndex = 14;
this.decryptInProgressGb.TabStop = false;
this.decryptInProgressGb.Text = "Decrypt in progress";
//
// decryptInProgressLibationFilesRb
//
this.decryptInProgressLibationFilesRb.AutoSize = true;
this.decryptInProgressLibationFilesRb.CheckAlign = System.Drawing.ContentAlignment.TopLeft;
this.decryptInProgressLibationFilesRb.Location = new System.Drawing.Point(6, 81);
this.decryptInProgressLibationFilesRb.Name = "decryptInProgressLibationFilesRb";
this.decryptInProgressLibationFilesRb.Size = new System.Drawing.Size(177, 30);
this.decryptInProgressLibationFilesRb.TabIndex = 2;
this.decryptInProgressLibationFilesRb.TabStop = true;
this.decryptInProgressLibationFilesRb.Text = "[desc]\r\n[libationFiles\\DecryptInProgress]";
this.decryptInProgressLibationFilesRb.UseVisualStyleBackColor = true;
//
// decryptInProgressWinTempRb
//
this.decryptInProgressWinTempRb.AutoSize = true;
this.decryptInProgressWinTempRb.CheckAlign = System.Drawing.ContentAlignment.TopLeft;
this.decryptInProgressWinTempRb.Location = new System.Drawing.Point(6, 45);
this.decryptInProgressWinTempRb.Name = "decryptInProgressWinTempRb";
this.decryptInProgressWinTempRb.Size = new System.Drawing.Size(166, 30);
this.decryptInProgressWinTempRb.TabIndex = 1;
this.decryptInProgressWinTempRb.TabStop = true;
this.decryptInProgressWinTempRb.Text = "[desc]\r\n[winTemp\\DecryptInProgress]";
this.decryptInProgressWinTempRb.UseVisualStyleBackColor = true;
//
// decryptInProgressDescLbl
//
this.decryptInProgressDescLbl.AutoSize = true;
this.decryptInProgressDescLbl.Location = new System.Drawing.Point(6, 16);
this.decryptInProgressDescLbl.Name = "decryptInProgressDescLbl";
this.decryptInProgressDescLbl.Size = new System.Drawing.Size(38, 26);
this.decryptInProgressDescLbl.TabIndex = 0;
this.decryptInProgressDescLbl.Text = "[desc]\r\n[line 2]";
//
// saveBtn
//
this.saveBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.saveBtn.Location = new System.Drawing.Point(612, 544);
this.saveBtn.Name = "saveBtn";
this.saveBtn.Size = new System.Drawing.Size(75, 23);
this.saveBtn.TabIndex = 15;
this.saveBtn.Text = "Save";
this.saveBtn.UseVisualStyleBackColor = true;
this.saveBtn.Click += new System.EventHandler(this.saveBtn_Click);
//
// cancelBtn
//
this.cancelBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.cancelBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelBtn.Location = new System.Drawing.Point(713, 544);
this.cancelBtn.Name = "cancelBtn";
this.cancelBtn.Size = new System.Drawing.Size(75, 23);
this.cancelBtn.TabIndex = 16;
this.cancelBtn.Text = "Cancel";
this.cancelBtn.UseVisualStyleBackColor = true;
this.cancelBtn.Click += new System.EventHandler(this.cancelBtn_Click);
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.downloadsInProgressGb.SuspendLayout();
this.decryptInProgressGb.SuspendLayout();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// decryptKeyLbl
//
this.decryptKeyLbl.AutoSize = true;
this.decryptKeyLbl.Location = new System.Drawing.Point(6, 22);
this.decryptKeyLbl.Name = "decryptKeyLbl";
this.decryptKeyLbl.Size = new System.Drawing.Size(64, 13);
this.decryptKeyLbl.TabIndex = 0;
this.decryptKeyLbl.Text = "Decrypt key";
//
// decryptKeyTb
//
this.decryptKeyTb.Location = new System.Drawing.Point(76, 19);
this.decryptKeyTb.Name = "decryptKeyTb";
this.decryptKeyTb.Size = new System.Drawing.Size(100, 20);
this.decryptKeyTb.TabIndex = 1;
//
// booksLocationLbl
//
this.booksLocationLbl.AutoSize = true;
this.booksLocationLbl.Location = new System.Drawing.Point(12, 17);
this.booksLocationLbl.Name = "booksLocationLbl";
this.booksLocationLbl.Size = new System.Drawing.Size(77, 13);
this.booksLocationLbl.TabIndex = 0;
this.booksLocationLbl.Text = "Books location";
//
// booksLocationTb
//
this.booksLocationTb.Location = new System.Drawing.Point(95, 14);
this.booksLocationTb.Name = "booksLocationTb";
this.booksLocationTb.Size = new System.Drawing.Size(652, 20);
this.booksLocationTb.TabIndex = 1;
//
// booksLocationSearchBtn
//
this.booksLocationSearchBtn.Location = new System.Drawing.Point(753, 12);
this.booksLocationSearchBtn.Name = "booksLocationSearchBtn";
this.booksLocationSearchBtn.Size = new System.Drawing.Size(35, 23);
this.booksLocationSearchBtn.TabIndex = 2;
this.booksLocationSearchBtn.Text = "...";
this.booksLocationSearchBtn.UseVisualStyleBackColor = true;
this.booksLocationSearchBtn.Click += new System.EventHandler(this.booksLocationSearchBtn_Click);
//
// decryptKeyDescLbl
//
this.decryptKeyDescLbl.AutoSize = true;
this.decryptKeyDescLbl.Location = new System.Drawing.Point(73, 42);
this.decryptKeyDescLbl.Name = "decryptKeyDescLbl";
this.decryptKeyDescLbl.Size = new System.Drawing.Size(36, 13);
this.decryptKeyDescLbl.TabIndex = 2;
this.decryptKeyDescLbl.Text = "[desc]";
//
// booksLocationDescLbl
//
this.booksLocationDescLbl.AutoSize = true;
this.booksLocationDescLbl.Location = new System.Drawing.Point(92, 37);
this.booksLocationDescLbl.Name = "booksLocationDescLbl";
this.booksLocationDescLbl.Size = new System.Drawing.Size(36, 13);
this.booksLocationDescLbl.TabIndex = 3;
this.booksLocationDescLbl.Text = "[desc]";
//
// downloadsInProgressGb
//
this.downloadsInProgressGb.Controls.Add(this.downloadsInProgressLibationFilesRb);
this.downloadsInProgressGb.Controls.Add(this.downloadsInProgressWinTempRb);
this.downloadsInProgressGb.Controls.Add(this.downloadsInProgressDescLbl);
this.downloadsInProgressGb.Location = new System.Drawing.Point(15, 58);
this.downloadsInProgressGb.Name = "downloadsInProgressGb";
this.downloadsInProgressGb.Size = new System.Drawing.Size(758, 117);
this.downloadsInProgressGb.TabIndex = 4;
this.downloadsInProgressGb.TabStop = false;
this.downloadsInProgressGb.Text = "Downloads in progress";
//
// downloadsInProgressLibationFilesRb
//
this.downloadsInProgressLibationFilesRb.AutoSize = true;
this.downloadsInProgressLibationFilesRb.CheckAlign = System.Drawing.ContentAlignment.TopLeft;
this.downloadsInProgressLibationFilesRb.Location = new System.Drawing.Point(9, 81);
this.downloadsInProgressLibationFilesRb.Name = "downloadsInProgressLibationFilesRb";
this.downloadsInProgressLibationFilesRb.Size = new System.Drawing.Size(193, 30);
this.downloadsInProgressLibationFilesRb.TabIndex = 2;
this.downloadsInProgressLibationFilesRb.TabStop = true;
this.downloadsInProgressLibationFilesRb.Text = "[desc]\r\n[libationFiles\\DownloadsInProgress]";
this.downloadsInProgressLibationFilesRb.UseVisualStyleBackColor = true;
//
// downloadsInProgressWinTempRb
//
this.downloadsInProgressWinTempRb.AutoSize = true;
this.downloadsInProgressWinTempRb.CheckAlign = System.Drawing.ContentAlignment.TopLeft;
this.downloadsInProgressWinTempRb.Location = new System.Drawing.Point(9, 45);
this.downloadsInProgressWinTempRb.Name = "downloadsInProgressWinTempRb";
this.downloadsInProgressWinTempRb.Size = new System.Drawing.Size(182, 30);
this.downloadsInProgressWinTempRb.TabIndex = 1;
this.downloadsInProgressWinTempRb.TabStop = true;
this.downloadsInProgressWinTempRb.Text = "[desc]\r\n[winTemp\\DownloadsInProgress]";
this.downloadsInProgressWinTempRb.UseVisualStyleBackColor = true;
//
// downloadsInProgressDescLbl
//
this.downloadsInProgressDescLbl.AutoSize = true;
this.downloadsInProgressDescLbl.Location = new System.Drawing.Point(6, 16);
this.downloadsInProgressDescLbl.Name = "downloadsInProgressDescLbl";
this.downloadsInProgressDescLbl.Size = new System.Drawing.Size(38, 26);
this.downloadsInProgressDescLbl.TabIndex = 0;
this.downloadsInProgressDescLbl.Text = "[desc]\r\n[line 2]";
//
// decryptInProgressGb
//
this.decryptInProgressGb.Controls.Add(this.decryptInProgressLibationFilesRb);
this.decryptInProgressGb.Controls.Add(this.decryptInProgressWinTempRb);
this.decryptInProgressGb.Controls.Add(this.decryptInProgressDescLbl);
this.decryptInProgressGb.Location = new System.Drawing.Point(9, 183);
this.decryptInProgressGb.Name = "decryptInProgressGb";
this.decryptInProgressGb.Size = new System.Drawing.Size(758, 117);
this.decryptInProgressGb.TabIndex = 5;
this.decryptInProgressGb.TabStop = false;
this.decryptInProgressGb.Text = "Decrypt in progress";
//
// decryptInProgressLibationFilesRb
//
this.decryptInProgressLibationFilesRb.AutoSize = true;
this.decryptInProgressLibationFilesRb.CheckAlign = System.Drawing.ContentAlignment.TopLeft;
this.decryptInProgressLibationFilesRb.Location = new System.Drawing.Point(6, 81);
this.decryptInProgressLibationFilesRb.Name = "decryptInProgressLibationFilesRb";
this.decryptInProgressLibationFilesRb.Size = new System.Drawing.Size(177, 30);
this.decryptInProgressLibationFilesRb.TabIndex = 2;
this.decryptInProgressLibationFilesRb.TabStop = true;
this.decryptInProgressLibationFilesRb.Text = "[desc]\r\n[libationFiles\\DecryptInProgress]";
this.decryptInProgressLibationFilesRb.UseVisualStyleBackColor = true;
//
// decryptInProgressWinTempRb
//
this.decryptInProgressWinTempRb.AutoSize = true;
this.decryptInProgressWinTempRb.CheckAlign = System.Drawing.ContentAlignment.TopLeft;
this.decryptInProgressWinTempRb.Location = new System.Drawing.Point(6, 45);
this.decryptInProgressWinTempRb.Name = "decryptInProgressWinTempRb";
this.decryptInProgressWinTempRb.Size = new System.Drawing.Size(166, 30);
this.decryptInProgressWinTempRb.TabIndex = 1;
this.decryptInProgressWinTempRb.TabStop = true;
this.decryptInProgressWinTempRb.Text = "[desc]\r\n[winTemp\\DecryptInProgress]";
this.decryptInProgressWinTempRb.UseVisualStyleBackColor = true;
//
// decryptInProgressDescLbl
//
this.decryptInProgressDescLbl.AutoSize = true;
this.decryptInProgressDescLbl.Location = new System.Drawing.Point(6, 16);
this.decryptInProgressDescLbl.Name = "decryptInProgressDescLbl";
this.decryptInProgressDescLbl.Size = new System.Drawing.Size(38, 26);
this.decryptInProgressDescLbl.TabIndex = 0;
this.decryptInProgressDescLbl.Text = "[desc]\r\n[line 2]";
//
// saveBtn
//
this.saveBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.saveBtn.Location = new System.Drawing.Point(612, 404);
this.saveBtn.Name = "saveBtn";
this.saveBtn.Size = new System.Drawing.Size(75, 23);
this.saveBtn.TabIndex = 7;
this.saveBtn.Text = "Save";
this.saveBtn.UseVisualStyleBackColor = true;
this.saveBtn.Click += new System.EventHandler(this.saveBtn_Click);
//
// cancelBtn
//
this.cancelBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.cancelBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelBtn.Location = new System.Drawing.Point(713, 404);
this.cancelBtn.Name = "cancelBtn";
this.cancelBtn.Size = new System.Drawing.Size(75, 23);
this.cancelBtn.TabIndex = 8;
this.cancelBtn.Text = "Cancel";
this.cancelBtn.UseVisualStyleBackColor = true;
this.cancelBtn.Click += new System.EventHandler(this.cancelBtn_Click);
//
// audibleLocaleLbl
//
this.audibleLocaleLbl.AutoSize = true;
this.audibleLocaleLbl.Location = new System.Drawing.Point(7, 98);
this.audibleLocaleLbl.Location = new System.Drawing.Point(12, 56);
this.audibleLocaleLbl.Name = "audibleLocaleLbl";
this.audibleLocaleLbl.Size = new System.Drawing.Size(77, 13);
this.audibleLocaleLbl.TabIndex = 6;
this.audibleLocaleLbl.TabIndex = 4;
this.audibleLocaleLbl.Text = "Audible Locale";
//
// audibleLocaleCb
@ -361,81 +245,77 @@
"germany",
"france",
"canada"});
this.audibleLocaleCb.Location = new System.Drawing.Point(90, 95);
this.audibleLocaleCb.Location = new System.Drawing.Point(95, 53);
this.audibleLocaleCb.Name = "audibleLocaleCb";
this.audibleLocaleCb.Size = new System.Drawing.Size(121, 21);
this.audibleLocaleCb.TabIndex = 7;
this.audibleLocaleCb.Size = new System.Drawing.Size(53, 21);
this.audibleLocaleCb.TabIndex = 5;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.decryptKeyTb);
this.groupBox1.Controls.Add(this.decryptKeyLbl);
this.groupBox1.Controls.Add(this.decryptKeyDescLbl);
this.groupBox1.Controls.Add(this.downloadsInProgressGb);
this.groupBox1.Controls.Add(this.decryptInProgressGb);
this.groupBox1.Location = new System.Drawing.Point(15, 90);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(773, 308);
this.groupBox1.TabIndex = 6;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Advanced settings for control freaks";
//
// SettingsDialog
//
this.AcceptButton = this.saveBtn;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.cancelBtn;
this.ClientSize = new System.Drawing.Size(800, 579);
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.cancelBtn;
this.ClientSize = new System.Drawing.Size(800, 439);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.audibleLocaleCb);
this.Controls.Add(this.audibleLocaleLbl);
this.Controls.Add(this.cancelBtn);
this.Controls.Add(this.saveBtn);
this.Controls.Add(this.decryptInProgressGb);
this.Controls.Add(this.downloadsInProgressGb);
this.Controls.Add(this.libationFilesGb);
this.Controls.Add(this.booksLocationDescLbl);
this.Controls.Add(this.decryptKeyDescLbl);
this.Controls.Add(this.settingsFileDescLbl);
this.Controls.Add(this.booksLocationSearchBtn);
this.Controls.Add(this.booksLocationTb);
this.Controls.Add(this.booksLocationLbl);
this.Controls.Add(this.decryptKeyTb);
this.Controls.Add(this.decryptKeyLbl);
this.Controls.Add(this.settingsFileTb);
this.Controls.Add(this.settingsFileLbl);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Name = "SettingsDialog";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Edit Settings";
this.Load += new System.EventHandler(this.SettingsDialog_Load);
this.libationFilesGb.ResumeLayout(false);
this.libationFilesGb.PerformLayout();
this.downloadsInProgressGb.ResumeLayout(false);
this.downloadsInProgressGb.PerformLayout();
this.decryptInProgressGb.ResumeLayout(false);
this.decryptInProgressGb.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
this.Controls.Add(this.saveBtn);
this.Controls.Add(this.booksLocationDescLbl);
this.Controls.Add(this.booksLocationSearchBtn);
this.Controls.Add(this.booksLocationTb);
this.Controls.Add(this.booksLocationLbl);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Name = "SettingsDialog";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Edit Settings";
this.Load += new System.EventHandler(this.SettingsDialog_Load);
this.downloadsInProgressGb.ResumeLayout(false);
this.downloadsInProgressGb.PerformLayout();
this.decryptInProgressGb.ResumeLayout(false);
this.decryptInProgressGb.PerformLayout();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
}
#endregion
private System.Windows.Forms.Label settingsFileLbl;
private System.Windows.Forms.TextBox settingsFileTb;
private System.Windows.Forms.Label decryptKeyLbl;
private System.Windows.Forms.TextBox decryptKeyTb;
private System.Windows.Forms.Label booksLocationLbl;
private System.Windows.Forms.TextBox booksLocationTb;
private System.Windows.Forms.Button booksLocationSearchBtn;
private System.Windows.Forms.Label settingsFileDescLbl;
private System.Windows.Forms.Label decryptKeyDescLbl;
private System.Windows.Forms.Label booksLocationDescLbl;
private System.Windows.Forms.GroupBox libationFilesGb;
private System.Windows.Forms.Button libationFilesCustomBtn;
private System.Windows.Forms.TextBox libationFilesCustomTb;
private System.Windows.Forms.RadioButton libationFilesCustomRb;
private System.Windows.Forms.RadioButton libationFilesMyDocsRb;
private System.Windows.Forms.RadioButton libationFilesRootRb;
private System.Windows.Forms.Label libationFilesDescLbl;
private System.Windows.Forms.GroupBox downloadsInProgressGb;
private System.Windows.Forms.Label downloadsInProgressDescLbl;
private System.Windows.Forms.RadioButton downloadsInProgressWinTempRb;
private System.Windows.Forms.RadioButton downloadsInProgressLibationFilesRb;
private System.Windows.Forms.GroupBox decryptInProgressGb;
private System.Windows.Forms.Label decryptInProgressDescLbl;
private System.Windows.Forms.RadioButton decryptInProgressLibationFilesRb;
private System.Windows.Forms.RadioButton decryptInProgressWinTempRb;
private System.Windows.Forms.Button saveBtn;
private System.Windows.Forms.Button cancelBtn;
#endregion
private System.Windows.Forms.Label decryptKeyLbl;
private System.Windows.Forms.TextBox decryptKeyTb;
private System.Windows.Forms.Label booksLocationLbl;
private System.Windows.Forms.TextBox booksLocationTb;
private System.Windows.Forms.Button booksLocationSearchBtn;
private System.Windows.Forms.Label decryptKeyDescLbl;
private System.Windows.Forms.Label booksLocationDescLbl;
private System.Windows.Forms.GroupBox downloadsInProgressGb;
private System.Windows.Forms.Label downloadsInProgressDescLbl;
private System.Windows.Forms.RadioButton downloadsInProgressWinTempRb;
private System.Windows.Forms.RadioButton downloadsInProgressLibationFilesRb;
private System.Windows.Forms.GroupBox decryptInProgressGb;
private System.Windows.Forms.Label decryptInProgressDescLbl;
private System.Windows.Forms.RadioButton decryptInProgressLibationFilesRb;
private System.Windows.Forms.RadioButton decryptInProgressWinTempRb;
private System.Windows.Forms.Button saveBtn;
private System.Windows.Forms.Button cancelBtn;
private System.Windows.Forms.Label audibleLocaleLbl;
private System.Windows.Forms.ComboBox audibleLocaleCb;
private System.Windows.Forms.GroupBox groupBox1;
}
}

View File

@ -4,42 +4,25 @@ using System.Windows.Forms;
using Dinah.Core;
using FileManager;
namespace LibationWinForms
namespace LibationWinForms.Dialogs
{
public partial class SettingsDialog : Form
{
Configuration config { get; } = Configuration.Instance;
Func<string, string> desc { get; } = Configuration.GetDescription;
string exeRoot { get; }
string myDocs { get; }
bool isFirstLoad;
public SettingsDialog()
{
InitializeComponent();
this.libationFilesCustomTb.TextChanged += (_, __) =>
{
if (!string.IsNullOrWhiteSpace(libationFilesCustomTb.Text))
this.libationFilesCustomRb.Checked = true;
};
exeRoot = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(Exe.FileLocationOnDisk), "Libation"));
myDocs = Path.GetFullPath(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Libation"));
}
private void SettingsDialog_Load(object sender, EventArgs e)
{
isFirstLoad = string.IsNullOrWhiteSpace(config.Books);
this.settingsFileTb.Text = config.Filepath;
this.settingsFileDescLbl.Text = desc(nameof(config.Filepath));
this.decryptKeyTb.Text = config.DecryptKey;
this.decryptKeyDescLbl.Text = desc(nameof(config.DecryptKey));
this.booksLocationTb.Text
= !string.IsNullOrWhiteSpace(config.Books)
= !string.IsNullOrWhiteSpace(config.Books)
? config.Books
: Path.GetDirectoryName(Exe.FileLocationOnDisk);
this.booksLocationDescLbl.Text = desc(nameof(config.Books));
@ -49,21 +32,8 @@ namespace LibationWinForms
? config.LocaleCountryCode
: "us";
libationFilesDescLbl.Text = desc(nameof(config.LibationFiles));
this.libationFilesRootRb.Text = "In the same folder that Libation is running from\r\n" + exeRoot;
this.libationFilesMyDocsRb.Text = "In My Documents\r\n" + myDocs;
if (config.LibationFiles == exeRoot)
libationFilesRootRb.Checked = true;
else if (config.LibationFiles == myDocs)
libationFilesMyDocsRb.Checked = true;
else
{
libationFilesCustomRb.Checked = true;
libationFilesCustomTb.Text = config.LibationFiles;
}
this.downloadsInProgressDescLbl.Text = desc(nameof(config.DownloadsInProgressEnum));
var winTempDownloadsInProgress = Path.Combine(config.WinTemp, "DownloadsInProgress");
var winTempDownloadsInProgress = Path.Combine(Configuration.WinTemp, "DownloadsInProgress");
this.downloadsInProgressWinTempRb.Text = "In your Windows temporary folder\r\n" + winTempDownloadsInProgress;
switch (config.DownloadsInProgressEnum)
{
@ -77,7 +47,7 @@ namespace LibationWinForms
}
this.decryptInProgressDescLbl.Text = desc(nameof(config.DecryptInProgressEnum));
var winTempDecryptInProgress = Path.Combine(config.WinTemp, "DecryptInProgress");
var winTempDecryptInProgress = Path.Combine(Configuration.WinTemp, "DecryptInProgress");
this.decryptInProgressWinTempRb.Text = "In your Windows temporary folder\r\n" + winTempDecryptInProgress;
switch (config.DecryptInProgressEnum)
{
@ -89,87 +59,38 @@ namespace LibationWinForms
decryptInProgressWinTempRb.Checked = true;
break;
}
libationFiles_Changed(this, null);
}
private void libationFiles_Changed(object sender, EventArgs e)
{
var libationFilesDir
= libationFilesRootRb.Checked ? exeRoot
: libationFilesMyDocsRb.Checked ? myDocs
: libationFilesCustomTb.Text;
var downloadsInProgress = Path.Combine(libationFilesDir, "DownloadsInProgress");
this.downloadsInProgressLibationFilesRb.Text = $"In your Libation Files (ie: program-created files)\r\n{downloadsInProgress}";
var decryptInProgress = Path.Combine(libationFilesDir, "DecryptInProgress");
this.decryptInProgressLibationFilesRb.Text = $"In your Libation Files (ie: program-created files)\r\n{decryptInProgress}";
}
private void booksLocationSearchBtn_Click(object sender, EventArgs e) => selectFolder("Search for books location", this.booksLocationTb);
private void libationFilesCustomBtn_Click(object sender, EventArgs e) => selectFolder("Search for Libation Files location", this.libationFilesCustomTb);
private static void selectFolder(string desc, TextBox textbox)
{
using var dialog = new FolderBrowserDialog { Description = desc, SelectedPath = "" };
dialog.ShowDialog();
if (!string.IsNullOrWhiteSpace(dialog.SelectedPath))
textbox.Text = dialog.SelectedPath;
}
private void saveBtn_Click(object sender, EventArgs e)
{
config.DecryptKey = this.decryptKeyTb.Text;
var pathsChanged = false;
if (!Directory.Exists(this.booksLocationTb.Text))
MessageBox.Show("Not saving change to Books location. This folder does not exist:\r\n" + this.booksLocationTb.Text);
else if (config.Books != this.booksLocationTb.Text)
{
pathsChanged = true;
config.Books = this.booksLocationTb.Text;
}
{
using var dialog = new FolderBrowserDialog { Description = desc, SelectedPath = "" };
dialog.ShowDialog();
if (!string.IsNullOrWhiteSpace(dialog.SelectedPath))
textbox.Text = dialog.SelectedPath;
}
private void saveBtn_Click(object sender, EventArgs e)
{
config.DecryptKey = this.decryptKeyTb.Text;
config.LocaleCountryCode = this.audibleLocaleCb.Text;
config.DownloadsInProgressEnum = downloadsInProgressLibationFilesRb.Checked ? "LibationFiles" : "WinTemp";
config.DecryptInProgressEnum = decryptInProgressLibationFilesRb.Checked ? "LibationFiles" : "WinTemp";
var libationDir
= libationFilesRootRb.Checked ? exeRoot
: libationFilesMyDocsRb.Checked ? myDocs
: libationFilesCustomTb.Text;
if (!Directory.Exists(libationDir))
MessageBox.Show("Not saving change to Libation Files location. This folder does not exist:\r\n" + libationDir);
else if (config.LibationFiles != libationDir)
{
pathsChanged = true;
config.LibationFiles = libationDir;
}
var newBooks = this.booksLocationTb.Text;
if (!Directory.Exists(newBooks))
{
MessageBox.Show($"Not saving change to Books location. This folder does not exist:\r\n{newBooks}");
return;
}
else
config.Books = newBooks;
config.DownloadsInProgressEnum = downloadsInProgressLibationFilesRb.Checked ? "LibationFiles" : "WinTemp";
config.DecryptInProgressEnum = decryptInProgressLibationFilesRb.Checked ? "LibationFiles" : "WinTemp";
this.DialogResult = DialogResult.OK;
this.Close();
}
if (!isFirstLoad && pathsChanged)
{
var shutdownResult = MessageBox.Show(
"You have changed a file path important for this program. All files will remain in their original location; nothing will be moved. It is highly recommended that you restart this program so these changes are handled correctly."
+ "\r\n"
+ "\r\nClose program?",
"Restart program",
MessageBoxButtons.YesNo,
MessageBoxIcon.Exclamation,
MessageBoxDefaultButton.Button1);
if (shutdownResult == DialogResult.Yes)
{
Application.Exit();
}
}
this.DialogResult = DialogResult.OK;
this.Close();
}
private void cancelBtn_Click(object sender, EventArgs e) => this.Close();
private void cancelBtn_Click(object sender, EventArgs e) => this.Close();
}
}

View File

@ -0,0 +1,99 @@
namespace LibationWinForms.Dialogs
{
partial class SetupDialog
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SetupDialog));
this.welcomeLbl = new System.Windows.Forms.Label();
this.noQuestionsBtn = new System.Windows.Forms.Button();
this.basicBtn = new System.Windows.Forms.Button();
this.advancedBtn = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// welcomeLbl
//
this.welcomeLbl.AutoSize = true;
this.welcomeLbl.Location = new System.Drawing.Point(12, 9);
this.welcomeLbl.Name = "welcomeLbl";
this.welcomeLbl.Size = new System.Drawing.Size(399, 78);
this.welcomeLbl.TabIndex = 0;
this.welcomeLbl.Text = resources.GetString("welcomeLbl.Text");
//
// noQuestionsBtn
//
this.noQuestionsBtn.Location = new System.Drawing.Point(15, 90);
this.noQuestionsBtn.Name = "noQuestionsBtn";
this.noQuestionsBtn.Size = new System.Drawing.Size(396, 57);
this.noQuestionsBtn.TabIndex = 1;
this.noQuestionsBtn.Text = "NO-QUESTIONS SETUP\r\n\r\nAccept all defaults";
this.noQuestionsBtn.UseVisualStyleBackColor = true;
//
// basicBtn
//
this.basicBtn.Location = new System.Drawing.Point(15, 153);
this.basicBtn.Name = "basicBtn";
this.basicBtn.Size = new System.Drawing.Size(396, 57);
this.basicBtn.TabIndex = 2;
this.basicBtn.Text = "BASIC SETUP\r\n\r\nChoose settings";
this.basicBtn.UseVisualStyleBackColor = true;
//
// advancedBtn
//
this.advancedBtn.Location = new System.Drawing.Point(15, 216);
this.advancedBtn.Name = "advancedBtn";
this.advancedBtn.Size = new System.Drawing.Size(396, 57);
this.advancedBtn.TabIndex = 3;
this.advancedBtn.Text = "ADVANCED SETUP\r\n\r\nChoose settings and where to store them";
this.advancedBtn.UseVisualStyleBackColor = true;
//
// SetupDialog
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(423, 285);
this.Controls.Add(this.advancedBtn);
this.Controls.Add(this.basicBtn);
this.Controls.Add(this.noQuestionsBtn);
this.Controls.Add(this.welcomeLbl);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Name = "SetupDialog";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Welcome to Libation";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label welcomeLbl;
private System.Windows.Forms.Button noQuestionsBtn;
private System.Windows.Forms.Button basicBtn;
private System.Windows.Forms.Button advancedBtn;
}
}

View File

@ -0,0 +1,37 @@
using System;
using System.Windows.Forms;
namespace LibationWinForms.Dialogs
{
public partial class SetupDialog : Form
{
public event EventHandler NoQuestionsBtn_Click
{
add => noQuestionsBtn.Click += value;
remove => noQuestionsBtn.Click -= value;
}
public event EventHandler BasicBtn_Click
{
add => basicBtn.Click += value;
remove => basicBtn.Click -= value;
}
public event EventHandler AdvancedBtn_Click
{
add => advancedBtn.Click += value;
remove => advancedBtn.Click -= value;
}
public SetupDialog()
{
InitializeComponent();
noQuestionsBtn.Click += btn_Click;
basicBtn.Click += btn_Click;
advancedBtn.Click += btn_Click;
}
private void btn_Click(object sender, EventArgs e) => Close();
}
}

View File

@ -0,0 +1,128 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="welcomeLbl.Text" xml:space="preserve">
<value>This appears to be your first time using Libation or a previous setup was incomplete.
Please fill in a few settings. You can also change these settings later.
After you make your selections, get started by importing your library.
Go to Import &gt; Scan Library</value>
</data>
</root>

View File

@ -8,6 +8,7 @@ using Dinah.Core;
using Dinah.Core.Drawing;
using Dinah.Core.Windows.Forms;
using FileManager;
using LibationWinForms.Dialogs;
namespace LibationWinForms
{

View File

@ -7,6 +7,7 @@ using DataLayer;
using Dinah.Core.Collections.Generic;
using Dinah.Core.DataBinding;
using Dinah.Core.Windows.Forms;
using LibationWinForms.Dialogs;
namespace LibationWinForms
{

View File

@ -0,0 +1,156 @@
namespace WinFormsDesigner.Dialogs
{
partial class LibationFilesDialog
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.libationFilesDescLbl = new System.Windows.Forms.Label();
this.libationFilesCustomBtn = new System.Windows.Forms.Button();
this.libationFilesCustomTb = new System.Windows.Forms.TextBox();
this.libationFilesCustomRb = new System.Windows.Forms.RadioButton();
this.libationFilesMyDocsRb = new System.Windows.Forms.RadioButton();
this.libationFilesRootRb = new System.Windows.Forms.RadioButton();
this.cancelBtn = new System.Windows.Forms.Button();
this.saveBtn = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// libationFilesDescLbl
//
this.libationFilesDescLbl.AutoSize = true;
this.libationFilesDescLbl.Location = new System.Drawing.Point(12, 9);
this.libationFilesDescLbl.Name = "libationFilesDescLbl";
this.libationFilesDescLbl.Size = new System.Drawing.Size(36, 13);
this.libationFilesDescLbl.TabIndex = 0;
this.libationFilesDescLbl.Text = "[desc]";
//
// libationFilesCustomBtn
//
this.libationFilesCustomBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.libationFilesCustomBtn.Location = new System.Drawing.Point(753, 95);
this.libationFilesCustomBtn.Name = "libationFilesCustomBtn";
this.libationFilesCustomBtn.Size = new System.Drawing.Size(35, 23);
this.libationFilesCustomBtn.TabIndex = 5;
this.libationFilesCustomBtn.Text = "...";
this.libationFilesCustomBtn.UseVisualStyleBackColor = true;
//
// libationFilesCustomTb
//
this.libationFilesCustomTb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.libationFilesCustomTb.Location = new System.Drawing.Point(35, 97);
this.libationFilesCustomTb.Name = "libationFilesCustomTb";
this.libationFilesCustomTb.Size = new System.Drawing.Size(712, 20);
this.libationFilesCustomTb.TabIndex = 4;
//
// libationFilesCustomRb
//
this.libationFilesCustomRb.AutoSize = true;
this.libationFilesCustomRb.Location = new System.Drawing.Point(15, 100);
this.libationFilesCustomRb.Name = "libationFilesCustomRb";
this.libationFilesCustomRb.Size = new System.Drawing.Size(14, 13);
this.libationFilesCustomRb.TabIndex = 3;
this.libationFilesCustomRb.TabStop = true;
this.libationFilesCustomRb.UseVisualStyleBackColor = true;
//
// libationFilesMyDocsRb
//
this.libationFilesMyDocsRb.AutoSize = true;
this.libationFilesMyDocsRb.CheckAlign = System.Drawing.ContentAlignment.TopLeft;
this.libationFilesMyDocsRb.Location = new System.Drawing.Point(15, 61);
this.libationFilesMyDocsRb.Name = "libationFilesMyDocsRb";
this.libationFilesMyDocsRb.Size = new System.Drawing.Size(111, 30);
this.libationFilesMyDocsRb.TabIndex = 2;
this.libationFilesMyDocsRb.TabStop = true;
this.libationFilesMyDocsRb.Text = "[desc]\r\n[myDocs\\Libation]";
this.libationFilesMyDocsRb.UseVisualStyleBackColor = true;
//
// libationFilesRootRb
//
this.libationFilesRootRb.AutoSize = true;
this.libationFilesRootRb.CheckAlign = System.Drawing.ContentAlignment.TopLeft;
this.libationFilesRootRb.Location = new System.Drawing.Point(15, 25);
this.libationFilesRootRb.Name = "libationFilesRootRb";
this.libationFilesRootRb.Size = new System.Drawing.Size(113, 30);
this.libationFilesRootRb.TabIndex = 1;
this.libationFilesRootRb.TabStop = true;
this.libationFilesRootRb.Text = "[desc]\r\n[exeRoot\\Libation]";
this.libationFilesRootRb.UseVisualStyleBackColor = true;
//
// cancelBtn
//
this.cancelBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.cancelBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelBtn.Location = new System.Drawing.Point(713, 124);
this.cancelBtn.Name = "cancelBtn";
this.cancelBtn.Size = new System.Drawing.Size(75, 23);
this.cancelBtn.TabIndex = 10;
this.cancelBtn.Text = "Cancel";
this.cancelBtn.UseVisualStyleBackColor = true;
//
// saveBtn
//
this.saveBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.saveBtn.Location = new System.Drawing.Point(612, 124);
this.saveBtn.Name = "saveBtn";
this.saveBtn.Size = new System.Drawing.Size(75, 23);
this.saveBtn.TabIndex = 9;
this.saveBtn.Text = "Save";
this.saveBtn.UseVisualStyleBackColor = true;
//
// LibationFilesDialog
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 159);
this.Controls.Add(this.cancelBtn);
this.Controls.Add(this.saveBtn);
this.Controls.Add(this.libationFilesDescLbl);
this.Controls.Add(this.libationFilesCustomBtn);
this.Controls.Add(this.libationFilesCustomTb);
this.Controls.Add(this.libationFilesRootRb);
this.Controls.Add(this.libationFilesCustomRb);
this.Controls.Add(this.libationFilesMyDocsRb);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Name = "LibationFilesDialog";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Libation Files location";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label libationFilesDescLbl;
private System.Windows.Forms.Button libationFilesCustomBtn;
private System.Windows.Forms.TextBox libationFilesCustomTb;
private System.Windows.Forms.RadioButton libationFilesCustomRb;
private System.Windows.Forms.RadioButton libationFilesMyDocsRb;
private System.Windows.Forms.RadioButton libationFilesRootRb;
private System.Windows.Forms.Button cancelBtn;
private System.Windows.Forms.Button saveBtn;
}
}

View File

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WinFormsDesigner.Dialogs
{
public partial class LibationFilesDialog : Form
{
public LibationFilesDialog()
{
InitializeComponent();
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -1,4 +1,4 @@
namespace WinFormsDesigner
namespace WinFormsDesigner.Dialogs
{
partial class SettingsDialog
{
@ -28,23 +28,13 @@
/// </summary>
private void InitializeComponent()
{
this.settingsFileLbl = new System.Windows.Forms.Label();
this.settingsFileTb = new System.Windows.Forms.TextBox();
this.decryptKeyLbl = new System.Windows.Forms.Label();
this.decryptKeyTb = new System.Windows.Forms.TextBox();
this.booksLocationLbl = new System.Windows.Forms.Label();
this.booksLocationTb = new System.Windows.Forms.TextBox();
this.booksLocationSearchBtn = new System.Windows.Forms.Button();
this.settingsFileDescLbl = new System.Windows.Forms.Label();
this.decryptKeyDescLbl = new System.Windows.Forms.Label();
this.booksLocationDescLbl = new System.Windows.Forms.Label();
this.libationFilesGb = new System.Windows.Forms.GroupBox();
this.libationFilesDescLbl = new System.Windows.Forms.Label();
this.libationFilesCustomBtn = new System.Windows.Forms.Button();
this.libationFilesCustomTb = new System.Windows.Forms.TextBox();
this.libationFilesCustomRb = new System.Windows.Forms.RadioButton();
this.libationFilesMyDocsRb = new System.Windows.Forms.RadioButton();
this.libationFilesRootRb = new System.Windows.Forms.RadioButton();
this.downloadsInProgressGb = new System.Windows.Forms.GroupBox();
this.downloadsInProgressLibationFilesRb = new System.Windows.Forms.RadioButton();
this.downloadsInProgressWinTempRb = new System.Windows.Forms.RadioButton();
@ -57,182 +47,80 @@
this.cancelBtn = new System.Windows.Forms.Button();
this.audibleLocaleLbl = new System.Windows.Forms.Label();
this.audibleLocaleCb = new System.Windows.Forms.ComboBox();
this.libationFilesGb.SuspendLayout();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.downloadsInProgressGb.SuspendLayout();
this.decryptInProgressGb.SuspendLayout();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// settingsFileLbl
//
this.settingsFileLbl.AutoSize = true;
this.settingsFileLbl.Location = new System.Drawing.Point(7, 15);
this.settingsFileLbl.Name = "settingsFileLbl";
this.settingsFileLbl.Size = new System.Drawing.Size(61, 13);
this.settingsFileLbl.TabIndex = 0;
this.settingsFileLbl.Text = "Settings file";
//
// settingsFileTb
//
this.settingsFileTb.Location = new System.Drawing.Point(90, 12);
this.settingsFileTb.Name = "settingsFileTb";
this.settingsFileTb.ReadOnly = true;
this.settingsFileTb.Size = new System.Drawing.Size(698, 20);
this.settingsFileTb.TabIndex = 1;
//
// decryptKeyLbl
//
this.decryptKeyLbl.AutoSize = true;
this.decryptKeyLbl.Location = new System.Drawing.Point(7, 59);
this.decryptKeyLbl.Location = new System.Drawing.Point(6, 22);
this.decryptKeyLbl.Name = "decryptKeyLbl";
this.decryptKeyLbl.Size = new System.Drawing.Size(64, 13);
this.decryptKeyLbl.TabIndex = 3;
this.decryptKeyLbl.TabIndex = 0;
this.decryptKeyLbl.Text = "Decrypt key";
//
// decryptKeyTb
//
this.decryptKeyTb.Location = new System.Drawing.Point(90, 56);
this.decryptKeyTb.Location = new System.Drawing.Point(76, 19);
this.decryptKeyTb.Name = "decryptKeyTb";
this.decryptKeyTb.Size = new System.Drawing.Size(100, 20);
this.decryptKeyTb.TabIndex = 4;
this.decryptKeyTb.TabIndex = 1;
//
// booksLocationLbl
//
this.booksLocationLbl.AutoSize = true;
this.booksLocationLbl.Location = new System.Drawing.Point(7, 125);
this.booksLocationLbl.Location = new System.Drawing.Point(12, 17);
this.booksLocationLbl.Name = "booksLocationLbl";
this.booksLocationLbl.Size = new System.Drawing.Size(77, 13);
this.booksLocationLbl.TabIndex = 8;
this.booksLocationLbl.TabIndex = 0;
this.booksLocationLbl.Text = "Books location";
//
// booksLocationTb
//
this.booksLocationTb.Location = new System.Drawing.Point(90, 122);
this.booksLocationTb.Location = new System.Drawing.Point(95, 14);
this.booksLocationTb.Name = "booksLocationTb";
this.booksLocationTb.Size = new System.Drawing.Size(657, 20);
this.booksLocationTb.TabIndex = 9;
this.booksLocationTb.Size = new System.Drawing.Size(652, 20);
this.booksLocationTb.TabIndex = 1;
//
// booksLocationSearchBtn
//
this.booksLocationSearchBtn.Location = new System.Drawing.Point(753, 120);
this.booksLocationSearchBtn.Location = new System.Drawing.Point(753, 12);
this.booksLocationSearchBtn.Name = "booksLocationSearchBtn";
this.booksLocationSearchBtn.Size = new System.Drawing.Size(35, 23);
this.booksLocationSearchBtn.TabIndex = 10;
this.booksLocationSearchBtn.TabIndex = 2;
this.booksLocationSearchBtn.Text = "...";
this.booksLocationSearchBtn.UseVisualStyleBackColor = true;
//
// settingsFileDescLbl
//
this.settingsFileDescLbl.AutoSize = true;
this.settingsFileDescLbl.Location = new System.Drawing.Point(87, 35);
this.settingsFileDescLbl.Name = "settingsFileDescLbl";
this.settingsFileDescLbl.Size = new System.Drawing.Size(36, 13);
this.settingsFileDescLbl.TabIndex = 2;
this.settingsFileDescLbl.Text = "[desc]";
//
// decryptKeyDescLbl
//
this.decryptKeyDescLbl.AutoSize = true;
this.decryptKeyDescLbl.Location = new System.Drawing.Point(87, 79);
this.decryptKeyDescLbl.Location = new System.Drawing.Point(73, 42);
this.decryptKeyDescLbl.Name = "decryptKeyDescLbl";
this.decryptKeyDescLbl.Size = new System.Drawing.Size(36, 13);
this.decryptKeyDescLbl.TabIndex = 5;
this.decryptKeyDescLbl.TabIndex = 2;
this.decryptKeyDescLbl.Text = "[desc]";
//
// booksLocationDescLbl
//
this.booksLocationDescLbl.AutoSize = true;
this.booksLocationDescLbl.Location = new System.Drawing.Point(87, 145);
this.booksLocationDescLbl.Location = new System.Drawing.Point(92, 37);
this.booksLocationDescLbl.Name = "booksLocationDescLbl";
this.booksLocationDescLbl.Size = new System.Drawing.Size(36, 13);
this.booksLocationDescLbl.TabIndex = 11;
this.booksLocationDescLbl.TabIndex = 3;
this.booksLocationDescLbl.Text = "[desc]";
//
// libationFilesGb
//
this.libationFilesGb.Controls.Add(this.libationFilesDescLbl);
this.libationFilesGb.Controls.Add(this.libationFilesCustomBtn);
this.libationFilesGb.Controls.Add(this.libationFilesCustomTb);
this.libationFilesGb.Controls.Add(this.libationFilesCustomRb);
this.libationFilesGb.Controls.Add(this.libationFilesMyDocsRb);
this.libationFilesGb.Controls.Add(this.libationFilesRootRb);
this.libationFilesGb.Location = new System.Drawing.Point(12, 161);
this.libationFilesGb.Name = "libationFilesGb";
this.libationFilesGb.Size = new System.Drawing.Size(776, 131);
this.libationFilesGb.TabIndex = 12;
this.libationFilesGb.TabStop = false;
this.libationFilesGb.Text = "Libation files";
//
// libationFilesDescLbl
//
this.libationFilesDescLbl.AutoSize = true;
this.libationFilesDescLbl.Location = new System.Drawing.Point(6, 16);
this.libationFilesDescLbl.Name = "libationFilesDescLbl";
this.libationFilesDescLbl.Size = new System.Drawing.Size(36, 13);
this.libationFilesDescLbl.TabIndex = 0;
this.libationFilesDescLbl.Text = "[desc]";
//
// libationFilesCustomBtn
//
this.libationFilesCustomBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.libationFilesCustomBtn.Location = new System.Drawing.Point(741, 102);
this.libationFilesCustomBtn.Name = "libationFilesCustomBtn";
this.libationFilesCustomBtn.Size = new System.Drawing.Size(35, 23);
this.libationFilesCustomBtn.TabIndex = 5;
this.libationFilesCustomBtn.Text = "...";
this.libationFilesCustomBtn.UseVisualStyleBackColor = true;
//
// libationFilesCustomTb
//
this.libationFilesCustomTb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.libationFilesCustomTb.Location = new System.Drawing.Point(29, 104);
this.libationFilesCustomTb.Name = "libationFilesCustomTb";
this.libationFilesCustomTb.Size = new System.Drawing.Size(706, 20);
this.libationFilesCustomTb.TabIndex = 4;
//
// libationFilesCustomRb
//
this.libationFilesCustomRb.AutoSize = true;
this.libationFilesCustomRb.Location = new System.Drawing.Point(9, 107);
this.libationFilesCustomRb.Name = "libationFilesCustomRb";
this.libationFilesCustomRb.Size = new System.Drawing.Size(14, 13);
this.libationFilesCustomRb.TabIndex = 3;
this.libationFilesCustomRb.TabStop = true;
this.libationFilesCustomRb.UseVisualStyleBackColor = true;
//
// libationFilesMyDocsRb
//
this.libationFilesMyDocsRb.AutoSize = true;
this.libationFilesMyDocsRb.CheckAlign = System.Drawing.ContentAlignment.TopLeft;
this.libationFilesMyDocsRb.Location = new System.Drawing.Point(9, 68);
this.libationFilesMyDocsRb.Name = "libationFilesMyDocsRb";
this.libationFilesMyDocsRb.Size = new System.Drawing.Size(111, 30);
this.libationFilesMyDocsRb.TabIndex = 2;
this.libationFilesMyDocsRb.TabStop = true;
this.libationFilesMyDocsRb.Text = "[desc]\r\n[myDocs\\Libation]";
this.libationFilesMyDocsRb.UseVisualStyleBackColor = true;
//
// libationFilesRootRb
//
this.libationFilesRootRb.AutoSize = true;
this.libationFilesRootRb.CheckAlign = System.Drawing.ContentAlignment.TopLeft;
this.libationFilesRootRb.Location = new System.Drawing.Point(9, 32);
this.libationFilesRootRb.Name = "libationFilesRootRb";
this.libationFilesRootRb.Size = new System.Drawing.Size(113, 30);
this.libationFilesRootRb.TabIndex = 1;
this.libationFilesRootRb.TabStop = true;
this.libationFilesRootRb.Text = "[desc]\r\n[exeRoot\\Libation]";
this.libationFilesRootRb.UseVisualStyleBackColor = true;
//
// downloadsInProgressGb
//
this.downloadsInProgressGb.Controls.Add(this.downloadsInProgressLibationFilesRb);
this.downloadsInProgressGb.Controls.Add(this.downloadsInProgressWinTempRb);
this.downloadsInProgressGb.Controls.Add(this.downloadsInProgressDescLbl);
this.downloadsInProgressGb.Location = new System.Drawing.Point(12, 298);
this.downloadsInProgressGb.Location = new System.Drawing.Point(15, 58);
this.downloadsInProgressGb.Name = "downloadsInProgressGb";
this.downloadsInProgressGb.Size = new System.Drawing.Size(776, 117);
this.downloadsInProgressGb.TabIndex = 13;
this.downloadsInProgressGb.Size = new System.Drawing.Size(758, 117);
this.downloadsInProgressGb.TabIndex = 4;
this.downloadsInProgressGb.TabStop = false;
this.downloadsInProgressGb.Text = "Downloads in progress";
//
@ -274,10 +162,10 @@
this.decryptInProgressGb.Controls.Add(this.decryptInProgressLibationFilesRb);
this.decryptInProgressGb.Controls.Add(this.decryptInProgressWinTempRb);
this.decryptInProgressGb.Controls.Add(this.decryptInProgressDescLbl);
this.decryptInProgressGb.Location = new System.Drawing.Point(12, 421);
this.decryptInProgressGb.Location = new System.Drawing.Point(9, 183);
this.decryptInProgressGb.Name = "decryptInProgressGb";
this.decryptInProgressGb.Size = new System.Drawing.Size(776, 117);
this.decryptInProgressGb.TabIndex = 14;
this.decryptInProgressGb.Size = new System.Drawing.Size(758, 117);
this.decryptInProgressGb.TabIndex = 5;
this.decryptInProgressGb.TabStop = false;
this.decryptInProgressGb.Text = "Decrypt in progress";
//
@ -317,10 +205,10 @@
// saveBtn
//
this.saveBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.saveBtn.Location = new System.Drawing.Point(612, 544);
this.saveBtn.Location = new System.Drawing.Point(612, 404);
this.saveBtn.Name = "saveBtn";
this.saveBtn.Size = new System.Drawing.Size(75, 23);
this.saveBtn.TabIndex = 15;
this.saveBtn.TabIndex = 7;
this.saveBtn.Text = "Save";
this.saveBtn.UseVisualStyleBackColor = true;
//
@ -328,20 +216,20 @@
//
this.cancelBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.cancelBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelBtn.Location = new System.Drawing.Point(713, 544);
this.cancelBtn.Location = new System.Drawing.Point(713, 404);
this.cancelBtn.Name = "cancelBtn";
this.cancelBtn.Size = new System.Drawing.Size(75, 23);
this.cancelBtn.TabIndex = 16;
this.cancelBtn.TabIndex = 8;
this.cancelBtn.Text = "Cancel";
this.cancelBtn.UseVisualStyleBackColor = true;
//
// audibleLocaleLbl
//
this.audibleLocaleLbl.AutoSize = true;
this.audibleLocaleLbl.Location = new System.Drawing.Point(7, 98);
this.audibleLocaleLbl.Location = new System.Drawing.Point(12, 56);
this.audibleLocaleLbl.Name = "audibleLocaleLbl";
this.audibleLocaleLbl.Size = new System.Drawing.Size(77, 13);
this.audibleLocaleLbl.TabIndex = 6;
this.audibleLocaleLbl.TabIndex = 4;
this.audibleLocaleLbl.Text = "Audible Locale";
//
// audibleLocaleCb
@ -354,10 +242,24 @@
"germany",
"france",
"canada"});
this.audibleLocaleCb.Location = new System.Drawing.Point(90, 95);
this.audibleLocaleCb.Location = new System.Drawing.Point(95, 53);
this.audibleLocaleCb.Name = "audibleLocaleCb";
this.audibleLocaleCb.Size = new System.Drawing.Size(121, 21);
this.audibleLocaleCb.TabIndex = 7;
this.audibleLocaleCb.Size = new System.Drawing.Size(53, 21);
this.audibleLocaleCb.TabIndex = 5;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.decryptKeyTb);
this.groupBox1.Controls.Add(this.decryptKeyLbl);
this.groupBox1.Controls.Add(this.decryptKeyDescLbl);
this.groupBox1.Controls.Add(this.downloadsInProgressGb);
this.groupBox1.Controls.Add(this.decryptInProgressGb);
this.groupBox1.Location = new System.Drawing.Point(15, 90);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(773, 308);
this.groupBox1.TabIndex = 6;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Advanced settings for control freaks";
//
// SettingsDialog
//
@ -365,58 +267,39 @@
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.cancelBtn;
this.ClientSize = new System.Drawing.Size(800, 579);
this.ClientSize = new System.Drawing.Size(800, 439);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.audibleLocaleCb);
this.Controls.Add(this.audibleLocaleLbl);
this.Controls.Add(this.cancelBtn);
this.Controls.Add(this.saveBtn);
this.Controls.Add(this.decryptInProgressGb);
this.Controls.Add(this.downloadsInProgressGb);
this.Controls.Add(this.libationFilesGb);
this.Controls.Add(this.booksLocationDescLbl);
this.Controls.Add(this.decryptKeyDescLbl);
this.Controls.Add(this.settingsFileDescLbl);
this.Controls.Add(this.booksLocationSearchBtn);
this.Controls.Add(this.booksLocationTb);
this.Controls.Add(this.booksLocationLbl);
this.Controls.Add(this.decryptKeyTb);
this.Controls.Add(this.decryptKeyLbl);
this.Controls.Add(this.settingsFileTb);
this.Controls.Add(this.settingsFileLbl);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Name = "SettingsDialog";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Edit Settings";
this.libationFilesGb.ResumeLayout(false);
this.libationFilesGb.PerformLayout();
this.downloadsInProgressGb.ResumeLayout(false);
this.downloadsInProgressGb.PerformLayout();
this.decryptInProgressGb.ResumeLayout(false);
this.decryptInProgressGb.PerformLayout();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label settingsFileLbl;
private System.Windows.Forms.TextBox settingsFileTb;
private System.Windows.Forms.Label decryptKeyLbl;
private System.Windows.Forms.TextBox decryptKeyTb;
private System.Windows.Forms.Label booksLocationLbl;
private System.Windows.Forms.TextBox booksLocationTb;
private System.Windows.Forms.Button booksLocationSearchBtn;
private System.Windows.Forms.Label settingsFileDescLbl;
private System.Windows.Forms.Label decryptKeyDescLbl;
private System.Windows.Forms.Label booksLocationDescLbl;
private System.Windows.Forms.GroupBox libationFilesGb;
private System.Windows.Forms.Button libationFilesCustomBtn;
private System.Windows.Forms.TextBox libationFilesCustomTb;
private System.Windows.Forms.RadioButton libationFilesCustomRb;
private System.Windows.Forms.RadioButton libationFilesMyDocsRb;
private System.Windows.Forms.RadioButton libationFilesRootRb;
private System.Windows.Forms.Label libationFilesDescLbl;
private System.Windows.Forms.GroupBox downloadsInProgressGb;
private System.Windows.Forms.Label downloadsInProgressDescLbl;
private System.Windows.Forms.RadioButton downloadsInProgressWinTempRb;
@ -429,5 +312,6 @@
private System.Windows.Forms.Button cancelBtn;
private System.Windows.Forms.Label audibleLocaleLbl;
private System.Windows.Forms.ComboBox audibleLocaleCb;
private System.Windows.Forms.GroupBox groupBox1;
}
}

View File

@ -1,14 +1,13 @@
using System;
using System.Windows.Forms;
namespace WinFormsDesigner
namespace WinFormsDesigner.Dialogs
{
public partial class SettingsDialog : Form
{
public SettingsDialog()
{
InitializeComponent();
audibleLocaleCb.SelectedIndex = 0;
}
}
}

View File

@ -0,0 +1,99 @@
namespace WinFormsDesigner.Dialogs
{
partial class SetupDialog
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SetupDialog));
this.welcomeLbl = new System.Windows.Forms.Label();
this.noQuestionsBtn = new System.Windows.Forms.Button();
this.basicBtn = new System.Windows.Forms.Button();
this.advancedBtn = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// welcomeLbl
//
this.welcomeLbl.AutoSize = true;
this.welcomeLbl.Location = new System.Drawing.Point(12, 9);
this.welcomeLbl.Name = "welcomeLbl";
this.welcomeLbl.Size = new System.Drawing.Size(399, 78);
this.welcomeLbl.TabIndex = 0;
this.welcomeLbl.Text = resources.GetString("welcomeLbl.Text");
//
// noQuestionsBtn
//
this.noQuestionsBtn.Location = new System.Drawing.Point(15, 90);
this.noQuestionsBtn.Name = "noQuestionsBtn";
this.noQuestionsBtn.Size = new System.Drawing.Size(396, 57);
this.noQuestionsBtn.TabIndex = 1;
this.noQuestionsBtn.Text = "NO-QUESTIONS SETUP\r\n\r\nAccept all defaults";
this.noQuestionsBtn.UseVisualStyleBackColor = true;
//
// basicBtn
//
this.basicBtn.Location = new System.Drawing.Point(15, 153);
this.basicBtn.Name = "basicBtn";
this.basicBtn.Size = new System.Drawing.Size(396, 57);
this.basicBtn.TabIndex = 2;
this.basicBtn.Text = "BASIC SETUP\r\n\r\nChoose settings";
this.basicBtn.UseVisualStyleBackColor = true;
//
// advancedBtn
//
this.advancedBtn.Location = new System.Drawing.Point(15, 216);
this.advancedBtn.Name = "advancedBtn";
this.advancedBtn.Size = new System.Drawing.Size(396, 57);
this.advancedBtn.TabIndex = 3;
this.advancedBtn.Text = "ADVANCED SETUP\r\n\r\nChoose settings and where to store them";
this.advancedBtn.UseVisualStyleBackColor = true;
//
// SetupDialog
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(423, 285);
this.Controls.Add(this.advancedBtn);
this.Controls.Add(this.basicBtn);
this.Controls.Add(this.noQuestionsBtn);
this.Controls.Add(this.welcomeLbl);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Name = "SetupDialog";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Welcome to Libation";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label welcomeLbl;
private System.Windows.Forms.Button noQuestionsBtn;
private System.Windows.Forms.Button basicBtn;
private System.Windows.Forms.Button advancedBtn;
}
}

View File

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WinFormsDesigner.Dialogs
{
public partial class SetupDialog : Form
{
public SetupDialog()
{
InitializeComponent();
}
}
}

View File

@ -0,0 +1,128 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="welcomeLbl.Text" xml:space="preserve">
<value>This appears to be your first time using Libation or a previous setup was incomplete.
Please fill in a few settings. You can also change these settings later.
After you make your selections, get started by importing your library.
Go to Import &gt; Scan Library</value>
</data>
</root>

View File

@ -6,8 +6,8 @@
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{0807616A-A77A-4B08-A65A-1582B09E114B}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>LibationWinForm_Framework</RootNamespace>
<AssemblyName>LibationWinForm_Framework</AssemblyName>
<RootNamespace>WinFormsDesigner</RootNamespace>
<AssemblyName>WinFormsDesigner</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
@ -77,6 +77,12 @@
<Compile Include="Dialogs\IndexLibraryDialog.Designer.cs">
<DependentUpon>IndexLibraryDialog.cs</DependentUpon>
</Compile>
<Compile Include="Dialogs\LibationFilesDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Dialogs\LibationFilesDialog.Designer.cs">
<DependentUpon>LibationFilesDialog.cs</DependentUpon>
</Compile>
<Compile Include="Dialogs\Login\AudibleLoginDialog.cs">
<SubType>Form</SubType>
</Compile>
@ -101,17 +107,23 @@
<Compile Include="Dialogs\EditTagsDialog.Designer.cs">
<DependentUpon>EditTagsDialog.cs</DependentUpon>
</Compile>
<Compile Include="Dialogs\SettingsDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Dialogs\SettingsDialog.Designer.cs">
<DependentUpon>SettingsDialog.cs</DependentUpon>
</Compile>
<Compile Include="Dialogs\SearchSyntaxDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Dialogs\SearchSyntaxDialog.Designer.cs">
<DependentUpon>SearchSyntaxDialog.cs</DependentUpon>
</Compile>
<Compile Include="Dialogs\SettingsDialog.cs">
<Compile Include="Dialogs\SetupDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Dialogs\SettingsDialog.Designer.cs">
<DependentUpon>SettingsDialog.cs</DependentUpon>
<Compile Include="Dialogs\SetupDialog.Designer.cs">
<DependentUpon>SetupDialog.cs</DependentUpon>
</Compile>
<Compile Include="Form1.cs">
<SubType>Form</SubType>
@ -145,6 +157,9 @@
<EmbeddedResource Include="Dialogs\IndexLibraryDialog.resx">
<DependentUpon>IndexLibraryDialog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Dialogs\LibationFilesDialog.resx">
<DependentUpon>LibationFilesDialog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Dialogs\Login\AudibleLoginDialog.resx">
<DependentUpon>AudibleLoginDialog.cs</DependentUpon>
</EmbeddedResource>
@ -154,11 +169,14 @@
<EmbeddedResource Include="Dialogs\Login\_2faCodeDialog.resx">
<DependentUpon>_2faCodeDialog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Dialogs\SettingsDialog.resx">
<DependentUpon>SettingsDialog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Dialogs\SearchSyntaxDialog.resx">
<DependentUpon>SearchSyntaxDialog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Dialogs\SettingsDialog.resx">
<DependentUpon>SettingsDialog.cs</DependentUpon>
<EmbeddedResource Include="Dialogs\SetupDialog.resx">
<DependentUpon>SetupDialog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>