diff options
Diffstat (limited to 'src/plugins')
| -rw-r--r-- | src/plugins/CommandLineOptions/PlayListOption/playlistoption.cpp | 14 | ||||
| -rw-r--r-- | src/plugins/General/mpris/mpris1/playerobject.cpp | 19 | ||||
| -rw-r--r-- | src/plugins/General/mpris/mpris1/playerobject.h | 6 | ||||
| -rw-r--r-- | src/plugins/General/mpris/mpris1/tracklistobject.cpp | 7 | ||||
| -rw-r--r-- | src/plugins/General/mpris/mpris1/tracklistobject.h | 4 | ||||
| -rw-r--r-- | src/plugins/General/mpris/mpris2/player2object.cpp | 27 | ||||
| -rw-r--r-- | src/plugins/General/mpris/mpris2/player2object.h | 2 | ||||
| -rw-r--r-- | src/plugins/Ui/skinned/display.cpp | 7 | ||||
| -rw-r--r-- | src/plugins/Ui/skinned/listwidget.cpp | 8 | ||||
| -rw-r--r-- | src/plugins/Ui/skinned/listwidget.h | 4 | ||||
| -rw-r--r-- | src/plugins/Ui/skinned/mainwindow.cpp | 32 | ||||
| -rw-r--r-- | src/plugins/Ui/skinned/mainwindow.h | 2 | ||||
| -rw-r--r-- | src/plugins/Ui/skinned/playlist.cpp | 6 | ||||
| -rw-r--r-- | src/plugins/Ui/skinned/playlist.h | 2 |
14 files changed, 82 insertions, 58 deletions
diff --git a/src/plugins/CommandLineOptions/PlayListOption/playlistoption.cpp b/src/plugins/CommandLineOptions/PlayListOption/playlistoption.cpp index 2fcd37b30..7930e84e4 100644 --- a/src/plugins/CommandLineOptions/PlayListOption/playlistoption.cpp +++ b/src/plugins/CommandLineOptions/PlayListOption/playlistoption.cpp @@ -25,6 +25,7 @@ #include <qmmpui/playlistmanager.h> #include <qmmpui/metadataformatter.h> #include <qmmpui/mediaplayer.h> +#include <qmmpui/qmmpuisettings.h> #include "playlistoption.h" bool PlayListOption::identify(const QString & str) const @@ -52,6 +53,7 @@ QString PlayListOption::executeCommand(const QString& opt_str, const QStringList QString out; PlayListManager *pl_manager = PlayListManager::instance(); MediaPlayer *player = MediaPlayer::instance(); + QmmpUiSettings *ui_settings = QmmpUiSettings::instance(); if(opt_str == "--pl-help") { @@ -121,18 +123,18 @@ QString PlayListOption::executeCommand(const QString& opt_str, const QStringList } else if(opt_str == "--pl-repeat-toggle") { - player->setRepeatable(!player->isRepeatable()); + ui_settings->setRepeatableTrack(!ui_settings->isRepeatableTrack()); } else if(opt_str == "--pl-shuffle-toggle") { - pl_manager->setShuffle(!pl_manager->isShuffle()); + ui_settings->setShuffle(!ui_settings->isShuffle()); } else if(opt_str == "--pl-state") { - out += "SHUFFLE: " + boolToText(pl_manager->isShuffle()) + "\n"; - out += "REPEAT PLAYLIST: " + boolToText(pl_manager->isRepeatableList()) + "\n"; - out += "REPEAT TRACK: " + boolToText(player->isRepeatable()) + "\n"; - out += "NO PLAYLIST ADVANCE: " + boolToText(player->isNoPlaylistAdvance()) + "\n"; + out += "SHUFFLE: " + boolToText(ui_settings->isShuffle()) + "\n"; + out += "REPEAT PLAYLIST: " + boolToText(ui_settings->isRepeatableList()) + "\n"; + out += "REPEAT TRACK: " + boolToText(ui_settings->isRepeatableTrack()) + "\n"; + out += "NO PLAYLIST ADVANCE: " + boolToText(ui_settings->isNoPlaylistAdvance()) + "\n"; } return out; } diff --git a/src/plugins/General/mpris/mpris1/playerobject.cpp b/src/plugins/General/mpris/mpris1/playerobject.cpp index 8d6d0e165..27c9ca9fa 100644 --- a/src/plugins/General/mpris/mpris1/playerobject.cpp +++ b/src/plugins/General/mpris/mpris1/playerobject.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2008-2009 by Ilya Kotov * + * Copyright (C) 2008-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -25,7 +25,7 @@ #include <qmmp/metadatamanager.h> #include <qmmpui/mediaplayer.h> #include <qmmpui/playlistmanager.h> - +#include <qmmpui/qmmpuisettings.h> #include "playerobject.h" @@ -59,12 +59,13 @@ PlayerObject::PlayerObject(QObject *parent) : QObject(parent) m_core = SoundCore::instance(); m_player = MediaPlayer::instance(); m_pl_manager = m_player->playListManager(); + m_ui_settings = QmmpUiSettings::instance(); connect(m_core, SIGNAL(stateChanged (Qmmp::State)), SLOT(updateCaps())); connect(m_core, SIGNAL(metaDataChanged ()), SLOT(updateTrack())); connect(m_core, SIGNAL(stateChanged (Qmmp::State)), SLOT(updateStatus())); - connect(m_pl_manager, SIGNAL(repeatableListChanged(bool)), SLOT(updateStatus())); - connect(m_pl_manager, SIGNAL(shuffleChanged(bool)), SLOT(updateStatus())); - connect(m_player, SIGNAL(repeatableChanged(bool)), SLOT(updateStatus())); + connect(m_ui_settings, SIGNAL(repeatableListChanged(bool)), SLOT(updateStatus())); + connect(m_ui_settings, SIGNAL(shuffleChanged(bool)), SLOT(updateStatus())); + connect(m_ui_settings, SIGNAL(repeatableTrackChanged(bool)), SLOT(updateStatus())); } PlayerObject::~PlayerObject() @@ -97,7 +98,7 @@ void PlayerObject::Play() void PlayerObject::Repeat(bool in0) { - m_player->setRepeatable(in0); + m_ui_settings->setRepeatableTrack(in0); } PlayerStatus PlayerObject::GetStatus() @@ -117,9 +118,9 @@ PlayerStatus PlayerObject::GetStatus() case Qmmp::Paused: st.state = 1; }; - st.random = int(m_pl_manager->isShuffle()); - st.repeat = int(m_player->isRepeatable()); - st.repeatPlayList = int(m_pl_manager->isRepeatableList()); + st.random = int(m_ui_settings->isShuffle()); + st.repeat = int(m_ui_settings->isRepeatableTrack()); + st.repeatPlayList = int(m_ui_settings->isRepeatableList()); return st; } diff --git a/src/plugins/General/mpris/mpris1/playerobject.h b/src/plugins/General/mpris/mpris1/playerobject.h index 632ca989f..c4f07587e 100644 --- a/src/plugins/General/mpris/mpris1/playerobject.h +++ b/src/plugins/General/mpris/mpris1/playerobject.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2008-2009 by Ilya Kotov * + * Copyright (C) 2008-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -26,6 +26,7 @@ class SoundCore; class MediaPlayer; class PlayListManager; +class QmmpUiSettings; /** @author Ilya Kotov <forkotov02@hotmail.ru> @@ -39,7 +40,7 @@ struct PlayerStatus int repeatPlayList; // 0 = Stop playing once the last element has been played, 1 = Never give up playing }; -Q_DECLARE_METATYPE(PlayerStatus); +Q_DECLARE_METATYPE(PlayerStatus) class PlayerObject : public QObject { @@ -95,6 +96,7 @@ private: SoundCore *m_core; MediaPlayer *m_player; PlayListManager *m_pl_manager; + QmmpUiSettings *m_ui_settings; }; diff --git a/src/plugins/General/mpris/mpris1/tracklistobject.cpp b/src/plugins/General/mpris/mpris1/tracklistobject.cpp index 0fb498788..c7176c371 100644 --- a/src/plugins/General/mpris/mpris1/tracklistobject.cpp +++ b/src/plugins/General/mpris/mpris1/tracklistobject.cpp @@ -24,12 +24,13 @@ #include <qmmpui/playlistmanager.h> #include <qmmpui/mediaplayer.h> #include <qmmpui/playlistitem.h> - +#include <qmmpui/qmmpuisettings.h> #include "tracklistobject.h" TrackListObject::TrackListObject(QObject *parent) : QObject(parent) { m_player = MediaPlayer::instance(); + m_ui_settings = QmmpUiSettings::instance(); m_pl_manager = m_player->playListManager(); m_model = m_pl_manager->currentPlayList(); connect (m_model, SIGNAL(listChanged()), SLOT(updateTrackList())); @@ -104,12 +105,12 @@ QVariantMap TrackListObject::GetMetadata(int in0) void TrackListObject::SetLoop(bool in0) { - m_pl_manager->setRepeatableList(in0); + m_ui_settings->setRepeatableList(in0); } void TrackListObject::SetRandom(bool in0) { - m_pl_manager->setShuffle(in0); + m_ui_settings->setShuffle(in0); } void TrackListObject::disconnectPl() diff --git a/src/plugins/General/mpris/mpris1/tracklistobject.h b/src/plugins/General/mpris/mpris1/tracklistobject.h index c92844d9f..b7532656a 100644 --- a/src/plugins/General/mpris/mpris1/tracklistobject.h +++ b/src/plugins/General/mpris/mpris1/tracklistobject.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2008-2009 by Ilya Kotov * + * Copyright (C) 2008-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -27,6 +27,7 @@ class PlayListModel; class PlayListManager; class MediaPlayer; +class QmmpUiSettings; /** @author Ilya Kotov <forkotov02@hotmail.ru> @@ -63,6 +64,7 @@ private: PlayListModel *m_model; PlayListManager *m_pl_manager; MediaPlayer *m_player; + QmmpUiSettings *m_ui_settings; int m_prev_count; }; diff --git a/src/plugins/General/mpris/mpris2/player2object.cpp b/src/plugins/General/mpris/mpris2/player2object.cpp index 7427e15c4..e7fedac5e 100644 --- a/src/plugins/General/mpris/mpris2/player2object.cpp +++ b/src/plugins/General/mpris/mpris2/player2object.cpp @@ -27,6 +27,7 @@ #include <qmmp/metadatamanager.h> #include <qmmpui/mediaplayer.h> #include <qmmpui/playlistmanager.h> +#include <qmmpui/qmmpuisettings.h> #include "player2object.h" Player2Object::Player2Object(QObject *parent) : QDBusAbstractAdaptor(parent) @@ -36,17 +37,18 @@ Player2Object::Player2Object(QObject *parent) : QDBusAbstractAdaptor(parent) m_core = SoundCore::instance(); m_player = MediaPlayer::instance(); m_pl_manager = m_player->playListManager(); + m_ui_settings = QmmpUiSettings::instance(); connect(m_core, SIGNAL(metaDataChanged ()), SLOT(updateId())); connect(m_core, SIGNAL(metaDataChanged ()), SLOT(emitPropertiesChanged())); connect(m_core, SIGNAL(stateChanged (Qmmp::State)), SLOT(checkState(Qmmp::State))); connect(m_core, SIGNAL(stateChanged (Qmmp::State)), SLOT(emitPropertiesChanged())); connect(m_core, SIGNAL(volumeChanged(int,int)), SLOT(emitPropertiesChanged())); connect(m_core, SIGNAL(elapsedChanged(qint64)), SLOT(checkSeeking(qint64))); - connect(m_pl_manager, SIGNAL(repeatableListChanged(bool)), SLOT(emitPropertiesChanged())); - connect(m_pl_manager, SIGNAL(shuffleChanged(bool)), SLOT(emitPropertiesChanged())); + connect(m_ui_settings, SIGNAL(repeatableListChanged(bool)), SLOT(emitPropertiesChanged())); + connect(m_ui_settings, SIGNAL(shuffleChanged(bool)), SLOT(emitPropertiesChanged())); connect(m_pl_manager, SIGNAL(currentPlayListChanged(PlayListModel*,PlayListModel*)), SLOT(setModel(PlayListModel*,PlayListModel*))); - connect(m_player, SIGNAL(repeatableChanged(bool)), SLOT(emitPropertiesChanged())); + connect(m_ui_settings, SIGNAL(repeatableListChanged(bool)), SLOT(emitPropertiesChanged())); setModel(m_pl_manager->currentPlayList(), 0); updateId(); syncProperties(); @@ -86,9 +88,9 @@ bool Player2Object::canSeek() const QString Player2Object::loopStatus() const { - if(m_player->isRepeatable()) + if(m_ui_settings->isRepeatableTrack()) return "Track"; - else if(m_pl_manager->isRepeatableList()) + else if(m_ui_settings->isRepeatableList()) return "Playlist"; else return "None"; @@ -98,17 +100,18 @@ void Player2Object::setLoopStatus(const QString &value) { if(value == "Track") { - m_player->setRepeatable(true); + m_ui_settings->setRepeatableList(false); + m_ui_settings->setRepeatableTrack(true); } else if(value == "Playlist") { - m_pl_manager->setRepeatableList(true); - m_player->setRepeatable(false); + m_ui_settings->setRepeatableList(true); + m_ui_settings->setRepeatableTrack(false); } else { - m_pl_manager->setRepeatableList(false); - m_player->setRepeatable(false); + m_ui_settings->setRepeatableList(false); + m_ui_settings->setRepeatableTrack(false); } } @@ -184,12 +187,12 @@ void Player2Object::setRate(double value) bool Player2Object::shuffle() const { - return m_pl_manager->isShuffle(); + return m_ui_settings->isShuffle(); } void Player2Object::setShuffle(bool value) { - m_pl_manager->setShuffle(value); + m_ui_settings->setShuffle(value); } double Player2Object::volume() const diff --git a/src/plugins/General/mpris/mpris2/player2object.h b/src/plugins/General/mpris/mpris2/player2object.h index 19c7d24e0..f66b55664 100644 --- a/src/plugins/General/mpris/mpris2/player2object.h +++ b/src/plugins/General/mpris/mpris2/player2object.h @@ -32,6 +32,7 @@ class MediaPlayer; class PlayListManager; class PlayListTrack; class PlayListModel; +class QmmpUiSettings; /** @author Ilya Kotov <forkotov02@hotmail.ru> @@ -107,6 +108,7 @@ private: SoundCore *m_core; MediaPlayer *m_player; PlayListManager *m_pl_manager; + QmmpUiSettings *m_ui_settings; QMap<QString, QVariant> m_props; QDBusObjectPath m_trackID; PlayListTrack *m_prev_track; diff --git a/src/plugins/Ui/skinned/display.cpp b/src/plugins/Ui/skinned/display.cpp index 505725800..e72bf75d7 100644 --- a/src/plugins/Ui/skinned/display.cpp +++ b/src/plugins/Ui/skinned/display.cpp @@ -24,6 +24,7 @@ #include <qmmp/soundcore.h> #include <qmmpui/mediaplayer.h> #include <qmmpui/playlistmanager.h> +#include <qmmpui/qmmpuisettings.h> #include "skin.h" #include "mainvisual.h" #include "button.h" @@ -130,9 +131,9 @@ MainDisplay::MainDisplay (MainWindow *parent) m_volumeBar->setValue(m_core->volume()); m_balanceBar->setValue(m_core->balance()); - PlayListManager *pl_manager = MediaPlayer::instance()->playListManager(); - connect(pl_manager, SIGNAL(repeatableListChanged(bool)), m_repeatButton, SLOT(setChecked(bool))); - connect(pl_manager, SIGNAL(shuffleChanged(bool)), m_shuffleButton, SLOT(setChecked(bool))); + QmmpUiSettings *ui_settings = QmmpUiSettings::instance(); + connect(ui_settings, SIGNAL(repeatableListChanged(bool)), m_repeatButton, SLOT(setChecked(bool))); + connect(ui_settings, SIGNAL(shuffleChanged(bool)), m_shuffleButton, SLOT(setChecked(bool))); updatePositions(); updateMask(); } diff --git a/src/plugins/Ui/skinned/listwidget.cpp b/src/plugins/Ui/skinned/listwidget.cpp index 2dd80a8f5..c324eda66 100644 --- a/src/plugins/Ui/skinned/listwidget.cpp +++ b/src/plugins/Ui/skinned/listwidget.cpp @@ -30,7 +30,7 @@ #include <QTimer> #include <qmmpui/playlistitem.h> #include <qmmpui/playlistmodel.h> -#include <qmmpui/mediaplayer.h> +#include <qmmpui/qmmpuisettings.h> #include "listwidget.h" #include "skin.h" #include "popupwidget.h" @@ -53,8 +53,8 @@ ListWidget::ListWidget(QWidget *parent) m_prev_y = 0; m_anchor_index = INVALID_INDEX; m_pressed_index = INVALID_INDEX; - m_player = MediaPlayer::instance(); - connect (m_player, SIGNAL(repeatableChanged(bool)), SLOT(updateList())); + m_ui_settings = QmmpUiSettings::instance(); + connect (m_ui_settings, SIGNAL(repeatableTrackChanged(bool)), SLOT(updateList())); m_first = 0; m_row_count = 0; m_scroll = false; @@ -594,7 +594,7 @@ const QString ListWidget::getExtraString(int i) extra_string += "|"+QString::number(index + 1)+"|"; } - if(m_model->currentIndex() == i && m_player->isRepeatable()) + if(m_model->currentIndex() == i && m_ui_settings->isRepeatableTrack()) extra_string += "|R|"; else if(m_model->isStopAfter(track)) extra_string += "|S|"; diff --git a/src/plugins/Ui/skinned/listwidget.h b/src/plugins/Ui/skinned/listwidget.h index 5cfcdb695..70872fc20 100644 --- a/src/plugins/Ui/skinned/listwidget.h +++ b/src/plugins/Ui/skinned/listwidget.h @@ -33,7 +33,7 @@ class QTimer; class PlayListModel; class Skin; class PlayListItem; -class MediaPlayer; +class QmmpUiSettings; namespace PlayListPopup{ class PopupWidget; } @@ -144,7 +144,7 @@ private: int m_number_width; int m_drop_index; QList<ListWidgetRow *> m_rows; - MediaPlayer *m_player; + QmmpUiSettings *m_ui_settings; PlayListPopup::PopupWidget *m_popupWidget; QTimer *m_timer; }; diff --git a/src/plugins/Ui/skinned/mainwindow.cpp b/src/plugins/Ui/skinned/mainwindow.cpp index c1ec27841..378651079 100644 --- a/src/plugins/Ui/skinned/mainwindow.cpp +++ b/src/plugins/Ui/skinned/mainwindow.cpp @@ -36,6 +36,7 @@ #include <qmmpui/playlistmanager.h> #include <qmmpui/mediaplayer.h> #include <qmmpui/configdialog.h> +#include <qmmpui/qmmpuisettings.h> #include "hotkeyeditor.h" #include "skinnedsettings.h" #include "mainwindow.h" @@ -68,6 +69,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) m_core = SoundCore::instance(); m_pl_manager = PlayListManager::instance(); m_uiHelper = UiHelper::instance(); + m_ui_settings = QmmpUiSettings::instance(); //user interface m_skin = new Skin(this); @@ -99,8 +101,8 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) connect (m_playlist,SIGNAL(loadPlaylist()),SLOT(loadPlaylist())); connect (m_playlist,SIGNAL(savePlaylist()),SLOT(savePlaylist())); - connect(m_display,SIGNAL(shuffleToggled(bool)),m_pl_manager,SLOT(setShuffle(bool))); - connect(m_display,SIGNAL(repeatableToggled(bool)),m_pl_manager,SLOT(setRepeatableList(bool))); + connect(m_display,SIGNAL(shuffleToggled(bool)),m_ui_settings,SLOT(setShuffle(bool))); + connect(m_display,SIGNAL(repeatableToggled(bool)),m_ui_settings,SLOT(setRepeatableList(bool))); connect(m_core, SIGNAL(stateChanged(Qmmp::State)), SLOT(showState(Qmmp::State))); connect(m_core, SIGNAL(elapsedChanged(qint64)),m_playlist, SLOT(setTime(qint64))); @@ -241,10 +243,12 @@ void MainWindow::readSettings() m_equalizer->setVisible(settings.value("eq_visible",true).toBool()); qApp->processEvents(); // Repeat/Shuffle - m_display->setIsRepeatable(m_pl_manager->isRepeatableList()); - m_display->setIsShuffle(m_pl_manager->isShuffle()); - ACTION(ActionManager::REPEAT_ALL)->setChecked(m_pl_manager->isRepeatableList()); - ACTION(ActionManager::SHUFFLE)->setChecked(m_pl_manager->isShuffle()); + m_display->setIsRepeatable(m_ui_settings->isRepeatableList()); + m_display->setIsShuffle(m_ui_settings->isShuffle()); + ACTION(ActionManager::REPEAT_ALL)->setChecked(m_ui_settings->isRepeatableList()); + ACTION(ActionManager::SHUFFLE)->setChecked(m_ui_settings->isShuffle()); + ACTION(ActionManager::REPEAT_TRACK)->setChecked(m_ui_settings->isRepeatableTrack()); + ACTION(ActionManager::NO_PL_ADVANCE)->setChecked(m_ui_settings->isNoPlaylistAdvance()); m_update = true; } else @@ -379,21 +383,21 @@ void MainWindow::createActions() viewMenu->addAction(SET_ACTION(ActionManager::WM_DOUBLE_SIZE, this, SLOT(updateSettings()))); QMenu *plMenu = m_mainMenu->addMenu(tr("Playlist")); - plMenu->addAction(SET_ACTION(ActionManager::REPEAT_ALL, m_pl_manager, SLOT(setRepeatableList(bool)))); - plMenu->addAction(SET_ACTION(ActionManager::REPEAT_TRACK, m_player, SLOT(setRepeatable(bool)))); - plMenu->addAction(SET_ACTION(ActionManager::SHUFFLE, m_pl_manager, SLOT(setShuffle(bool)))); - plMenu->addAction(SET_ACTION(ActionManager::NO_PL_ADVANCE, m_player, + plMenu->addAction(SET_ACTION(ActionManager::REPEAT_ALL, m_ui_settings, SLOT(setRepeatableList(bool)))); + plMenu->addAction(SET_ACTION(ActionManager::REPEAT_TRACK, m_ui_settings, SLOT(setRepeatableTrack(bool)))); + plMenu->addAction(SET_ACTION(ActionManager::SHUFFLE, m_ui_settings, SLOT(setShuffle(bool)))); + plMenu->addAction(SET_ACTION(ActionManager::NO_PL_ADVANCE, m_ui_settings, SLOT(setNoPlaylistAdvance(bool)))); plMenu->addAction(SET_ACTION(ActionManager::STOP_AFTER_SELECTED, m_pl_manager, SLOT(stopAfterSelected()))); plMenu->addAction(SET_ACTION(ActionManager::CLEAR_QUEUE, m_pl_manager, SLOT(clearQueue()))); - connect(m_pl_manager, SIGNAL(repeatableListChanged(bool)), + connect(m_ui_settings, SIGNAL(repeatableListChanged(bool)), ACTION(ActionManager::REPEAT_ALL), SLOT(setChecked(bool))); - connect(m_player, SIGNAL (repeatableChanged(bool)), + connect(m_ui_settings, SIGNAL (repeatableTrackChanged(bool)), ACTION(ActionManager::REPEAT_TRACK), SLOT(setChecked(bool))); - connect(m_player, SIGNAL (noPlaylistAdvanceChanged(bool)), + connect(m_ui_settings, SIGNAL (noPlaylistAdvanceChanged(bool)), ACTION(ActionManager::NO_PL_ADVANCE), SLOT(setChecked(bool))); - connect(m_pl_manager, SIGNAL(shuffleChanged(bool)), + connect(m_ui_settings, SIGNAL(shuffleChanged(bool)), ACTION(ActionManager::SHUFFLE), SLOT(setChecked(bool))); QMenu *audioMenu = m_mainMenu->addMenu(tr("Audio")); diff --git a/src/plugins/Ui/skinned/mainwindow.h b/src/plugins/Ui/skinned/mainwindow.h index ec50fe483..48672c750 100644 --- a/src/plugins/Ui/skinned/mainwindow.h +++ b/src/plugins/Ui/skinned/mainwindow.h @@ -40,6 +40,7 @@ class UiHelper; class MediaPlayer; class QMenu; class QKeyEvent; +class QmmpUiSettings; /** @author Ilya Kotov <forkotov02@hotmail.ru> @@ -105,6 +106,7 @@ private: bool m_hideOnClose, m_startHidden; VisualMenu *m_visMenu; UiHelper *m_uiHelper; + QmmpUiSettings *m_ui_settings; MediaPlayer *m_player; }; diff --git a/src/plugins/Ui/skinned/playlist.cpp b/src/plugins/Ui/skinned/playlist.cpp index e95977804..ccb722460 100644 --- a/src/plugins/Ui/skinned/playlist.cpp +++ b/src/plugins/Ui/skinned/playlist.cpp @@ -30,6 +30,7 @@ #include <qmmpui/playlistmodel.h> #include <qmmpui/playlistmanager.h> #include <qmmpui/uihelper.h> +#include <qmmpui/qmmpuisettings.h> #include <qmmp/soundcore.h> #include "dock.h" #include "skin.h" @@ -53,6 +54,7 @@ PlayList::PlayList (PlayListManager *manager, QWidget *parent) setAttribute(Qt::WA_AlwaysShowToolTips,true); setWindowTitle(tr("Playlist")); m_pl_manager = manager; + m_ui_settings = QmmpUiSettings::instance(); m_update = false; m_resize = false; m_skin = Skin::instance(); @@ -299,8 +301,8 @@ void PlayList::createActions() m_sortMenu->addAction (QIcon::fromTheme("view-sort-descending"), tr("Reverse List"), m_pl_manager, SLOT(reverseList())); - m_sortMenu->addAction(SET_ACTION(ActionManager::PL_GROUP_TRACKS, m_pl_manager, SLOT(setGroupsEnabled(bool)))); - ACTION(ActionManager::PL_GROUP_TRACKS)->setChecked(m_pl_manager->isGroupsEnabled()); + m_sortMenu->addAction(SET_ACTION(ActionManager::PL_GROUP_TRACKS, m_ui_settings, SLOT(setGroupsEnabled(bool)))); + ACTION(ActionManager::PL_GROUP_TRACKS)->setChecked(m_ui_settings->isGroupsEnabled()); //playlist context menu m_listWidget->menu()->addAction(ActionManager::instance()->action(ActionManager::PL_SHOW_INFO)); m_listWidget->menu()->addSeparator(); diff --git a/src/plugins/Ui/skinned/playlist.h b/src/plugins/Ui/skinned/playlist.h index 1b7f73bd8..12454bbdf 100644 --- a/src/plugins/Ui/skinned/playlist.h +++ b/src/plugins/Ui/skinned/playlist.h @@ -40,6 +40,7 @@ class KeyboardManager; class PlayListManager; class PlayListBrowser; class PlayListSelector; +class QmmpUiSettings; /** @author Ilya Kotov <forkotov02@hotmail.ru> @@ -130,6 +131,7 @@ class PlayList : public QWidget int m_height; bool m_shaded; PlayListManager *m_pl_manager; + QmmpUiSettings *m_ui_settings; KeyboardManager* m_keyboardManager; QPointer <PlayListBrowser> m_pl_browser; PlayListSelector *m_pl_selector; |
