Add unicode stream support

Signed-off-by: ormorph <roma251078@mail.ru>
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/11/head
ormorph 12 months ago committed by Michele Calgaro
parent 1801e3aaca
commit e1799206d9
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -68,6 +68,7 @@ KStreamRipper::KStreamRipper( TQWidget* parent, const char* name )
m_timeEdit->setText( appConfig->readEntry( "Riptime", "0" ));
m_tuneInEdit->setText( appConfig->readEntry( "Command", "xmms <url>" ));
m_id3Checkbox->setChecked( appConfig->readBoolEntry( "Id3Tag", 1 ));
m_unicodeCheckbox->setChecked( appConfig->readBoolEntry( "Unicode", 1 ));
//listview entrys
TQStringList nameList,urlList,descList;
@ -132,6 +133,7 @@ void KStreamRipper::closeEvent( TQCloseEvent *e )
appConfig->writeEntry( "Riptime", m_timeEdit->text());
appConfig->writeEntry( "Command", m_tuneInEdit->text());
appConfig->writeEntry( "Id3Tag", m_id3Checkbox->isChecked());
appConfig->writeEntry( "Unicode", m_unicodeCheckbox->isChecked());
//save the listview entrys
TQStringList nameList,urlList,descList;
@ -224,7 +226,8 @@ void KStreamRipper::ripButtonClicked()
{
if (!(TDEStandardDirs::findExe("streamripper").isEmpty())) {
ProcessListViewItem * ProcItem = (ProcessListViewItem*)m_streamsListView->currentItem();
ProcItem->getProcessController()->startRip(m_destEdit->text(), m_timeEdit->text());
ProcItem->getProcessController()->startRip(m_destEdit->text(), m_timeEdit->text(),
m_unicodeCheckbox->isChecked());
m_ripButton->setEnabled( false );
m_stopRipButton->setEnabled( true );
} else {

@ -274,6 +274,28 @@
<string>Choose a directory</string>
</property>
</widget>
<widget class="TQLabel" row="1" column="3">
<property name="name">
<cstring>m_unicodeLabel</cstring>
</property>
<property name="text">
<string>Unicode:</string>
</property>
<property name="alignment">
<set>AlignVCenter|AlignRight</set>
</property>
</widget>
<widget class="TQCheckBox" row="1" column="4">
<property name="name">
<cstring>m_unicodeCheckbox</cstring>
</property>
<property name="text">
<string></string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</grid>
</widget>
<widget class="TQGroupBox" row="2" column="0" rowspan="1" colspan="2">

@ -23,7 +23,8 @@
#include "processlistviewitem.h"
ProcessController::ProcessController(ProcessListViewItem * parent)
: TQObject(parent), myParent(parent), myStatus(false), myAutomatic(false), myProcess(new TQProcess(this))
: TQObject(parent), myParent(parent), myStatus(false), myAutomatic(false), myUnicodeEnabled(false),
myProcess(new TQProcess(this))
{
connect (myProcess, TQT_SIGNAL( readyReadStdout() ), (ProcessController *) this, TQT_SLOT( readStdout()) );
connect (myProcess, TQT_SIGNAL(processExited() ), (ProcessController *) this, TQT_SLOT( processExited()) );
@ -38,7 +39,15 @@ ProcessController::~ProcessController()
void ProcessController::readStdout()
{
TQString tempOutput = myProcess->readStdout();
TQString tempOutput;
if (myUnicodeEnabled)
{
tempOutput = TQString::fromUtf8(myProcess->readStdout());
}
else
{
tempOutput = TQString::fromLocal8Bit(myProcess->readStdout());
}
if( tempOutput.contains( "ripping..." ))
{
@ -77,14 +86,20 @@ void ProcessController::processExited()
emit stopRipSignal(this);
}
void ProcessController::startRip(TQString destination, TQString time)
void ProcessController::startRip(TQString destination, TQString time, bool isUnicode)
{
myUnicodeEnabled = isUnicode;
myStatus = true;
myParent->setText( 1, "Ripping" );
myProcess->clearArguments();
myProcess->addArgument( "streamripper" );
myProcess->addArgument( myUrl );
if( isUnicode )
{
myProcess->addArgument( "--codeset-filesys=UTF-8 " );
myProcess->addArgument( "--codeset-metadata=UTF-8 " );
}
myProcess->addArgument( "-d " );
myProcess->addArgument( destination );
if( time.toInt() )

@ -51,7 +51,7 @@ public:
void setDescription(TQString Description);
TQString getUrl();
TQString getDescription();
void startRip(TQString destination, TQString time);
void startRip(TQString destination, TQString time, bool isUnicode);
void stopRip();
signals:
@ -65,6 +65,7 @@ private:
ProcessListViewItem * myParent;
bool myStatus;
bool myAutomatic;
bool myUnicodeEnabled;
#if KDE_IS_VERSION(3,3,90)
DNSSD::RemoteService::Ptr myService;
#endif

Loading…
Cancel
Save