Qt: Move soloar sensor menu items into submenu

This commit is contained in:
Jeffrey Pfau 2015-03-13 00:11:10 -07:00
parent 943b805306
commit d9797cf084
1 changed files with 9 additions and 9 deletions

View File

@ -698,22 +698,22 @@ void Window::setupMenu(QMenuBar* menubar) {
addControlledAction(toolsMenu, gdbWindow, "gdbWindow");
#endif
toolsMenu->addSeparator();
QAction* solarIncrease = new QAction(tr("Increase solar level"), toolsMenu);
QMenu* solarMenu = toolsMenu->addMenu(tr("Solar sensor"));
QAction* solarIncrease = new QAction(tr("Increase solar level"), solarMenu);
connect(solarIncrease, SIGNAL(triggered()), m_controller, SLOT(increaseLuminanceLevel()));
addControlledAction(toolsMenu, solarIncrease, "increaseLuminanceLevel");
addControlledAction(solarMenu, solarIncrease, "increaseLuminanceLevel");
QAction* solarDecrease = new QAction(tr("Decrease solar level"), toolsMenu);
QAction* solarDecrease = new QAction(tr("Decrease solar level"), solarMenu);
connect(solarDecrease, SIGNAL(triggered()), m_controller, SLOT(decreaseLuminanceLevel()));
addControlledAction(toolsMenu, solarDecrease, "decreaseLuminanceLevel");
addControlledAction(solarMenu, solarDecrease, "decreaseLuminanceLevel");
QAction* maxSolar = new QAction(tr("Brightest solar level"), toolsMenu);
QAction* maxSolar = new QAction(tr("Brightest solar level"), solarMenu);
connect(maxSolar, &QAction::triggered, [this]() { m_controller->setLuminanceLevel(10); });
addControlledAction(toolsMenu, maxSolar, "maxLuminanceLevel");
addControlledAction(solarMenu, maxSolar, "maxLuminanceLevel");
QAction* minSolar = new QAction(tr("Darkest solar level"), toolsMenu);
QAction* minSolar = new QAction(tr("Darkest solar level"), solarMenu);
connect(minSolar, &QAction::triggered, [this]() { m_controller->setLuminanceLevel(0); });
addControlledAction(toolsMenu, minSolar, "minLuminanceLevel");
addControlledAction(solarMenu, minSolar, "minLuminanceLevel");
toolsMenu->addSeparator();
addControlledAction(toolsMenu, toolsMenu->addAction(tr("Settings..."), this, SLOT(openSettingsWindow())), "settings");