Free cookie consent management tool by TermsFeed Policy Generator

Changeset 1394


Ignore:
Timestamp:
03/21/09 16:41:32 (16 years ago)
Author:
gkronber
Message:

Fixed #526 (UI feedback when starting plugin-manager). Mouse cursor is changed before loading the plugin manager form and set back to normal once all plugins are loaded.

Location:
trunk/sources
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.PluginInfrastructure.GUI/ManagerForm.cs

    r918 r1394  
    4848      InitializeComponent();
    4949      InitializePlugins();
     50      Cursor = Cursors.Arrow;
    5051    }
    5152
  • trunk/sources/HeuristicLab/MainForm.cs

    r1392 r1394  
    6969      applicationsListView.Items.Add(pluginManagerListViewItem);
    7070
    71       foreach(ApplicationInfo info in PluginManager.Manager.InstalledApplications) {
     71      foreach (ApplicationInfo info in PluginManager.Manager.InstalledApplications) {
    7272        ListViewItem item = new ListViewItem(info.Name, 0);
    7373        item.Tag = info;
     
    8181
    8282    private void applicationsListView_ItemActivate(object sender, EventArgs e) {
    83       if(applicationsListView.SelectedItems.Count > 0) {
     83      if (applicationsListView.SelectedItems.Count > 0) {
    8484        ListViewItem selected = applicationsListView.SelectedItems[0];
    85         if(selected == pluginManagerListViewItem) {
    86           ManagerForm form = new ManagerForm();
    87           this.Visible = false;
    88           form.ShowDialog(this);
    89           RefreshApplicationsList();
    90           this.Visible = true;
     85        if (selected == pluginManagerListViewItem) {
     86          try {
     87            Cursor = Cursors.AppStarting;
     88            ManagerForm form = new ManagerForm();
     89            this.Visible = false;
     90            form.ShowDialog(this);
     91            RefreshApplicationsList();
     92            this.Visible = true;
     93          }
     94          finally {
     95            Cursor = Cursors.Arrow;
     96          }
    9197        } else {
    9298          ApplicationInfo app = (ApplicationInfo)applicationsListView.SelectedItems[0].Tag;
     
    99105            do {
    100106              try {
    101                 if(!abortRequested)
     107                if (!abortRequested)
    102108                  PluginManager.Manager.Run(app);
    103109                stopped = true;
    104               } catch(Exception ex) {
     110              }
     111              catch (Exception ex) {
    105112                stopped = false;
    106113                ThreadPool.QueueUserWorkItem(delegate(object exception) { ShowErrorMessageBox((Exception)exception); }, ex);
    107114                Thread.Sleep(5000); // sleep 5 seconds before autorestart
    108115              }
    109             } while(!abortRequested && !stopped && app.AutoRestart);
     116            } while (!abortRequested && !stopped && app.AutoRestart);
    110117          });
    111118          t.SetApartmentState(ApartmentState.STA); // needed for the AdvancedOptimizationFrontent
     
    116123
    117124    private void applicationsListBox_SelectedIndexChanged(object sender, ListViewItemSelectionChangedEventArgs e) {
    118       if(e.IsSelected) {
     125      if (e.IsSelected) {
    119126        startButton.Enabled = true;
    120127      } else {
     
    145152      sb.Append("Sorry, but something went wrong!\n\n" + ex.Message + "\n\n" + ex.StackTrace);
    146153
    147       while(ex.InnerException != null) {
     154      while (ex.InnerException != null) {
    148155        ex = ex.InnerException;
    149156        sb.Append("\n\n-----\n\n" + ex.Message + "\n\n" + ex.StackTrace);
Note: See TracChangeset for help on using the changeset viewer.