Skip to content
This repository was archived by the owner on Mar 4, 2018. It is now read-only.

Commit 3b31476

Browse files
committed
display edit notice
1 parent a659ed9 commit 3b31476

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

Forms/dspfEdit.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Main.cs

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,16 +119,27 @@ internal static void About()
119119

120120
internal static void DisplayEdit()
121121
{
122-
dspfEdit Editor = new dspfEdit();
123-
string path = NppFunctions.GetCurrentFileName();
124-
if (path.Trim() != "")
122+
DialogResult buttonPress = (IBMi.GetConfig("dspfNotice") == "yes" ? DialogResult.Yes : DialogResult.No);
123+
if (buttonPress == DialogResult.No)
125124
{
126-
DisplayParse parser = new LanguageTools.DisplayParse();
127-
parser.ParseFile(path);
128-
Editor = new dspfEdit(parser.GetRecordFormats(), path);
125+
buttonPress = MessageBox.Show("Do you understand that you use the Display File Editor at your own risk? Currently, the Display File Editor is not ready for production use and therefore holds no responsibility of changes made to source when saving.", "Notice!", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
126+
if (buttonPress == DialogResult.Yes) IBMi.SetConfig("dspfNotice", "yes");
127+
}
128+
129+
if (buttonPress == DialogResult.Yes)
130+
{
131+
dspfEdit Editor = new dspfEdit();
132+
string path = NppFunctions.GetCurrentFileName();
133+
if (path.Trim() != "")
134+
{
135+
DisplayParse parser = new LanguageTools.DisplayParse();
136+
parser.ParseFile(path);
137+
Editor = new dspfEdit(parser.GetRecordFormats(), path);
138+
}
139+
140+
Editor.ShowDialog();
129141
}
130142

131-
Editor.ShowDialog();
132143
}
133144

134145
internal static void ManageCL()

0 commit comments

Comments
 (0)