@ -25,18 +25,18 @@
# 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 < t qpushbutton.h>
# include < t qlistview.h>
# include < t qlineedit.h>
# include < t qdir.h>
# include < t qstring.h>
# include < t qstringlist.h>
# include < t qbuttongroup.h>
# include < t qcheckbox.h>
# include < t qprocess.h>
# include < t qtextedit.h>
# include < t qframe.h>
# include < t qtimer.h>
# include <kmessagebox.h>
# include <kstandarddirs.h>
# include <kdeversion.h>
@ -48,16 +48,16 @@
KStreamRipper : : KStreamRipper ( QWidget* parent, const char * name )
: KStreamRipperBase ( parent, name )
KStreamRipper : : KStreamRipper ( T QWidget* tq parent, const char * name )
: KStreamRipperBase ( tq parent, name )
# if KDE_IS_VERSION(3,3,90)
, m_browser ( " _shoutcast._tcp " , 0 , true )
# endif
{
m_destEdit - > setText ( QDir: : homeDirPath ( ) ) ;
m_destEdit - > setText ( T QDir: : homeDirPath ( ) ) ;
m_streamsListView - > addColumn ( " Name " ) ;
m_streamsListView - > addColumn ( " Status" ) ;
m_streamsListView - > addColumn ( " tq Status" ) ;
m_streamsListView - > addColumn ( " Size " ) ;
//app config
@ -69,12 +69,12 @@ KStreamRipper::KStreamRipper( QWidget* parent, const char* name )
m_id3Checkbox - > setChecked ( appConfig - > readBoolEntry ( " Id3Tag " , 1 ) ) ;
//listview entrys
QStringList nameList , urlList , descList ;
T QStringList nameList , urlList , descList ;
nameList = appConfig - > readListEntry ( " names " ) ;
urlList = appConfig - > readListEntry ( " urls " ) ;
descList = appConfig - > readListEntry ( " descs " ) ;
QStringList: : iterator iter1 , iter2 , iter3 ;
T QStringList: : iterator iter1 , iter2 , iter3 ;
iter1 = nameList . begin ( ) ;
iter2 = urlList . begin ( ) ;
iter3 = descList . begin ( ) ;
@ -90,26 +90,26 @@ KStreamRipper::KStreamRipper( QWidget* parent, const char* name )
//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 ( ) ) ) ;
connect ( m_addStreamButton , TQT_ SIGNAL( clicked ( ) ) , this , TQT_ SLOT( addStreamButtonClicked ( ) ) ) ;
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 ( ) ) ) ;
connect ( m_stopRipButton , TQT_ SIGNAL( clicked ( ) ) , this , TQT_ SLOT( stopRipButtonClicked ( ) ) ) ;
connect ( m_browseButton , TQT_ SIGNAL( clicked ( ) ) , this , TQT_ SLOT( browseButtonClicked ( ) ) ) ;
connect ( m_aboutButton , TQT_ SIGNAL( clicked ( ) ) , this , TQT_ SLOT( aboutButtonClicked ( ) ) ) ;
connect ( m_quitButton , TQT_ SIGNAL( clicked ( ) ) , this , TQT_ 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 ( ) ) ) ;
connect ( m_streamsListView , TQT_ SIGNAL( selectionChanged ( ) ) , this , TQT_ SLOT( selectedNewListItem ( ) ) ) ;
connect ( m_DescriptionEdit , TQT_ SIGNAL( textChanged ( const T QString& ) ) , this , TQT_ SLOT( descriptionChanged ( ) ) ) ;
connect ( m_UrlEdit , TQT_ SIGNAL( textChanged ( const T QString& ) ) , this , TQT_ 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 ) ) ) ;
connect ( & m_browser , TQT_ SIGNAL( serviceAdded ( DNSSD : : RemoteService : : Ptr ) ) , this ,
TQT_ SLOT( serviceAdded ( DNSSD : : RemoteService : : Ptr ) ) ) ;
connect ( & m_browser , TQT_ SIGNAL( serviceRemoved ( DNSSD : : RemoteService : : Ptr ) ) , this ,
TQT_ SLOT( serviceRemoved ( DNSSD : : RemoteService : : Ptr ) ) ) ;
m_browser . startBrowse ( ) ;
# endif
}
@ -120,7 +120,7 @@ KStreamRipper::~KStreamRipper()
}
void KStreamRipper : : closeEvent ( QCloseEvent * e )
void KStreamRipper : : closeEvent ( T QCloseEvent * e )
{
KConfig * appConfig = KGlobal : : config ( ) ;
@ -131,8 +131,8 @@ void KStreamRipper::closeEvent( QCloseEvent *e )
//save the listview entrys
QStringList nameList , urlList , descList ;
QListViewItemIterator iter ( m_streamsListView ) ;
T QStringList nameList , urlList , descList ;
T QListViewItemIterator iter ( m_streamsListView ) ;
while ( iter . current ( ) )
{
@ -159,7 +159,7 @@ void KStreamRipper::closeEvent( QCloseEvent *e )
void KStreamRipper : : addStreamButtonClicked ( )
{
AddNewStreamImpl * test = new AddNewStreamImpl ( this ) ;
connect ( test , SIGNAL( finished ( AddNewStreamImpl * ) ) , this , SLOT( addStreamFinished ( AddNewStreamImpl * ) ) ) ;
connect ( test , TQT_ SIGNAL( finished ( AddNewStreamImpl * ) ) , this , TQT_ SLOT( addStreamFinished ( AddNewStreamImpl * ) ) ) ;
test - > show ( ) ;
}
@ -175,11 +175,11 @@ void KStreamRipper::tuneInButtonClicked()
{
if ( m_streamsListView - > currentItem ( ) )
{
QString command = m_tuneInEdit - > text ( ) . replace( " <url> " , m_UrlEdit - > text ( ) ) ;
T QString command = m_tuneInEdit - > text ( ) . tq replace( " <url> " , m_UrlEdit - > text ( ) ) ;
QStringList commands = QStringList: : split ( " " , command ) ;
T QStringList commands = T QStringList: : split ( " " , command ) ;
QProcess * process = new QProcess( this ) ;
T QProcess * process = new T QProcess( TQT_TQOBJECT ( this ) ) ;
process - > setArguments ( commands ) ;
process - > start ( ) ;
@ -191,7 +191,7 @@ void KStreamRipper::tuneInButtonClicked()
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 ( ) - > setUrl ( T QString( " http://%1:%2%3 " ) . tq arg( srv - > hostName ( ) ) . tq arg( srv - > port ( ) ) . tq arg( srv - > textData ( ) [ " path " ] ) ) ;
proc - > getProcessController ( ) - > setDescription ( i18n ( " found by Zeroconf " ) ) ;
proc - > getProcessController ( ) - > setAutomatic ( true ) ;
proc - > getProcessController ( ) - > setService ( srv ) ;
@ -199,7 +199,7 @@ void KStreamRipper::serviceAdded(DNSSD::RemoteService::Ptr srv)
}
void KStreamRipper : : serviceRemoved ( DNSSD : : RemoteService : : Ptr srv )
{
QListViewItemIterator iter ( m_streamsListView ) ;
T QListViewItemIterator iter ( m_streamsListView ) ;
while ( iter . current ( ) ) {
ProcessListViewItem * ProcItem = ( ProcessListViewItem * ) iter . current ( ) ;
@ -237,7 +237,7 @@ void KStreamRipper::stopRipButtonClicked()
void KStreamRipper : : browseButtonClicked ( )
{
QString openDest = KFileDialog : : getExistingDirectory ( QDir: : homeDirPath ( ) ,
T QString openDest = KFileDialog : : getExistingDirectory ( T QDir: : homeDirPath ( ) ,
this ,
" Select Destination... " ) ;
m_destEdit - > setText ( openDest ) ;
@ -260,17 +260,17 @@ void KStreamRipper::selectedNewListItem()
m_deleteStreamButton - > setEnabled ( false ) ;
m_tuneInButton - > setEnabled ( false ) ;
m_ripButton - > setEnabled ( false ) ;
m_DescriptionEdit - > setText ( QString: : null ) ;
m_DescriptionEdit - > setText ( TQString( ) ) ;
m_DescriptionEdit - > setEnabled ( false ) ;
m_UrlEdit - > setEnabled ( false ) ;
m_UrlEdit - > setText ( QString: : null ) ;
m_UrlEdit - > setText ( TQString( ) ) ;
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 - > get Status( ) ) ;
m_stopRipButton - > setEnabled ( ProcCtl - > get Status( ) ) ;
m_ripButton - > setEnabled ( ! ProcCtl - > get tq Status( ) ) ;
m_stopRipButton - > setEnabled ( ProcCtl - > get tq Status( ) ) ;
m_tuneInButton - > setEnabled ( true ) ;
m_deleteStreamButton - > setEnabled ( ! ProcCtl - > getAutomatic ( ) ) ;
@ -281,8 +281,8 @@ void KStreamRipper::selectedNewListItem()
// 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&))
//connect(m_DescriptionEdit, TQT_ SIGNAL(textChanged(const T QString&)), (ProcessListViewItem*)m_streamsListView->currentItem()->getProcessController(), TQT_ SIGNAL(descriptionChanged(const T QString&))
//connect(m_UrlEdit, TQT_ SIGNAL(textChanged(const T QString&)), (ProcessListViewItem*)m_streamsListView->currentItem()->getProcessController(), TQT_ SIGNAL(urlChanged(const T QString&))
}
void KStreamRipper : : descriptionChanged ( )