Changeset 28 for gui/main_window.cpp


Ignore:
Timestamp:
01/05/08 16:32:32 (4 years ago)
Author:
sander
Message:

Made it possible to set "random" and "repeat"

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gui/main_window.cpp

    r26 r28  
    5050    connect(playPauseTrackButton, SIGNAL(clicked(bool)), this, SLOT(playPauseTrack())); 
    5151    connect(nextTrackButton, SIGNAL(clicked(bool)), this, SLOT(nextTrack())); 
     52    connect(randomCheckBox, SIGNAL(stateChanged(int)), this, SLOT(setRandom(int))); 
     53    connect(repeatCheckBox, SIGNAL(stateChanged(int)), this, SLOT(setRepeat(int))); 
    5254    connect(playlistTableView, SIGNAL(activated(const QModelIndex &)), this, SLOT(playlistItemActivated(const QModelIndex &))); 
    5355    connect(removeFromPlaylistPushButton, SIGNAL(clicked(bool)), this, SLOT(removeFromPlaylist())); 
     
    116118} 
    117119 
     120void MainWindow::setRandom(int state) 
     121{ 
     122    if(state == Qt::Checked) 
     123        mpd.setRandom(true); 
     124    else 
     125        mpd.setRandom(false); 
     126} 
     127 
     128void MainWindow::setRepeat(int state) 
     129{ 
     130    if(state == Qt::Checked) 
     131        mpd.setRepeat(true); 
     132    else 
     133        mpd.setRepeat(false); 
     134} 
     135 
    118136void MainWindow::updateCurrentSong(Song *song) 
    119137{ 
     
    136154    if(!slidingVolume) 
    137155        volumeSlider->setValue(status.volume); 
     156 
     157    if(status.random) { 
     158        randomCheckBox->setCheckState(Qt::Checked); 
     159    } else { 
     160        randomCheckBox->setCheckState(Qt::Unchecked); 
     161    } 
     162 
     163    if(status.repeat) { 
     164        repeatCheckBox->setCheckState(Qt::Checked); 
     165    } else { 
     166        repeatCheckBox->setCheckState(Qt::Unchecked); 
     167    } 
    138168 
    139169    if(status.time_total == -1) { 
Note: See TracChangeset for help on using the changeset viewer.