mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-13 09:34:53 +02:00
Add Play/Next/Prev to menu and make space a global shortcut
This commit is contained in:
@@ -293,6 +293,16 @@ TomahawkWindow::setupSignals()
|
|||||||
connect( ui->actionCreate_New_Station, SIGNAL( triggered() ), SLOT( createStation() ));
|
connect( ui->actionCreate_New_Station, SIGNAL( triggered() ), SLOT( createStation() ));
|
||||||
connect( ui->actionAboutTomahawk, SIGNAL( triggered() ), SLOT( showAboutTomahawk() ) );
|
connect( ui->actionAboutTomahawk, SIGNAL( triggered() ), SLOT( showAboutTomahawk() ) );
|
||||||
connect( ui->actionExit, SIGNAL( triggered() ), qApp, SLOT( quit() ) );
|
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 )
|
#if defined( Q_OS_DARWIN )
|
||||||
connect( ui->actionMinimize, SIGNAL( triggered() ), SLOT( minimize() ) );
|
connect( ui->actionMinimize, SIGNAL( triggered() ), SLOT( minimize() ) );
|
||||||
connect( ui->actionZoom, SIGNAL( triggered() ), SLOT( maximize() ) );
|
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
|
void
|
||||||
TomahawkWindow::onPlaybackLoading( const Tomahawk::result_ptr& result )
|
TomahawkWindow::onPlaybackLoading( const Tomahawk::result_ptr& result )
|
||||||
|
@@ -50,7 +50,6 @@ public:
|
|||||||
~TomahawkWindow();
|
~TomahawkWindow();
|
||||||
|
|
||||||
AudioControls* audioControls() { return m_audioControls; }
|
AudioControls* audioControls() { return m_audioControls; }
|
||||||
QStackedWidget* playlistStack();
|
|
||||||
SourceTreeView* sourceTreeView() const { return m_sourcetree; }
|
SourceTreeView* sourceTreeView() const { return m_sourcetree; }
|
||||||
|
|
||||||
void setWindowTitle( const QString& title );
|
void setWindowTitle( const QString& title );
|
||||||
@@ -83,6 +82,9 @@ private slots:
|
|||||||
void onHistoryBackAvailable( bool avail );
|
void onHistoryBackAvailable( bool avail );
|
||||||
void onHistoryForwardAvailable( bool avail );
|
void onHistoryForwardAvailable( bool avail );
|
||||||
|
|
||||||
|
void audioStarted();
|
||||||
|
void audioStopped();
|
||||||
|
|
||||||
void showAboutTomahawk();
|
void showAboutTomahawk();
|
||||||
void checkForUpdates();
|
void checkForUpdates();
|
||||||
|
|
||||||
|
@@ -35,7 +35,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>1000</width>
|
<width>1000</width>
|
||||||
<height>21</height>
|
<height>20</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QMenu" name="menuSettings">
|
<widget class="QMenu" name="menuSettings">
|
||||||
@@ -48,6 +48,10 @@
|
|||||||
<property name="title">
|
<property name="title">
|
||||||
<string>&Music Player</string>
|
<string>&Music Player</string>
|
||||||
</property>
|
</property>
|
||||||
|
<addaction name="actionPlay"/>
|
||||||
|
<addaction name="actionPrevious"/>
|
||||||
|
<addaction name="actionNext"/>
|
||||||
|
<addaction name="separator"/>
|
||||||
<addaction name="actionRescanCollection"/>
|
<addaction name="actionRescanCollection"/>
|
||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
<addaction name="actionShowOfflineSources"/>
|
<addaction name="actionShowOfflineSources"/>
|
||||||
@@ -189,6 +193,24 @@
|
|||||||
<enum>QAction::ApplicationSpecificRole</enum>
|
<enum>QAction::ApplicationSpecificRole</enum>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</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>
|
</widget>
|
||||||
<layoutdefault spacing="6" margin="11"/>
|
<layoutdefault spacing="6" margin="11"/>
|
||||||
<resources/>
|
<resources/>
|
||||||
|
Reference in New Issue
Block a user