Merge pull request 'B2025-007 RO Editor – RO Figure Default File extension' (#495) from B2025-007 into Development

good for testing phase
This commit is contained in:
John Jenko 2025-01-23 11:06:24 -05:00
commit c3b7b1e5a4

View File

@ -327,22 +327,10 @@ namespace ctlXMLEditLib
// DefaultGraphicFileExtension = TheIniFile.GetINIKeyValueStr("ROApp","Extention","",5,"ROAPP.INI"); // DefaultGraphicFileExtension = TheIniFile.GetINIKeyValueStr("ROApp","Extention","",5,"ROAPP.INI");
// Bug fix: B2006-025 // Bug fix: B2006-025
// needed to pass the full path of ROAPP.INI // needed to pass the full path of ROAPP.INI
// B2025-007 only use the default file location (remove 16 bit PROMS location)
IniReader in1 = new IniReader(ROINI); IniReader in1 = new IniReader(ROINI);
DefaultGraphicFileExtension = in1.ReadString("ROApp","Extention",""); DefaultGraphicFileExtension = in1.ReadString("ROApp", "Extention");
if (DefaultGraphicFileExtension.Equals("")) if (string.IsNullOrEmpty(DefaultGraphicFileExtension)) DefaultGraphicFileExtension = in1.ReadString("ROApp", "Extension", ".TIF");
{
string ApplPathUp = ApplicationPath.ToUpper();
int idx = ApplPathUp.IndexOf("VE-PROMS.NET\\BIN");
if (idx >= 0)
{
string PromsINI = ApplicationPath.Substring(0, idx);
PromsINI += "VE-PROMS\\VEPROMS.INI";
IniReader in2 = new IniReader(PromsINI);
DefaultGraphicFileExtension = in2.ReadString("Graphics", "defaultext", ".TIF");
}
else
DefaultGraphicFileExtension = ".TIF";
}
// if (File.Exists(PromsINI)) // if (File.Exists(PromsINI))
// DefaultGraphicFileExtension = TheIniFile.GetINIKeyValueStr("Graphics","defaultext",".TIF",5,PromsINI); // DefaultGraphicFileExtension = TheIniFile.GetINIKeyValueStr("Graphics","defaultext",".TIF",5,PromsINI);
// if (File.Exists("ROAPP.INI")) // if (File.Exists("ROAPP.INI"))
@ -1486,11 +1474,14 @@ namespace ctlXMLEditLib
FileInfo ifi = new FileInfo(fnamebox.Text); FileInfo ifi = new FileInfo(fnamebox.Text);
if (ifi.Exists == false) if (ifi.Exists == false)
{ {
MessageBoxButtons buttons = MessageBoxButtons.OK; FileInfo ifi2 = new FileInfo(fnamebox.Text + DefaultGraphicFileExtension);
if (!ifi2.Exists)
{
MessageBox.Show("File does not exist.", MessageBox.Show("File does not exist.",
"File Input Error", buttons); "File Input Error", MessageBoxButtons.OK);
return; return;
} }
}
bool ok = ValidGraphicsFile(fnamebox.Text); bool ok = ValidGraphicsFile(fnamebox.Text);
if (ok != true) if (ok != true)
{ {