mirror of
https://github.com/LMMS/lmms.git
synced 2026-04-02 05:16:40 -04:00
Added view menu
To be reviewed and reverted if undesired. Based on https://sourceforge.net/p/lmms/patches/38/ Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
This commit is contained in:
committed by
Tobias Doerffel
parent
15e759b6d3
commit
96882f44d5
@@ -74,7 +74,8 @@ MainWindow::MainWindow() :
|
||||
m_templatesMenu( NULL ),
|
||||
m_recentlyOpenedProjectsMenu( NULL ),
|
||||
m_toolsMenu( NULL ),
|
||||
m_autoSaveTimer( this )
|
||||
m_autoSaveTimer( this ),
|
||||
m_viewMenu( NULL )
|
||||
{
|
||||
setAttribute( Qt::WA_DeleteOnClose );
|
||||
|
||||
@@ -300,6 +301,13 @@ void MainWindow::finalize()
|
||||
tr( "Settings" ),
|
||||
this, SLOT( showSettingsDialog() ) );
|
||||
|
||||
m_viewMenu = new QMenu( this );
|
||||
menuBar()->addMenu( m_viewMenu )->setText( tr( "&View" ) );
|
||||
connect( m_viewMenu, SIGNAL( aboutToShow() ),
|
||||
this, SLOT( updateViewMenu() ) );
|
||||
connect( m_viewMenu, SIGNAL(triggered(QAction*)), this,
|
||||
SLOT(updateConfig(QAction*)));
|
||||
|
||||
|
||||
m_toolsMenu = new QMenu( this );
|
||||
Plugin::DescriptorList pluginDescriptors;
|
||||
@@ -1008,6 +1016,111 @@ void MainWindow::toggleFxMixerWin()
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::updateViewMenu()
|
||||
{
|
||||
m_viewMenu->clear();
|
||||
// TODO: get current visibility for these and indicate in menu?
|
||||
// Not that it's straight visible <-> invisible, more like
|
||||
// not on top -> top <-> invisible
|
||||
m_viewMenu->addAction(embed::getIconPixmap( "songeditor" ),
|
||||
tr( "Song Editor" ) + " (F5)",
|
||||
this, SLOT( toggleSongEditorWin() )
|
||||
);
|
||||
m_viewMenu->addAction(embed::getIconPixmap( "bb_track" ),
|
||||
tr( "Pattern Editor" ) + " (F6)",
|
||||
this, SLOT( toggleBBEditorWin() )
|
||||
);
|
||||
m_viewMenu->addAction(embed::getIconPixmap( "piano" ),
|
||||
tr( "Piano Roll" ) + " (F7)",
|
||||
this, SLOT( togglePianoRollWin() )
|
||||
);
|
||||
m_viewMenu->addAction(embed::getIconPixmap( "automation" ),
|
||||
tr( "Automation Editor" ) + " (F8)",
|
||||
this,
|
||||
SLOT( toggleAutomationEditorWin())
|
||||
);
|
||||
m_viewMenu->addAction(embed::getIconPixmap( "fx_mixer" ),
|
||||
tr( "FX Mixer" ) + " (F9)",
|
||||
this, SLOT( toggleFxMixerWin() )
|
||||
);
|
||||
m_viewMenu->addAction(embed::getIconPixmap( "project_notes" ),
|
||||
tr( "Project Notes" ) + " (F10)",
|
||||
this, SLOT( toggleProjectNotesWin() )
|
||||
);
|
||||
m_viewMenu->addAction(embed::getIconPixmap( "controller" ),
|
||||
tr( "Show/hide controller rack" ) +
|
||||
" (F11)",
|
||||
this, SLOT( toggleControllerRack() )
|
||||
);
|
||||
|
||||
m_viewMenu->addSeparator();
|
||||
|
||||
// Here we should put all look&feel -stuff from configmanager
|
||||
// that is safe to change on the fly. There is probably some
|
||||
// more elegant way to do this.
|
||||
QAction *qa;
|
||||
qa = new QAction(tr( "Volume as dBV" ), this);
|
||||
qa->setData("displaydbv");
|
||||
qa->setCheckable( true );
|
||||
qa->setChecked( ConfigManager::inst()->value( "app", "displaydbv" ).
|
||||
toInt() ? true : false );
|
||||
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 );
|
||||
m_viewMenu->addAction(qa);
|
||||
*/
|
||||
|
||||
// Should be doable.
|
||||
/* qa = new QAction(tr( "Smooth scroll" ), this);
|
||||
qa->setData("smoothscroll");
|
||||
qa->setCheckable( true );
|
||||
qa->setChecked( ConfigManager::inst()->value( "ui", "smoothscroll" ).
|
||||
toInt() ? true : false );
|
||||
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 );
|
||||
m_viewMenu->addAction(qa);
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::updateConfig( QAction * _who )
|
||||
{
|
||||
QString tag = _who->data().toString();
|
||||
bool checked = _who->isChecked();
|
||||
|
||||
if( tag == "displaydbv" )
|
||||
{
|
||||
ConfigManager::inst()->setValue( "app", "displaydbv",
|
||||
QString::number(checked) );
|
||||
}
|
||||
else if ( tag == "tooltips" )
|
||||
{
|
||||
ConfigManager::inst()->setValue( "tooltips", "disabled",
|
||||
QString::number(!checked) );
|
||||
}
|
||||
else if ( tag == "smoothscroll" )
|
||||
{
|
||||
ConfigManager::inst()->setValue( "ui", "smoothscroll",
|
||||
QString::number(checked) );
|
||||
}
|
||||
else if ( tag == "oneinstrument" )
|
||||
{
|
||||
ConfigManager::inst()->setValue( "ui", "oneinstrumenttrackwindow",
|
||||
QString::number(checked) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::toggleControllerRack()
|
||||
|
||||
Reference in New Issue
Block a user