Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit c3525dc2 authored by Scott Wheeler's avatar Scott Wheeler

Removing files which are no longer used. (Because of the cleanups everything

all of the playlists and the "collection" are an instance or subclass of
Playlist.)

svn path=/trunk/kdemultimedia/juk/; revision=178227
parent 3a9ea139
/***************************************************************************
playlistwidget.cpp - description
-------------------
begin : Tue Feb 5 2002
copyright : (C) 2002 by Scott Wheeler
email : scott@slackorama.net
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#include <klocale.h>
#include <qnamespace.h>
#include <qvbox.h>
#include <qhbox.h>
#include <qlayout.h>
#include <qlabel.h>
#include "playlistwidget.h"
////////////////////////////////////////////////////////////////////////////////
// public members
////////////////////////////////////////////////////////////////////////////////
PlaylistWidget::PlaylistWidget(QWidget *parent) : QWidget(parent)
{
setupLayout();
}
PlaylistWidget::~PlaylistWidget()
{
}
void PlaylistWidget::add(const QString &item)
{
playlistList->append(item);
}
void PlaylistWidget::add(QStringList &items)
{
playlistList->append(items);
}
void PlaylistWidget::add(PlaylistItem *item)
{
playlistList->append(item);
}
void PlaylistWidget::add(QPtrList<PlaylistItem> &items)
{
playlistList->append(items);
}
void PlaylistWidget::remove(QPtrList<PlaylistItem> &items)
{
playlistList->remove(items);
}
Playlist *PlaylistWidget::getPlaylistList()
{
return(playlistList);
}
QPtrList<PlaylistItem> PlaylistWidget::getSelectedItems()
{
return(playlistList->selectedItems());
}
PlaylistItem *PlaylistWidget::firstItem()
{
return(dynamic_cast<PlaylistItem *>(playlistList->firstChild()));
}
////////////////////////////////////////////////////////////////////////////////
// private members
////////////////////////////////////////////////////////////////////////////////
void PlaylistWidget::setupLayout()
{
/////////////////////////////////////////////////////////////////////////
// define a main layout box
/////////////////////////////////////////////////////////////////////////
QVBoxLayout *playlistMainLayout = new QVBoxLayout(this);
playlistList = new Playlist(this, "playlistList");
playlistMainLayout->addWidget(playlistList);
}
/***************************************************************************
playlistwidget.h - description
-------------------
begin : Tue Feb 5 2002
copyright : (C) 2002 by Scott Wheeler
email : scott@slackorama.net
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#ifndef PLAYLISTWIDGET_H
#define PLAYLISTWIDGET_H
#include <klistview.h>
#include <qptrlist.h>
#include "playlist.h"
#include "playlistitem.h"
class PlaylistWidget : public QWidget
{
public:
PlaylistWidget(QWidget *parent);
virtual ~PlaylistWidget();
void add(const QString &item);
void add(QStringList &items);
void add(PlaylistItem *item);
void add(QPtrList<PlaylistItem> &items);
void remove(QPtrList<PlaylistItem> &items);
Playlist *getPlaylistList();
QPtrList<PlaylistItem> getSelectedItems();
PlaylistItem *firstItem();
private:
void setupLayout();
// main visual objects
Playlist *playlistList;
};
#endif
/***************************************************************************
taggerwidget.cpp - description
-------------------
begin : Tue Feb 5 2002
copyright : (C) 2002 by Scott Wheeler
email : scott@slackorama.net
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#include <kmessagebox.h>
#include <klocale.h>
#include <kdebug.h>
#include <qsplitter.h>
#include <qvbox.h>
#include <qhbox.h>
#include <qlayout.h>
#include <qlabel.h>
#include <qdir.h>
#include "taggerwidget.h"
#include "genrelistlist.h"
////////////////////////////////////////////////////////////////////////////////
// public members
////////////////////////////////////////////////////////////////////////////////
TaggerWidget::TaggerWidget(QWidget *parent) : QWidget(parent)
{
setupLayout();
}
TaggerWidget::~TaggerWidget()
{
}
void TaggerWidget::add(const QString &item)
{
taggerList->append(item);
}
void TaggerWidget::add(const QStringList &items)
{
taggerList->append(items);
}
Playlist *TaggerWidget::getTaggerList()
{
return(taggerList);
}
QPtrList<PlaylistItem> TaggerWidget::getSelectedItems()
{
return(taggerList->selectedItems());
}
////////////////////////////////////////////////////////////////////////////////
// public slots
////////////////////////////////////////////////////////////////////////////////
void TaggerWidget::save()
{
if(editor)
editor->save();
}
void TaggerWidget::remove()
{
taggerList->remove();
}
void TaggerWidget::remove(const QPtrList<PlaylistItem> &items)
{
taggerList->remove(items);
}
////////////////////////////////////////////////////////////////////////////////
// private members
////////////////////////////////////////////////////////////////////////////////
void TaggerWidget::setupLayout()
{
//////////////////////////////////////////////////////////////////////////////
// define a main layout box -- all that should be in this is the splitter
//////////////////////////////////////////////////////////////////////////////
QVBoxLayout *taggerMainLayout = new QVBoxLayout(this);
//////////////////////////////////////////////////////////////////////////////
// set up a vertical splitter between the file list and the track information
//////////////////////////////////////////////////////////////////////////////
QSplitter *split = new QSplitter(Qt::Vertical, this);
split->setOpaqueResize();
//////////////////////////////////////////////////////////////////////////////
// add the splitter to the main layout -- once again, it should for now be
// the only thing in this layout object
//////////////////////////////////////////////////////////////////////////////
taggerMainLayout->addWidget(split);
//////////////////////////////////////////////////////////////////////////////
// initialze the tagger list -- the top of the splitter
//////////////////////////////////////////////////////////////////////////////
taggerList = new Playlist(split, "taggerList");
//////////////////////////////////////////////////////////////////////////////
// now set up a bottom widget of the splitter and make it stay small at
// start up. also define a bottem layout to organize things in
//////////////////////////////////////////////////////////////////////////////
editor = new TagEditor(split, "editor");
split->setResizeMode(editor, QSplitter::FollowSizeHint);
//////////////////////////////////////////////////////////////////////////////
// set up some connections
//////////////////////////////////////////////////////////////////////////////
// Should be moved to CollectionList
connect(taggerList, SIGNAL(collectionChanged(Playlist *)), editor, SLOT(updateCollection(Playlist *)));
// Should be moved to Playlist constructor
connect(taggerList, SIGNAL(selectionChanged(const QPtrList<PlaylistItem> &)), editor, SLOT(setItems(const QPtrList<PlaylistItem> &)));
}
#include "taggerwidget.moc"
/***************************************************************************
taggerwidget.h - description
-------------------
begin : Tue Feb 5 2002
copyright : (C) 2002 by Scott Wheeler
email : scott@slackorama.net
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#ifndef TAGGERWIDGET_H
#define TAGGERWIDGET_H
#include <qptrlist.h>
#include "playlist.h"
#include "playlistitem.h"
#include "genrelist.h"
#include "tageditor.h"
class TaggerWidget : public QWidget
{
Q_OBJECT
public:
TaggerWidget(QWidget *parent);
virtual ~TaggerWidget();
void add(const QString &item);
void add(const QStringList &items);
Playlist *getTaggerList();
QPtrList<PlaylistItem> getSelectedItems();
public slots:
void save();
void remove();
void remove(const QPtrList<PlaylistItem> &items);
private:
void setupLayout();
// main visual objects
Playlist *taggerList;
TagEditor *editor;
};
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment