diff --git a/PROMS/VEPROMS User Interface/App.config b/PROMS/VEPROMS User Interface/App.config index be950f12..73c3a0b7 100644 --- a/PROMS/VEPROMS User Interface/App.config +++ b/PROMS/VEPROMS User Interface/App.config @@ -137,6 +137,9 @@ 0.0 + + C:\Development + diff --git a/PROMS/VEPROMS User Interface/Properties/Settings.Designer.cs b/PROMS/VEPROMS User Interface/Properties/Settings.Designer.cs index c86f08f7..474f2a94 100644 --- a/PROMS/VEPROMS User Interface/Properties/Settings.Designer.cs +++ b/PROMS/VEPROMS User Interface/Properties/Settings.Designer.cs @@ -267,5 +267,17 @@ namespace VEPROMS.Properties { this["LastVersion"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("C:\\Development")] + public string FormatPath { + get { + return ((string)(this["FormatPath"])); + } + set { + this["FormatPath"] = value; + } + } } } diff --git a/PROMS/VEPROMS User Interface/Properties/Settings.settings b/PROMS/VEPROMS User Interface/Properties/Settings.settings index 97a5b6dc..163dff53 100644 --- a/PROMS/VEPROMS User Interface/Properties/Settings.settings +++ b/PROMS/VEPROMS User Interface/Properties/Settings.settings @@ -65,5 +65,8 @@ 0.0 + + C:\Development + \ No newline at end of file diff --git a/PROMS/VEPROMS User Interface/frmVEPROMS.Designer.cs b/PROMS/VEPROMS User Interface/frmVEPROMS.Designer.cs index f80abf72..7284a310 100644 --- a/PROMS/VEPROMS User Interface/frmVEPROMS.Designer.cs +++ b/PROMS/VEPROMS User Interface/frmVEPROMS.Designer.cs @@ -114,6 +114,7 @@ namespace VEPROMS this.buttonItem1 = new DevComponents.DotNetBar.ButtonItem(); this.itemAnnotationsBindingSource = new System.Windows.Forms.BindingSource(this.components); this.tc = new Volian.Controls.Library.DisplayTabControl(); + this.fbd = new System.Windows.Forms.FolderBrowserDialog(); ((System.ComponentModel.ISupportInitialize)(this.bottomBar)).BeginInit(); this.bottomBar.SuspendLayout(); this.epAnnotations.SuspendLayout(); @@ -1434,6 +1435,7 @@ namespace VEPROMS private DevComponents.DotNetBar.TabItem infotabHistory; private Volian.Controls.Library.DisplayHistory displayHistory; private DevComponents.DotNetBar.ButtonItem btnUpdateFormats; + private System.Windows.Forms.FolderBrowserDialog fbd; } } diff --git a/PROMS/VEPROMS User Interface/frmVEPROMS.cs b/PROMS/VEPROMS User Interface/frmVEPROMS.cs index 63ee814d..f6fdc6fd 100644 --- a/PROMS/VEPROMS User Interface/frmVEPROMS.cs +++ b/PROMS/VEPROMS User Interface/frmVEPROMS.cs @@ -436,6 +436,9 @@ namespace VEPROMS } else RunAutomatic(); + // Shutoff UpdateFormats for Production Mode + if (Volian.Base.Library.VlnSettings.ProductionMode) + btnAdmin.Visible = false; } void tmrShutDown_Tick(object sender, EventArgs e) { @@ -1787,9 +1790,23 @@ namespace VEPROMS } private void btnUpdateFormat_Click(object sender, EventArgs e) { - string appPath = Application.ExecutablePath; - FileInfo fi = new FileInfo(appPath); - DirectoryInfo di = fi.Directory.Parent.Parent.Parent.Parent; + DirectoryInfo di = new DirectoryInfo(Properties.Settings.Default.FormatPath); + if (!di.Exists || !File.Exists(di.FullName + @"\fmtall") || !File.Exists(di.FullName + @"\genmacall")) + { + while (!di.Exists || !Directory.Exists(di.FullName + @"\fmtall") || !Directory.Exists(di.FullName + @"\genmacall")) + { + fbd.Description = "Select folder containing FmtAll and GenMacAll folders to update formats"; + DialogResult dr = fbd.ShowDialog(); + if (dr == DialogResult.Cancel) + { + bottomProgBar.Text = "Format Update Cancelled"; + return; + } + di = new DirectoryInfo(fbd.SelectedPath); + } + Properties.Settings.Default.FormatPath = fbd.SelectedPath; + Properties.Settings.Default.Save(); + } string fmtPath = di.FullName + @"\fmtall"; string genmacPath = di.FullName + @"\genmacall"; Format.FormatLoaded += new FormatEvent(Format_FormatLoaded);