Switch to unified view

a/GUI/mainw/mainw.cpp b/GUI/mainw/mainw.cpp
...
...
165
    m_metadata = md;
165
    m_metadata = md;
166
166
167
    total_time_changed(md.length_ms);
167
    total_time_changed(md.length_ms);
168
168
169
    ui->player_w->mdata()->setData(md);
169
    ui->player_w->mdata()->setData(md);
170
    
171
    m_trayIcon->songChangedMessage(md);
172
170
173
    this->setWindowTitle(QString("Upplay - ") + md.title);
171
    this->setWindowTitle(QString("Upplay - ") + md.title);
174
172
175
    if (!md.albumArtURI.isEmpty()) {
173
    if (!md.albumArtURI.isEmpty()) {
176
        fetch_cover(md.albumArtURI);
174
        fetch_cover(md.albumArtURI);
...
...
187
185
188
    ui->player_w->progress()->setEnabled(true);
186
    ui->player_w->progress()->setEnabled(true);
189
187
190
    m_metadata_available = true;
188
    m_metadata_available = true;
191
}
189
}
190
void GUI_Player::onNotify(const MetaData& md)
191
{
192
    m_trayIcon->songChangedMessage(md);
193
}
192
194
193
void GUI_Player::fetch_cover(const QString& URI)
195
void GUI_Player::fetch_cover(const QString& URI)
194
{
196
{
195
    if (!m_netmanager) {
197
    if (!m_netmanager) {
196
        m_currentCoverReply = 0;
198
        m_currentCoverReply = 0;
...
...
233
/** TRAY ICON **/
235
/** TRAY ICON **/
234
void GUI_Player::setupTrayActions()
236
void GUI_Player::setupTrayActions()
235
{
237
{
236
    m_trayIcon = new GUI_TrayIcon(this);
238
    m_trayIcon = new GUI_TrayIcon(this);
237
239
238
    connect(m_trayIcon, SIGNAL(sig_stop_clicked()), this, SLOT(onStopActivated()));
240
    connect(m_trayIcon, SIGNAL(sig_stop_clicked()),
241
            this, SLOT(onStopActivated()));
239
    connect(m_trayIcon, SIGNAL(sig_bwd_clicked()),
242
    connect(m_trayIcon, SIGNAL(sig_bwd_clicked()),
240
            this, SLOT(onBackwardActivated()));
243
            this, SLOT(onBackwardActivated()));
241
    connect(m_trayIcon, SIGNAL(sig_fwd_clicked()),
244
    connect(m_trayIcon, SIGNAL(sig_fwd_clicked()),
242
            this, SLOT(onForwardActivated()));
245
            this, SLOT(onForwardActivated()));
243
    connect(m_trayIcon, SIGNAL(sig_play_clicked()),
246
    connect(m_trayIcon, SIGNAL(sig_play_clicked()),
244
            this, SLOT(onPlayActivated()));
247
            this, SLOT(onPlayActivated()));
245
    connect(m_trayIcon, SIGNAL(sig_pause_clicked()),
248
    connect(m_trayIcon, SIGNAL(sig_pause_clicked()),
246
            this, SLOT(onPauseActivated()));
249
            this, SLOT(onPauseActivated()));
247
    connect(m_trayIcon, SIGNAL(sig_mute_clicked()),
250
    connect(m_trayIcon, SIGNAL(sig_mute_clicked()),
248
            ui->player_w->volume(), SLOT(toggleMute()));
251
            ui->player_w->volume(), SLOT(toggleMute()));
249
250
    connect(m_trayIcon, SIGNAL(sig_close_clicked()), this, SLOT(really_close()));
252
    connect(m_trayIcon, SIGNAL(sig_close_clicked()),
253
            this, SLOT(really_close()));
251
    connect(m_trayIcon, SIGNAL(sig_show_clicked()), this, SLOT(showNormal()));
254
    connect(m_trayIcon, SIGNAL(sig_show_clicked()), this, SLOT(showNormal()));
252
253
    connect(m_trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
255
    connect(m_trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
254
            this, SLOT(trayItemActivated(QSystemTrayIcon::ActivationReason)));
256
            this, SLOT(trayItemActivated(QSystemTrayIcon::ActivationReason)));
255
256
    connect(m_trayIcon, SIGNAL(sig_volume_changed_by_wheel(int)),
257
    connect(m_trayIcon, SIGNAL(sig_volume_changed_by_wheel(int)),
257
            this, SLOT(onVolumeStepActivated(int)));
258
            this, SLOT(onVolumeStepActivated(int)));
258
259
259
    m_trayIcon->setPlaying(false);
260
    m_trayIcon->setPlaying(false);
260
261