Skip to content

Commit

Permalink
Show the description of solvers when user mouse over the solver drop …
Browse files Browse the repository at this point in the history
…down.
  • Loading branch information
adeas31 committed Feb 2, 2016
1 parent ee4e7b6 commit 1ebc13b
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 0 deletions.
22 changes: 22 additions & 0 deletions OMEdit/OMEditGUI/Options/OptionsDialog.cpp
Expand Up @@ -2555,6 +2555,7 @@ SimulationPage::SimulationPage(OptionsDialog *pOptionsDialog)
mpMatchingAlgorithmComboBox->setItemData(i, matchingAlgorithmComments[i], Qt::ToolTipRole);
i++;
}
connect(mpMatchingAlgorithmComboBox, SIGNAL(currentIndexChanged(int)), SLOT(updateMatchingAlgorithmToolTip(int)));
mpMatchingAlgorithmComboBox->setCurrentIndex(mpMatchingAlgorithmComboBox->findText(mpOptionsDialog->getMainWindow()->getOMCProxy()->getMatchingAlgorithm()));
// Index Reduction Method
mpIndexReductionMethodLabel = new Label(tr("Index Reduction Method:"));
Expand All @@ -2567,6 +2568,7 @@ SimulationPage::SimulationPage(OptionsDialog *pOptionsDialog)
mpIndexReductionMethodComboBox->setItemData(i, indexReductionMethodComments[i], Qt::ToolTipRole);
i++;
}
connect(mpIndexReductionMethodComboBox, SIGNAL(currentIndexChanged(int)), SLOT(updateIndexReductionToolTip(int)));
mpIndexReductionMethodComboBox->setCurrentIndex(mpIndexReductionMethodComboBox->findText(mpOptionsDialog->getMainWindow()->getOMCProxy()->getIndexReductionMethod()));
// Target Language
mpTargetLanguageLabel = new Label(tr("Target Language:"));
Expand Down Expand Up @@ -2659,6 +2661,26 @@ QString SimulationPage::getOutputMode()
}
}

/*!
* \brief SimulationPage::updateMatchingAlgorithmToolTip
* Updates the matching algorithm combobox tooltip.
* \param index
*/
void SimulationPage::updateMatchingAlgorithmToolTip(int index)
{
mpMatchingAlgorithmComboBox->setToolTip(mpMatchingAlgorithmComboBox->itemData(index, Qt::ToolTipRole).toString());
}

/*!
* \brief SimulationPage::updateIndexReductionToolTip
* Updates the index reduction combobox tooltip.
* \param index
*/
void SimulationPage::updateIndexReductionToolTip(int index)
{
mpIndexReductionMethodComboBox->setToolTip(mpIndexReductionMethodComboBox->itemData(index, Qt::ToolTipRole).toString());
}

//! @class MessagesPage
//! @brief Creates an interface for MessagesWidget settings.

Expand Down
3 changes: 3 additions & 0 deletions OMEdit/OMEditGUI/Options/OptionsDialog.h
Expand Up @@ -482,6 +482,9 @@ class SimulationPage : public QWidget
QGroupBox *mpOutputGroupBox;
QRadioButton *mpStructuredRadioButton;
QRadioButton *mpFormattedTextRadioButton;
public slots:
void updateMatchingAlgorithmToolTip(int index);
void updateIndexReductionToolTip(int index);
};

class MessagesPage : public QWidget
Expand Down
11 changes: 11 additions & 0 deletions OMEdit/OMEditGUI/Simulation/SimulationDialog.cpp
Expand Up @@ -154,6 +154,7 @@ void SimulationDialog::setUpForm()
for (int i = 0 ; i < solverMethodsDesc.size() ; i++) {
mpMethodComboBox->setItemData(i, solverMethodsDesc.at(i), Qt::ToolTipRole);
}
connect(mpMethodComboBox, SIGNAL(currentIndexChanged(int)), SLOT(updateMethodToolTip(int)));
// make dassl default solver method.
int currentIndex = mpMethodComboBox->findText("dassl", Qt::MatchExactly);
if (currentIndex > -1) {
Expand Down Expand Up @@ -1102,6 +1103,16 @@ void SimulationDialog::simulationProcessFinished(SimulationOptions simulationOpt
}
}

/*!
* \brief SimulationDialog::updateMethodToolTip
* Updates the Method combobox tooltip.
* \param index
*/
void SimulationDialog::updateMethodToolTip(int index)
{
mpMethodComboBox->setToolTip(mpMethodComboBox->itemData(index, Qt::ToolTipRole).toString());
}

/*!
Slot activated when mpMethodComboBox currentIndexChanged signal is raised.\n
Enables/disables the Dassl options group box
Expand Down
1 change: 1 addition & 0 deletions OMEdit/OMEditGUI/Simulation/SimulationDialog.h
Expand Up @@ -210,6 +210,7 @@ class SimulationDialog : public QDialog
void showAlgorithmicDebugger(SimulationOptions simulationOptions);
void simulationProcessFinished(SimulationOptions simulationOptions, QDateTime resultFileLastModifiedDateTime);
public slots:
void updateMethodToolTip(int index);
void enableDasslOptions(QString method);
void showIntegrationHelp();
void buildOnly(bool checked);
Expand Down

0 comments on commit 1ebc13b

Please sign in to comment.