83 lines
2.6 KiB
C++
83 lines
2.6 KiB
C++
/*
|
|
* Cantata
|
|
*
|
|
* Copyright (c) 2011 Craig Drummond <craig.p.drummond@gmail.com>
|
|
*
|
|
* ----
|
|
*
|
|
* 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; see the file COPYING. If not, write to
|
|
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
* Boston, MA 02110-1301, USA.
|
|
*/
|
|
|
|
#include "streamspage.h"
|
|
#include <QtGui/QIcon>
|
|
#include <QtGui/QToolButton>
|
|
#ifdef ENABLE_KDE_SUPPORT
|
|
#include <KAction>
|
|
#include <KLocale>
|
|
#include <KActionCollection>
|
|
#else
|
|
#include <QAction>
|
|
#endif
|
|
|
|
StreamsPage::StreamsPage(MainWindow *p)
|
|
: QWidget(p)
|
|
{
|
|
setupUi(this);
|
|
#ifdef ENABLE_KDE_SUPPORT
|
|
addAction = p->actionCollection()->addAction("addstream");
|
|
addAction->setText(i18n("Add Stream"));
|
|
removeAction = p->actionCollection()->addAction("removestream");
|
|
removeAction->setText(i18n("Remove Stream"));
|
|
#else
|
|
addAction = new QAction(tr("Add Stream"), this);
|
|
removeAction = new QAction(tr("Remove Stream"), this);
|
|
#endif
|
|
addAction->setIcon(QIcon::fromTheme("list-add"));
|
|
removeAction->setIcon(QIcon::fromTheme("list-remove"));
|
|
addStream->setDefaultAction(addAction);
|
|
removeStream->setDefaultAction(removeAction);
|
|
addToPlaylist->setDefaultAction(p->addToPlaylistAction);
|
|
replacePlaylist->setDefaultAction(p->replacePlaylistAction);
|
|
connect(view, SIGNAL(itemsSelected(bool)), addToPlaylist, SLOT(setEnabled(bool)));
|
|
connect(view, SIGNAL(itemsSelected(bool)), replacePlaylist, SLOT(setEnabled(bool)));
|
|
connect(view, SIGNAL(itemsSelected(bool)), removeStream, SLOT(setEnabled(bool)));
|
|
connect(addAction, SIGNAL(triggered(bool)), this, SLOT(add()));
|
|
connect(removeAction, SIGNAL(triggered(bool)), this, SLOT(remove()));
|
|
|
|
addStream->setAutoRaise(true);
|
|
removeStream->setAutoRaise(true);
|
|
addToPlaylist->setAutoRaise(true);
|
|
replacePlaylist->setAutoRaise(true);
|
|
removeStream->setEnabled(false);
|
|
addToPlaylist->setEnabled(false);
|
|
replacePlaylist->setEnabled(false);
|
|
|
|
view->addAction(p->addToPlaylistAction);
|
|
view->addAction(p->replacePlaylistAction);
|
|
}
|
|
|
|
StreamsPage::~StreamsPage()
|
|
{
|
|
}
|
|
|
|
void StreamsPage::add()
|
|
{
|
|
}
|
|
|
|
void StreamsPage::remove()
|
|
{
|
|
}
|