diff --git a/src/libtomahawk/ActionCollection.cpp b/src/libtomahawk/ActionCollection.cpp index ea5f23e2b..6ce9b0f36 100644 --- a/src/libtomahawk/ActionCollection.cpp +++ b/src/libtomahawk/ActionCollection.cpp @@ -99,44 +99,47 @@ ActionCollection::initActions() connect( m_actionCollection[ "nextTrack" ], SIGNAL( triggered() ), ae, SLOT( next() ), Qt::UniqueConnection ); // main menu actions - m_actionCollection[ "loadXSPF" ] = new QAction( tr( "Load &XSPF..." ), this ); - m_actionCollection[ "updateCollection" ] = new QAction( tr( "U&pdate Collection" ), this ); - m_actionCollection[ "rescanCollection" ] = new QAction( tr( "Fully &Rescan Collection" ), this ); + m_actionCollection[ "loadXSPF" ] = new QAction( tr( "Load &XSPF..." ), this ); + m_actionCollection[ "updateCollection" ] = new QAction( tr( "U&pdate Collection" ), this ); + m_actionCollection[ "rescanCollection" ] = new QAction( tr( "Fully &Rescan Collection" ), this ); m_actionCollection[ "showOfflineSources" ] = new QAction( tr( "Show Offline Sources" ), this ); m_actionCollection[ "showOfflineSources" ]->setCheckable( true ); - m_actionCollection[ "preferences" ] = new QAction( tr( "&Configure Tomahawk..." ), this ); + m_actionCollection[ "preferences" ] = new QAction( tr( "&Configure Tomahawk..." ), this ); m_actionCollection[ "preferences" ]->setIcon( ImageRegistry::instance()->icon( RESPATH "images/configure.svg" ) ); m_actionCollection[ "preferences" ]->setMenuRole( QAction::PreferencesRole ); #ifdef Q_OS_MAC - m_actionCollection[ "minimize" ] = new QAction( tr( "Minimize" ), this ); + m_actionCollection[ "minimize" ] = new QAction( tr( "Minimize" ), this ); m_actionCollection[ "minimize" ]->setShortcut( QKeySequence( "Ctrl+M" ) ); - m_actionCollection[ "zoom" ] = new QAction( tr( "Zoom" ), this ); + m_actionCollection[ "zoom" ] = new QAction( tr( "Zoom" ), this ); m_actionCollection[ "zoom" ]->setShortcut( QKeySequence( "Meta+Ctrl+Z" ) ); #else - m_actionCollection[ "toggleMenuBar" ] = new QAction( tr( "Hide Menu Bar" ), this ); + m_actionCollection[ "toggleMenuBar" ] = new QAction( tr( "Hide Menu Bar" ), this ); m_actionCollection[ "toggleMenuBar" ]->setShortcut( QKeySequence( "Ctrl+M" ) ); m_actionCollection[ "toggleMenuBar" ]->setShortcutContext( Qt::ApplicationShortcut ); #endif - m_actionCollection[ "diagnostics" ] = new QAction( tr( "Diagnostics..." ), this ); + m_actionCollection[ "diagnostics" ] = new QAction( tr( "Diagnostics..." ), this ); m_actionCollection[ "diagnostics" ]->setMenuRole( QAction::ApplicationSpecificRole ); - m_actionCollection[ "aboutTomahawk" ] = new QAction( tr( "About &Tomahawk..." ), this ); + m_actionCollection[ "aboutTomahawk" ] = new QAction( tr( "About &Tomahawk..." ), this ); m_actionCollection[ "aboutTomahawk" ]->setIcon( ImageRegistry::instance()->icon( RESPATH "images/info.svg" ) ); m_actionCollection[ "aboutTomahawk" ]->setMenuRole( QAction::AboutRole ); - m_actionCollection[ "legalInfo" ] = new QAction( tr( "&Legal Information..." ), this ); + m_actionCollection[ "legalInfo" ] = new QAction( tr( "&Legal Information..." ), this ); m_actionCollection[ "legalInfo" ]->setMenuRole( QAction::ApplicationSpecificRole ); -#if defined( Q_OS_MAC ) && defined( HAVE_SPARKLE ) || defined( Q_WS_WIN ) - m_actionCollection[ "checkForUpdates" ] = new QAction( tr( "Check For Updates..." ), this ); + m_actionCollection[ "openLogfile" ] = new QAction( tr( "&View Logfile" ), this ); + m_actionCollection[ "openLogfile" ]->setMenuRole( QAction::ApplicationSpecificRole ); + #if defined( Q_OS_MAC ) && defined( HAVE_SPARKLE ) || defined( Q_WS_WIN ) + m_actionCollection[ "checkForUpdates" ] = new QAction( tr( "Check For Updates..." ), this ); m_actionCollection[ "checkForUpdates" ]->setMenuRole( QAction::ApplicationSpecificRole ); #endif - m_actionCollection[ "crashNow" ] = new QAction( "Crash now...", this ); + m_actionCollection[ "crashNow" ] = new QAction( "Crash now...", this ); } -QMenuBar * + +QMenuBar* ActionCollection::createMenuBar( QWidget *parent ) { - QMenuBar *menuBar = new QMenuBar( parent ); + QMenuBar* menuBar = new QMenuBar( parent ); - QMenu *controlsMenu = new QMenu( tr( "&Controls" ), menuBar ); + QMenu* controlsMenu = new QMenu( tr( "&Controls" ), menuBar ); controlsMenu->addAction( m_actionCollection[ "playPause" ] ); controlsMenu->addAction( m_actionCollection[ "previousTrack" ] ); controlsMenu->addAction( m_actionCollection[ "nextTrack" ] ); @@ -150,14 +153,15 @@ ActionCollection::createMenuBar( QWidget *parent ) controlsMenu->addSeparator(); controlsMenu->addAction( m_actionCollection[ "quit" ] ); - QMenu *settingsMenu = new QMenu( tr( "&Settings" ), menuBar ); + QMenu* settingsMenu = new QMenu( tr( "&Settings" ), menuBar ); #ifndef Q_OS_MAC settingsMenu->addAction( m_actionCollection[ "toggleMenuBar" ] ); #endif settingsMenu->addAction( m_actionCollection[ "preferences" ] ); - QMenu *helpMenu = new QMenu( tr( "&Help" ), menuBar ); + QMenu* helpMenu = new QMenu( tr( "&Help" ), menuBar ); helpMenu->addAction( m_actionCollection[ "diagnostics" ] ); + helpMenu->addAction( m_actionCollection[ "openLogfile" ] ); helpMenu->addAction( m_actionCollection[ "legalInfo" ] ); helpMenu->addAction( m_actionCollection[ "aboutTomahawk" ] ); @@ -180,21 +184,24 @@ ActionCollection::createMenuBar( QWidget *parent ) menuBar->addMenu( controlsMenu ); menuBar->addMenu( settingsMenu ); + #if defined( Q_OS_MAC ) - QMenu *windowMenu = new QMenu( tr( "&Window" ), menuBar ); + QMenu* windowMenu = new QMenu( tr( "&Window" ), menuBar ); windowMenu->addAction( m_actionCollection[ "minimize" ] ); windowMenu->addAction( m_actionCollection[ "zoom" ] ); menuBar->addMenu( windowMenu ); #endif + menuBar->addMenu( helpMenu ); return menuBar; } -QMenu * + +QMenu* ActionCollection::createCompactMenu( QWidget *parent ) { - QMenu *compactMenu = new QMenu( tr( "Main Menu" ), parent ); + QMenu* compactMenu = new QMenu( tr( "Main Menu" ), parent ); compactMenu->addAction( m_actionCollection[ "playPause" ] ); compactMenu->addAction( m_actionCollection[ "previousTrack" ] ); @@ -218,12 +225,13 @@ ActionCollection::createCompactMenu( QWidget *parent ) compactMenu->addSeparator(); compactMenu->addAction( m_actionCollection[ "diagnostics" ] ); - compactMenu->addAction( m_actionCollection[ "aboutTomahawk" ] ); + compactMenu->addAction( m_actionCollection[ "openLogfile" ] ); compactMenu->addAction( m_actionCollection[ "legalInfo" ] ); + compactMenu->addAction( m_actionCollection[ "aboutTomahawk" ] ); // Setup update check #ifndef Q_OS_MAC - compactMenu->insertSeparator( m_actionCollection[ "aboutTomahawk" ] ); + compactMenu->insertSeparator( m_actionCollection[ "legalInfo" ] ); #endif #if defined( Q_OS_MAC ) && defined( HAVE_SPARKLE )