Skip to content

Commit

Permalink
Improve code
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivier Rogier committed Dec 4, 2021
1 parent 95acdcb commit 7ee9162
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/// You may add additional accurate notices of copyright ownership.
/// </license>
/// <created> 2016-04 </created>
/// <edited> 2021-02 </edited>
/// <edited> 2021-12 </edited>
namespace Ordisoftware.Core;

/// <summary>
Expand Down Expand Up @@ -44,6 +44,12 @@ static partial class SysTranslations
[Language.FR] = "Chargement des données..."
};

static public readonly TranslationsDictionary BindingData = new()
{
[Language.EN] = "Binding data...",
[Language.FR] = "Liaison des données..."
};

static public readonly TranslationsDictionary CreatingData = new()
{
[Language.EN] = "Creating data...",
Expand Down
6 changes: 6 additions & 0 deletions Project/Source/Forms/MainForm/MainForm.SetView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ private sealed class ViewConnector

private int SavedSelectionStart;
private int SavedSelectionLength;
private bool ViewNotebookFirstTime = true;

/// <summary>
/// Sets the view panel.
Expand Down Expand Up @@ -122,6 +123,11 @@ public void SetView(ViewMode view, bool first)
SavedSelectionLength = EditWord.TextBox.SelectionLength;
}
LabelCurrentView.Text = AppTranslations.CurrentViewText[view].GetLang();
if ( view == ViewMode.Notebook && ViewNotebookFirstTime )
{
ViewNotebookFirstTime = false;
ActionNotebookClearLetter.PerformClick();
}
}

}
7 changes: 0 additions & 7 deletions Project/Source/Forms/MainForm/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -431,16 +431,9 @@ private void ActionViewLetters_Click(object sender, EventArgs e)
SetView(ViewMode.Letters);
}

private bool ViewNotebookFirstTime = true;

private void ActionViewNotebook_Click(object sender, EventArgs e)
{
SetView(ViewMode.Notebook);
if ( ViewNotebookFirstTime )
{
ViewNotebookFirstTime = false;
ActionNotebookClearLetter.PerformClick();
}
}

/// <summary>
Expand Down

0 comments on commit 7ee9162

Please sign in to comment.