summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/kstreamripper.cpp5
-rw-r--r--src/kstreamripperbase.ui22
-rw-r--r--src/processcontroller.cpp21
-rw-r--r--src/processcontroller.h3
4 files changed, 46 insertions, 5 deletions
diff --git a/src/kstreamripper.cpp b/src/kstreamripper.cpp
index 9630c8f..c27e41c 100644
--- a/src/kstreamripper.cpp
+++ b/src/kstreamripper.cpp
@@ -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 {
diff --git a/src/kstreamripperbase.ui b/src/kstreamripperbase.ui
index 8d2baa8..fb4e130 100644
--- a/src/kstreamripperbase.ui
+++ b/src/kstreamripperbase.ui
@@ -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">
diff --git a/src/processcontroller.cpp b/src/processcontroller.cpp
index a065ed6..da5e15c 100644
--- a/src/processcontroller.cpp
+++ b/src/processcontroller.cpp
@@ -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() )
diff --git a/src/processcontroller.h b/src/processcontroller.h
index 9405471..16b3358 100644
--- a/src/processcontroller.h
+++ b/src/processcontroller.h
@@ -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