Add menu entries to open LAMMPS tutorial website
This commit is contained in:
@ -775,6 +775,11 @@ void CodeEditor::contextMenuEvent(QContextMenuEvent *event)
|
||||
action->setData(QString());
|
||||
connect(action, &QAction::triggered, this, &CodeEditor::open_help);
|
||||
|
||||
action = menu->addAction(QString("LAMMPS Tutorial"));
|
||||
action->setIcon(QIcon(":/icons/help-tutorial.png"));
|
||||
action->setData(QString("https://lammpstutorials.github.io/"));
|
||||
connect(action, &QAction::triggered, this, &CodeEditor::open_url);
|
||||
|
||||
menu->exec(event->globalPos());
|
||||
delete menu;
|
||||
}
|
||||
@ -1208,6 +1213,12 @@ void CodeEditor::open_help()
|
||||
QUrl(QString("https://docs.lammps.org/%1").arg(act->data().toString())));
|
||||
}
|
||||
|
||||
void CodeEditor::open_url()
|
||||
{
|
||||
auto *act = qobject_cast<QAction *>(sender());
|
||||
QDesktopServices::openUrl(QUrl(act->data().toString()));
|
||||
}
|
||||
|
||||
void CodeEditor::view_file()
|
||||
{
|
||||
auto *act = qobject_cast<QAction *>(sender());
|
||||
|
||||
Reference in New Issue
Block a user