Skip to content
This repository has been archived by the owner on May 21, 2021. It is now read-only.

Commit

Permalink
SEBWIN-79 Also added this fix in:
Browse files Browse the repository at this point in the history
- Save As
- Exit with task bar button
- Exit when form is closed.

In the following cases also added checking for unconfirmed passwords:
- Open Settings (button, menu)
- Open settings by drag-and-drop
- Revert Settings to Default/Local Client/Last Opened
- Use Current Settings to Edit Duplicate/Configure Client/Apply and Start SEB
  • Loading branch information
danschlet committed Apr 4, 2017
1 parent 1c23093 commit a9296e3
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions SebWindowsConfig/SebWindowsConfigForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1026,6 +1026,12 @@ private int checkSettingsChanged()

private void buttonOpenSettings_Click(object sender, EventArgs e)
{
// Check if there are unconfirmed passwords, if yes show an alert and abort saving
if (ArePasswordsUnconfirmed()) return;

// Commit cells which are being edited in DataGridViews
CommitEditingInDataGridViews();

// Check if settings changed since last saved/opened
int result = checkSettingsChanged();
// User selected cancel, abort
Expand Down Expand Up @@ -1072,6 +1078,12 @@ private void buttonOpenSettings_Click(object sender, EventArgs e)

public void openSettingsFile(string filePath)
{
// Check if there are unconfirmed passwords, if yes show an alert and abort saving
if (ArePasswordsUnconfirmed()) return;

// Commit cells which are being edited in DataGridViews
CommitEditingInDataGridViews();

// Check if settings changed since last saved/opened
int result = checkSettingsChanged();
// User selected cancel, abort
Expand Down Expand Up @@ -1225,6 +1237,12 @@ private void buttonSaveSettingsAs_Click(object sender, EventArgs e)

private void buttonRevertToDefaultSettings_Click(object sender, EventArgs e)
{
// Check if there are unconfirmed passwords, if yes show an alert and abort saving
if (ArePasswordsUnconfirmed()) return;

// Commit cells which are being edited in DataGridViews
CommitEditingInDataGridViews();

// Check if settings changed since last saved/opened
int result = checkSettingsChanged();
// User selected cancel, abort
Expand Down Expand Up @@ -1260,6 +1278,12 @@ private void buttonRevertToDefaultSettings_Click(object sender, EventArgs e)

private void buttonRevertToLocalClientSettings_Click(object sender, EventArgs e)
{
// Check if there are unconfirmed passwords, if yes show an alert and abort saving
if (ArePasswordsUnconfirmed()) return;

// Commit cells which are being edited in DataGridViews
CommitEditingInDataGridViews();

// Check if settings changed since last saved/opened
int result = checkSettingsChanged();
// User selected cancel, abort
Expand Down Expand Up @@ -1297,6 +1321,12 @@ private void buttonRevertToLocalClientSettings_Click(object sender, EventArgs e)

private void buttonRevertToLastOpened_Click(object sender, EventArgs e)
{
// Check if there are unconfirmed passwords, if yes show an alert and abort saving
if (ArePasswordsUnconfirmed()) return;

// Commit cells which are being edited in DataGridViews
CommitEditingInDataGridViews();

// Check if settings changed since last saved/opened
int result = checkSettingsChanged();
// User selected cancel, abort
Expand All @@ -1321,6 +1351,12 @@ private void buttonRevertToLastOpened_Click(object sender, EventArgs e)

private void buttonEditDuplicate_Click(object sender, EventArgs e)
{
// Check if there are unconfirmed passwords, if yes show an alert and abort saving
if (ArePasswordsUnconfirmed()) return;

// Commit cells which are being edited in DataGridViews
CommitEditingInDataGridViews();

// Check if settings changed since last saved/opened
int result = checkSettingsChanged();
// User selected cancel, abort
Expand Down Expand Up @@ -1386,6 +1422,12 @@ private void buttonEditDuplicate_Click(object sender, EventArgs e)

private void buttonConfigureClient_Click(object sender, EventArgs e)
{
// Check if there are unconfirmed passwords, if yes show an alert and abort saving
if (ArePasswordsUnconfirmed()) return;

// Commit cells which are being edited in DataGridViews
CommitEditingInDataGridViews();

// Get the path to the local client settings configuration file
StringBuilder sebClientSettingsAppDataBuilder = new StringBuilder(SEBClientInfo.SebClientSettingsAppDataDirectory).Append(SEBClientInfo.SEB_CLIENT_CONFIG);
string filename = sebClientSettingsAppDataBuilder.ToString();
Expand Down Expand Up @@ -1421,6 +1463,12 @@ private void buttonConfigureClient_Click(object sender, EventArgs e)

private void buttonApplyAndStartSEB_Click(object sender, EventArgs e)
{
// Check if there are unconfirmed passwords, if yes show an alert and abort saving
if (ArePasswordsUnconfirmed()) return;

// Commit cells which are being edited in DataGridViews
CommitEditingInDataGridViews();

// Check if settings changed and save them if yes
// Generate current Browser Exam Key
string currentBrowserExamKey = SEBProtectionController.ComputeBrowserExamKey();
Expand Down

0 comments on commit a9296e3

Please sign in to comment.