mirror of
https://github.com/SabreTools/MPF.git
synced 2026-07-02 17:24:48 +00:00
Settings and more (fixes #141)
This commit is contained in:
@@ -67,6 +67,11 @@ namespace DICUI.Utilities
|
||||
/// </summary>
|
||||
public Parameters DICParameters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Determines if placeholder values should be set for fields
|
||||
/// </summary>
|
||||
public bool AddPlaceholders { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Extra DIC arguments
|
||||
@@ -528,18 +533,18 @@ namespace DICUI.Utilities
|
||||
{
|
||||
System = this.System,
|
||||
Media = this.Type,
|
||||
Title = Template.RequiredValue,
|
||||
ForeignTitleNonLatin = Template.OptionalValue,
|
||||
DiscNumberLetter = Template.OptionalValue,
|
||||
DiscTitle = Template.OptionalValue,
|
||||
Title = (this.AddPlaceholders ? Template.RequiredValue : ""),
|
||||
ForeignTitleNonLatin = (AddPlaceholders ? Template.OptionalValue : ""),
|
||||
DiscNumberLetter = (AddPlaceholders ? Template.OptionalValue : ""),
|
||||
DiscTitle = (AddPlaceholders ? Template.OptionalValue : ""),
|
||||
Category = Category.Games,
|
||||
Region = null,
|
||||
Languages = null,
|
||||
Serial = Template.RequiredIfExistsValue,
|
||||
Barcode = Template.OptionalValue,
|
||||
Contents = Template.OptionalValue,
|
||||
Version = Template.RequiredIfExistsValue,
|
||||
OtherEditions = "Original (VERIFY THIS)",
|
||||
Serial = (AddPlaceholders ? Template.RequiredIfExistsValue : ""),
|
||||
Barcode = (AddPlaceholders ? Template.OptionalValue : ""),
|
||||
Contents = (AddPlaceholders ? Template.OptionalValue : ""),
|
||||
Version = (AddPlaceholders ? Template.RequiredIfExistsValue : ""),
|
||||
OtherEditions = (AddPlaceholders ? "Original (VERIFY THIS)" : ""),
|
||||
ClrMameProData = GetDatfile(combinedBase + ".dat"),
|
||||
};
|
||||
|
||||
@@ -590,12 +595,12 @@ namespace DICUI.Utilities
|
||||
{
|
||||
case MediaType.CDROM:
|
||||
case MediaType.GDROM: // TODO: Verify GD-ROM outputs this
|
||||
info.MasteringRingFirstLayerDataSide = Template.RequiredIfExistsValue;
|
||||
info.MasteringSIDCodeFirstLayerDataSide = Template.RequiredIfExistsValue;
|
||||
info.ToolstampMasteringCodeFirstLayerDataSide = Template.RequiredIfExistsValue;
|
||||
info.MouldSIDCodeFirstLayerDataSide = Template.RequiredIfExistsValue;
|
||||
info.MouldSIDCodeSecondLayerLabelSide = Template.RequiredIfExistsValue;
|
||||
info.AdditionalMouldFirstLayerDataSide = Template.RequiredIfExistsValue;
|
||||
info.MasteringRingFirstLayerDataSide = (AddPlaceholders ? Template.RequiredIfExistsValue : "");
|
||||
info.MasteringSIDCodeFirstLayerDataSide = (AddPlaceholders ? Template.RequiredIfExistsValue : "");
|
||||
info.ToolstampMasteringCodeFirstLayerDataSide = (AddPlaceholders ? Template.RequiredIfExistsValue : "");
|
||||
info.MouldSIDCodeFirstLayerDataSide = (AddPlaceholders ? Template.RequiredIfExistsValue : "");
|
||||
info.MouldSIDCodeSecondLayerLabelSide = (AddPlaceholders ? Template.RequiredIfExistsValue : "");
|
||||
info.AdditionalMouldFirstLayerDataSide = (AddPlaceholders ? Template.RequiredIfExistsValue : "");
|
||||
info.PVD = GetPVD(combinedBase + "_mainInfo.txt") ?? "Disc has no PVD"; ;
|
||||
|
||||
long errorCount = -1;
|
||||
@@ -642,27 +647,27 @@ namespace DICUI.Utilities
|
||||
// If we have a single-layer disc
|
||||
if (String.IsNullOrWhiteSpace(layerbreak))
|
||||
{
|
||||
info.MasteringRingFirstLayerDataSide = Template.RequiredIfExistsValue;
|
||||
info.MasteringSIDCodeFirstLayerDataSide = Template.RequiredIfExistsValue;
|
||||
info.ToolstampMasteringCodeFirstLayerDataSide = Template.RequiredIfExistsValue;
|
||||
info.MouldSIDCodeFirstLayerDataSide = Template.RequiredIfExistsValue;
|
||||
info.MouldSIDCodeSecondLayerLabelSide = Template.RequiredIfExistsValue;
|
||||
info.AdditionalMouldFirstLayerDataSide = Template.RequiredIfExistsValue;
|
||||
info.MasteringRingFirstLayerDataSide = (AddPlaceholders ? Template.RequiredIfExistsValue : "");
|
||||
info.MasteringSIDCodeFirstLayerDataSide = (AddPlaceholders ? Template.RequiredIfExistsValue : "");
|
||||
info.ToolstampMasteringCodeFirstLayerDataSide = (AddPlaceholders ? Template.RequiredIfExistsValue : "");
|
||||
info.MouldSIDCodeFirstLayerDataSide = (AddPlaceholders ? Template.RequiredIfExistsValue : "");
|
||||
info.MouldSIDCodeSecondLayerLabelSide = (AddPlaceholders ? Template.RequiredIfExistsValue : "");
|
||||
info.AdditionalMouldFirstLayerDataSide = (AddPlaceholders ? Template.RequiredIfExistsValue : "");
|
||||
info.PVD = GetPVD(combinedBase + "_mainInfo.txt") ?? "";
|
||||
}
|
||||
// If we have a dual-layer disc
|
||||
else
|
||||
{
|
||||
info.MasteringRingFirstLayerDataSide = Template.RequiredIfExistsValue;
|
||||
info.MasteringSIDCodeFirstLayerDataSide = Template.RequiredIfExistsValue;
|
||||
info.ToolstampMasteringCodeFirstLayerDataSide = Template.RequiredIfExistsValue;
|
||||
info.MouldSIDCodeFirstLayerDataSide = Template.RequiredIfExistsValue;
|
||||
info.AdditionalMouldFirstLayerDataSide = Template.RequiredIfExistsValue;
|
||||
info.MasteringRingFirstLayerDataSide = (AddPlaceholders ? Template.RequiredIfExistsValue : "");
|
||||
info.MasteringSIDCodeFirstLayerDataSide = (AddPlaceholders ? Template.RequiredIfExistsValue : "");
|
||||
info.ToolstampMasteringCodeFirstLayerDataSide = (AddPlaceholders ? Template.RequiredIfExistsValue : "");
|
||||
info.MouldSIDCodeFirstLayerDataSide = (AddPlaceholders ? Template.RequiredIfExistsValue : "");
|
||||
info.AdditionalMouldFirstLayerDataSide = (AddPlaceholders ? Template.RequiredIfExistsValue : "");
|
||||
|
||||
info.MasteringRingSecondLayerLabelSide = Template.RequiredIfExistsValue;
|
||||
info.MasteringSIDCodeSecondLayerLabelSide = Template.RequiredIfExistsValue;
|
||||
info.ToolstampMasteringCodeSecondLayerLabelSide = Template.RequiredIfExistsValue;
|
||||
info.MouldSIDCodeSecondLayerLabelSide = Template.RequiredIfExistsValue;
|
||||
info.MasteringRingSecondLayerLabelSide = (AddPlaceholders ? Template.RequiredIfExistsValue : "");
|
||||
info.MasteringSIDCodeSecondLayerLabelSide = (AddPlaceholders ? Template.RequiredIfExistsValue : "");
|
||||
info.ToolstampMasteringCodeSecondLayerLabelSide = (AddPlaceholders ? Template.RequiredIfExistsValue : "");
|
||||
info.MouldSIDCodeSecondLayerLabelSide = (AddPlaceholders ? Template.RequiredIfExistsValue : "");
|
||||
|
||||
info.PVD = GetPVD(combinedBase + "_mainInfo.txt") ?? "";
|
||||
info.Layerbreak = Int64.Parse(layerbreak);
|
||||
@@ -675,19 +680,19 @@ namespace DICUI.Utilities
|
||||
break;
|
||||
|
||||
case MediaType.NintendoGameCubeGameDisc:
|
||||
info.BCA = Template.RequiredValue;
|
||||
info.BCA = (this.AddPlaceholders ? Template.RequiredValue : "");
|
||||
break;
|
||||
|
||||
case MediaType.NintendoWiiOpticalDisc:
|
||||
info.DiscKey = Template.RequiredValue;
|
||||
info.BCA = Template.RequiredValue;
|
||||
info.DiscKey = (this.AddPlaceholders ? Template.RequiredValue : "");
|
||||
info.BCA = (this.AddPlaceholders ? Template.RequiredValue : "");
|
||||
break;
|
||||
|
||||
case MediaType.UMD:
|
||||
info.PVD = GetPVD(combinedBase + "_mainInfo.txt") ?? "";
|
||||
info.CRC32 = Template.RequiredValue + " [Not automatically generated for UMD]";
|
||||
info.MD5 = Template.RequiredValue + " [Not automatically generated for UMD]";
|
||||
info.SHA1 = Template.RequiredValue + " [Not automatically generated for UMD]";
|
||||
info.CRC32 = (this.AddPlaceholders ? Template.RequiredValue + " [Not automatically generated for UMD]" : "");
|
||||
info.MD5 = (this.AddPlaceholders ? Template.RequiredValue + " [Not automatically generated for UMD]" : "");
|
||||
info.SHA1 = (this.AddPlaceholders ? Template.RequiredValue + " [Not automatically generated for UMD]" : "");
|
||||
info.ClrMameProData = null;
|
||||
|
||||
if (GetUMDAuxInfo(combinedBase + "_disc.txt", out string title, out Category? umdcat, out string umdversion, out string umdlayer, out long umdsize))
|
||||
@@ -712,7 +717,7 @@ namespace DICUI.Utilities
|
||||
case KnownSystem.IBMPCCompatible:
|
||||
case KnownSystem.RainbowDisc:
|
||||
if (string.IsNullOrWhiteSpace(info.Comments))
|
||||
info.Comments += $"[T:ISBN] {Template.OptionalValue}";
|
||||
info.Comments += $"[T:ISBN] {(AddPlaceholders ? Template.OptionalValue : "")}";
|
||||
|
||||
progress?.Report(Result.Success("Running copy protection scan... this might take a while!"));
|
||||
info.Protection = GetCopyProtection();
|
||||
@@ -728,23 +733,23 @@ namespace DICUI.Utilities
|
||||
break;
|
||||
|
||||
case KnownSystem.BandaiPlaydiaQuickInteractiveSystem:
|
||||
info.EXEDateBuildDate = Template.RequiredValue;
|
||||
info.EXEDateBuildDate = (this.AddPlaceholders ? Template.RequiredValue : "");
|
||||
break;
|
||||
|
||||
case KnownSystem.BDVideo:
|
||||
info.Protection = Template.RequiredIfExistsValue;
|
||||
info.Protection = (AddPlaceholders ? Template.RequiredIfExistsValue : "");
|
||||
break;
|
||||
|
||||
case KnownSystem.CommodoreAmiga:
|
||||
info.EXEDateBuildDate = Template.RequiredValue;
|
||||
info.EXEDateBuildDate = (this.AddPlaceholders ? Template.RequiredValue : "");
|
||||
break;
|
||||
|
||||
case KnownSystem.CommodoreAmigaCD32:
|
||||
info.EXEDateBuildDate = Template.RequiredValue;
|
||||
info.EXEDateBuildDate = (this.AddPlaceholders ? Template.RequiredValue : "");
|
||||
break;
|
||||
|
||||
case KnownSystem.CommodoreAmigaCDTV:
|
||||
info.EXEDateBuildDate = Template.RequiredValue;
|
||||
info.EXEDateBuildDate = (this.AddPlaceholders ? Template.RequiredValue : "");
|
||||
break;
|
||||
|
||||
case KnownSystem.DVDVideo:
|
||||
@@ -752,35 +757,35 @@ namespace DICUI.Utilities
|
||||
break;
|
||||
|
||||
case KnownSystem.FujitsuFMTowns:
|
||||
info.EXEDateBuildDate = Template.RequiredValue;
|
||||
info.EXEDateBuildDate = (this.AddPlaceholders ? Template.RequiredValue : "");
|
||||
break;
|
||||
|
||||
case KnownSystem.IncredibleTechnologiesEagle:
|
||||
info.EXEDateBuildDate = Template.RequiredValue;
|
||||
info.EXEDateBuildDate = (this.AddPlaceholders ? Template.RequiredValue : "");
|
||||
break;
|
||||
|
||||
case KnownSystem.KonamieAmusement:
|
||||
info.EXEDateBuildDate = Template.RequiredValue;
|
||||
info.EXEDateBuildDate = (this.AddPlaceholders ? Template.RequiredValue : "");
|
||||
break;
|
||||
|
||||
case KnownSystem.KonamiFirebeat:
|
||||
info.EXEDateBuildDate = Template.RequiredValue;
|
||||
info.EXEDateBuildDate = (this.AddPlaceholders ? Template.RequiredValue : "");
|
||||
break;
|
||||
|
||||
case KnownSystem.KonamiGVSystem:
|
||||
info.EXEDateBuildDate = Template.RequiredValue;
|
||||
info.EXEDateBuildDate = (this.AddPlaceholders ? Template.RequiredValue : "");
|
||||
break;
|
||||
|
||||
case KnownSystem.KonamiSystem573:
|
||||
info.EXEDateBuildDate = Template.RequiredValue;
|
||||
info.EXEDateBuildDate = (this.AddPlaceholders ? Template.RequiredValue : "");
|
||||
break;
|
||||
|
||||
case KnownSystem.KonamiTwinkle:
|
||||
info.EXEDateBuildDate = Template.RequiredValue;
|
||||
info.EXEDateBuildDate = (this.AddPlaceholders ? Template.RequiredValue : "");
|
||||
break;
|
||||
|
||||
case KnownSystem.MattelHyperscan:
|
||||
info.EXEDateBuildDate = Template.RequiredValue;
|
||||
info.EXEDateBuildDate = (this.AddPlaceholders ? Template.RequiredValue : "");
|
||||
break;
|
||||
|
||||
case KnownSystem.MicrosoftXBOX:
|
||||
@@ -795,8 +800,8 @@ namespace DICUI.Utilities
|
||||
|
||||
if (GetXBOXDMIInfo(Path.Combine(OutputDirectory, "DMI.bin"), out string serial, out string version, out Region? region))
|
||||
{
|
||||
info.Serial = serial ?? Template.RequiredValue;
|
||||
info.Version = version ?? Template.RequiredValue;
|
||||
info.Serial = serial ?? (this.AddPlaceholders ? Template.RequiredValue : "");
|
||||
info.Version = version ?? (this.AddPlaceholders ? Template.RequiredValue : "");
|
||||
info.Region = region;
|
||||
}
|
||||
|
||||
@@ -814,22 +819,22 @@ namespace DICUI.Utilities
|
||||
|
||||
if (GetXBOX360DMIInfo(Path.Combine(OutputDirectory, "DMI.bin"), out string serial360, out string version360, out Region? region360))
|
||||
{
|
||||
info.Serial = serial360 ?? Template.RequiredValue;
|
||||
info.Version = version360 ?? Template.RequiredValue;
|
||||
info.Serial = serial360 ?? (this.AddPlaceholders ? Template.RequiredValue : "");
|
||||
info.Version = version360 ?? (this.AddPlaceholders ? Template.RequiredValue : "");
|
||||
info.Region = region360;
|
||||
}
|
||||
break;
|
||||
|
||||
case KnownSystem.NamcoSegaNintendoTriforce:
|
||||
info.EXEDateBuildDate = Template.RequiredValue;
|
||||
info.EXEDateBuildDate = (this.AddPlaceholders ? Template.RequiredValue : "");
|
||||
break;
|
||||
|
||||
case KnownSystem.NavisoftNaviken21:
|
||||
info.EXEDateBuildDate = Template.RequiredValue;
|
||||
info.EXEDateBuildDate = (this.AddPlaceholders ? Template.RequiredValue : "");
|
||||
break;
|
||||
|
||||
case KnownSystem.NECPC98:
|
||||
info.EXEDateBuildDate = Template.RequiredValue;
|
||||
info.EXEDateBuildDate = (this.AddPlaceholders ? Template.RequiredValue : "");
|
||||
break;
|
||||
|
||||
case KnownSystem.SegaCDMegaCD:
|
||||
@@ -848,19 +853,19 @@ namespace DICUI.Utilities
|
||||
break;
|
||||
|
||||
case KnownSystem.SegaChihiro:
|
||||
info.EXEDateBuildDate = Template.RequiredValue;
|
||||
info.EXEDateBuildDate = (this.AddPlaceholders ? Template.RequiredValue : "");
|
||||
break;
|
||||
|
||||
case KnownSystem.SegaDreamcast:
|
||||
info.EXEDateBuildDate = Template.RequiredValue;
|
||||
info.EXEDateBuildDate = (this.AddPlaceholders ? Template.RequiredValue : "");
|
||||
break;
|
||||
|
||||
case KnownSystem.SegaNaomi:
|
||||
info.EXEDateBuildDate = Template.RequiredValue;
|
||||
info.EXEDateBuildDate = (this.AddPlaceholders ? Template.RequiredValue : "");
|
||||
break;
|
||||
|
||||
case KnownSystem.SegaNaomi2:
|
||||
info.EXEDateBuildDate = Template.RequiredValue;
|
||||
info.EXEDateBuildDate = (this.AddPlaceholders ? Template.RequiredValue : "");
|
||||
break;
|
||||
|
||||
case KnownSystem.SegaSaturn:
|
||||
@@ -880,11 +885,11 @@ namespace DICUI.Utilities
|
||||
break;
|
||||
|
||||
case KnownSystem.SegaTitanVideo:
|
||||
info.EXEDateBuildDate = Template.RequiredValue;
|
||||
info.EXEDateBuildDate = (this.AddPlaceholders ? Template.RequiredValue : "");
|
||||
break;
|
||||
|
||||
case KnownSystem.SNKNeoGeoCD:
|
||||
info.EXEDateBuildDate = Template.RequiredValue;
|
||||
info.EXEDateBuildDate = (this.AddPlaceholders ? Template.RequiredValue : "");
|
||||
break;
|
||||
|
||||
case KnownSystem.SonyPlayStation:
|
||||
@@ -911,8 +916,8 @@ namespace DICUI.Utilities
|
||||
break;
|
||||
|
||||
case KnownSystem.SonyPlayStation3:
|
||||
info.DiscKey = Template.RequiredValue;
|
||||
info.DiscID = Template.RequiredValue;
|
||||
info.DiscKey = (this.AddPlaceholders ? Template.RequiredValue : "");
|
||||
info.DiscID = (this.AddPlaceholders ? Template.RequiredValue : "");
|
||||
break;
|
||||
|
||||
case KnownSystem.SonyPlayStation4:
|
||||
@@ -920,13 +925,13 @@ namespace DICUI.Utilities
|
||||
break;
|
||||
|
||||
case KnownSystem.ZAPiTGamesGameWaveFamilyEntertainmentSystem:
|
||||
info.Protection = Template.RequiredIfExistsValue;
|
||||
info.Protection = (AddPlaceholders ? Template.RequiredIfExistsValue : "");
|
||||
break;
|
||||
}
|
||||
|
||||
// Comments is one of the few fields with odd handling
|
||||
if (string.IsNullOrEmpty(info.Comments))
|
||||
info.Comments = Template.OptionalValue;
|
||||
info.Comments = (AddPlaceholders ? Template.OptionalValue : "");
|
||||
|
||||
return info;
|
||||
}
|
||||
@@ -1976,8 +1981,8 @@ namespace DICUI.Utilities
|
||||
|
||||
if (line.StartsWith("TITLE") && title == null)
|
||||
title = line.Substring("TITLE: ".Length);
|
||||
else if (line.StartsWith("version") && umdversion == null)
|
||||
umdversion = line.Substring("version: ".Length);
|
||||
else if (line.StartsWith("DISC_VERSION") && umdversion == null)
|
||||
umdversion = line.Split(' ')[1];
|
||||
else if (line.StartsWith("pspUmdTypes"))
|
||||
umdcat = GetUMDCategory(line.Split(' ')[1]);
|
||||
else if (line.StartsWith("L0 length"))
|
||||
|
||||
@@ -4,13 +4,18 @@
|
||||
<add key="DICPath" value="Programs\DiscImageCreator.exe"/>
|
||||
<add key="SubDumpPath" value="subdump.exe"/>
|
||||
<add key="DefaultOutputPath" value="ISO"/>
|
||||
<add key="preferredDumpSpeedCD" value="72"/>
|
||||
<add key="preferredDumpSpeedDVD" value="24"/>
|
||||
<add key="PreferredDumpSpeedCD" value="72"/>
|
||||
<add key="PreferredDumpSpeedDVD" value="24"/>
|
||||
<add key="PreferredDumpSpeedBD" value="16"/>
|
||||
<add key="QuietMode" value="false"/>
|
||||
<add key="ParanoidMode" value="false"/>
|
||||
<add key="ScanForProtection" value="true"/>
|
||||
<add key="SkipMediaTypeDetection" value="false"/>
|
||||
<add key="RereadAmountForC2" value="20"/>
|
||||
<add key="VerboseLogging" value="true"/>
|
||||
<add key="OpenLogWindowAtStartup" value="true"/>
|
||||
<add key="username" value=""/>
|
||||
<add key="password" value=""/>
|
||||
<add key="AddPlaceholders" value="true"/>
|
||||
<add key="Username" value=""/>
|
||||
<add key="Password" value=""/>
|
||||
</appSettings>
|
||||
</configuration>
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace DICUI
|
||||
public bool ParanoidMode { get; set; }
|
||||
public bool ScanForProtection { get; set; }
|
||||
public int RereadAmountForC2 { get; set; }
|
||||
public bool AddPlaceholders { get; set; }
|
||||
|
||||
public bool SkipMediaTypeDetection { get; set; }
|
||||
|
||||
@@ -47,25 +48,28 @@ namespace DICUI
|
||||
|
||||
public void Load()
|
||||
{
|
||||
Configuration configFile = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
|
||||
|
||||
//TODO: hardcoded, we should find a better way
|
||||
DICPath = ConfigurationManager.AppSettings["DICPath"] ?? @"Programs\DiscImageCreator.exe";
|
||||
SubDumpPath = ConfigurationManager.AppSettings["SubDumpPath"] ?? "subdump.exe";
|
||||
DefaultOutputPath = ConfigurationManager.AppSettings["DefaultOutputPath"] ?? "ISO";
|
||||
DICPath = configFile.AppSettings.Settings["DICPath"].Value ?? @"Programs\DiscImageCreator.exe";
|
||||
SubDumpPath = configFile.AppSettings.Settings["SubDumpPath"].Value ?? "subdump.exe";
|
||||
DefaultOutputPath = configFile.AppSettings.Settings["DefaultOutputPath"].Value ?? "ISO";
|
||||
|
||||
this.PreferredDumpSpeedCD = Int32.TryParse(ConfigurationManager.AppSettings["preferredDumpSpeedCD"], out int maxDumpSpeedCD) ? maxDumpSpeedCD : 72;
|
||||
this.PreferredDumpSpeedDVD = Int32.TryParse(ConfigurationManager.AppSettings["preferredDumpSpeedDVD"], out int maxDumpSpeedDVD) ? maxDumpSpeedDVD : 24;
|
||||
this.PreferredDumpSpeedBD = Int32.TryParse(ConfigurationManager.AppSettings["preferredDumpSpeedBD"], out int maxDumpSpeedBD) ? maxDumpSpeedBD : 16;
|
||||
this.PreferredDumpSpeedCD = Int32.TryParse(configFile.AppSettings.Settings["PreferredDumpSpeedCD"].Value, out int maxDumpSpeedCD) ? maxDumpSpeedCD : 72;
|
||||
this.PreferredDumpSpeedDVD = Int32.TryParse(configFile.AppSettings.Settings["PreferredDumpSpeedDVD"].Value, out int maxDumpSpeedDVD) ? maxDumpSpeedDVD : 24;
|
||||
this.PreferredDumpSpeedBD = Int32.TryParse(configFile.AppSettings.Settings["PreferredDumpSpeedBD"].Value, out int maxDumpSpeedBD) ? maxDumpSpeedBD : 16;
|
||||
|
||||
this.QuietMode = Boolean.TryParse(ConfigurationManager.AppSettings["QuietMode"], out bool quietMode) ? quietMode : false;
|
||||
this.ParanoidMode = Boolean.TryParse(ConfigurationManager.AppSettings["ParanoidMode"], out bool paranoidMode) ? paranoidMode : false;
|
||||
this.ScanForProtection = Boolean.TryParse(ConfigurationManager.AppSettings["ScanForProtection"], out bool scanForProtection) ? scanForProtection : true;
|
||||
this.SkipMediaTypeDetection = Boolean.TryParse(ConfigurationManager.AppSettings["SkipMediaTypeDetection"], out bool skipMediaTypeDetection) ? skipMediaTypeDetection : false;
|
||||
this.RereadAmountForC2 = Int32.TryParse(ConfigurationManager.AppSettings["RereadAmountForC2"], out int rereadAmountForC2) ? rereadAmountForC2 : 20;
|
||||
this.VerboseLogging = Boolean.TryParse(ConfigurationManager.AppSettings["VerboseLogging"], out bool verboseLogging) ? verboseLogging : true;
|
||||
this.OpenLogWindowAtStartup = Boolean.TryParse(ConfigurationManager.AppSettings["OpenLogWindowAtStartup"], out bool openLogWindowAtStartup) ? openLogWindowAtStartup : true;
|
||||
this.QuietMode = Boolean.TryParse(configFile.AppSettings.Settings["QuietMode"].Value, out bool quietMode) ? quietMode : false;
|
||||
this.ParanoidMode = Boolean.TryParse(configFile.AppSettings.Settings["ParanoidMode"].Value, out bool paranoidMode) ? paranoidMode : false;
|
||||
this.ScanForProtection = Boolean.TryParse(configFile.AppSettings.Settings["ScanForProtection"].Value, out bool scanForProtection) ? scanForProtection : true;
|
||||
this.SkipMediaTypeDetection = Boolean.TryParse(configFile.AppSettings.Settings["SkipMediaTypeDetection"].Value, out bool skipMediaTypeDetection) ? skipMediaTypeDetection : false;
|
||||
this.RereadAmountForC2 = Int32.TryParse(configFile.AppSettings.Settings["RereadAmountForC2"].Value, out int rereadAmountForC2) ? rereadAmountForC2 : 20;
|
||||
this.VerboseLogging = Boolean.TryParse(configFile.AppSettings.Settings["VerboseLogging"].Value, out bool verboseLogging) ? verboseLogging : true;
|
||||
this.OpenLogWindowAtStartup = Boolean.TryParse(configFile.AppSettings.Settings["OpenLogWindowAtStartup"].Value, out bool openLogWindowAtStartup) ? openLogWindowAtStartup : true;
|
||||
this.AddPlaceholders = Boolean.TryParse(configFile.AppSettings.Settings["AddPlaceholders"].Value, out bool addPlaceholders) ? addPlaceholders : true;
|
||||
|
||||
this.Username = ConfigurationManager.AppSettings["username"] ?? "";
|
||||
this.Password = ConfigurationManager.AppSettings["password"] ?? "";
|
||||
this.Username = configFile.AppSettings.Settings["Username"].Value ?? "";
|
||||
this.Password = configFile.AppSettings.Settings["Password"].Value ?? "";
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -386,6 +386,7 @@ namespace DICUI.Windows
|
||||
ParanoidMode = _options.ParanoidMode,
|
||||
ScanForProtection = _options.ScanForProtection,
|
||||
RereadAmountC2 = _options.RereadAmountForC2,
|
||||
AddPlaceholders = _options.AddPlaceholders,
|
||||
|
||||
Username = _options.Username,
|
||||
Password = _options.Password,
|
||||
|
||||
@@ -5,13 +5,14 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:DICUI"
|
||||
mc:Ignorable="d"
|
||||
Title="Options" Height="480" Width="515.132">
|
||||
Title="Options" Height="580" Width="515.132">
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="150"/>
|
||||
<RowDefinition Height="100"/>
|
||||
<RowDefinition Height="80"/>
|
||||
<RowDefinition Height="40"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
@@ -30,7 +31,7 @@
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Label Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Right" Content="DicImageCreator Path" />
|
||||
<Label Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Right" Content="DiscImageCreator Path" />
|
||||
<TextBox x:Name="DICPathTextBox" Grid.Row="0" Grid.Column="1" Height="22" HorizontalAlignment="Stretch" />
|
||||
<Button x:Name="DICPathButton" Grid.Row="0" Grid.Column="2" Height="22" Width="22" Content="..." Click="BrowseForPathClick" />
|
||||
|
||||
@@ -112,22 +113,49 @@
|
||||
/>
|
||||
</Grid>
|
||||
|
||||
<CheckBox Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2" VerticalAlignment="Top" Content="Automatically Scan for Protection"
|
||||
<CheckBox Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2" VerticalAlignment="Top" Content="Protection Scan"
|
||||
DataContext="{Binding Source={x:Static local:ViewModels.OptionsViewModel}}"
|
||||
IsChecked="{Binding Path=ScanForProtection}"
|
||||
ToolTip="Enable automatic checking for copy protection on dumped media" Margin="0,4,0,0"
|
||||
/>
|
||||
|
||||
<CheckBox Grid.Column="2" Grid.Row="1" Grid.ColumnSpan="2" VerticalAlignment="Center" Content="Skip Media Type Detection"
|
||||
<CheckBox Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="2" VerticalAlignment="Center" Content="Skip Media Type Detection"
|
||||
DataContext="{Binding Source={x:Static local:ViewModels.OptionsViewModel}}"
|
||||
IsChecked="{Binding Path=SkipMediaTypeDetection}"
|
||||
ToolTip="Disable trying to guess media type inserted (may improve performance at startup)"
|
||||
/>
|
||||
|
||||
<CheckBox Grid.Column="3" Grid.Row="1" VerticalAlignment="Center" Content="Add Placeholders"
|
||||
DataContext="{Binding Source={x:Static local:ViewModels.OptionsViewModel}}"
|
||||
IsChecked="{Binding Path=AddPlaceholders}"
|
||||
ToolTip="Enable adding placeholder text in the submissioninfo output for required and optional fields"
|
||||
/>
|
||||
</Grid>
|
||||
|
||||
</GroupBox>
|
||||
|
||||
<Grid Height="22" Grid.Row="3" Grid.Column="0">
|
||||
<GroupBox Grid.Row="3" Margin="5,5,5,5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Header="Redump Login" Padding="10">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Label Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Right" Content="Username" />
|
||||
<TextBox x:Name="RedumpUsernameTextBox" Grid.Row="0" Grid.Column="1" Height="22" HorizontalAlignment="Stretch" />
|
||||
|
||||
<Label Grid.Row="0" Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Right" Content="Password" />
|
||||
<TextBox x:Name="RedumpPasswordTextBox" Grid.Row="0" Grid.Column="3" Height="22" HorizontalAlignment="Stretch" />
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
<Grid Height="22" Grid.Row="4" Grid.Column="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
|
||||
@@ -103,6 +103,9 @@ namespace DICUI.Windows
|
||||
DumpSpeedCDSlider.Value = _options.PreferredDumpSpeedCD;
|
||||
DumpSpeedDVDSlider.Value = _options.PreferredDumpSpeedDVD;
|
||||
DumpSpeedBDSlider.Value = _options.PreferredDumpSpeedBD;
|
||||
|
||||
RedumpUsernameTextBox.Text = _options.Username;
|
||||
RedumpPasswordTextBox.Text = _options.Password;
|
||||
}
|
||||
|
||||
#region Event Handlers
|
||||
@@ -115,6 +118,9 @@ namespace DICUI.Windows
|
||||
_options.PreferredDumpSpeedDVD = Convert.ToInt32(DumpSpeedDVDSlider.Value);
|
||||
_options.PreferredDumpSpeedBD = Convert.ToInt32(DumpSpeedBDSlider.Value);
|
||||
|
||||
_options.Username = RedumpUsernameTextBox.Text;
|
||||
_options.Password = RedumpPasswordTextBox.Text;
|
||||
|
||||
_options.Save();
|
||||
Hide();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user