B2024-030 On the Working Draft properties page, added a check to see if we need to create the folder(s) for the path typed into the PDF Location text box. #320
@ -254,7 +254,7 @@ namespace VEPROMS
|
|||||||
//
|
//
|
||||||
this.ppBtnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
this.ppBtnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
this.ppBtnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
this.ppBtnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||||
this.ppBtnCancel.Location = new System.Drawing.Point(742, 342);
|
this.ppBtnCancel.Location = new System.Drawing.Point(742, 338);
|
||||||
this.ppBtnCancel.Margin = new System.Windows.Forms.Padding(2);
|
this.ppBtnCancel.Margin = new System.Windows.Forms.Padding(2);
|
||||||
this.ppBtnCancel.Name = "ppBtnCancel";
|
this.ppBtnCancel.Name = "ppBtnCancel";
|
||||||
this.ppBtnCancel.Size = new System.Drawing.Size(56, 21);
|
this.ppBtnCancel.Size = new System.Drawing.Size(56, 21);
|
||||||
@ -266,7 +266,7 @@ namespace VEPROMS
|
|||||||
// ppBtnOK
|
// ppBtnOK
|
||||||
//
|
//
|
||||||
this.ppBtnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
this.ppBtnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
this.ppBtnOK.Location = new System.Drawing.Point(669, 342);
|
this.ppBtnOK.Location = new System.Drawing.Point(669, 338);
|
||||||
this.ppBtnOK.Margin = new System.Windows.Forms.Padding(2);
|
this.ppBtnOK.Margin = new System.Windows.Forms.Padding(2);
|
||||||
this.ppBtnOK.Name = "ppBtnOK";
|
this.ppBtnOK.Name = "ppBtnOK";
|
||||||
this.ppBtnOK.Size = new System.Drawing.Size(56, 21);
|
this.ppBtnOK.Size = new System.Drawing.Size(56, 21);
|
||||||
|
@ -29,6 +29,7 @@ namespace VEPROMS
|
|||||||
private List<MiniConfig> _DeletedApples;
|
private List<MiniConfig> _DeletedApples;
|
||||||
private List<EnhancedMiniConfig> _Enhanced;
|
private List<EnhancedMiniConfig> _Enhanced;
|
||||||
private DocVersionConfig _DocVersionConfig;
|
private DocVersionConfig _DocVersionConfig;
|
||||||
|
private string _OrgPDFPath; // B2024-030 used to save last PDF path
|
||||||
|
|
||||||
// Default values
|
// Default values
|
||||||
private string _DefaultFormatName = null;
|
private string _DefaultFormatName = null;
|
||||||
@ -97,6 +98,7 @@ namespace VEPROMS
|
|||||||
|
|
||||||
_Initializing = true;
|
_Initializing = true;
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
_OrgPDFPath = _DocVersionConfig.Print_PDFLocation; // B2024-030 save last PDF path
|
||||||
btnGeneral.PerformClick(); // always start with General tab or button
|
btnGeneral.PerformClick(); // always start with General tab or button
|
||||||
_Initializing = false;
|
_Initializing = false;
|
||||||
|
|
||||||
@ -323,8 +325,6 @@ namespace VEPROMS
|
|||||||
tiApplicability.Visible = false;
|
tiApplicability.Visible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ppTxtBxPDFLoc.TextChanged += new EventHandler(ppTxtBxPDFLoc_TextChanged);
|
|
||||||
|
|
||||||
//end add new applicability stuff
|
//end add new applicability stuff
|
||||||
lblProcSetRev.Visible = ppRTxtProcSetRev.Visible = _DocVersionConfig.MyDocVersion.MyDocVersionInfo.ActiveFormat.MyStepSectionPrintData.UseXtraRevNumber;
|
lblProcSetRev.Visible = ppRTxtProcSetRev.Visible = _DocVersionConfig.MyDocVersion.MyDocVersionInfo.ActiveFormat.MyStepSectionPrintData.UseXtraRevNumber;
|
||||||
|
|
||||||
@ -538,11 +538,32 @@ namespace VEPROMS
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// The following code was added to fix Bug B2013-117
|
//B2024-030 Check the PDF Location path and prompt to create the folders if needed
|
||||||
private void ppTxtBxPDFLoc_TextChanged(object sender, EventArgs e)
|
private void CheckPDFLocationPath()
|
||||||
{
|
{
|
||||||
if (_Initializing == false)
|
string pdfloc = ppTxtBxPDFLoc.Text;
|
||||||
_DocVersionConfig.Print_PDFLocation = ppTxtBxPDFLoc.Text;
|
if (pdfloc == string.Empty) return;
|
||||||
|
if (!Directory.Exists(ppTxtBxPDFLoc.Text))
|
||||||
|
{
|
||||||
|
string msg = string.Format(" The Folder: '{0}' does not exist. \n\nCreate it?", ppTxtBxPDFLoc.Text);
|
||||||
|
DialogResult dr = MessageBox.Show(msg, "PDF Location Folder Not Found", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
|
||||||
|
if (dr == DialogResult.Yes)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(ppTxtBxPDFLoc.Text);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Error trying to create folder", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
_DocVersionConfig.Print_PDFLocation = _OrgPDFPath; // reset to the path we started with
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_DocVersionConfig.Print_PDFLocation = _OrgPDFPath; // reset to the path we started with
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private string AddSlaveNode(MiniConfig mc)
|
private string AddSlaveNode(MiniConfig mc)
|
||||||
@ -588,6 +609,9 @@ namespace VEPROMS
|
|||||||
|
|
||||||
private void btnVersionsPropOK_Click(object sender, EventArgs e)
|
private void btnVersionsPropOK_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
//B2024-030 Check the PDF Location path and prompt to create the folders if needed
|
||||||
|
CheckPDFLocationPath();
|
||||||
|
|
||||||
docVersionConfigBindingSource.EndEdit(); // need to end the edit session first or any format selection chanage will not stick B2015-157
|
docVersionConfigBindingSource.EndEdit(); // need to end the edit session first or any format selection chanage will not stick B2015-157
|
||||||
|
|
||||||
// if there is a change to the format, clean up any overridden formats that point to the selected item before saving the format change:
|
// if there is a change to the format, clean up any overridden formats that point to the selected item before saving the format change:
|
||||||
@ -773,7 +797,6 @@ namespace VEPROMS
|
|||||||
|
|
||||||
// B2019-132 update the association count for this working draft
|
// B2019-132 update the association count for this working draft
|
||||||
_DocVersionConfig.MyDocVersion.MyDocVersionInfo.RefreshDocVersionAssociations();
|
_DocVersionConfig.MyDocVersion.MyDocVersionInfo.RefreshDocVersionAssociations();
|
||||||
|
|
||||||
this.Close();
|
this.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user