add keyboard shortcut and context menu entry for jump to next warning

This commit is contained in:
Axel Kohlmeyer
2024-12-29 11:27:16 -05:00
parent b6714794c7
commit 644e8064d4
2 changed files with 11 additions and 1 deletions

View File

@ -284,7 +284,8 @@ warnings or errors in the LAMMPS output, they are highlighted by using
bold text colored in red. There is a small panel at the bottom center
of the *Output* window showing how many warnings and errors were
detected and how many lines the entire output has. By clicking on the
button on the right with the warning symbol, you can jump to the next
button on the right with the warning symbol or by using the keyboard
shortcut `Ctrl-N` (`Command-N` on macOS), you can jump to the next
line with a warning or error.
By default, the *Output* window is replaced each time a run is started.

View File

@ -79,6 +79,8 @@ LogWindow::LogWindow(const QString &_filename, QWidget *parent) :
connect(action, &QShortcut::activated, this, &LogWindow::extract_yaml);
action = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_Q), this);
connect(action, &QShortcut::activated, this, &LogWindow::quit);
action = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_N), this);
connect(action, &QShortcut::activated, this, &LogWindow::next_warning);
action = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_Slash), this);
connect(action, &QShortcut::activated, this, &LogWindow::stop_run);
@ -213,9 +215,16 @@ void LogWindow::contextMenuEvent(QContextMenuEvent *event)
action->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_Y));
connect(action, &QAction::triggered, this, &LogWindow::extract_yaml);
}
action = menu->addAction("&Jump to next warning or error", this, &LogWindow::next_warning);
action->setIcon(QIcon(":/icons/warning.png"));
action->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_N));
menu->addSeparator();
action = menu->addAction("&Close Window", this, &QWidget::close);
action->setIcon(QIcon(":/icons/window-close.png"));
action->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_W));
action = menu->addAction("&Quit LAMMPS-GUI", this, &LogWindow::quit);
action->setIcon(QIcon(":/icons/application-exit.png"));
action->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_Q));
menu->exec(event->globalPos());
delete menu;
}