Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/18/12 11:00:27 (12 years ago)
Author:
abeham
Message:

#1782:

  • Changed tooltip generation in ProblemInstanceConsumerViewGeneric (typeof(T).Name doesn't work, because T doesn't change miraculously when the selected provider changes). The current solution might not be optimal, maybe include another property "FileFormat" in IProblemInstanceProvider that can then be TSPLIB, QAPLIB, CSV, etc.
  • Set instances combobox to not display a selected instance initially and disabled button in this case. If that still doesn't reduce the confusion, then I think we have to add problem loading on selected index change and do away with the button.
Location:
trunk/sources/HeuristicLab.Problems.Instances.Views/3.3
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.Instances.Views/3.3/ProblemInstanceConsumerViewGeneric.cs

    r7956 r8031  
    6969      importButton.Text = String.Empty;
    7070      importButton.Image = VSImageLibrary.Open;
    71       toolTip.SetToolTip(importButton, "Open a " + GetProblemType() + " problem from file.");
    7271      exportButton.Text = String.Empty;
    7372      exportButton.Image = VSImageLibrary.SaveAs;
    74       toolTip.SetToolTip(exportButton, "Export currently loaded " + GetProblemType() + " problem to a file.");
    7573      libraryInfoButton.Text = String.Empty;
    7674      libraryInfoButton.Image = VSImageLibrary.Help;
     
    160158
    161159    protected string GetProblemType() {
    162       string dataTypeName = typeof(T).Name.Split(new char[] { '.' }, StringSplitOptions.RemoveEmptyEntries).Last();
    163       if (dataTypeName.EndsWith("Data"))
    164         return dataTypeName.Substring(0, dataTypeName.Length - "Data".Length);
    165       else return dataTypeName;
     160      return SelectedProvider.Name;
    166161    }
    167162
     
    169164    protected void SetTooltip() {
    170165      toolTip.SetToolTip(problemInstanceProviderComboBox, GetProviderToolTip());
     166      toolTip.SetToolTip(importButton, "Open a " + GetProblemType() + " problem from file.");
     167      toolTip.SetToolTip(exportButton, "Export currently loaded " + GetProblemType() + " problem to a file.");
    171168      if (SelectedProvider.WebLink != null)
    172169        toolTip.SetToolTip(libraryInfoButton, "Browse to " + SelectedProvider.WebLink.ToString());
  • trunk/sources/HeuristicLab.Problems.Instances.Views/3.3/ProblemInstanceProviderViewGeneric.Designer.cs

    r7967 r8031  
    8585      this.instancesComboBox.TabIndex = 7;
    8686      this.instancesComboBox.DataSourceChanged += new System.EventHandler(this.instancesComboBox_DataSourceChanged);
     87      this.instancesComboBox.SelectedIndexChanged += new System.EventHandler(this.instancesComboBox_SelectedIndexChanged);
    8788      //
    8889      // openFileDialog
  • trunk/sources/HeuristicLab.Problems.Instances.Views/3.3/ProblemInstanceProviderViewGeneric.cs

    r7956 r8031  
    6565        ShowInstanceLoad(dataDescriptors.Count() > 0);
    6666        instancesComboBox.DataSource = dataDescriptors;
     67        instancesComboBox.SelectedIndex = -1;
    6768      }
    6869    }
     
    8384      base.SetEnabledStateOfControls();
    8485      instancesComboBox.Enabled = !ReadOnly && !Locked && Content != null && GenericConsumer != null;
    85       loadButton.Enabled = !ReadOnly && !Locked && Content != null && GenericConsumer != null;
     86      loadButton.Enabled = !ReadOnly && !Locked && Content != null && GenericConsumer != null && instancesComboBox.SelectedIndex >= 0;
    8687    }
    8788
     
    102103        comboBox.Items.Clear();
    103104    }
     105
     106    private void instancesComboBox_SelectedIndexChanged(object sender, System.EventArgs e) {
     107      SetEnabledStateOfControls();
     108    }
    104109  }
    105110}
Note: See TracChangeset for help on using the changeset viewer.