diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-05 19:32:49 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-05 19:32:49 +0000 |
commit | 2e77c0b4ce1781d87a532022d8ebaccff0fb2b17 (patch) | |
tree | 26280a750b189b6bc989565eed26a256bb8fd9bb /src | |
download | kstreamripper-2e77c0b4ce1781d87a532022d8ebaccff0fb2b17.tar.gz kstreamripper-2e77c0b4ce1781d87a532022d8ebaccff0fb2b17.zip |
Added kstreamripper
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kstreamripper@1239912 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src')
-rw-r--r-- | src/SConscript | 69 | ||||
-rw-r--r-- | src/addnewstream.ui | 108 | ||||
-rw-r--r-- | src/addnewstreamimpl.cpp | 66 | ||||
-rw-r--r-- | src/addnewstreamimpl.h | 48 | ||||
-rw-r--r-- | src/hi16-app-kstreamripper.png | bin | 0 -> 1033 bytes | |||
-rw-r--r-- | src/hi32-app-kstreamripper.png | bin | 0 -> 2749 bytes | |||
-rw-r--r-- | src/kstreamripper.cpp | 309 | ||||
-rw-r--r-- | src/kstreamripper.desktop | 16 | ||||
-rw-r--r-- | src/kstreamripper.h | 79 | ||||
-rw-r--r-- | src/kstreamripper.lsm | 16 | ||||
-rw-r--r-- | src/kstreamripperbase.ui | 337 | ||||
-rw-r--r-- | src/kstreamripperui.rc | 8 | ||||
-rw-r--r-- | src/main.cpp | 66 | ||||
-rw-r--r-- | src/processcontroller.cpp | 148 | ||||
-rw-r--r-- | src/processcontroller.h | 71 | ||||
-rw-r--r-- | src/processlistviewitem.cpp | 108 | ||||
-rw-r--r-- | src/processlistviewitem.h | 71 | ||||
-rw-r--r-- | src/processlistviewitem_interface.h | 38 |
18 files changed, 1558 insertions, 0 deletions
diff --git a/src/SConscript b/src/SConscript new file mode 100644 index 0000000..5d40432 --- /dev/null +++ b/src/SConscript @@ -0,0 +1,69 @@ +#! /usr/bin/env python +## This script demonstrates how to build and install +## a simple kde program having KconfigXT settings +## with scons +## +## Thomas Nagy, 2004, 2005 + +## This file can be reused freely for any project (see COPYING) + +############################ +## load the config + +## Use the environment and the tools set in the top-level +## SConstruct file (set with 'Export') - this is very important + +Import( 'env' ) +myenv=env.Copy() + +############################# +## the programs to build + +# The sources for our program - only .ui, .skel and .cpp are accepted +kstreamripper_sources = """ +addnewstreamimpl.cpp +addnewstream.ui +kstreamripperbase.ui +kstreamripper.cpp +main.cpp +processcontroller.cpp +processlistviewitem.cpp +""".split() + +# Our main program +# KDEprogram add the file to the install targets automatically, +# so you do not need to write KDEinstall('KDEBIN', '', test1, myenv) +myenv.KDEprogram( "kstreamripper", kstreamripper_sources ) + +############################ +## Customization + +## Additional include paths for compiling the source files +## Always add '../' (top-level directory) because moc makes code that needs it +myenv.KDEaddpaths_includes( ['./', '../'] ) + +## Necessary libraries to link against +myenv.KDEaddlibs( ['qt-mt', 'kio', 'kdeui'] ) +if env['KDEm2']>3: myenv.KDEaddlibs( ['kdnssd']) +############################# +## Data to install + +## The ui.rc file and the tips go into datadir/appname/ +myenv.KDEinstall( 'KDEDATA', 'kstreamripper', 'kstreamripperui.rc' ) + +## The kcfg file is installed in a global kcfg directory +#myenv.KDEinstall( 'KDEKCFG', '', 'test1.kcfg' ) + +## Warning : there is a difference between the normal destop file used for the menu +## and the servicetype desktop file, so they go in different directories +## you will find more information in 'test3' +myenv.KDEinstall( 'KDEMENU', 'Utilities', 'kstreamripper.desktop') + +## Use this when you need to install a mimetype file +#myenv.KDEinstall( 'KDEMIME', 'application', 'x-test1.desktop' ) + +## Installing icons is easy (hi-16-app-test1.png, hi-22-app-test1.png) +## do not forget that this is a python script so loops are allowed here :) +myenv.KDEicon( 'hi16-app-kstreameripper.png') +myenv.KDEicon( 'hi32-app-kstreameripper.png') + diff --git a/src/addnewstream.ui b/src/addnewstream.ui new file mode 100644 index 0000000..5b46733 --- /dev/null +++ b/src/addnewstream.ui @@ -0,0 +1,108 @@ +<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> +<class>AddNewStream</class> +<widget class="QDialog"> + <property name="name"> + <cstring>AddNewStream</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>383</width> + <height>287</height> + </rect> + </property> + <property name="caption"> + <string>Add Stream....</string> + </property> + <property name="focusPolicy"> + <enum>TabFocus</enum> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QFrame" row="0" column="0" rowspan="1" colspan="2"> + <property name="name"> + <cstring>frame3</cstring> + </property> + <property name="frameShape"> + <enum>StyledPanel</enum> + </property> + <property name="frameShadow"> + <enum>Raised</enum> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QLabel" row="0" column="0"> + <property name="name"> + <cstring>d_nameLabel</cstring> + </property> + <property name="text"> + <string>Name:</string> + </property> + </widget> + <widget class="QLabel" row="2" column="0"> + <property name="name"> + <cstring>d_descriptionLabel</cstring> + </property> + <property name="text"> + <string>Description:</string> + </property> + </widget> + <widget class="QLineEdit" row="0" column="1"> + <property name="name"> + <cstring>d_nameEdit</cstring> + </property> + </widget> + <widget class="QLineEdit" row="1" column="1"> + <property name="name"> + <cstring>d_urlEdit</cstring> + </property> + </widget> + <widget class="QLineEdit" row="2" column="1"> + <property name="name"> + <cstring>d_descEdit</cstring> + </property> + </widget> + <widget class="QLabel" row="1" column="0"> + <property name="name"> + <cstring>d_urlLabel</cstring> + </property> + <property name="text"> + <string>Url of Stream:</string> + </property> + </widget> + </grid> + </widget> + <widget class="QPushButton" row="1" column="0"> + <property name="name"> + <cstring>d_okButton</cstring> + </property> + <property name="focusPolicy"> + <enum>TabFocus</enum> + </property> + <property name="text"> + <string>&Ok</string> + </property> + <property name="accel"> + <string>Alt+O</string> + </property> + </widget> + <widget class="QPushButton" row="1" column="1"> + <property name="name"> + <cstring>d_cancelButton</cstring> + </property> + <property name="text"> + <string>&Cancel</string> + </property> + <property name="accel"> + <string>Alt+C</string> + </property> + </widget> + </grid> +</widget> +<layoutdefaults spacing="6" margin="11"/> +</UI> diff --git a/src/addnewstreamimpl.cpp b/src/addnewstreamimpl.cpp new file mode 100644 index 0000000..033e44e --- /dev/null +++ b/src/addnewstreamimpl.cpp @@ -0,0 +1,66 @@ +/*************************************************************************** + * Copyright (C) 2003-2005 by Michael Goettsche * + * mail@tuxipuxi.org * + * * + * 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. * + ***************************************************************************/ + +#include <kmessagebox.h> + +#include <qpushbutton.h> +#include <qlineedit.h> + +#include "addnewstreamimpl.h" + + +AddNewStreamImpl::AddNewStreamImpl( QWidget* parent, const char* name ) + : AddNewStream( parent,name, true ) +{ + connect( d_okButton, SIGNAL( clicked()), this, SLOT( okButtonClicked()) ); + connect( d_cancelButton, SIGNAL( clicked()), this, SLOT( cancelButtonClicked()) ); +} + + +AddNewStreamImpl::~AddNewStreamImpl() +{ +} + + +//SLOTS + + +void AddNewStreamImpl::okButtonClicked() +{ + if( d_nameEdit->text() != "" && d_urlEdit->text() != "") + { + emit finished( this ); + this->close(); + } + else + { + KMessageBox::error( this, "You forgot to fill out one or more fields, please do it now.", + "Missing Information" ); + } +} + + +void AddNewStreamImpl::cancelButtonClicked() +{ + this->close(); +} + + + diff --git a/src/addnewstreamimpl.h b/src/addnewstreamimpl.h new file mode 100644 index 0000000..30bcb49 --- /dev/null +++ b/src/addnewstreamimpl.h @@ -0,0 +1,48 @@ +/*************************************************************************** + * Copyright (C) 2003-2005 by Michael Goettsche * + * mail@tuxipuxi.org * + * * + * 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 ADDNEWSTREAMIMPL_H +#define ADDNEWSTREAMIMPL_H + +#include "addnewstream.h" + +class AddNewStreamImpl : public AddNewStream +{ + Q_OBJECT + +public: + + AddNewStreamImpl( QWidget* parent = 0, const char* name = 0 ); + ~AddNewStreamImpl(); + +protected: + +protected slots: + + void okButtonClicked(); + void cancelButtonClicked(); + +signals: + + void finished( AddNewStreamImpl* ); +}; + +#endif + diff --git a/src/hi16-app-kstreamripper.png b/src/hi16-app-kstreamripper.png Binary files differnew file mode 100644 index 0000000..4ed606c --- /dev/null +++ b/src/hi16-app-kstreamripper.png diff --git a/src/hi32-app-kstreamripper.png b/src/hi32-app-kstreamripper.png Binary files differnew file mode 100644 index 0000000..45ae1a1 --- /dev/null +++ b/src/hi32-app-kstreamripper.png diff --git a/src/kstreamripper.cpp b/src/kstreamripper.cpp new file mode 100644 index 0000000..9641df2 --- /dev/null +++ b/src/kstreamripper.cpp @@ -0,0 +1,309 @@ +/*************************************************************************** + * Copyright (C) 2003-2005 by Michael Goettsche * + * mail@tuxipuxi.org * + * * + * 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. * + ***************************************************************************/ + + +#include <kconfig.h> +#include <kglobal.h> +#include <kled.h> +#include <kfiledialog.h> +#include <kaboutapplication.h> + +#include <qpushbutton.h> +#include <qlistview.h> +#include <qlineedit.h> +#include <qdir.h> +#include <qstring.h> +#include <qstringlist.h> +#include <qbuttongroup.h> +#include <qcheckbox.h> +#include <qprocess.h> +#include <qtextedit.h> +#include <qframe.h> +#include <qtimer.h> +#include <kmessagebox.h> +#include <kstandarddirs.h> +#include <kdeversion.h> + +#include "kstreamripper.h" +#include "addnewstreamimpl.h" +#include "processlistviewitem.h" +#include "processcontroller.h" + + + +KStreamRipper::KStreamRipper( QWidget* parent, const char* name ) + : KStreamRipperBase( parent,name ) +#if KDE_IS_VERSION(3,3,90) + , m_browser("_shoutcast._tcp",0,true) +#endif +{ + m_destEdit->setText( QDir::homeDirPath() ); + + m_streamsListView->addColumn( "Name" ); + m_streamsListView->addColumn( "Status" ); + m_streamsListView->addColumn( "Size" ); + + //app config + KConfig *appConfig = KGlobal::config(); + + m_destEdit->setText( appConfig->readEntry( "Destination" , "" ) ); + m_timeEdit->setText( appConfig->readEntry( "Riptime", "0" )); + m_tuneInEdit->setText( appConfig->readEntry( "Command", "xmms <url>" )); + m_id3Checkbox->setChecked( appConfig->readBoolEntry( "Id3Tag", 1 )); + + //listview entrys + QStringList nameList,urlList,descList; + + nameList = appConfig->readListEntry( "names" ); + urlList = appConfig->readListEntry( "urls" ); + descList = appConfig->readListEntry( "descs" ); + QStringList::iterator iter1, iter2, iter3; + iter1 = nameList.begin(); + iter2 = urlList.begin(); + iter3 = descList.begin(); + + for( ; iter1 != nameList.end() && iter2 != urlList.end() && iter3 != descList.end(); ++iter1, ++iter2, ++iter3 ) + { + ProcessListViewItem * proc = new ProcessListViewItem( m_streamsListView, *iter1, "", ""); + proc->setRenameEnabled(0, true); + proc->getProcessController()->setUrl( *iter2 ); + proc->getProcessController()->setDescription( *iter3 ); + } + + //CONNECTS + + //clicks + connect(m_addStreamButton, SIGNAL(clicked()), this, SLOT(addStreamButtonClicked())); + connect(m_deleteStreamButton, SIGNAL(clicked()), this, SLOT(deleteStreamButtonClicked())); + connect(m_tuneInButton, SIGNAL(clicked()), this, SLOT(tuneInButtonClicked())); + connect(m_ripButton, SIGNAL(clicked()), this, SLOT(ripButtonClicked())); + connect(m_stopRipButton, SIGNAL(clicked()), this, SLOT(stopRipButtonClicked())); + connect(m_browseButton, SIGNAL(clicked()), this, SLOT(browseButtonClicked())); + connect(m_aboutButton, SIGNAL(clicked()), this, SLOT(aboutButtonClicked())); + connect(m_quitButton, SIGNAL(clicked()), this, SLOT(quitButtonClicked())); + + //other + connect( m_streamsListView, SIGNAL(selectionChanged()), this, SLOT( selectedNewListItem()) ); + connect( m_DescriptionEdit, SIGNAL(textChanged(const QString&)), this, SLOT( descriptionChanged()) ); + connect( m_UrlEdit, SIGNAL(textChanged(const QString&)), this, SLOT( urlChanged()) ); + + // zeroconf +#if KDE_IS_VERSION(3,3,90) + connect(&m_browser, SIGNAL(serviceAdded(DNSSD::RemoteService::Ptr)), this, + SLOT(serviceAdded(DNSSD::RemoteService::Ptr))); + connect(&m_browser, SIGNAL(serviceRemoved(DNSSD::RemoteService::Ptr)), this, + SLOT(serviceRemoved(DNSSD::RemoteService::Ptr))); + m_browser.startBrowse(); +#endif +} + + +KStreamRipper::~KStreamRipper() +{ +} + + +void KStreamRipper::closeEvent( QCloseEvent *e ) +{ + KConfig *appConfig = KGlobal::config(); + + appConfig->writeEntry( "Destination", m_destEdit->text()); + appConfig->writeEntry( "Riptime", m_timeEdit->text()); + appConfig->writeEntry( "Command", m_tuneInEdit->text()); + appConfig->writeEntry( "Id3Tag", m_id3Checkbox->isChecked()); + + //save the listview entrys + + QStringList nameList,urlList,descList; + QListViewItemIterator iter( m_streamsListView ); + + while( iter.current() ) + { + ProcessListViewItem * ProcItem = (ProcessListViewItem*)iter.current(); + if(ProcItem->getProcessController()->getAutomatic()) continue; + + nameList.append( iter.current()->text( 0 )); + urlList.append( ProcItem->getProcessController()->getUrl() ); + descList.append( ProcItem->getProcessController()->getDescription() ); + ++iter; + } + + appConfig->writeEntry( "names", nameList ); + appConfig->writeEntry( "urls" , urlList ); + appConfig->writeEntry( "descs", descList ); + + appConfig->sync(); + + e->accept(); +} + + +//SLOTS +void KStreamRipper::addStreamButtonClicked() +{ + AddNewStreamImpl *test = new AddNewStreamImpl( this ); + connect( test, SIGNAL( finished( AddNewStreamImpl* )), this, SLOT( addStreamFinished( AddNewStreamImpl* )) ); + + test->show(); +} + +void KStreamRipper::deleteStreamButtonClicked() +{ + ProcessListViewItem * ProcItem = (ProcessListViewItem*)m_streamsListView->currentItem(); + stopRipButtonClicked(); + delete ProcItem; +} + +void KStreamRipper::tuneInButtonClicked() +{ + if( m_streamsListView->currentItem() ) + { + QString command = m_tuneInEdit->text().replace( "<url>", m_UrlEdit->text() ); + + QStringList commands = QStringList::split( " ", command ); + + QProcess *process = new QProcess( this ); + process->setArguments( commands ); + + process->start(); + } + else ; +} + +#if KDE_IS_VERSION(3,3,90) +void KStreamRipper::serviceAdded(DNSSD::RemoteService::Ptr srv) +{ + ProcessListViewItem * proc = new ProcessListViewItem( m_streamsListView, srv->serviceName(), "", ""); + proc->getProcessController()->setUrl( QString("http://%1:%2%3").arg(srv->hostName()).arg(srv->port()).arg(srv->textData()["path"]) ); + proc->getProcessController()->setDescription( i18n("found by Zeroconf") ); + proc->getProcessController()->setAutomatic(true); + proc->getProcessController()->setService(srv); + +} +void KStreamRipper::serviceRemoved(DNSSD::RemoteService::Ptr srv) +{ + QListViewItemIterator iter( m_streamsListView ); + + while( iter.current() ) { + ProcessListViewItem * ProcItem = (ProcessListViewItem*)iter.current(); + if (ProcItem->getProcessController()->getAutomatic() && + srv==ProcItem->getProcessController()->getService()) { + delete ProcItem; + return; + } + ++iter; + } + +} +#endif + +void KStreamRipper::ripButtonClicked() +{ + if (KStandardDirs::findExe("streamripper")) { + ProcessListViewItem * ProcItem = (ProcessListViewItem*)m_streamsListView->currentItem(); + ProcItem->getProcessController()->startRip(m_destEdit->text(), m_timeEdit->text()); + m_ripButton->setEnabled( false ); + m_stopRipButton->setEnabled( true ); + } else { + KMessageBox::error(this, "The streamripper executable wasn't found. Make sure " + "it's in your path.", "streamripper not found"); + } +} + +void KStreamRipper::stopRipButtonClicked() +{ + ProcessListViewItem * ProcItem = (ProcessListViewItem*)m_streamsListView->currentItem(); + ProcItem->getProcessController()->stopRip(); + m_ripButton->setEnabled( true ); + m_stopRipButton->setEnabled( false ); +} + +void KStreamRipper::browseButtonClicked() +{ + QString openDest = KFileDialog::getExistingDirectory( QDir::homeDirPath(), + this, + "Select Destination..." ); + m_destEdit->setText( openDest ); +} + +void KStreamRipper::aboutButtonClicked() +{ + KAboutApplication *aboutApp = new KAboutApplication(); + aboutApp->show(); +} + +void KStreamRipper::quitButtonClicked() +{ + this->close(); +} + +void KStreamRipper::selectedNewListItem() +{ + if ( !m_streamsListView->selectedItem() ) { + m_deleteStreamButton->setEnabled( false ); + m_tuneInButton->setEnabled( false ); + m_ripButton->setEnabled( false ); + m_DescriptionEdit->setText( QString::null ); + m_DescriptionEdit->setEnabled(false); + m_UrlEdit->setEnabled(false); + m_UrlEdit->setText( QString::null ); + return; + } + ProcessController * ProcCtl = ((ProcessListViewItem*)m_streamsListView->currentItem())->getProcessController(); + + // reconfigure what the user is allowed to do based on if this process is ripping + m_ripButton->setEnabled( !ProcCtl->getStatus() ); + m_stopRipButton->setEnabled( ProcCtl->getStatus() ); + m_tuneInButton->setEnabled( true ); + m_deleteStreamButton->setEnabled( !ProcCtl->getAutomatic() ); + + m_DescriptionEdit->setText(ProcCtl->getDescription()); + m_DescriptionEdit->setEnabled(true); + m_UrlEdit->setText(ProcCtl->getUrl()); + m_UrlEdit->setEnabled( !ProcCtl->getAutomatic() ); + + + // maybe these are more elegant than the next two functions, assuming the slots are implemented in ProcessController + //connect(m_DescriptionEdit, SIGNAL(textChanged(const QString&)), (ProcessListViewItem*)m_streamsListView->currentItem()->getProcessController(), SIGNAL(descriptionChanged(const QString&)) + //connect(m_UrlEdit, SIGNAL(textChanged(const QString&)), (ProcessListViewItem*)m_streamsListView->currentItem()->getProcessController(), SIGNAL(urlChanged(const QString&)) +} + +void KStreamRipper::descriptionChanged() +{ + // maybe this should be deleted and the communication would be through a slot + ProcessListViewItem * ProcItem = (ProcessListViewItem*)m_streamsListView->currentItem(); + ProcItem->getProcessController()->setDescription(m_DescriptionEdit->text()); +} + +void KStreamRipper::urlChanged() +{ + // maybe this should be deleted and the communication would be through a slot + ProcessListViewItem * ProcItem = (ProcessListViewItem*)m_streamsListView->currentItem(); + ProcItem->getProcessController()->setUrl(m_UrlEdit->text()); +} + + +void KStreamRipper::addStreamFinished( AddNewStreamImpl *e ) +{ + ProcessListViewItem * proc = new ProcessListViewItem( m_streamsListView, e->d_nameEdit->text(), "", ""); + proc->getProcessController()->setUrl( e->d_urlEdit->text() ); + proc->getProcessController()->setDescription( e->d_descEdit->text() ); +} + diff --git a/src/kstreamripper.desktop b/src/kstreamripper.desktop new file mode 100644 index 0000000..3810f9f --- /dev/null +++ b/src/kstreamripper.desktop @@ -0,0 +1,16 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=KStreamRipper +Name[xx]=xxKStreamRipperxx +Exec=kstreamripper +Icon=kstreamripper +Type=Application +Comment=A simple KDE Application +Comment[da]=Et simpelt KDE program +Comment[es]=Una aplicación de KDE sencilla +Comment[hu]=Egyszerű KDE-alkalmazás +Comment[pt]=Uma aplicação KDE simples +Comment[pt_BR]=Um simples Aplicativo do KDE +Comment[sl]=Preprost program za KDE +Comment[sv]=Ett enkelt KDE-program +Comment[xx]=xxA simple KDE Applicationxx diff --git a/src/kstreamripper.h b/src/kstreamripper.h new file mode 100644 index 0000000..f1a5192 --- /dev/null +++ b/src/kstreamripper.h @@ -0,0 +1,79 @@ +/*************************************************************************** + * Copyright (C) 2003-2005 by Michael Goettsche * + * mail@tuxipuxi.org * + * * + * 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 KSTREAMRIPPER_H +#define KSTREAMRIPPER_H + +#include <kdeversion.h> +#include "kstreamripperbase.h" +#if KDE_IS_VERSION(3,3,90) +#include <dnssd/servicebrowser.h> +#include <dnssd/remoteservice.h> +#else +// damned moc will create slots regardless of #if macro +// this is hack to avoid undefined type +namespace DNSSD { namespace RemoteService { typedef int Ptr; } } +#endif + + +class AddNewStreamImpl; +class QString; + +class KStreamRipper : public KStreamRipperBase +{ + Q_OBJECT + +public: + + KStreamRipper( QWidget* parent = 0, const char* name = 0 ); + ~KStreamRipper(); + + virtual void closeEvent( QCloseEvent* ); +#if KDE_IS_VERSION(3,3,90) + DNSSD::ServiceBrowser m_browser; +#endif + +protected slots: + + void addStreamButtonClicked(); + void deleteStreamButtonClicked(); + void tuneInButtonClicked(); + void ripButtonClicked(); + void stopRipButtonClicked(); + void browseButtonClicked(); + void aboutButtonClicked(); + void quitButtonClicked(); + + void selectedNewListItem(); + void descriptionChanged(); + void urlChanged(); + + void addStreamFinished( AddNewStreamImpl* ); +#if KDE_IS_VERSION(3,3,90) + void serviceAdded(DNSSD::RemoteService::Ptr srv); + void serviceRemoved(DNSSD::RemoteService::Ptr srv); +#else + void serviceAdded(DNSSD::RemoteService::Ptr) {}; + void serviceRemoved(DNSSD::RemoteService::Ptr) {}; +#endif +}; + +#endif + diff --git a/src/kstreamripper.lsm b/src/kstreamripper.lsm new file mode 100644 index 0000000..0dbae01 --- /dev/null +++ b/src/kstreamripper.lsm @@ -0,0 +1,16 @@ +Begin3 +Title: KStreamRipper -- Some description +Version: 0.1 +Entered-date: +Description: +Keywords: KDE Qt +Author: Michael Goettsche <mail@tuxipuxi.de> +Maintained-by: Michael Goettsche <mail@tuxipuxi.de> +Home-page: +Alternate-site: +Primary-site: ftp://ftp.kde.org/pub/kde/unstable/apps/utils + xxxxxx kstreamripper-0.1.tar.gz + xxx kstreamripper-0.1.lsm +Platform: Linux. Needs KDE +Copying-policy: GPL +End diff --git a/src/kstreamripperbase.ui b/src/kstreamripperbase.ui new file mode 100644 index 0000000..fc87901 --- /dev/null +++ b/src/kstreamripperbase.ui @@ -0,0 +1,337 @@ +<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> +<class>KStreamRipperBase</class> +<widget class="QWidget"> + <property name="name"> + <cstring>KStreamRipperBase</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>749</width> + <height>782</height> + </rect> + </property> + <property name="caption"> + <string>KStreamRipper V. 0.3.4</string> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <spacer row="5" column="0" rowspan="1" colspan="2"> + <property name="name"> + <cstring>spacer1</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>31</width> + <height>20</height> + </size> + </property> + </spacer> + <widget class="QLabel" row="0" column="0" rowspan="1" colspan="2"> + <property name="name"> + <cstring>m_favoriteLabel</cstring> + </property> + <property name="text"> + <string>Your Radio Streams:</string> + </property> + </widget> + <widget class="QLayoutWidget" row="6" column="1"> + <property name="name"> + <cstring>layout10</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QPushButton"> + <property name="name"> + <cstring>m_aboutButton</cstring> + </property> + <property name="text"> + <string>About</string> + </property> + </widget> + <widget class="QPushButton"> + <property name="name"> + <cstring>m_quitButton</cstring> + </property> + <property name="text"> + <string>&Quit</string> + </property> + </widget> + </hbox> + </widget> + <spacer row="6" column="0"> + <property name="name"> + <cstring>spacer5</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>421</width> + <height>21</height> + </size> + </property> + </spacer> + <widget class="QButtonGroup" row="3" column="0" rowspan="1" colspan="2"> + <property name="name"> + <cstring>m_streamsGroup</cstring> + </property> + <property name="title"> + <string>Stream Options</string> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QPushButton" row="0" column="0"> + <property name="name"> + <cstring>m_addStreamButton</cstring> + </property> + <property name="text"> + <string>&Add Stream</string> + </property> + <property name="accel"> + <string>Alt+A</string> + </property> + </widget> + <widget class="QPushButton" row="0" column="1"> + <property name="name"> + <cstring>m_deleteStreamButton</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="text"> + <string>&Delete Stream</string> + </property> + <property name="accel"> + <string>Alt+D</string> + </property> + </widget> + <widget class="QPushButton" row="0" column="4"> + <property name="name"> + <cstring>m_stopRipButton</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="text"> + <string>&Stop Rip</string> + </property> + <property name="accel"> + <string>Alt+S</string> + </property> + <property name="on"> + <bool>false</bool> + </property> + </widget> + <widget class="QPushButton" row="0" column="2"> + <property name="name"> + <cstring>m_tuneInButton</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="text"> + <string>&Tune in</string> + </property> + <property name="accel"> + <string>Alt+T</string> + </property> + </widget> + <widget class="QPushButton" row="0" column="3"> + <property name="name"> + <cstring>m_ripButton</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="text"> + <string>&Rip Stream</string> + </property> + <property name="accel"> + <string>Alt+R</string> + </property> + </widget> + </grid> + </widget> + <widget class="QListView" row="1" column="0" rowspan="1" colspan="2"> + <property name="name"> + <cstring>m_streamsListView</cstring> + </property> + <property name="allColumnsShowFocus"> + <bool>true</bool> + </property> + <property name="resizeMode"> + <enum>AllColumns</enum> + </property> + <property name="defaultRenameAction"> + <enum>Reject</enum> + </property> + </widget> + <widget class="QGroupBox" row="4" column="0" rowspan="1" colspan="2"> + <property name="name"> + <cstring>m_settingsGroup</cstring> + </property> + <property name="mouseTracking"> + <bool>false</bool> + </property> + <property name="title"> + <string>Settings</string> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QLabel" row="0" column="0"> + <property name="name"> + <cstring>m_pathLabel</cstring> + </property> + <property name="text"> + <string>Destination:</string> + </property> + </widget> + <widget class="QLabel" row="1" column="0"> + <property name="name"> + <cstring>m_timeToRip</cstring> + </property> + <property name="text"> + <string>Time to Rip:</string> + </property> + </widget> + <widget class="QLabel" row="0" column="3"> + <property name="name"> + <cstring>m_id3Label</cstring> + </property> + <property name="text"> + <string>Add ID3 Tag:</string> + </property> + </widget> + <widget class="QCheckBox" row="0" column="4"> + <property name="name"> + <cstring>m_id3Checkbox</cstring> + </property> + <property name="text"> + <string></string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + <widget class="QLabel" row="2" column="0"> + <property name="name"> + <cstring>m_tuneInLabel</cstring> + </property> + <property name="text"> + <string>Tune in Command:</string> + </property> + </widget> + <widget class="QLabel" row="1" column="2"> + <property name="name"> + <cstring>m_secondsLabel</cstring> + </property> + <property name="text"> + <string>seconds</string> + </property> + </widget> + <widget class="QPushButton" row="0" column="2"> + <property name="name"> + <cstring>m_browseButton</cstring> + </property> + <property name="text"> + <string>....</string> + </property> + </widget> + <widget class="QLineEdit" row="2" column="1"> + <property name="name"> + <cstring>m_tuneInEdit</cstring> + </property> + <property name="text"> + <string>xmms <url></string> + </property> + </widget> + <widget class="QLineEdit" row="1" column="1"> + <property name="name"> + <cstring>m_timeEdit</cstring> + </property> + <property name="text"> + <string>0</string> + </property> + </widget> + <widget class="QLineEdit" row="0" column="1"> + <property name="name"> + <cstring>m_destEdit</cstring> + </property> + <property name="text"> + <string>Choose a directory</string> + </property> + </widget> + </grid> + </widget> + <widget class="QGroupBox" row="2" column="0" rowspan="1" colspan="2"> + <property name="name"> + <cstring>m_Details</cstring> + </property> + <property name="title"> + <string>Details</string> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QLabel" row="0" column="0"> + <property name="name"> + <cstring>m_StreamDesc</cstring> + </property> + <property name="text"> + <string>Description:</string> + </property> + </widget> + <widget class="QLabel" row="1" column="0" rowspan="2" colspan="2"> + <property name="name"> + <cstring>m_StreamURL</cstring> + </property> + <property name="text"> + <string>URL:</string> + </property> + </widget> + <widget class="QLineEdit" row="2" column="1"> + <property name="name"> + <cstring>m_UrlEdit</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="readOnly"> + <bool>true</bool> + </property> + </widget> + <widget class="QLineEdit" row="0" column="1"> + <property name="name"> + <cstring>m_DescriptionEdit</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + </widget> + </grid> + </widget> + </grid> +</widget> +<layoutdefaults spacing="6" margin="11"/> +</UI> diff --git a/src/kstreamripperui.rc b/src/kstreamripperui.rc new file mode 100644 index 0000000..850885b --- /dev/null +++ b/src/kstreamripperui.rc @@ -0,0 +1,8 @@ +<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd"> +<kpartgui name="kstreamripper" version="1"> +<MenuBar> + <Menu name="custom"><text>C&ustom</text> + <Action name="custom_action" /> + </Menu> +</MenuBar> +</kpartgui> diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..81d8846 --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,66 @@ +/*************************************************************************** + * Copyright (C) 2003-2005 by Michael Goettsche * + * mail@tuxipuxi.org * + * * + * 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. * + ***************************************************************************/ + +#include <kapplication.h> +#include <kaboutdata.h> +#include <kcmdlineargs.h> + +#include "kstreamripper.h" + + +int main( int argc, char *argv[] ) +{ + KAboutData aboutApp( "KStreamRipper", I18N_NOOP( "KStreamRipper" ), "0.3.4", + "KStreamRipper is a Frontend to Streamripper. Visit Homepage for more Info.", + KAboutData::License_GPL, "(C) 2003-2005 Michael Goettsche", 0, + "http://kstreamripper.tuxipuxi.org", "mail@tuxipuxi.org" ); + + aboutApp.addAuthor( "Michael Goettsche", "Maintainer, Initial version", "mail@tuxipuxi.org" ); + aboutApp.addAuthor( "William Entriken", "Concurrent Ripping, Major UI improvements", "william.entriken@villanova.edu" ); + aboutApp.addCredit( "Kevin Krammer", "Assistance"); + aboutApp.addCredit( "Jakub Stachowski", "bksys migration, crash fix" ); + KCmdLineArgs::init( argc, argv, &aboutApp ); + + KApplication app; + + KStreamRipper *mainWidget = new KStreamRipper(); + + app.setMainWidget( mainWidget ); + mainWidget->show(); + + mainWidget->resize( 700, 600 ); + + return app.exec(); +} + + + + + + + + + + + + + + + diff --git a/src/processcontroller.cpp b/src/processcontroller.cpp new file mode 100644 index 0000000..f0dfb6c --- /dev/null +++ b/src/processcontroller.cpp @@ -0,0 +1,148 @@ +/*************************************************************************** + * Copyright (C) 2005 by Will Entriken * + * william.entriken@villanova.edu * + * * + * 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. * + ***************************************************************************/ + + +#include "processcontroller.h" +#include "processlistviewitem.h" + +ProcessController::ProcessController(ProcessListViewItem * parent) + : QObject((QObject *)parent), myParent(parent), myStatus(false), myAutomatic(false), myProcess(new QProcess(this)) +{ + connect (myProcess, SIGNAL( readyReadStdout() ), (ProcessController *) this, SLOT( readStdout()) ); + // connect (myProcess, SIGNAL( destroyed() ), myProcess, SLOT( kill()) ); + // this should work, according to http://doc.trolltech.com/3.2/qobject.html#~QObject but it doesn't +} + +ProcessController::~ProcessController() +{ + myProcess->kill(); +} + +void ProcessController::readStdout() +{ + QString tempOutput = myProcess->readStdout(); + + if( tempOutput.contains( "ripping..." )) + { + QString songname = tempOutput.mid( tempOutput.find( "]" )+1, tempOutput.findRev( "[" ) - tempOutput.find( "]" ) - 1); + myParent->setText( 1, songname.stripWhiteSpace() ); + + QString bytesR = tempOutput.mid( tempOutput.findRev( "[" )+1, tempOutput.findRev( "]" ) - tempOutput.findRev( "[" ) - 1); + myParent->setText( 2, bytesR.stripWhiteSpace() ); + } + + if( tempOutput.contains( "Connecting..." )) + { + myParent->setText( 1, "Connecting..." ); + myParent->setText( 2, "" ); + } + + if( tempOutput.contains( "buffering" )) + { + myParent->setText( 1, "Buffering..." ); + myParent->setText( 2, "" ); + } + + if( tempOutput.contains( "Time to stop is here" )) + { + myParent->setText( 1, "Complete" ); + myParent->setText( 2, "" ); + //QTimer::singleShot( 1500, myParent, SLOT( setEmptyText(3) )); + } +} + + +void ProcessController::startRip(QString destination, QString time) +{ + myStatus = true; + myParent->setText( 1, "Ripping" ); + + myProcess->clearArguments(); + myProcess->addArgument( "streamripper" ); + myProcess->addArgument( myUrl ); + myProcess->addArgument( "-d " ); + myProcess->addArgument( destination ); + if( time.toInt() ) + { + myProcess->addArgument( "-l " ); + myProcess->addArgument( time ); + } + + myProcess->setCommunication( QProcess::Stdout | QProcess::Stderr | QProcess::DupStderr ); + myProcess->start(); +} + + +void ProcessController::stopRip() +{ + myStatus = false; + myParent->setText( 1, "" ); + myParent->setText( 2, "" ); + + myProcess->tryTerminate(); + QTimer::singleShot( 2000, myProcess, SLOT( kill() ) ); +} + + +bool ProcessController::getStatus() +{ + return myStatus; +} + +QString ProcessController::getUrl() +{ + return myUrl; +} + +void ProcessController::setAutomatic(bool a) +{ + myAutomatic = a; +} + +bool ProcessController::getAutomatic() +{ + return myAutomatic; +} +#if KDE_IS_VERSION(3,3,90) +void ProcessController::setService(DNSSD::RemoteService::Ptr service) +{ + myService = service; +} + +DNSSD::RemoteService::Ptr ProcessController::getService() +{ + return myService; +} +#endif + +QString ProcessController::getDescription() +{ + return myDescription; +} + +void ProcessController::setUrl(QString Url) +{ + myUrl = Url; +} + +void ProcessController::setDescription(QString Description) +{ + myDescription = Description; +} diff --git a/src/processcontroller.h b/src/processcontroller.h new file mode 100644 index 0000000..22183df --- /dev/null +++ b/src/processcontroller.h @@ -0,0 +1,71 @@ +/*************************************************************************** + * Copyright (C) 2005 by Will Entriken * + * william.entriken@villanova.edu * + * * + * 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 PROCESSCONTROLLER_H +#define PROCESSCONTROLLER_H + +#include <qprocess.h> +#include <qstring.h> +#include <qtimer.h> +#include <qobject.h> +#include <kdeversion.h> +#if KDE_IS_VERSION(3,3,90) +#include <dnssd/remoteservice.h> +#endif + +class ProcessListViewItem; + +class ProcessController : public QObject +{ + Q_OBJECT +public: + ProcessController(ProcessListViewItem * parent); + ~ProcessController(); + + bool getStatus(); + bool getAutomatic(); + void setAutomatic(bool a); +#if KDE_IS_VERSION(3,3,90) + DNSSD::RemoteService::Ptr getService(); + void setService(DNSSD::RemoteService::Ptr service); +#endif + void setUrl(QString Url); + void setDescription(QString Description); + QString getUrl(); + QString getDescription(); + void startRip(QString destination, QString time); + void stopRip(); + +protected slots: + void readStdout(); + +private: + ProcessListViewItem * myParent; + bool myStatus; + bool myAutomatic; +#if KDE_IS_VERSION(3,3,90) + DNSSD::RemoteService::Ptr myService; +#endif + QProcess * myProcess; + QString myUrl; + QString myDescription; +}; + +#endif diff --git a/src/processlistviewitem.cpp b/src/processlistviewitem.cpp new file mode 100644 index 0000000..d2c88cc --- /dev/null +++ b/src/processlistviewitem.cpp @@ -0,0 +1,108 @@ +/*************************************************************************** + * Copyright (C) 2005 by Will Entriken * + * william.entriken@villanova.edu * + * * + * 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. * + ***************************************************************************/ + + +#include "processlistviewitem.h" + +#include "processlistviewitem.h" +#include "processcontroller.h" + +ProcessListViewItem::ProcessListViewItem( QListView * parent ) + : QListViewItem(parent), myProcessController(new ProcessController(this)) +{ +} + +ProcessListViewItem::ProcessListViewItem( QListViewItem * parent ) + : QListViewItem(parent), myProcessController(new ProcessController(this)) +{ +} + +ProcessListViewItem::ProcessListViewItem( QListView * parent, QListViewItem * after ) + : QListViewItem(parent, after), myProcessController(new ProcessController(this)) +{ +} + +ProcessListViewItem::ProcessListViewItem( QListViewItem * parent, QListViewItem * after ) + : QListViewItem(parent, after), myProcessController(new ProcessController(this)) +{ +} + +ProcessListViewItem::ProcessListViewItem( QListView * parent, + QString label1, + QString label2, + QString label3, + QString label4, + QString label5, + QString label6, + QString label7, + QString label8 ) + : QListViewItem(parent, label1, label2, label3, label4, label5, label6, label7, label8), myProcessController(new ProcessController(this)) +{ +} + +ProcessListViewItem::ProcessListViewItem( QListViewItem * parent, + QString label1, + QString label2, + QString label3, + QString label4, + QString label5, + QString label6, + QString label7, + QString label8 ) + : QListViewItem(parent, label1, label2, label3, label4, label5, label6, label7, label8), myProcessController(new ProcessController(this)) +{ +} + +ProcessListViewItem::ProcessListViewItem( QListView * parent, QListViewItem * after, + QString label1, + QString label2, + QString label3, + QString label4, + QString label5, + QString label6, + QString label7, + QString label8 ) + : QListViewItem(parent, after, label1, label2, label3, label4, label5, label6, label7, label8), + myProcessController(new ProcessController(this)) +{ +} + +ProcessListViewItem::ProcessListViewItem( QListViewItem * parent, QListViewItem * after, + QString label1, + QString label2, + QString label3, + QString label4, + QString label5, + QString label6, + QString label7, + QString label8 ) + : QListViewItem(parent, after, label1, label2, label3, label4, label5, label6, label7, label8), + myProcessController(new ProcessController(this)) +{ +} + +ProcessListViewItem::~ProcessListViewItem() +{ +} + +ProcessController * ProcessListViewItem::getProcessController() +{ + return myProcessController; +} diff --git a/src/processlistviewitem.h b/src/processlistviewitem.h new file mode 100644 index 0000000..aaa3e74 --- /dev/null +++ b/src/processlistviewitem.h @@ -0,0 +1,71 @@ +/*************************************************************************** + * Copyright (C) 2005 by Will Entriken * + * william.entriken@villanova.edu * + * * + * 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 PROCESSLISTVIEWITEM_H +#define PROCESSLISTVIEWITEM_H + +#include <qlistview.h> +#include <qstring.h> +#include <qobject.h> + +class ProcessController; + +class ProcessListViewItem : public QObject, public QListViewItem +{ + Q_OBJECT +public: + + ProcessListViewItem( QListView * parent ); + ProcessListViewItem( QListViewItem * parent ); + ProcessListViewItem( QListView * parent, QListViewItem * after ); + ProcessListViewItem( QListViewItem * parent, QListViewItem * after ); + + ProcessListViewItem( QListView * parent, + QString, QString = QString::null, + QString = QString::null, QString = QString::null, + QString = QString::null, QString = QString::null, + QString = QString::null, QString = QString::null ); + ProcessListViewItem( QListViewItem * parent, + QString, QString = QString::null, + QString = QString::null, QString = QString::null, + QString = QString::null, QString = QString::null, + QString = QString::null, QString = QString::null ); + + ProcessListViewItem( QListView * parent, QListViewItem * after, + QString, QString = QString::null, + QString = QString::null, QString = QString::null, + QString = QString::null, QString = QString::null, + QString = QString::null, QString = QString::null ); + ProcessListViewItem( QListViewItem * parent, QListViewItem * after, + QString, QString = QString::null, + QString = QString::null, QString = QString::null, + QString = QString::null, QString = QString::null, + QString = QString::null, QString = QString::null ); + + ~ProcessListViewItem(); + + ProcessController * getProcessController(); + +private: + ProcessController * myProcessController; +}; + +#endif diff --git a/src/processlistviewitem_interface.h b/src/processlistviewitem_interface.h new file mode 100644 index 0000000..49385fa --- /dev/null +++ b/src/processlistviewitem_interface.h @@ -0,0 +1,38 @@ +/*************************************************************************** + * Copyright (C) 2005 by Will Entriken * + * william.entriken@villanova.edu * + * * + * 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 __PROCESSLISTVIEWITEM_INTERFACE_H +#define __PROCESSLISTVIEWITEM_INTERFACE_H + +class ProcessListViewItemInterface +{ +public: + ProcessListViewItemInterface() {} + virtual ~ProcessListViewItemInterface() {} + + +private: + ProcessListViewItemInterface( const ProcessListViewItemInterface& source ); + void operator = ( const ProcessListViewItemInterface& source ); +}; + + +#endif // __PROCESSLISTVIEWITEM_INTERFACE_H |