add keyboard shortcut and context menu entry for jump to next warning
This commit is contained in:
@ -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
|
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
|
of the *Output* window showing how many warnings and errors were
|
||||||
detected and how many lines the entire output has. By clicking on the
|
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.
|
line with a warning or error.
|
||||||
|
|
||||||
By default, the *Output* window is replaced each time a run is started.
|
By default, the *Output* window is replaced each time a run is started.
|
||||||
|
|||||||
@ -79,6 +79,8 @@ LogWindow::LogWindow(const QString &_filename, QWidget *parent) :
|
|||||||
connect(action, &QShortcut::activated, this, &LogWindow::extract_yaml);
|
connect(action, &QShortcut::activated, this, &LogWindow::extract_yaml);
|
||||||
action = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_Q), this);
|
action = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_Q), this);
|
||||||
connect(action, &QShortcut::activated, this, &LogWindow::quit);
|
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);
|
action = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_Slash), this);
|
||||||
connect(action, &QShortcut::activated, this, &LogWindow::stop_run);
|
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));
|
action->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_Y));
|
||||||
connect(action, &QAction::triggered, this, &LogWindow::extract_yaml);
|
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 = menu->addAction("&Close Window", this, &QWidget::close);
|
||||||
action->setIcon(QIcon(":/icons/window-close.png"));
|
action->setIcon(QIcon(":/icons/window-close.png"));
|
||||||
action->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_W));
|
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());
|
menu->exec(event->globalPos());
|
||||||
delete menu;
|
delete menu;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user