From d87a39d43209362b172c6a5557effe42bd155975 Mon Sep 17 00:00:00 2001 From: "Raine M. Ekman" Date: Tue, 7 Apr 2015 21:52:56 +0300 Subject: [PATCH 1/2] View menu: added toggle for piano roll note labels --- src/gui/MainWindow.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 78df3798b..9c435a30f 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -1086,7 +1086,6 @@ void MainWindow::updateViewMenu() m_viewMenu->addAction(qa); */ - // Should be doable. qa = new QAction(tr( "Smooth scroll" ), this); qa->setData("smoothscroll"); qa->setCheckable( true ); @@ -1102,6 +1101,14 @@ void MainWindow::updateViewMenu() toInt() ? true : false ); m_viewMenu->addAction(qa); */ + + qa = new QAction(tr( "Enable note labels in piano roll" ), this); + qa->setData("printnotelabels"); + qa->setCheckable( true ); + qa->setChecked( ConfigManager::inst()->value( "ui", "printnotelabels" ). + toInt() ? true : false ); + m_viewMenu->addAction(qa); + } @@ -1130,6 +1137,11 @@ void MainWindow::updateConfig( QAction * _who ) ConfigManager::inst()->setValue( "ui", "oneinstrumenttrackwindow", QString::number(checked) ); } + else if ( tag == "printnotelabels" ) + { + ConfigManager::inst()->setValue( "ui", "printnotelabels", + QString::number(checked) ); + } } From c56ebb2e48736b182e1d2c16010c9f53880b7309 Mon Sep 17 00:00:00 2001 From: "Raine M. Ekman" Date: Wed, 8 Apr 2015 12:16:45 +0300 Subject: [PATCH 2/2] View menu: Removed unnecessary ternary operators --- src/gui/MainWindow.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 9c435a30f..0c62bf6b4 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -1073,40 +1073,35 @@ void MainWindow::updateViewMenu() qa = new QAction(tr( "Volume as dBV" ), this); qa->setData("displaydbv"); qa->setCheckable( true ); - qa->setChecked( ConfigManager::inst()->value( "app", "displaydbv" ). - toInt() ? true : false ); + qa->setChecked( ConfigManager::inst()->value( "app", "displaydbv" ).toInt() ); m_viewMenu->addAction(qa); // Maybe this is impossible? /* qa = new QAction(tr( "Tooltips" ), this); qa->setData("tooltips"); qa->setCheckable( true ); - qa->setChecked( ConfigManager::inst()->value( "tooltips", "disabled" ). - toInt() ? false : true ); + qa->setChecked( !ConfigManager::inst()->value( "tooltips", "disabled" ).toInt() ); m_viewMenu->addAction(qa); */ qa = new QAction(tr( "Smooth scroll" ), this); qa->setData("smoothscroll"); qa->setCheckable( true ); - qa->setChecked( ConfigManager::inst()->value( "ui", "smoothscroll" ). - toInt() ? true : false ); + qa->setChecked( ConfigManager::inst()->value( "ui", "smoothscroll" ).toInt() ); m_viewMenu->addAction(qa); // Not yet. /* qa = new QAction(tr( "One instrument track window" ), this); qa->setData("oneinstrument"); qa->setCheckable( true ); - qa->setChecked( ConfigManager::inst()->value( "ui", "oneinstrumenttrackwindow" ). - toInt() ? true : false ); + qa->setChecked( ConfigManager::inst()->value( "ui", "oneinstrumenttrackwindow" ).toInt() ); m_viewMenu->addAction(qa); */ qa = new QAction(tr( "Enable note labels in piano roll" ), this); qa->setData("printnotelabels"); qa->setCheckable( true ); - qa->setChecked( ConfigManager::inst()->value( "ui", "printnotelabels" ). - toInt() ? true : false ); + qa->setChecked( ConfigManager::inst()->value( "ui", "printnotelabels" ).toInt() ); m_viewMenu->addAction(qa); }