Commit 21c4d54d authored by Alexander Semke's avatar Alexander Semke
Browse files

Don't shown the "move up" and "move down" actions in the context menu of a...

Don't shown the "move up" and "move down" actions in the context menu of a worksheet entry if the entry is already at the very top or very bottom, respectively.
parent ac0a38a3
......@@ -415,16 +415,20 @@ void WorksheetEntry::populateMenu(QMenu* menu, QPointF pos)
menu->insertSeparator(firstAction);
}
action = new QAction(QIcon::fromTheme(QLatin1String("go-up")), i18n("Move Up"));
// connect(action, &QAction::triggered, this, &WorksheetEntry::moveToPrevious); //TODO: doesn't work
connect(action, SIGNAL(triggered()), this, SLOT(moveToPrevious()));
menu->insertAction(firstAction, action);
if (m_prev) {
action = new QAction(QIcon::fromTheme(QLatin1String("go-up")), i18n("Move Up"));
// connect(action, &QAction::triggered, this, &WorksheetEntry::moveToPrevious); //TODO: doesn't work
connect(action, SIGNAL(triggered()), this, SLOT(moveToPrevious()));
menu->insertAction(firstAction, action);
}
action = new QAction(QIcon::fromTheme(QLatin1String("go-down")), i18n("Move Down"));
// connect(action, &QAction::triggered, this, &WorksheetEntry::moveToNext); //TODO: doesn't work
connect(action, SIGNAL(triggered()), this, SLOT(moveToNext()));
menu->insertAction(firstAction, action);
menu->insertSeparator(firstAction);
if (m_next) {
action = new QAction(QIcon::fromTheme(QLatin1String("go-down")), i18n("Move Down"));
// connect(action, &QAction::triggered, this, &WorksheetEntry::moveToNext); //TODO: doesn't work
connect(action, SIGNAL(triggered()), this, SLOT(moveToNext()));
menu->insertAction(firstAction, action);
menu->insertSeparator(firstAction);
}
action = new QAction(QIcon::fromTheme(QLatin1String("edit-delete")), i18n("Remove"));
connect(action, &QAction::triggered, this, &WorksheetEntry::startRemoving);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment