PlaylistPanel::PlaylistPanel() { setupUi(this); // Random and such connect(MPD::instance(), SIGNAL(randomUpdated(bool)), randomButton, SLOT(setChecked(bool))); connect(MPD::instance(), SIGNAL(repeatUpdated(bool)), repeatButton, SLOT(setChecked(bool))); connect(Config::instance(), SIGNAL(autoAddSongsChanged(bool)), dynamicButton, SLOT(setChecked(bool))); connect(randomButton, SIGNAL(toggled(bool)), MPD::instance(), SLOT(setRandom(bool))); connect(repeatButton, SIGNAL(toggled(bool)), MPD::instance(), SLOT(setRepeat(bool))); dynamicButton->setChecked(Config::instance()->autoAddSongs()); connect(dynamicButton, SIGNAL(toggled(bool)), Config::instance(), SLOT(setAutoAddSongs(bool))); // Button clicks connect(cropButton, SIGNAL(clicked()), playlistView, SLOT(cropItems())); connect(removeButton, SIGNAL(clicked()), playlistView, SLOT(removeItems())); connect(saveAsButton, SIGNAL(clicked()), playlistView, SLOT(savePlaylist())); connect(clearButton, SIGNAL(clicked()), MPD::instance(), SLOT(clearPlaylist())); connect(shuffleButton, SIGNAL(clicked()), MPD::instance(), SLOT(shufflePlaylist())); // Toggle actions connect(playlistView, SIGNAL(toggleActions(bool)), removeButton, SLOT(setEnabled(bool))); connect(playlistView, SIGNAL(toggleActions(bool)), cropButton, SLOT(setEnabled(bool))); // Filter connect(filter, SIGNAL(textChanged(const QString &)), this, SLOT(updateFilter(const QString &))); }
void DlgAutoDJ::shufflePlaylistButton(bool) { // Activate regardless of button being checked shufflePlaylist(1.0); }