Skip to content

Commit

Permalink
Implementation of Localization and new Logs.Manager/GUI.LogsViewer
Browse files Browse the repository at this point in the history
  • Loading branch information
iSmokeDrow committed Sep 22, 2019
1 parent 2e0e981 commit e7fe4aa
Show file tree
Hide file tree
Showing 34 changed files with 1,212 additions and 1,388 deletions.
10 changes: 7 additions & 3 deletions GUI/BitFlag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Grimoire.Utilities;

namespace Grimoire.GUI
{
Expand All @@ -21,6 +22,7 @@ public BitFlag()
InitializeComponent();
lManager = Logs.Manager.Instance;

localize();
}

public BitFlag(int vector)
Expand All @@ -29,6 +31,7 @@ public BitFlag(int vector)
lManager = Logs.Manager.Instance;

defaultFlag = vector;
localize();
}

#endregion
Expand Down Expand Up @@ -58,7 +61,8 @@ public int Flag
}
set { flag = value; }
}


XmlManager xMan = XmlManager.Instance;

#endregion

Expand Down Expand Up @@ -226,9 +230,9 @@ private void clear_on_list_change_CheckedChanged(object sender, EventArgs e)
Utilities.OPT.Update("flag.clear_on_list_change", Convert.ToInt32(clear_on_change_chkBx.Checked).ToString());
}

void load_strings()
void localize()
{
clear_on_change_chkBx.Text = strings.clear_on_change;
xMan.Localize(this, Localization.Enums.SenderType.GUI);
}
}
}
8 changes: 5 additions & 3 deletions GUI/DataRebuild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using System.Windows.Forms.DataVisualization.Charting;
using System.Windows.Forms;
using DataCore;
using Grimoire.Utilities;

namespace Grimoire.GUI
{
Expand All @@ -19,6 +20,7 @@ public partial class DataRebuild : Form
Tabs.Manager tManager = Tabs.Manager.Instance;
Logs.Manager lManager = Logs.Manager.Instance;
DataCore.Core core = null;
XmlManager xMan = XmlManager.Instance;

public DataRebuild()
{
Expand All @@ -27,7 +29,7 @@ public DataRebuild()
hook_core_events();
dataChart.Series.Add(new Series() { Name = "All Data", ChartType = SeriesChartType.Pie });
dataList.Items[0].Selected = true;
load_strings();
localize();
}

private void hook_core_events()
Expand Down Expand Up @@ -183,9 +185,9 @@ private void cleanup(int dataId)

}

public void load_strings()
public void localize()
{
rebuildBtn.Text = strings.rebuildBtn;
xMan.Localize(this, Localization.Enums.SenderType.GUI);
}
}
}
11 changes: 7 additions & 4 deletions GUI/Input.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
using System;
using System.Windows.Forms;
using Grimoire.Utilities;

namespace Grimoire.GUI
{
public partial class InputBox : Form
{
XmlManager xMan = XmlManager.Instance;

public InputBox(string description, string defaultText)
{
InitializeComponent();
Text = description;
input.Text = defaultText;
DialogResult = DialogResult.Cancel;
load_strings();
localize();
}

public InputBox(string description, bool resizable)
Expand All @@ -21,7 +24,7 @@ public InputBox(string description, bool resizable)
this.FormBorderStyle = (resizable) ? FormBorderStyle.SizableToolWindow : FormBorderStyle.FixedToolWindow;
input.Multiline = resizable;
DialogResult = DialogResult.Cancel;
load_strings();
localize();
}

public string Value { get { return (input.Text.Length > 0) ? input.Text : null; } set { input.Text = value; } }
Expand All @@ -37,9 +40,9 @@ private void InputBox_Shown(object sender, EventArgs e)
input.Focus();
}

private void load_strings()
private void localize()
{
okBtn.Text = strings.okBtn;
xMan.Localize(this, Localization.Enums.SenderType.GUI);
}
}
}
34 changes: 17 additions & 17 deletions GUI/ListInput.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions GUI/ListInput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,20 @@
using System.Threading.Tasks;
using System.Windows.Forms;
using Daedalus.Structures;
using Grimoire.Utilities;

namespace Grimoire.GUI
{
public partial class ListInput : Form
{
XmlManager xMan = XmlManager.Instance;

Cell[] cells = null;

public ListInput()
{
InitializeComponent();
load_strings();
localize();
}

public ListInput(string description, Cell[] cells)
Expand All @@ -30,7 +33,7 @@ public ListInput(string description, Cell[] cells)

populateList();

load_strings();
localize();
}

public ListInput(string description, string[] selections)
Expand Down Expand Up @@ -71,10 +74,9 @@ private void ok_btn_Click(object sender, EventArgs e)
Hide();
}

private void load_strings()
private void localize()
{
descLbl.Text = strings.descLbl;
inputLbl.Text = strings.inputLbl;
xMan.Localize(this, Localization.Enums.SenderType.GUI);
}

private void ListInput_Shown(object sender, EventArgs e)
Expand Down
9 changes: 6 additions & 3 deletions GUI/ListSelect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,20 @@
using System.Collections.Generic;
using DataCore.Structures;
using System.Windows.Forms;
using Grimoire.Utilities;

namespace Grimoire.GUI
{
public partial class ListSelect : Form
{
XmlManager xMan = XmlManager.Instance;

public ListSelect(string title, List<IndexEntry> selections)
{
this.Text = title;
InitializeComponent();
populateList(selections);
load_strings();
localize();
}

public string SelectedText
Expand Down Expand Up @@ -40,9 +43,9 @@ private void list_DoubleClick(object sender, EventArgs e)
Close();
}

private void load_strings()
private void localize()
{
okBtn.Text = strings.okBtn;
xMan.Localize(this, Localization.Enums.SenderType.GUI);
}
}
}
80 changes: 40 additions & 40 deletions GUI/LogViewer.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e7fe4aa

Please sign in to comment.