diff --git a/src/qprojectM/src/QPlaylistFileDialog.hpp b/src/qprojectM/src/QPlaylistFileDialog.hpp new file mode 100644 index 000000000..ae47853b9 --- /dev/null +++ b/src/qprojectM/src/QPlaylistFileDialog.hpp @@ -0,0 +1,43 @@ +/*************************************************************************** + * Copyright (C) 2007 by carm * + * carm@localhost * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + + +#ifndef QPLAYLIST_FILEDIALOG_H +#define QPLAYLIST_FILEDIALOG_H + +#include + + class QPlaylistFileDialog : public QFileDialog + { + Q_OBJECT // must include this if you use Qt signals/slots + + public: + QPlaylistFileDialog(QWidget * parent = 0): + QFileDialog(parent, "Open a new preset playlist", QString(), "Preset Playlists (*.ppl)" ) { + + this->setFileMode(QFileDialog::ExistingFile); + } + + ~QPlaylistFileDialog() { } + private: + + +}; +#endif diff --git a/src/qprojectM/src/QPlaylistModel.cpp b/src/qprojectM/src/QPlaylistModel.cpp index c88883c1b..1a14ec7ea 100644 --- a/src/qprojectM/src/QPlaylistModel.cpp +++ b/src/qprojectM/src/QPlaylistModel.cpp @@ -215,6 +215,7 @@ void QPlaylistModel::clearItems() endRemoveRows(); } + bool QPlaylistModel::writePlaylist ( const QString & file ) { QFile qfile(file); diff --git a/src/qprojectM/src/QPlaylistModel.hpp b/src/qprojectM/src/QPlaylistModel.hpp index 70fc2ebe2..fed32028e 100644 --- a/src/qprojectM/src/QPlaylistModel.hpp +++ b/src/qprojectM/src/QPlaylistModel.hpp @@ -71,9 +71,10 @@ inline void setPlaylistDesc(const QString & desc) { } void clearItems(); -public slots: -void updateItemHighlights(); +public slots: + void updateItemHighlights(); + private: void readPlaylistItem(QXmlStreamReader & reader); diff --git a/src/qprojectM/src/QProjectM_MainWindow.cpp b/src/qprojectM/src/QProjectM_MainWindow.cpp index c612c0670..a3f01d916 100644 --- a/src/qprojectM/src/QProjectM_MainWindow.cpp +++ b/src/qprojectM/src/QProjectM_MainWindow.cpp @@ -251,6 +251,13 @@ void QProjectM_MainWindow::keyReleaseEvent ( QKeyEvent * e ) this->setWindowState ( this->windowState() ^ Qt::WindowFullScreen ); return; + case Qt::Key_Delete: +// const QModelIndexList & list = ui->tableView->selectedIndexes(); +// for (QModelIndexList::iterator pos = list.begin(); pos != list.end(); ++pos) { +// QModelIndex index = *pos; +// playlistModel->removeRow(index.row()); +// } + return; case Qt::Key_M: if ( ui->presetSearchBarLineEdit->hasFocus() ) return;