WinForms cleanup, fix #38 (#39)

* fix spelling of "CreateIslndForm"

* sync up values of MinimizeBox, MaximizeBox, ShowInTaskbar, FormBorderStyle, and StartPosition properties on forms

* enable menu items after creating a new project

* improve form names

* add some clarity to warning/question MessageBox.Show text

* invert if statement to reduce nesting and change OKCancel to YesNo
This commit is contained in:
Andrew DeLisa 2019-01-07 14:24:32 -05:00 committed by GrapeshotGames
parent 92e71cf94a
commit bc0b7b70ba
22 changed files with 154 additions and 62 deletions

View file

@ -1,6 +1,6 @@
namespace ServerGridEditor namespace ServerGridEditor
{ {
partial class CreateIslndForm partial class CreateIslandForm
{ {
/// <summary> /// <summary>
/// Required designer variable. /// Required designer variable.
@ -365,7 +365,7 @@
this.instancesListBox.Size = new System.Drawing.Size(194, 95); this.instancesListBox.Size = new System.Drawing.Size(194, 95);
this.instancesListBox.TabIndex = 39; this.instancesListBox.TabIndex = 39;
// //
// CreateIslndForm // CreateIslandForm
// //
this.AcceptButton = this.createBtn; this.AcceptButton = this.createBtn;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -404,7 +404,10 @@
this.Controls.Add(this.label1); this.Controls.Add(this.label1);
this.Controls.Add(this.islandNameTxtBox); this.Controls.Add(this.islandNameTxtBox);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Name = "CreateIslndForm"; this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "CreateIslandForm";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Create Island"; this.Text = "Create Island";
this.Load += new System.EventHandler(this.Form2_Load); this.Load += new System.EventHandler(this.Form2_Load);

View file

@ -12,13 +12,13 @@ using System.Windows.Forms;
namespace ServerGridEditor namespace ServerGridEditor
{ {
public partial class CreateIslndForm : Form public partial class CreateIslandForm : Form
{ {
public MainForm mainForm; public MainForm mainForm;
public Island editedIsland; public Island editedIsland;
public bool bIslandNameChanged = false; public bool bIslandNameChanged = false;
public CreateIslndForm() public CreateIslandForm()
{ {
InitializeComponent(); InitializeComponent();
pictureBox1.SizeMode = PictureBoxSizeMode.Zoom; pictureBox1.SizeMode = PictureBoxSizeMode.Zoom;

View file

@ -126,12 +126,6 @@
<metadata name="SpawnerTemplate.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="SpawnerTemplate.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<metadata name="SpawnerName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="SpawnerTemplate.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>45</value> <value>45</value>
</metadata> </metadata>

View file

@ -975,7 +975,10 @@
this.Controls.Add(this.sizeXTxtBox); this.Controls.Add(this.sizeXTxtBox);
this.Controls.Add(this.label1); this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "CreateProjectForm"; this.Name = "CreateProjectForm";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Create Project"; this.Text = "Create Project";
this.Load += new System.EventHandler(this.CreateProjectForm_Load); this.Load += new System.EventHandler(this.CreateProjectForm_Load);

View file

@ -428,6 +428,7 @@ namespace ServerGridEditor
mainForm.currentProject.TravelDataConfig.CopyFrom(TravelDataConfig); mainForm.currentProject.TravelDataConfig.CopyFrom(TravelDataConfig);
mainForm.currentProject.SharedLogConfig.CopyFrom(SharedLogConfig); mainForm.currentProject.SharedLogConfig.CopyFrom(SharedLogConfig);
} }
mainForm.EnableProjectMenuItems();
Close(); Close();
} }

View file

@ -146,8 +146,12 @@
this.Controls.Add(this.label3); this.Controls.Add(this.label3);
this.Controls.Add(this.label2); this.Controls.Add(this.label2);
this.Controls.Add(this.label1); this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "EditAllLocksForm"; this.Name = "EditAllLocksForm";
this.ShowIcon = false; this.ShowIcon = false;
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Locks"; this.Text = "Locks";
this.ResumeLayout(false); this.ResumeLayout(false);

View file

@ -219,8 +219,13 @@
this.Controls.Add(this.discoZonesGrid); this.Controls.Add(this.discoZonesGrid);
this.Controls.Add(this.cancelBtn); this.Controls.Add(this.cancelBtn);
this.Controls.Add(this.saveBtn); this.Controls.Add(this.saveBtn);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "EditDiscoZonesForm"; this.Name = "EditDiscoZonesForm";
this.Text = "EditDiscoZonesForm"; this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Edit Discovery Zones";
((System.ComponentModel.ISupportInitialize)(this.discoZonesGrid)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.discoZonesGrid)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);

View file

@ -159,4 +159,46 @@
<metadata name="allowSea.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="allowSea.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<metadata name="IsManual.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="zoneManualName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="zoneName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="zoneId.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="zoneParent.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="zoneSizeX.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="zoneSizeY.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="zoneSizeZ.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="zoneRotation.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="zoneXP.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="LocX.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="LocY.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="ExplorerNoteIndex.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="allowSea.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root> </root>

View file

@ -218,8 +218,13 @@
this.Controls.Add(this.zoneNameTxt); this.Controls.Add(this.zoneNameTxt);
this.Controls.Add(this.cancelBtn); this.Controls.Add(this.cancelBtn);
this.Controls.Add(this.saveBtn); this.Controls.Add(this.saveBtn);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "EditDiscoveryZoneInstance"; this.Name = "EditDiscoveryZoneInstance";
this.Text = "EditDiscoveryZoneInstance"; this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Edit Discovery Zone Instance";
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();

View file

@ -283,6 +283,7 @@
this.Controls.Add(this.saveBtn); this.Controls.Add(this.saveBtn);
this.Controls.Add(this.label1); this.Controls.Add(this.label1);
this.Controls.Add(this.spawnerOverridesGrid); this.Controls.Add(this.spawnerOverridesGrid);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false; this.MaximizeBox = false;
this.MinimizeBox = false; this.MinimizeBox = false;
this.Name = "EditIslandInstance"; this.Name = "EditIslandInstance";

View file

@ -123,4 +123,10 @@
<metadata name="SpawnerTemplate.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="SpawnerTemplate.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<metadata name="SpawnerName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="SpawnerTemplate.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root> </root>

View file

@ -741,7 +741,10 @@
this.Controls.Add(this.portTxtBox); this.Controls.Add(this.portTxtBox);
this.Controls.Add(this.label1); this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "EditServerForm"; this.Name = "EditServerForm";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Edit Server"; this.Text = "Edit Server";
this.Load += new System.EventHandler(this.EditServerForm_Load); this.Load += new System.EventHandler(this.EditServerForm_Load);

View file

@ -629,7 +629,10 @@
this.Controls.Add(this.cancelBtn); this.Controls.Add(this.cancelBtn);
this.Controls.Add(this.saveBtn); this.Controls.Add(this.saveBtn);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "EditServerTemplate"; this.Name = "EditServerTemplate";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Edit Server Template"; this.Text = "Edit Server Template";
this.Load += new System.EventHandler(this.EditServerTemplate_Load); this.Load += new System.EventHandler(this.EditServerTemplate_Load);

View file

@ -84,9 +84,12 @@
this.Controls.Add(this.addBtn); this.Controls.Add(this.addBtn);
this.Controls.Add(this.templatesLstBox); this.Controls.Add(this.templatesLstBox);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "EditServerTemplates"; this.Name = "EditServerTemplates";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "EditServerTemplates"; this.Text = "Edit Server Templates";
this.ResumeLayout(false); this.ResumeLayout(false);
} }

View file

@ -65,9 +65,9 @@ namespace ServerGridEditor.Forms
{ {
var confirmResult = MessageBox.Show("You are about to delete the selected template\n\nAre you sure?", var confirmResult = MessageBox.Show("You are about to delete the selected template\n\nAre you sure?",
"Warning", "Warning",
MessageBoxButtons.OKCancel, MessageBoxIcon.Warning); MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (confirmResult == DialogResult.OK) if (confirmResult == DialogResult.Yes)
{ {
templatesLstBox.Items.Remove(serverTemplate.name); templatesLstBox.Items.Remove(serverTemplate.name);
mainForm.currentProject.serverTemplates.Remove(serverTemplate); mainForm.currentProject.serverTemplates.Remove(serverTemplate);

View file

@ -133,8 +133,12 @@
this.Controls.Add(this.label1); this.Controls.Add(this.label1);
this.Controls.Add(this.applyBtn); this.Controls.Add(this.applyBtn);
this.Controls.Add(this.loopingPathChckBox); this.Controls.Add(this.loopingPathChckBox);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "EditShipPath"; this.Name = "EditShipPath";
this.ShowIcon = false; this.ShowIcon = false;
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Edit Ship Path"; this.Text = "Edit Ship Path";
this.Load += new System.EventHandler(this.EditShipPath_Load); this.Load += new System.EventHandler(this.EditShipPath_Load);

View file

@ -108,8 +108,12 @@
this.Controls.Add(this.cancelBtn); this.Controls.Add(this.cancelBtn);
this.Controls.Add(this.saveBtn); this.Controls.Add(this.saveBtn);
this.Controls.Add(this.spawnRegionsGrid); this.Controls.Add(this.spawnRegionsGrid);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "EditSpawnRegions"; this.Name = "EditSpawnRegions";
this.Text = "EditSpawnRegions"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Edit Spawn Regions";
((System.ComponentModel.ISupportInitialize)(this.spawnRegionsGrid)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.spawnRegionsGrid)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();

View file

@ -90,8 +90,12 @@
this.Controls.Add(this.lockDiscoChckbox); this.Controls.Add(this.lockDiscoChckbox);
this.Controls.Add(this.applyBtn); this.Controls.Add(this.applyBtn);
this.Controls.Add(this.lockIslandsChkbox); this.Controls.Add(this.lockIslandsChkbox);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "LocksForm"; this.Name = "LocksForm";
this.ShowIcon = false; this.ShowIcon = false;
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Locks"; this.Text = "Locks";
this.Load += new System.EventHandler(this.LocksForm_Load); this.Load += new System.EventHandler(this.LocksForm_Load);

View file

@ -1561,7 +1561,7 @@ namespace ServerGridEditor
///////////////////////////Action Handlers/////////////////////////////////// ///////////////////////////Action Handlers///////////////////////////////////
private void addIslandBtn_Click(object sender, EventArgs e) private void addIslandBtn_Click(object sender, EventArgs e)
{ {
var createForm = new CreateIslndForm(); var createForm = new CreateIslandForm();
createForm.mainForm = this; createForm.mainForm = this;
createForm.ShowDialog(); createForm.ShowDialog();
} }
@ -1596,7 +1596,7 @@ namespace ServerGridEditor
{ {
if (currentProject != null) if (currentProject != null)
{ {
MessageBox.Show("Creating a project will overwrite the currently opened one"); MessageBox.Show("If you create a new project, any unsaved changes to your current project will be LOST!");
} }
var createForm = new CreateProjectForm(); var createForm = new CreateProjectForm();
@ -1623,12 +1623,11 @@ namespace ServerGridEditor
{ {
if (currentProject != null) if (currentProject != null)
{ {
var confirmResult = MessageBox.Show("Opening a project will overwrite the currently opened one, open?", var confirmResult = MessageBox.Show("If you click OK, any unsaved changes to your current project will be LOST!",
"Warning", "Warning",
MessageBoxButtons.OKCancel); MessageBoxButtons.OKCancel);
if (confirmResult != DialogResult.OK) if (confirmResult != DialogResult.OK)
return; return;
//MessageBox.Show("Opening a project will overwrite the currently opened one");
} }
openFileDialog.Filter = "json files (*.json)|*.json"; openFileDialog.Filter = "json files (*.json)|*.json";
@ -1750,47 +1749,44 @@ namespace ServerGridEditor
private void removeIslandBtn_Click(object sender, EventArgs e) private void removeIslandBtn_Click(object sender, EventArgs e)
{ {
var confirmResult = MessageBox.Show("Removing an island will remove all its instances in the map\nAre you sure?", var confirmResult = MessageBox.Show("Removing an island will remove all its instances in the map!\n\nAre you sure?",
"Warning", "Warning",
MessageBoxButtons.OKCancel, MessageBoxIcon.Warning); MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (confirmResult == DialogResult.OK) if (confirmResult != DialogResult.Yes)
return;
List<string> islandsToRemove = new List<string>();
foreach (ListViewItem item in islandListBox.SelectedItems)
{ {
islandsToRemove.Add(item.SubItems[2].Text);
List<string> islandsToRemove = new List<string>();
foreach (ListViewItem item in islandListBox.SelectedItems)
{
islandsToRemove.Add(item.SubItems[2].Text);
}
if (currentProject != null)
{
for (int i = 0; i < currentProject.islandInstances.Count; i++)
foreach (string islandToRemove in islandsToRemove)
if (currentProject.islandInstances[i].name == islandToRemove)
{
currentProject.islandInstances[i].SetDirty(this);
currentProject.islandInstances.RemoveAt(i);
i--;
}
}
foreach (string islandToRemove in islandsToRemove)
{
//delete the image
islands[islandToRemove].InvalidateImage();
File.Delete(islands[islandToRemove].imagePath);
islands.Remove(islandToRemove);
}
RefreshIslandList();
mapPanel.Invalidate();
SaveIslands();
} }
if (currentProject != null)
{
for (int i = 0; i < currentProject.islandInstances.Count; i++)
foreach (string islandToRemove in islandsToRemove)
if (currentProject.islandInstances[i].name == islandToRemove)
{
currentProject.islandInstances[i].SetDirty(this);
currentProject.islandInstances.RemoveAt(i);
i--;
}
}
foreach (string islandToRemove in islandsToRemove)
{
//delete the image
islands[islandToRemove].InvalidateImage();
File.Delete(islands[islandToRemove].imagePath);
islands.Remove(islandToRemove);
}
RefreshIslandList();
mapPanel.Invalidate();
SaveIslands();
} }
private void showServerInfoCheckbox_CheckedChanged(object sender, EventArgs e) private void showServerInfoCheckbox_CheckedChanged(object sender, EventArgs e)
@ -1840,7 +1836,7 @@ namespace ServerGridEditor
if (isle == null) if (isle == null)
return; return;
var createForm = new CreateIslndForm(); var createForm = new CreateIslandForm();
createForm.mainForm = this; createForm.mainForm = this;
createForm.editedIsland = isle; createForm.editedIsland = isle;
if(createForm.ShowDialog() != DialogResult.Cancel && createForm.bIslandNameChanged) if(createForm.ShowDialog() != DialogResult.Cancel && createForm.bIslandNameChanged)
@ -1964,9 +1960,8 @@ namespace ServerGridEditor
{ {
if (currentProject != null) if (currentProject != null)
{ {
var confirmResult = MessageBox.Show("All unsaved progress will be lost", "Warning", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation); var confirmResult = MessageBox.Show("All unsaved changes to your current project will be LOST!", "Warning", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation);
if (confirmResult == DialogResult.Cancel) e.Cancel = confirmResult == DialogResult.Cancel;
e.Cancel = true;
} }
} }
@ -1985,7 +1980,7 @@ namespace ServerGridEditor
{ {
if (currentProject != null) if (currentProject != null)
{ {
MessageBox.Show("Creating a project will overwrite the currently opened one"); MessageBox.Show("If you create a new project, any unsaved changes to your current project will be LOST!");
} }
var createForm = new CreateProjectForm(); var createForm = new CreateProjectForm();

View file

@ -248,7 +248,11 @@
this.Controls.Add(this.saveBtn); this.Controls.Add(this.saveBtn);
this.Controls.Add(this.cancelBtn); this.Controls.Add(this.cancelBtn);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "SharedLogConfigForm"; this.Name = "SharedLogConfigForm";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Shared Log Config"; this.Text = "Shared Log Config";
this.Load += new System.EventHandler(this.SharedLogConfigForm_Load); this.Load += new System.EventHandler(this.SharedLogConfigForm_Load);
this.ResumeLayout(false); this.ResumeLayout(false);

View file

@ -152,7 +152,11 @@
this.Controls.Add(this.saveBtn); this.Controls.Add(this.saveBtn);
this.Controls.Add(this.cancelBtn); this.Controls.Add(this.cancelBtn);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "TravelDataConfigForm"; this.Name = "TravelDataConfigForm";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Travel Data Config"; this.Text = "Travel Data Config";
this.Load += new System.EventHandler(this.TravelDataConfigForm_Load); this.Load += new System.EventHandler(this.TravelDataConfigForm_Load);
this.ResumeLayout(false); this.ResumeLayout(false);

View file

@ -188,7 +188,11 @@
this.Controls.Add(this.saveBtn); this.Controls.Add(this.saveBtn);
this.Controls.Add(this.cancelBtn); this.Controls.Add(this.cancelBtn);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "TribeLogConfigForm"; this.Name = "TribeLogConfigForm";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Tribe Log Config"; this.Text = "Tribe Log Config";
this.Load += new System.EventHandler(this.TribeLogConfigForm_Load); this.Load += new System.EventHandler(this.TribeLogConfigForm_Load);
this.ResumeLayout(false); this.ResumeLayout(false);