mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-01 20:00:13 +02:00
* Show current track in window title.
This commit is contained in:
@@ -143,6 +143,10 @@ TomahawkWindow::setupSignals()
|
|||||||
connect( playlistManager(), SIGNAL( shuffleModeChanged( bool ) ),
|
connect( playlistManager(), SIGNAL( shuffleModeChanged( bool ) ),
|
||||||
m_audioControls, SLOT( onShuffleModeChanged( bool ) ) );
|
m_audioControls, SLOT( onShuffleModeChanged( bool ) ) );
|
||||||
|
|
||||||
|
// <From AudioEngine>
|
||||||
|
connect( (QObject*)APP->audioEngine(), SIGNAL( loading( const Tomahawk::result_ptr& ) ),
|
||||||
|
SLOT( onPlaybackLoading( const Tomahawk::result_ptr& ) ) );
|
||||||
|
|
||||||
// <Menu Items>
|
// <Menu Items>
|
||||||
connect( ui->actionPreferences, SIGNAL( triggered() ),
|
connect( ui->actionPreferences, SIGNAL( triggered() ),
|
||||||
SLOT( showSettingsDialog() ) );
|
SLOT( showSettingsDialog() ) );
|
||||||
@@ -282,3 +286,26 @@ TomahawkWindow::createPlaylist()
|
|||||||
QString creator = "someone"; // FIXME
|
QString creator = "someone"; // FIXME
|
||||||
Playlist::create( author, id, name, info, creator, false /* shared */ );
|
Playlist::create( author, id, name, info, creator, false /* shared */ );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
TomahawkWindow::onPlaybackLoading( const Tomahawk::result_ptr& result )
|
||||||
|
{
|
||||||
|
m_currentTrack = result;
|
||||||
|
setWindowTitle( m_windowTitle );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
TomahawkWindow::setWindowTitle( const QString& title )
|
||||||
|
{
|
||||||
|
m_windowTitle = title;
|
||||||
|
|
||||||
|
if ( m_currentTrack.isNull() )
|
||||||
|
QMainWindow::setWindowTitle( title );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
QString s = m_currentTrack->artist() + " - " + m_currentTrack->track();
|
||||||
|
QMainWindow::setWindowTitle( s + " - " + title );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -32,6 +32,8 @@ public:
|
|||||||
AudioControls* audioControls() { return m_audioControls; }
|
AudioControls* audioControls() { return m_audioControls; }
|
||||||
QStackedWidget* playlistStack();
|
QStackedWidget* playlistStack();
|
||||||
|
|
||||||
|
void setWindowTitle( const QString& title );
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void settingsChanged();
|
void settingsChanged();
|
||||||
|
|
||||||
@@ -48,6 +50,8 @@ private slots:
|
|||||||
void rescanCollectionManually();
|
void rescanCollectionManually();
|
||||||
void addPeerManually();
|
void addPeerManually();
|
||||||
|
|
||||||
|
void onPlaybackLoading( const Tomahawk::result_ptr& result );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void loadSettings();
|
void loadSettings();
|
||||||
void saveSettings();
|
void saveSettings();
|
||||||
@@ -57,8 +61,10 @@ private:
|
|||||||
TopBar* m_topbar;
|
TopBar* m_topbar;
|
||||||
AudioControls* m_audioControls;
|
AudioControls* m_audioControls;
|
||||||
PlaylistManager* m_playlistManager;
|
PlaylistManager* m_playlistManager;
|
||||||
|
|
||||||
QNetworkAccessManager m_nam;
|
QNetworkAccessManager m_nam;
|
||||||
|
|
||||||
|
Tomahawk::result_ptr m_currentTrack;
|
||||||
|
QString m_windowTitle;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // TOMAHAWKWINDOW_H
|
#endif // TOMAHAWKWINDOW_H
|
||||||
|
Reference in New Issue
Block a user