1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-10 16:14:40 +02:00

Add Play/Next/Prev to menu and make space a global shortcut

This commit is contained in:
Leo Franchi
2011-06-11 13:10:16 -04:00
parent badfe28626
commit 419a0c806f
3 changed files with 49 additions and 2 deletions

View File

@@ -293,6 +293,16 @@ TomahawkWindow::setupSignals()
connect( ui->actionCreate_New_Station, SIGNAL( triggered() ), SLOT( createStation() ));
connect( ui->actionAboutTomahawk, SIGNAL( triggered() ), SLOT( showAboutTomahawk() ) );
connect( ui->actionExit, SIGNAL( triggered() ), qApp, SLOT( quit() ) );
connect( ui->actionPlay, SIGNAL( triggered() ), AudioEngine::instance(), SLOT( playPause() ) );
connect( ui->actionNext, SIGNAL( triggered() ), AudioEngine::instance(), SLOT( previous() ) );
connect( ui->actionPrevious, SIGNAL( triggered() ), AudioEngine::instance(), SLOT( next() ) );
connect( AudioEngine::instance(), SIGNAL( started( Tomahawk::result_ptr ) ), this, SLOT( audioStarted() ) );
connect( AudioEngine::instance(), SIGNAL( resumed()), this, SLOT( audioStarted() ) );
connect( AudioEngine::instance(), SIGNAL( paused() ), this, SLOT( audioStopped() ) );
connect( AudioEngine::instance(), SIGNAL( stopped() ), this, SLOT( audioStopped() ) );
#if defined( Q_OS_DARWIN )
connect( ui->actionMinimize, SIGNAL( triggered() ), SLOT( minimize() ) );
connect( ui->actionZoom, SIGNAL( triggered() ), SLOT( maximize() ) );
@@ -519,6 +529,19 @@ TomahawkWindow::createPlaylist()
}
}
void
TomahawkWindow::audioStarted()
{
ui->actionPlay->setText( tr( "Pause" ) );
}
void
TomahawkWindow::audioStopped()
{
ui->actionPlay->setText( tr( "Play" ) );
}
void
TomahawkWindow::onPlaybackLoading( const Tomahawk::result_ptr& result )

View File

@@ -50,7 +50,6 @@ public:
~TomahawkWindow();
AudioControls* audioControls() { return m_audioControls; }
QStackedWidget* playlistStack();
SourceTreeView* sourceTreeView() const { return m_sourcetree; }
void setWindowTitle( const QString& title );
@@ -83,6 +82,9 @@ private slots:
void onHistoryBackAvailable( bool avail );
void onHistoryForwardAvailable( bool avail );
void audioStarted();
void audioStopped();
void showAboutTomahawk();
void checkForUpdates();

View File

@@ -35,7 +35,7 @@
<x>0</x>
<y>0</y>
<width>1000</width>
<height>21</height>
<height>20</height>
</rect>
</property>
<widget class="QMenu" name="menuSettings">
@@ -48,6 +48,10 @@
<property name="title">
<string>&amp;Music Player</string>
</property>
<addaction name="actionPlay"/>
<addaction name="actionPrevious"/>
<addaction name="actionNext"/>
<addaction name="separator"/>
<addaction name="actionRescanCollection"/>
<addaction name="separator"/>
<addaction name="actionShowOfflineSources"/>
@@ -189,6 +193,24 @@
<enum>QAction::ApplicationSpecificRole</enum>
</property>
</action>
<action name="actionPlay">
<property name="text">
<string>Play</string>
</property>
<property name="shortcut">
<string>Space</string>
</property>
</action>
<action name="actionPrevious">
<property name="text">
<string>Previous</string>
</property>
</action>
<action name="actionNext">
<property name="text">
<string>Next</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources/>