Mono does not like my settings for some reason. Moved settings to my own class that loads from properties.settings. Will load/save to xml in another commit.
This commit is contained in:
@ -43,6 +43,9 @@ namespace EduNetworkBuilder
|
||||
tbSearchBox.Visible = true;
|
||||
if (SelectedTag == NB.Translate("_All"))
|
||||
Text = Text + NB.Translate("_AllS");
|
||||
|
||||
NBSettings oursettings = NB.GetSettings();
|
||||
|
||||
foreach (string str in NB.GetPuzzleTags())
|
||||
{
|
||||
newCB = AddCheckBox(count, str);
|
||||
@ -60,7 +63,7 @@ namespace EduNetworkBuilder
|
||||
btnOK.Text = NB.Translate("_Load");
|
||||
btnAdd.Text = NB.Translate("_Cancel");
|
||||
btnAdd.Visible = true;
|
||||
cbLoadPuzzlesAtStart.Checked = Properties.Settings.Default.AutoStartPuzzles;
|
||||
cbLoadPuzzlesAtStart.Checked = oursettings.AutoStartPuzzles;
|
||||
UpdateForm();
|
||||
}
|
||||
|
||||
@ -151,12 +154,11 @@ namespace EduNetworkBuilder
|
||||
|
||||
private string GetSelectedTag()
|
||||
{
|
||||
if (Properties.Settings.Default.ScoreList == null)
|
||||
Properties.Settings.Default.ScoreList = new System.Collections.Specialized.StringCollection();
|
||||
PuzzleInfo PI;
|
||||
string first = "";
|
||||
NBSettings oursettings = NB.GetSettings();
|
||||
|
||||
string OriginalChoice = Properties.Settings.Default.ProcessingLevel;
|
||||
string OriginalChoice = oursettings.ProcessingLevel;
|
||||
if(OriginalChoice != null)
|
||||
{
|
||||
if (NB.PuzzleLevelHasUnsolved(OriginalChoice))
|
||||
@ -165,7 +167,7 @@ namespace EduNetworkBuilder
|
||||
|
||||
foreach (string str in NB.GetPuzzleNames())
|
||||
{
|
||||
if(!Properties.Settings.Default.ScoreList.Contains(str))
|
||||
if(!oursettings.ScoreList.Contains(str))
|
||||
{
|
||||
PI = NB.GetPuzzleInfoFromName(str);
|
||||
first = "Level_" + PI.Level;
|
||||
@ -222,10 +224,9 @@ namespace EduNetworkBuilder
|
||||
cbLoadPuzzlesAtStart.Visible = true;
|
||||
btnReset.Visible = true;
|
||||
PuzzleInfo pi;
|
||||
if (Properties.Settings.Default.ScoreList == null)
|
||||
Properties.Settings.Default.ScoreList = new System.Collections.Specialized.StringCollection();
|
||||
string shown_name;
|
||||
List<string> Puzzles = NB.GetPuzzleNames();
|
||||
NBSettings oursettings = NB.GetSettings();
|
||||
if (Puzzles == null) return;
|
||||
foreach (string str in Puzzles)
|
||||
{
|
||||
@ -233,7 +234,7 @@ namespace EduNetworkBuilder
|
||||
{
|
||||
pi = NB.GetPuzzleInfoFromName(str);
|
||||
shown_name = pi.PuzzleName;
|
||||
if (Properties.Settings.Default.ScoreList.Contains(str))
|
||||
if (oursettings.ScoreList.Contains(str))
|
||||
shown_name = "* " + shown_name;
|
||||
foreach (string tag in pi.PuzzleTags)
|
||||
{
|
||||
@ -250,7 +251,7 @@ namespace EduNetworkBuilder
|
||||
shown_name = pi.PuzzleName;
|
||||
bool added = false;
|
||||
string localFilter = ".*" + FilterString + ".*";
|
||||
if (Properties.Settings.Default.ScoreList.Contains(str))
|
||||
if (oursettings.ScoreList.Contains(str))
|
||||
shown_name = "* " + shown_name;
|
||||
if (!added && pi.PuzzleName != null && Regex.IsMatch(pi.PuzzleName, localFilter, RegexOptions.IgnoreCase))
|
||||
{
|
||||
@ -295,6 +296,7 @@ namespace EduNetworkBuilder
|
||||
|
||||
private void btnOK_Click(object sender, EventArgs e)
|
||||
{
|
||||
NBSettings oursettings = NB.GetSettings();
|
||||
if (MyMode == LBContents.puzzles && lbWindowData.SelectedItem != null)
|
||||
{
|
||||
string TheName = lbWindowData.SelectedItem.ToString();
|
||||
@ -305,10 +307,10 @@ namespace EduNetworkBuilder
|
||||
{
|
||||
myWin.Activate();
|
||||
}
|
||||
if(Properties.Settings.Default.AutoStartPuzzles != cbLoadPuzzlesAtStart.Checked)
|
||||
if(oursettings.AutoStartPuzzles != cbLoadPuzzlesAtStart.Checked)
|
||||
{
|
||||
Properties.Settings.Default.AutoStartPuzzles = cbLoadPuzzlesAtStart.Checked;
|
||||
Properties.Settings.Default.Save();
|
||||
oursettings.AutoStartPuzzles = cbLoadPuzzlesAtStart.Checked;
|
||||
// oursettings.Save();
|
||||
}
|
||||
if (lbWindowData.SelectedItem != null)
|
||||
NB.LoadNetworkFromResource(TheName);
|
||||
@ -360,6 +362,7 @@ namespace EduNetworkBuilder
|
||||
DebugLevel toFind;
|
||||
int mycount = 0;
|
||||
string labelname = "";
|
||||
NBSettings oursettings = NB.GetSettings();
|
||||
if (MyMode == LBContents.puzzles)
|
||||
{
|
||||
foreach (Control mycontrol in panelCheckboxes.Controls)
|
||||
@ -376,8 +379,8 @@ namespace EduNetworkBuilder
|
||||
if (mycount == 1)
|
||||
{
|
||||
//We only have one item checked. Store this value for later
|
||||
Properties.Settings.Default.ProcessingLevel = labelname;
|
||||
Properties.Settings.Default.Save();
|
||||
oursettings.ProcessingLevel = labelname;
|
||||
// oursettings.Save();
|
||||
}
|
||||
}
|
||||
if (MyMode == LBContents.messages)
|
||||
@ -406,16 +409,17 @@ namespace EduNetworkBuilder
|
||||
|
||||
private void btnAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
NBSettings oursettings = NB.GetSettings();
|
||||
if (MyMode == LBContents.routes)
|
||||
{
|
||||
AddRoute();
|
||||
}
|
||||
if(MyMode == LBContents.puzzles)
|
||||
{
|
||||
if (Properties.Settings.Default.AutoStartPuzzles != cbLoadPuzzlesAtStart.Checked)
|
||||
if (oursettings.AutoStartPuzzles != cbLoadPuzzlesAtStart.Checked)
|
||||
{
|
||||
Properties.Settings.Default.AutoStartPuzzles = cbLoadPuzzlesAtStart.Checked;
|
||||
Properties.Settings.Default.Save();
|
||||
oursettings.AutoStartPuzzles = cbLoadPuzzlesAtStart.Checked;
|
||||
// oursettings.Save();
|
||||
}
|
||||
Close();
|
||||
}
|
||||
@ -499,13 +503,11 @@ namespace EduNetworkBuilder
|
||||
|
||||
private void btnReset_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Properties.Settings.Default.ScoreList == null)
|
||||
Properties.Settings.Default.ScoreList = new System.Collections.Specialized.StringCollection();
|
||||
DialogResult answer = MessageBox.Show(NB.Translate("LBW_btnResetYouSure"), NB.Translate("LBW_btnResetForget"), MessageBoxButtons.YesNo);
|
||||
if (answer == System.Windows.Forms.DialogResult.Yes)
|
||||
{
|
||||
Properties.Settings.Default.ScoreList.Clear();
|
||||
Properties.Settings.Default.Save();
|
||||
NBSettings oursettings = NB.GetSettings();
|
||||
oursettings.ScoreList.Clear();
|
||||
UpdateForm();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user