Make playlist's selection buttons work
This commit is contained in:
parent
c988db9f31
commit
eef3e53bd9
4 changed files with 23 additions and 3 deletions
|
@ -38,7 +38,7 @@ XSettings::value_get (QString key)
|
|||
}
|
||||
|
||||
void
|
||||
XSettings::value_get (QString key, QString val)
|
||||
XSettings::value_set (QString key, QString val)
|
||||
{
|
||||
/* Only send change request to server here
|
||||
* update of local cache will be done through handle_config_value_changed
|
||||
|
|
|
@ -339,6 +339,7 @@ PlaylistWidget::addButtons (void)
|
|||
{
|
||||
PlaylistMenuButton *b;
|
||||
|
||||
/* Add menu */
|
||||
m_add = new PlaylistMenu (this, Skin::PLS_ADD,
|
||||
Skin::PLS_ADD_DEC);
|
||||
b = new PlaylistMenuButton (m_add, Skin::PLS_ADD_URL_0,
|
||||
|
@ -351,7 +352,7 @@ PlaylistWidget::addButtons (void)
|
|||
Skin::PLS_ADD_FIL_1);
|
||||
connect (b, SIGNAL(activated ()), this, SLOT (menuAddFile ()));
|
||||
|
||||
|
||||
/* Del menu */
|
||||
m_del = new PlaylistMenu (this, Skin::PLS_DEL,
|
||||
Skin::PLS_DEL_DEC);
|
||||
b = new PlaylistMenuButton (m_del, Skin::PLS_MSC_BTN_0,
|
||||
|
@ -366,15 +367,23 @@ PlaylistWidget::addButtons (void)
|
|||
Skin::PLS_DEL_FIL_1);
|
||||
// connect (b, SIGNAL(activated ()), m_list, SLOT (deleteFiles ()));
|
||||
|
||||
/* Selection menu */
|
||||
m_sel = new PlaylistMenu (this, Skin::PLS_SEL,
|
||||
Skin::PLS_SEL_DEC);
|
||||
b = new PlaylistMenuButton (m_sel, Skin::PLS_SEL_INV_0,
|
||||
Skin::PLS_SEL_INV_1);
|
||||
connect (b, SIGNAL (activated ()),
|
||||
m_view, SLOT (invertSelection ()));
|
||||
b = new PlaylistMenuButton (m_sel, Skin::PLS_SEL_NIL_0,
|
||||
Skin::PLS_SEL_NIL_1);
|
||||
connect (b, SIGNAL (activated ()),
|
||||
m_view, SLOT (clearSelection ()));
|
||||
b = new PlaylistMenuButton (m_sel, Skin::PLS_SEL_ALL_0,
|
||||
Skin::PLS_SEL_ALL_1);
|
||||
connect (b, SIGNAL (activated ()),
|
||||
m_view, SLOT (selectAll ()));
|
||||
|
||||
/* misc menu */
|
||||
m_msc = new PlaylistMenu (this, Skin::PLS_MSC,
|
||||
Skin::PLS_MSC_DEC);
|
||||
b = new PlaylistMenuButton (m_msc, Skin::PLS_MSC_SRT_0,
|
||||
|
@ -383,7 +392,7 @@ PlaylistWidget::addButtons (void)
|
|||
Skin::PLS_MSC_INF_1);
|
||||
b = new PlaylistMenuButton (m_msc, Skin::PLS_MSC_OPT_0,
|
||||
Skin::PLS_MSC_OPT_1);
|
||||
|
||||
/* playlist menu */
|
||||
m_lst = new PlaylistMenu (this, Skin::PLS_LST,
|
||||
Skin::PLS_LST_DEC);
|
||||
b = new PlaylistMenuButton (m_lst, Skin::PLS_LST_NEW_0,
|
||||
|
|
|
@ -109,6 +109,16 @@ PlaylistView::PlaylistView (QWidget *parent) : QListView (parent)
|
|||
this, SLOT(handleStatus(Xmms::Playback::Status)));
|
||||
}
|
||||
|
||||
void
|
||||
PlaylistView::invertSelection () {
|
||||
QItemSelection selection = QItemSelection (model ()->index (0, 0),
|
||||
model ()->index (model ()->rowCount ()-1, 0));
|
||||
selectionModel ()->select (selection, QItemSelectionModel::Toggle |
|
||||
QItemSelectionModel::Columns);
|
||||
selectionModel()->setCurrentIndex(model ()->index (0, 0),
|
||||
QItemSelectionModel::NoUpdate);
|
||||
}
|
||||
|
||||
void
|
||||
PlaylistView::setModel (QAbstractItemModel *model) {
|
||||
QListView::setModel (model);
|
||||
|
|
|
@ -37,6 +37,7 @@ class PlaylistView : public QListView {
|
|||
void contextMenuEvent (QContextMenuEvent *e);
|
||||
|
||||
void handleStatus (const Xmms::Playback::Status st);
|
||||
void invertSelection (void);
|
||||
void settingsSaved (void);
|
||||
void setPixmaps (Skin *skin);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue