|
|
|
@ -43,7 +43,7 @@
|
|
|
|
|
#include <tdeversion.h>
|
|
|
|
|
|
|
|
|
|
#include "kstreamripper.h"
|
|
|
|
|
#include "addnewstreamimpl.h"
|
|
|
|
|
#include "streampropertiesdlg.h"
|
|
|
|
|
#include "processlistviewitem.h"
|
|
|
|
|
#include "processcontroller.h"
|
|
|
|
|
|
|
|
|
@ -95,6 +95,7 @@ KStreamRipper::KStreamRipper( TQWidget* parent, const char* name )
|
|
|
|
|
|
|
|
|
|
//clicks
|
|
|
|
|
connect(m_addStreamButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(addStreamButtonClicked()));
|
|
|
|
|
connect(m_editStreamButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(editStreamButtonClicked()));
|
|
|
|
|
connect(m_deleteStreamButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(deleteStreamButtonClicked()));
|
|
|
|
|
connect(m_tuneInButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(tuneInButtonClicked()));
|
|
|
|
|
connect(m_ripButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(ripButtonClicked()));
|
|
|
|
@ -166,10 +167,23 @@ void KStreamRipper::closeEvent( TQCloseEvent *e )
|
|
|
|
|
//SLOTS
|
|
|
|
|
void KStreamRipper::addStreamButtonClicked()
|
|
|
|
|
{
|
|
|
|
|
AddNewStreamImpl *test = new AddNewStreamImpl( this );
|
|
|
|
|
connect( test, TQT_SIGNAL( finished( AddNewStreamImpl* )), this, TQT_SLOT( addStreamFinished( AddNewStreamImpl* )) );
|
|
|
|
|
StreamPropertiesDlg *dlg = new StreamPropertiesDlg(this);
|
|
|
|
|
connect( dlg, TQT_SIGNAL( finished( StreamPropertiesDlg* )), this, TQT_SLOT( addStreamFinished( StreamPropertiesDlg* )) );
|
|
|
|
|
dlg->setCaption("Add Stream...");
|
|
|
|
|
dlg->show();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void KStreamRipper::editStreamButtonClicked()
|
|
|
|
|
{
|
|
|
|
|
ProcessListViewItem *ProcItem = (ProcessListViewItem*)m_streamsListView->currentItem();
|
|
|
|
|
StreamPropertiesDlg *dlg = new StreamPropertiesDlg(this);
|
|
|
|
|
connect( dlg, TQT_SIGNAL( finished( StreamPropertiesDlg* )), this, TQT_SLOT( editStreamFinished( StreamPropertiesDlg* )) );
|
|
|
|
|
dlg->setCaption("Edit Stream");
|
|
|
|
|
dlg->d_nameEdit->setText(ProcItem->text(0));
|
|
|
|
|
dlg->d_urlEdit->setText(ProcItem->getProcessController()->getUrl());
|
|
|
|
|
dlg->d_descEdit->setText(ProcItem->getProcessController()->getDescription());
|
|
|
|
|
dlg->show();
|
|
|
|
|
|
|
|
|
|
test->show();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void KStreamRipper::deleteStreamButtonClicked()
|
|
|
|
@ -281,6 +295,7 @@ void KStreamRipper::quitButtonClicked()
|
|
|
|
|
void KStreamRipper::selectedNewListItem()
|
|
|
|
|
{
|
|
|
|
|
if ( !m_streamsListView->selectedItem() ) {
|
|
|
|
|
m_editStreamButton->setEnabled( false );
|
|
|
|
|
m_deleteStreamButton->setEnabled( false );
|
|
|
|
|
m_tuneInButton->setEnabled( false );
|
|
|
|
|
m_ripButton->setEnabled( false );
|
|
|
|
@ -296,17 +311,13 @@ void KStreamRipper::selectedNewListItem()
|
|
|
|
|
m_ripButton->setEnabled( !ProcCtl->getStatus() );
|
|
|
|
|
m_stopRipButton->setEnabled( ProcCtl->getStatus() );
|
|
|
|
|
m_tuneInButton->setEnabled( true );
|
|
|
|
|
m_editStreamButton->setEnabled( !ProcCtl->getAutomatic() );
|
|
|
|
|
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, TQT_SIGNAL(textChanged(const TQString&)), (ProcessListViewItem*)m_streamsListView->currentItem()->getProcessController(), TQT_SIGNAL(descriptionChanged(const TQString&))
|
|
|
|
|
//connect(m_UrlEdit, TQT_SIGNAL(textChanged(const TQString&)), (ProcessListViewItem*)m_streamsListView->currentItem()->getProcessController(), TQT_SIGNAL(urlChanged(const TQString&))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void KStreamRipper::descriptionChanged()
|
|
|
|
@ -323,8 +334,7 @@ void KStreamRipper::urlChanged()
|
|
|
|
|
ProcItem->getProcessController()->setUrl(m_UrlEdit->text());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void KStreamRipper::addStreamFinished( AddNewStreamImpl *e )
|
|
|
|
|
void KStreamRipper::addStreamFinished( StreamPropertiesDlg *e )
|
|
|
|
|
{
|
|
|
|
|
ProcessListViewItem *procItem = new ProcessListViewItem( m_streamsListView, e->d_nameEdit->text(), "", "");
|
|
|
|
|
ProcessController *pc = procItem->getProcessController();
|
|
|
|
@ -333,4 +343,15 @@ void KStreamRipper::addStreamFinished( AddNewStreamImpl *e )
|
|
|
|
|
connect(pc, TQT_SIGNAL(stopRipSignal(ProcessController*)), this, TQT_SLOT(ripStopped(ProcessController*)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void KStreamRipper::editStreamFinished( StreamPropertiesDlg *e )
|
|
|
|
|
{
|
|
|
|
|
ProcessListViewItem *procItem = (ProcessListViewItem*)m_streamsListView->currentItem();
|
|
|
|
|
ProcessController *pc = procItem->getProcessController();
|
|
|
|
|
procItem->setText(0, e->d_nameEdit->text());
|
|
|
|
|
pc->setUrl( e->d_urlEdit->text() );
|
|
|
|
|
pc->setDescription( e->d_descEdit->text() );
|
|
|
|
|
m_UrlEdit->setText( e->d_urlEdit->text() );
|
|
|
|
|
m_DescriptionEdit->setText( e->d_descEdit->text() );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#include "kstreamripper.moc"
|
|
|
|
|