Free cookie consent management tool by TermsFeed Policy Generator

Changeset 6864


Ignore:
Timestamp:
10/04/11 16:14:02 (13 years ago)
Author:
ascheibe
Message:

#1233 show messageboxes instead of exceptions if the username or password is wrong

Location:
branches/HeuristicLab.Hive-3.4/sources
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Administrator/3.3/HeuristicLab.Clients.Hive.Administrator-3.3.csproj

    r6761 r6864  
    147147    <Reference Include="System.Drawing" />
    148148    <Reference Include="System.Runtime.Serialization" />
     149    <Reference Include="System.ServiceModel" />
    149150    <Reference Include="System.Windows.Forms" />
    150151    <Reference Include="System.Windows.Forms.DataVisualization" />
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ResourcesView.cs

    r6761 r6864  
    2323using System.Drawing;
    2424using System.Linq;
     25using System.ServiceModel.Security;
    2526using System.Threading;
    2627using System.Threading.Tasks;
     
    6768      while (!stopProgressTask) {
    6869        int diff = (progressBar.Maximum - progressBar.Minimum) / 10;
    69         progressBar.Value = (progressBar.Value + diff) % progressBar.Maximum;
     70
     71        if (progressBar.InvokeRequired) {
     72          progressBar.Invoke(new Action(delegate() { progressBar.Value = (progressBar.Value + diff) % progressBar.Maximum; }));
     73        } else {
     74          progressBar.Value = (progressBar.Value + diff) % progressBar.Maximum;
     75        }
     76
    7077        //ok, this is not very clever...
    7178        Thread.Sleep(500);
    7279      }
    73       progressBar.Value = progressBar.Minimum;
     80      if (progressBar.InvokeRequired) {
     81        progressBar.Invoke(new Action(delegate() { progressBar.Value = progressBar.Minimum; }));
     82      } else {
     83        progressBar.Value = progressBar.Minimum;
     84      }
    7485    }
    7586
     
    339350      }
    340351
    341       HiveAdminClient.Instance.Refresh();
    342       Content = HiveAdminClient.Instance.Resources;
     352      try {
     353        HiveAdminClient.Instance.Refresh();
     354        Content = HiveAdminClient.Instance.Resources;
     355      }
     356      catch (MessageSecurityException) {
     357        MessageBox.Show("A Message Security error has occured. This normally means that your user name or password is wrong.", "HeuristicLab Hive Administrator", MessageBoxButtons.OK, MessageBoxIcon.Error);
     358      }
    343359    }
    344360
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.JobManager/3.3/HeuristicLab.Clients.Hive.JobManager-3.3.csproj

    r6792 r6864  
    145145    <Reference Include="System.Drawing" />
    146146    <Reference Include="System.Runtime.Serialization" />
     147    <Reference Include="System.ServiceModel" />
    147148    <Reference Include="System.Windows.Forms" />
    148149    <Reference Include="System.Windows.Forms.DataVisualization" />
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveJobManagerView.cs

    r6792 r6864  
    2222using System;
    2323using System.Linq;
     24using System.ServiceModel.Security;
    2425using System.Windows.Forms;
    2526using HeuristicLab.Collections;
     
    7071        hiveExperimentListView.Content = Content.Jobs;
    7172        if (Content != null)
    72           Content.RefreshAsync(new Action<Exception>((Exception ex) => ErrorHandling.ShowErrorDialog(this, "Refresh failed.", ex)));
     73          Content.RefreshAsync(new Action<Exception>((Exception ex) => HandleServiceException(ex)));
    7374      }
    7475    }
     
    101102
    102103    private void refreshButton_Click(object sender, EventArgs e) {
    103       Content.RefreshAsync(new Action<Exception>((Exception ex) => ErrorHandling.ShowErrorDialog(this, "Refresh failed.", ex)));
     104      Content.RefreshAsync(new Action<Exception>((Exception ex) => HandleServiceException(ex)));
     105    }
     106
     107    private void HandleServiceException(Exception ex) {
     108      if (ex is MessageSecurityException) {
     109        MessageBox.Show("A Message Security error has occured. This normally means that your user name or password is wrong.", "HeuristicLab Hive Administrator", MessageBoxButtons.OK, MessageBoxIcon.Error);
     110      } else {
     111        ErrorHandling.ShowErrorDialog(this, "Refresh failed.", ex);
     112      }
    104113    }
    105114
Note: See TracChangeset for help on using the changeset viewer.