Added stream editing in a separate dialog box

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Signed-off-by: ormorph <roma251078@mail.ru>
pull/12/head
Michele Calgaro 1 year ago
parent ee7c7b4016
commit fb82c1b008
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -17,13 +17,13 @@ link_directories(
tde_add_executable( ${PROJECT_NAME} AUTOMOC
SOURCES
addnewstreamimpl.cpp
addnewstream.ui
kstreamripperbase.ui
kstreamripper.cpp
main.cpp
processcontroller.cpp
processlistviewitem.cpp
streampropertiesdlgbase.ui
streampropertiesdlg.cpp
LINK
tdecore-shared
tdeui-shared

@ -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"

@ -36,7 +36,7 @@ namespace DNSSD { namespace RemoteService { typedef int Ptr; } }
#endif
class AddNewStreamImpl;
class StreamPropertiesDlg;
class TQString;
class KStreamRipper : public KStreamRipperBase
@ -57,6 +57,7 @@ public:
protected slots:
void addStreamButtonClicked();
void editStreamButtonClicked();
void deleteStreamButtonClicked();
void tuneInButtonClicked();
void ripButtonClicked();
@ -71,7 +72,9 @@ protected slots:
void descriptionChanged();
void urlChanged();
void addStreamFinished( AddNewStreamImpl* );
void addStreamFinished( StreamPropertiesDlg* );
void editStreamFinished( StreamPropertiesDlg* );
#if KDE_IS_VERSION(3,3,90)
void serviceAdded(DNSSD::RemoteService::Ptr srv);
void serviceRemoved(DNSSD::RemoteService::Ptr srv);

@ -116,30 +116,27 @@
</widget>
<widget class="TQPushButton" row="0" column="1">
<property name="name">
<cstring>m_deleteStreamButton</cstring>
<cstring>m_editStreamButton</cstring>
</property>
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>&amp;Delete Stream</string>
<string>&amp;Edit Stream</string>
</property>
</widget>
<widget class="TQPushButton" row="0" column="4">
<widget class="TQPushButton" row="0" column="2">
<property name="name">
<cstring>m_stopRipButton</cstring>
<cstring>m_deleteStreamButton</cstring>
</property>
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>&amp;Stop Rip</string>
</property>
<property name="on">
<bool>false</bool>
<string>&amp;Delete Stream</string>
</property>
</widget>
<widget class="TQPushButton" row="0" column="2">
<widget class="TQPushButton" row="1" column="0">
<property name="name">
<cstring>m_tuneInButton</cstring>
</property>
@ -150,7 +147,7 @@
<string>&amp;Tune in</string>
</property>
</widget>
<widget class="TQPushButton" row="0" column="3">
<widget class="TQPushButton" row="1" column="1">
<property name="name">
<cstring>m_ripButton</cstring>
</property>
@ -161,6 +158,20 @@
<string>&amp;Rip Stream</string>
</property>
</widget>
<widget class="TQPushButton" row="1" column="2">
<property name="name">
<cstring>m_stopRipButton</cstring>
</property>
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>&amp;Stop Rip</string>
</property>
<property name="on">
<bool>false</bool>
</property>
</widget>
</grid>
</widget>
<widget class="TQListView" row="1" column="0" rowspan="1" colspan="2">

@ -23,26 +23,25 @@
#include <tqpushbutton.h>
#include <tqlineedit.h>
#include "addnewstreamimpl.h"
#include "streampropertiesdlg.h"
AddNewStreamImpl::AddNewStreamImpl( TQWidget* parent, const char* name )
: AddNewStream( parent,name, true )
StreamPropertiesDlg::StreamPropertiesDlg(TQWidget *parent, const char *name)
: StreamPropertiesDlgBase(parent, name, true)
{
connect( d_okButton, TQT_SIGNAL( clicked()), this, TQT_SLOT( okButtonClicked()) );
connect( d_cancelButton, TQT_SIGNAL( clicked()), this, TQT_SLOT( cancelButtonClicked()) );
}
AddNewStreamImpl::~AddNewStreamImpl()
StreamPropertiesDlg::~StreamPropertiesDlg()
{
}
//SLOTS
void AddNewStreamImpl::okButtonClicked()
void StreamPropertiesDlg::okButtonClicked()
{
if( d_nameEdit->text() != "" && d_urlEdit->text() != "")
{
@ -57,9 +56,9 @@ void AddNewStreamImpl::okButtonClicked()
}
void AddNewStreamImpl::cancelButtonClicked()
void StreamPropertiesDlg::cancelButtonClicked()
{
this->close();
}
#include "addnewstreamimpl.moc"
#include "streampropertiesdlg.moc"

@ -18,22 +18,20 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef ADDNEWSTREAMIMPL_H
#define ADDNEWSTREAMIMPL_H
#ifndef STREAM_PROPERTIES_DLG_BASE_H
#define STREAM_PROPERTIES_DLG_BASE_H
#include "addnewstream.h"
#include "streampropertiesdlgbase.h"
class AddNewStreamImpl : public AddNewStream
class StreamPropertiesDlg : public StreamPropertiesDlgBase
{
TQ_OBJECT
public:
AddNewStreamImpl( TQWidget* parent = 0, const char* name = 0 );
~AddNewStreamImpl();
protected:
StreamPropertiesDlg(TQWidget *parent = nullptr, const char *name = nullptr);
~StreamPropertiesDlg();
protected slots:
@ -42,8 +40,7 @@ protected slots:
signals:
void finished( AddNewStreamImpl* );
void finished( StreamPropertiesDlg* );
};
#endif

@ -1,20 +1,17 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>AddNewStream</class>
<class>StreamPropertiesDlgBase</class>
<widget class="TQDialog">
<property name="name">
<cstring>AddNewStream</cstring>
<cstring>StreamPropertiesDlgBase</cstring>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>383</width>
<height>287</height>
<width>450</width>
<height>200</height>
</rect>
</property>
<property name="caption">
<string>Add Stream....</string>
</property>
<property name="focusPolicy">
<enum>TabFocus</enum>
</property>
@ -44,30 +41,25 @@
<string>Name:</string>
</property>
</widget>
<widget class="TQLabel" row="2" column="0">
<property name="name">
<cstring>d_descriptionLabel</cstring>
</property>
<property name="text">
<string>Description:</string>
</property>
</widget>
<widget class="TQLineEdit" row="0" column="1">
<property name="name">
<cstring>d_nameEdit</cstring>
</property>
</widget>
<widget class="TQLineEdit" row="1" column="1">
<widget class="TQLabel" row="1" column="0">
<property name="name">
<cstring>d_urlEdit</cstring>
<cstring>d_descriptionLabel</cstring>
</property>
<property name="text">
<string>Description:</string>
</property>
</widget>
<widget class="TQLineEdit" row="2" column="1">
<widget class="TQLineEdit" row="1" column="1">
<property name="name">
<cstring>d_descEdit</cstring>
</property>
</widget>
<widget class="TQLabel" row="1" column="0">
<widget class="TQLabel" row="2" column="0">
<property name="name">
<cstring>d_urlLabel</cstring>
</property>
@ -75,6 +67,11 @@
<string>Url of Stream:</string>
</property>
</widget>
<widget class="TQLineEdit" row="2" column="1">
<property name="name">
<cstring>d_urlEdit</cstring>
</property>
</widget>
</grid>
</widget>
<widget class="TQPushButton" row="1" column="0">

@ -33,27 +33,27 @@ msgstr ""
msgid "KStreamRipper"
msgstr ""
#: addnewstream.ui:16
#: streampropertiesdlg.ui:16
#, no-c-format
msgid "Add Stream...."
msgid "Add Stream..."
msgstr ""
#: addnewstream.ui:44
#: streampropertiesdlg.ui:44
#, no-c-format
msgid "Name:"
msgstr ""
#: addnewstream.ui:52 kstreamripperbase.ui:317
#: streampropertiesdlg.ui:52 kstreamripperbase.ui:317
#, no-c-format
msgid "Description:"
msgstr ""
#: addnewstream.ui:75
#: streampropertiesdlg.ui:75
#, no-c-format
msgid "Url of Stream:"
msgstr ""
#: addnewstream.ui:88
#: streampropertiesdlg.ui:88
#, no-c-format
msgid "&Ok"
msgstr ""

@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2023-12-08 18:15+0000\n"
"POT-Creation-Date: 2023-12-16 21:42+0900\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -27,7 +27,7 @@ msgid ""
"Your emails"
msgstr ""
#: kstreamripper.cpp:203
#: kstreamripper.cpp:217
msgid "found by Zeroconf"
msgstr ""
@ -35,31 +35,6 @@ msgstr ""
msgid "KStreamRipper"
msgstr ""
#: addnewstream.ui:16
#, no-c-format
msgid "Add Stream...."
msgstr ""
#: addnewstream.ui:44
#, no-c-format
msgid "Name:"
msgstr ""
#: addnewstream.ui:52 kstreamripperbase.ui:317
#, no-c-format
msgid "Description:"
msgstr ""
#: addnewstream.ui:75
#, no-c-format
msgid "Url of Stream:"
msgstr ""
#: addnewstream.ui:88
#, no-c-format
msgid "&Ok"
msgstr ""
#: kstreamripperbase.ui:16
#, no-c-format
msgid "KStreamRipper V. 0.3.4"
@ -82,85 +57,95 @@ msgstr ""
#: kstreamripperbase.ui:125
#, no-c-format
msgid "&Delete Stream"
msgid "&Edit Stream"
msgstr ""
#: kstreamripperbase.ui:136
#, no-c-format
msgid "&Stop Rip"
msgid "&Delete Stream"
msgstr ""
#: kstreamripperbase.ui:150
#: kstreamripperbase.ui:147
#, no-c-format
msgid "&Tune in"
msgstr ""
#: kstreamripperbase.ui:161
#: kstreamripperbase.ui:158
#, no-c-format
msgid "&Rip Stream"
msgstr ""
#: kstreamripperbase.ui:188
#: kstreamripperbase.ui:169
#, no-c-format
msgid "Settings"
msgid "&Stop Rip"
msgstr ""
#: kstreamripperbase.ui:199
#, no-c-format
msgid "Settings"
msgstr ""
#: kstreamripperbase.ui:210
#, no-c-format
msgid "Destination:"
msgstr ""
#: kstreamripperbase.ui:207
#: kstreamripperbase.ui:218
#, no-c-format
msgid "Time to Rip:"
msgstr ""
#: kstreamripperbase.ui:215
#: kstreamripperbase.ui:226
#, no-c-format
msgid "Add ID3 Tag:"
msgstr ""
#: kstreamripperbase.ui:234
#: kstreamripperbase.ui:245
#, no-c-format
msgid "Tune in Command:"
msgstr ""
#: kstreamripperbase.ui:242
#: kstreamripperbase.ui:253
#, no-c-format
msgid "seconds"
msgstr ""
#: kstreamripperbase.ui:250
#: kstreamripperbase.ui:261
#, no-c-format
msgid "...."
msgstr ""
#: kstreamripperbase.ui:258
#: kstreamripperbase.ui:269
#, no-c-format
msgid "xmms <url>"
msgstr ""
#: kstreamripperbase.ui:266
#: kstreamripperbase.ui:277
#, no-c-format
msgid "0"
msgstr ""
#: kstreamripperbase.ui:274
#: kstreamripperbase.ui:285
#, no-c-format
msgid "Choose a directory"
msgstr ""
#: kstreamripperbase.ui:282
#: kstreamripperbase.ui:293
#, no-c-format
msgid "Unicode:"
msgstr ""
#: kstreamripperbase.ui:306
#: kstreamripperbase.ui:317
#, no-c-format
msgid "Details"
msgstr ""
#: kstreamripperbase.ui:325
#: kstreamripperbase.ui:328 streampropertiesdlgbase.ui:54
#, no-c-format
msgid "Description:"
msgstr ""
#: kstreamripperbase.ui:336
#, no-c-format
msgid "URL:"
msgstr ""
@ -169,3 +154,18 @@ msgstr ""
#, no-c-format
msgid "C&ustom"
msgstr ""
#: streampropertiesdlgbase.ui:41
#, no-c-format
msgid "Name:"
msgstr ""
#: streampropertiesdlgbase.ui:67
#, no-c-format
msgid "Url of Stream:"
msgstr ""
#: streampropertiesdlgbase.ui:85
#, no-c-format
msgid "&Ok"
msgstr ""

@ -36,27 +36,27 @@ msgstr "znaleziono przez Zeroconf"
msgid "KStreamRipper"
msgstr ""
#: addnewstream.ui:16
#: streampropertiesdlg.ui:16
#, no-c-format
msgid "Add Stream...."
msgid "Add Stream..."
msgstr "Dodaj Strumień..."
#: addnewstream.ui:44
#: streampropertiesdlg.ui:44
#, no-c-format
msgid "Name:"
msgstr "Nazwa:"
#: addnewstream.ui:52 kstreamripperbase.ui:317
#: streampropertiesdlg.ui:52 kstreamripperbase.ui:317
#, no-c-format
msgid "Description:"
msgstr "Opis:"
#: addnewstream.ui:75
#: streampropertiesdlg.ui:75
#, no-c-format
msgid "Url of Stream:"
msgstr "URL strumienia:"
#: addnewstream.ui:88
#: streampropertiesdlg.ui:88
#, no-c-format
msgid "&Ok"
msgstr "OK"

Loading…
Cancel
Save