Skip to content

Commit

Permalink
Merge pull request #743 from ghutchis/add-ellipsis-generators
Browse files Browse the repository at this point in the history
Add "..." to all input generators to indicate opening a dialog
  • Loading branch information
ghutchis authored Aug 19, 2021
2 parents 4db1722 + 4fc5f9f commit 62c0d51
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 8 deletions.
4 changes: 2 additions & 2 deletions avogadro/qtplugins/apbs/apbs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ Apbs::Apbs(QObject* parent_)
m_progressDialog(nullptr), m_dialog(nullptr)
{
QAction* action = new QAction(this);
action->setText(tr("Run APBS"));
action->setText(tr("Run APBS..."));
connect(action, SIGNAL(triggered()), this, SLOT(onRunApbs()));
m_actions.append(action);

action = new QAction(this);
action->setText(tr("Open Output File"));
action->setText(tr("Open Output File..."));
connect(action, SIGNAL(triggered()), this, SLOT(onOpenOutputFile()));
m_actions.append(action);
}
Expand Down
2 changes: 1 addition & 1 deletion avogadro/qtplugins/cp2kinput/cp2kinput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Cp2kInput::Cp2kInput(QObject* parent_)
m_dialog(nullptr), m_outputFormat(nullptr)
{
m_action->setEnabled(true);
m_action->setText(tr("&CP2K"));
m_action->setText(tr("&CP2K..."));
connect(m_action, SIGNAL(triggered()), SLOT(menuActivated()));
}

Expand Down
2 changes: 1 addition & 1 deletion avogadro/qtplugins/gamessinput/gamessinput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ GamessInput::GamessInput(QObject* parent_)
m_dialog(nullptr), m_outputFormat(nullptr)
{
m_action->setEnabled(true);
m_action->setText(tr("&GAMESS"));
m_action->setText(tr("&GAMESS..."));
connect(m_action, SIGNAL(triggered()), SLOT(menuActivated()));
}

Expand Down
2 changes: 1 addition & 1 deletion avogadro/qtplugins/lammpsinput/lammpsinput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ LammpsInput::LammpsInput(QObject* parent_)
m_dialog(nullptr), m_outputFormat(nullptr)
{
m_action->setEnabled(true);
m_action->setText(tr("&LAMMPS Input"));
m_action->setText(tr("&LAMMPS..."));
connect(m_action, SIGNAL(triggered()), SLOT(menuActivated()));
}

Expand Down
2 changes: 1 addition & 1 deletion avogadro/qtplugins/openmminput/openmminput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ OpenMMInput::OpenMMInput(QObject* parent_)
m_dialog(nullptr), m_outputFormat(nullptr)
{
m_action->setEnabled(true);
m_action->setText(tr("&OpenMM Script Builder"));
m_action->setText(tr("&OpenMM Script..."));
connect(m_action, SIGNAL(triggered()), SLOT(menuActivated()));
}

Expand Down
8 changes: 6 additions & 2 deletions avogadro/qtplugins/quantuminput/quantuminput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,15 @@ void QuantumInput::updateActions()
QStringList scripts = m_inputGeneratorScripts.values(programName);
// Include the full path if there are multiple generators with the same
// name.
QString label = programName;
if (!label.endsWith("..."))
label.append("...");

if (scripts.size() == 1) {
addAction(programName, scripts.first());
addAction(label, scripts.first());
} else {
foreach (const QString& filePath, scripts) {
addAction(QString("%1 (%2)").arg(programName, filePath), filePath);
addAction(QString("%1 (%2)").arg(label, filePath), filePath);
}
}
}
Expand Down

0 comments on commit 62c0d51

Please sign in to comment.