mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-04-09 14:33:28 +02:00
2020-08-02 Fred Gleason <fredg@paravelsystems.com>
* Added a 'Post from Log' button to the 'Podcast List' dialog in rdcastmanager(1). Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
parent
44b5d7f7c2
commit
f13cb9ee89
@ -20136,3 +20136,6 @@
|
|||||||
dialogs in rdcatch(1).
|
dialogs in rdcatch(1).
|
||||||
2020-07-08 Fred Gleason <fredg@paravelsystems.com>
|
2020-07-08 Fred Gleason <fredg@paravelsystems.com>
|
||||||
* Incremented the package version to 3.4.0rss1.
|
* Incremented the package version to 3.4.0rss1.
|
||||||
|
2020-08-02 Fred Gleason <fredg@paravelsystems.com>
|
||||||
|
* Added a 'Post from Log' button to the 'Podcast List' dialog
|
||||||
|
in rdcastmanager(1).
|
||||||
|
@ -1 +1 @@
|
|||||||
3.4.0rss1
|
3.4.0rss1
|
187
lib/rdfeed.cpp
187
lib/rdfeed.cpp
@ -39,7 +39,9 @@
|
|||||||
#include "rdescape_string.h"
|
#include "rdescape_string.h"
|
||||||
#include "rdfeed.h"
|
#include "rdfeed.h"
|
||||||
#include "rdlibrary_conf.h"
|
#include "rdlibrary_conf.h"
|
||||||
|
#include "rdlog_event.h"
|
||||||
#include "rdpodcast.h"
|
#include "rdpodcast.h"
|
||||||
|
#include "rdrenderer.h"
|
||||||
#include "rdtempdirectory.h"
|
#include "rdtempdirectory.h"
|
||||||
#include "rdupload.h"
|
#include "rdupload.h"
|
||||||
#include "rdwavefile.h"
|
#include "rdwavefile.h"
|
||||||
@ -937,9 +939,7 @@ bool RDFeed::deleteImages(QString *err_msg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
unsigned RDFeed::postCut(RDUser *user,RDStation *station,
|
unsigned RDFeed::postCut(const QString &cutname,Error *err)
|
||||||
const QString &cutname,Error *err,bool log_debug,
|
|
||||||
RDConfig *config)
|
|
||||||
{
|
{
|
||||||
QString err_msg;
|
QString err_msg;
|
||||||
QString tmpfile;
|
QString tmpfile;
|
||||||
@ -952,8 +952,8 @@ unsigned RDFeed::postCut(RDUser *user,RDStation *station,
|
|||||||
RDAudioConvert::ErrorCode audio_conv_err;
|
RDAudioConvert::ErrorCode audio_conv_err;
|
||||||
RDAudioExport::ErrorCode export_err;
|
RDAudioExport::ErrorCode export_err;
|
||||||
|
|
||||||
|
emit postProgressRangeChanged(0,5);
|
||||||
emit postProgressChanged(0);
|
emit postProgressChanged(0);
|
||||||
emit postProgressChanged(1);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Export Cut
|
// Export Cut
|
||||||
@ -977,7 +977,8 @@ unsigned RDFeed::postCut(RDUser *user,RDStation *station,
|
|||||||
settings->setBitRate(uploadBitRate());
|
settings->setBitRate(uploadBitRate());
|
||||||
settings->setNormalizationLevel(normalizeLevel()/100);
|
settings->setNormalizationLevel(normalizeLevel()/100);
|
||||||
conv->setDestinationSettings(settings);
|
conv->setDestinationSettings(settings);
|
||||||
switch((export_err=conv->runExport(user->name(),user->password(),&audio_conv_err))) {
|
emit postProgressChanged(1);
|
||||||
|
switch((export_err=conv->runExport(rda->user()->name(),rda->user()->password(),&audio_conv_err))) {
|
||||||
case RDAudioExport::ErrorOk:
|
case RDAudioExport::ErrorOk:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -1018,13 +1019,13 @@ unsigned RDFeed::postCut(RDUser *user,RDStation *station,
|
|||||||
upload->setSourceFile(tmpfile);
|
upload->setSourceFile(tmpfile);
|
||||||
upload->setDestinationUrl(purgeUrl()+"/"+cast->audioFilename());
|
upload->setDestinationUrl(purgeUrl()+"/"+cast->audioFilename());
|
||||||
switch((upload_err=upload->runUpload(purgeUsername(),purgePassword(),
|
switch((upload_err=upload->runUpload(purgeUsername(),purgePassword(),
|
||||||
log_debug))) {
|
rda->config()->logXloadDebugData()))) {
|
||||||
case RDUpload::ErrorOk:
|
case RDUpload::ErrorOk:
|
||||||
*err=RDFeed::ErrorOk;
|
*err=RDFeed::ErrorOk;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
emit postProgressChanged(totalPostSteps());
|
emit postProgressChanged(5);
|
||||||
*err=RDFeed::ErrorUploadFailed;
|
*err=RDFeed::ErrorUploadFailed;
|
||||||
sql=QString().sprintf("delete from PODCASTS where ID=%u",cast_id);
|
sql=QString().sprintf("delete from PODCASTS where ID=%u",cast_id);
|
||||||
q=new RDSqlQuery(sql);
|
q=new RDSqlQuery(sql);
|
||||||
@ -1042,22 +1043,20 @@ unsigned RDFeed::postCut(RDUser *user,RDStation *station,
|
|||||||
//
|
//
|
||||||
// Set default cast parameters
|
// Set default cast parameters
|
||||||
//
|
//
|
||||||
cast->setItemAuthor(user->emailContact());
|
cast->setItemAuthor(rda->user()->emailContact());
|
||||||
cast->setItemImageId(defaultItemImageId());
|
cast->setItemImageId(defaultItemImageId());
|
||||||
delete cast;
|
delete cast;
|
||||||
|
|
||||||
emit postProgressChanged(4);
|
emit postProgressChanged(4);
|
||||||
postXml(&err_msg);
|
postXml(&err_msg);
|
||||||
|
|
||||||
emit postProgressChanged(totalPostSteps());
|
emit postProgressChanged(5);
|
||||||
|
|
||||||
return cast_id;
|
return cast_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
unsigned RDFeed::postFile(RDUser *user,RDStation *station,
|
unsigned RDFeed::postFile(const QString &srcfile,Error *err)
|
||||||
const QString &srcfile,Error *err,bool log_debug,
|
|
||||||
RDConfig *config)
|
|
||||||
{
|
{
|
||||||
QString err_msg;
|
QString err_msg;
|
||||||
QString sql;
|
QString sql;
|
||||||
@ -1072,9 +1071,8 @@ unsigned RDFeed::postFile(RDUser *user,RDStation *station,
|
|||||||
RDWaveFile *wave=NULL;
|
RDWaveFile *wave=NULL;
|
||||||
unsigned audio_time=0;
|
unsigned audio_time=0;
|
||||||
|
|
||||||
|
emit postProgressRangeChanged(0,4);
|
||||||
emit postProgressChanged(0);
|
emit postProgressChanged(0);
|
||||||
emit postProgressChanged(1);
|
|
||||||
qApp->processEvents();
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Convert Cut
|
// Convert Cut
|
||||||
@ -1090,6 +1088,9 @@ unsigned RDFeed::postFile(RDUser *user,RDStation *station,
|
|||||||
settings->setBitRate(uploadBitRate());
|
settings->setBitRate(uploadBitRate());
|
||||||
settings->setNormalizationLevel(normalizeLevel()/100);
|
settings->setNormalizationLevel(normalizeLevel()/100);
|
||||||
conv->setDestinationSettings(settings);
|
conv->setDestinationSettings(settings);
|
||||||
|
|
||||||
|
emit postProgressChanged(1);
|
||||||
|
|
||||||
switch(conv->convert()) {
|
switch(conv->convert()) {
|
||||||
case RDAudioConvert::ErrorOk:
|
case RDAudioConvert::ErrorOk:
|
||||||
wave=new RDWaveFile(tmpfile);
|
wave=new RDWaveFile(tmpfile);
|
||||||
@ -1101,7 +1102,7 @@ unsigned RDFeed::postFile(RDUser *user,RDStation *station,
|
|||||||
|
|
||||||
case RDAudioConvert::ErrorInvalidSettings:
|
case RDAudioConvert::ErrorInvalidSettings:
|
||||||
case RDAudioConvert::ErrorFormatNotSupported:
|
case RDAudioConvert::ErrorFormatNotSupported:
|
||||||
emit postProgressChanged(totalPostSteps());
|
emit postProgressChanged(4);
|
||||||
delete settings;
|
delete settings;
|
||||||
delete conv;
|
delete conv;
|
||||||
*err=RDFeed::ErrorUnsupportedType;
|
*err=RDFeed::ErrorUnsupportedType;
|
||||||
@ -1117,7 +1118,7 @@ unsigned RDFeed::postFile(RDUser *user,RDStation *station,
|
|||||||
case RDAudioConvert::ErrorInvalidSpeed:
|
case RDAudioConvert::ErrorInvalidSpeed:
|
||||||
case RDAudioConvert::ErrorFormatError:
|
case RDAudioConvert::ErrorFormatError:
|
||||||
case RDAudioConvert::ErrorNoSpace:
|
case RDAudioConvert::ErrorNoSpace:
|
||||||
emit postProgressChanged(totalPostSteps());
|
emit postProgressChanged(4);
|
||||||
delete settings;
|
delete settings;
|
||||||
delete conv;
|
delete conv;
|
||||||
*err=RDFeed::ErrorGeneral;
|
*err=RDFeed::ErrorGeneral;
|
||||||
@ -1131,8 +1132,7 @@ unsigned RDFeed::postFile(RDUser *user,RDStation *station,
|
|||||||
// Upload
|
// Upload
|
||||||
//
|
//
|
||||||
emit postProgressChanged(2);
|
emit postProgressChanged(2);
|
||||||
emit postProgressChanged(3);
|
|
||||||
qApp->processEvents();
|
|
||||||
QFile file(tmpfile);
|
QFile file(tmpfile);
|
||||||
int length=file.size();
|
int length=file.size();
|
||||||
|
|
||||||
@ -1142,7 +1142,7 @@ unsigned RDFeed::postFile(RDUser *user,RDStation *station,
|
|||||||
upload->setSourceFile(tmpfile);
|
upload->setSourceFile(tmpfile);
|
||||||
upload->setDestinationUrl(purgeUrl()+"/"+cast->audioFilename());
|
upload->setDestinationUrl(purgeUrl()+"/"+cast->audioFilename());
|
||||||
switch((upload_err=upload->runUpload(purgeUsername(),purgePassword(),
|
switch((upload_err=upload->runUpload(purgeUsername(),purgePassword(),
|
||||||
log_debug))) {
|
rda->config()->logXloadDebugData()))) {
|
||||||
case RDUpload::ErrorOk:
|
case RDUpload::ErrorOk:
|
||||||
sql=QString().sprintf("update PODCASTS set AUDIO_TIME=%u where ID=%u",
|
sql=QString().sprintf("update PODCASTS set AUDIO_TIME=%u where ID=%u",
|
||||||
audio_time,cast_id);
|
audio_time,cast_id);
|
||||||
@ -1151,7 +1151,7 @@ unsigned RDFeed::postFile(RDUser *user,RDStation *station,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
emit postProgressChanged(totalPostSteps());
|
emit postProgressChanged(4);
|
||||||
*err=RDFeed::ErrorUploadFailed;
|
*err=RDFeed::ErrorUploadFailed;
|
||||||
sql=QString().sprintf("delete from PODCASTS where ID=%u",cast_id);
|
sql=QString().sprintf("delete from PODCASTS where ID=%u",cast_id);
|
||||||
q=new RDSqlQuery(sql);
|
q=new RDSqlQuery(sql);
|
||||||
@ -1170,23 +1170,140 @@ unsigned RDFeed::postFile(RDUser *user,RDStation *station,
|
|||||||
//
|
//
|
||||||
// Set default cast parameters
|
// Set default cast parameters
|
||||||
//
|
//
|
||||||
cast->setItemAuthor(user->emailContact());
|
cast->setItemAuthor(rda->user()->emailContact());
|
||||||
cast->setItemImageId(defaultItemImageId());
|
cast->setItemImageId(defaultItemImageId());
|
||||||
delete cast;
|
delete cast;
|
||||||
|
|
||||||
emit postProgressChanged(4);
|
emit postProgressChanged(3);
|
||||||
postXml(&err_msg);
|
postXml(&err_msg);
|
||||||
|
|
||||||
emit postProgressChanged(totalPostSteps());
|
emit postProgressChanged(4);
|
||||||
|
|
||||||
*err=RDFeed::ErrorOk;
|
*err=RDFeed::ErrorOk;
|
||||||
return cast_id;
|
return cast_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int RDFeed::totalPostSteps() const
|
unsigned RDFeed::postLog(const QString &logname,RDFeed::Error *err)
|
||||||
{
|
{
|
||||||
return RDFEED_TOTAL_POST_STEPS+1;
|
QString sql;
|
||||||
|
RDSqlQuery *q=NULL;
|
||||||
|
QString tmpfile;
|
||||||
|
QString destfile;
|
||||||
|
QString err_msg;
|
||||||
|
RDUpload *upload=NULL;
|
||||||
|
RDUpload::ErrorCode upload_err;
|
||||||
|
RDRenderer *renderer=NULL;
|
||||||
|
RDSettings *settings=NULL;
|
||||||
|
RDLogEvent *log=NULL;
|
||||||
|
|
||||||
|
emit postProgressChanged(0);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Open Log
|
||||||
|
//
|
||||||
|
log=new RDLogEvent(logname);
|
||||||
|
log->load();
|
||||||
|
if(!log->exists()) {
|
||||||
|
*err=RDFeed::ErrorNoLog;
|
||||||
|
delete log;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
emit postProgressRangeChanged(0,3+log->size());
|
||||||
|
|
||||||
|
//
|
||||||
|
// Render Log
|
||||||
|
//
|
||||||
|
tmpfile=GetTempFilename();
|
||||||
|
|
||||||
|
settings=new RDSettings();
|
||||||
|
settings->setFormat(uploadFormat());
|
||||||
|
settings->setChannels(uploadChannels());
|
||||||
|
settings->setSampleRate(uploadSampleRate());
|
||||||
|
settings->setBitRate(uploadBitRate());
|
||||||
|
settings->setNormalizationLevel(normalizeLevel()/100);
|
||||||
|
|
||||||
|
renderer=new RDRenderer(this);
|
||||||
|
connect(renderer,SIGNAL(progressMessageSent(const QString &)),
|
||||||
|
this,SLOT(renderMessage(const QString &)));
|
||||||
|
connect(renderer,SIGNAL(lineStarted(int,int)),
|
||||||
|
this,SLOT(renderLineStartedData(int,int)));
|
||||||
|
|
||||||
|
if(!renderer->renderToFile(tmpfile,log,settings,QTime(),true,&err_msg,
|
||||||
|
0,log->size())) {
|
||||||
|
*err=RDFeed::ErrorRenderError;
|
||||||
|
delete renderer;
|
||||||
|
delete settings;
|
||||||
|
delete log;
|
||||||
|
unlink(tmpfile);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
delete renderer;
|
||||||
|
|
||||||
|
emit postProgressChanged(1+log->size());
|
||||||
|
|
||||||
|
//
|
||||||
|
// Upload Rendered File
|
||||||
|
//
|
||||||
|
QFile f(tmpfile);
|
||||||
|
unsigned cast_id=CreateCast(&destfile,f.size(),log->length(0,log->size()));
|
||||||
|
RDPodcast *cast=new RDPodcast(feed_config,cast_id);
|
||||||
|
upload=new RDUpload(rda->config(),this);
|
||||||
|
upload->setSourceFile(tmpfile);
|
||||||
|
upload->setDestinationUrl(purgeUrl()+"/"+cast->audioFilename());
|
||||||
|
switch((upload_err=upload->runUpload(purgeUsername(),purgePassword(),
|
||||||
|
rda->config()->logXloadDebugData()))) {
|
||||||
|
case RDUpload::ErrorOk:
|
||||||
|
sql=QString().sprintf("update PODCASTS set AUDIO_TIME=%u where ID=%u",
|
||||||
|
log->length(0,log->size()),cast_id);
|
||||||
|
q=new RDSqlQuery(sql);
|
||||||
|
delete q;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
//emit postProgressChanged(totalPostSteps());
|
||||||
|
*err=RDFeed::ErrorUploadFailed;
|
||||||
|
sql=QString().sprintf("delete from PODCASTS where ID=%u",cast_id);
|
||||||
|
q=new RDSqlQuery(sql);
|
||||||
|
delete q;
|
||||||
|
delete upload;
|
||||||
|
delete cast;
|
||||||
|
delete settings;
|
||||||
|
delete log;
|
||||||
|
*err=RDFeed::ErrorUploadFailed;
|
||||||
|
unlink(tmpfile);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
emit postProgressChanged(2+log->size());
|
||||||
|
|
||||||
|
//unlink(QString(tmpfile)+".wav");
|
||||||
|
unlink(tmpfile);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Set default cast parameters
|
||||||
|
//
|
||||||
|
cast->setItemAuthor(rda->user()->emailContact());
|
||||||
|
cast->setItemImageId(defaultItemImageId());
|
||||||
|
delete cast;
|
||||||
|
|
||||||
|
// emit postProgressChanged(4);
|
||||||
|
postXml(&err_msg);
|
||||||
|
|
||||||
|
// emit postProgressChanged(totalPostSteps());
|
||||||
|
|
||||||
|
*err=RDFeed::ErrorOk;
|
||||||
|
|
||||||
|
emit postProgressChanged(3+log->size());
|
||||||
|
|
||||||
|
delete upload;
|
||||||
|
// delete cast;
|
||||||
|
delete settings;
|
||||||
|
delete log;
|
||||||
|
unlink(tmpfile);
|
||||||
|
|
||||||
|
return cast_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1423,6 +1540,14 @@ QString RDFeed::errorString(RDFeed::Error err)
|
|||||||
case RDFeed::ErrorGeneral:
|
case RDFeed::ErrorGeneral:
|
||||||
ret="General Error";
|
ret="General Error";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case RDFeed::ErrorNoLog:
|
||||||
|
ret="No such log";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case RDFeed::ErrorRenderError:
|
||||||
|
ret="Log rendering error";
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -1460,6 +1585,18 @@ QString RDFeed::itunesCategoryXml(const QString &category,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void RDFeed::renderMessage(const QString &msg)
|
||||||
|
{
|
||||||
|
fprintf(stderr,"RENDERER: %s\n",msg.toUtf8().constData());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void RDFeed::renderLineStartedData(int lineno,int total_lines)
|
||||||
|
{
|
||||||
|
emit postProgressChanged(lineno+1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
unsigned RDFeed::CreateCast(QString *filename,int bytes,int msecs) const
|
unsigned RDFeed::CreateCast(QString *filename,int bytes,int msecs) const
|
||||||
{
|
{
|
||||||
QString sql;
|
QString sql;
|
||||||
|
17
lib/rdfeed.h
17
lib/rdfeed.h
@ -38,7 +38,8 @@ class RDFeed : public QObject
|
|||||||
Q_OBJECT;
|
Q_OBJECT;
|
||||||
public:
|
public:
|
||||||
enum Error {ErrorOk=0,ErrorNoFile=1,ErrorCannotOpenFile=2,
|
enum Error {ErrorOk=0,ErrorNoFile=1,ErrorCannotOpenFile=2,
|
||||||
ErrorUnsupportedType=3,ErrorUploadFailed=4,ErrorGeneral=5};
|
ErrorUnsupportedType=3,ErrorUploadFailed=4,ErrorGeneral=5,
|
||||||
|
ErrorNoLog=6,ErrorRenderError=7};
|
||||||
RDFeed(const QString &keyname,RDConfig *config,QObject *parent=0);
|
RDFeed(const QString &keyname,RDConfig *config,QObject *parent=0);
|
||||||
RDFeed(unsigned id,RDConfig *config,QObject *parent=0);
|
RDFeed(unsigned id,RDConfig *config,QObject *parent=0);
|
||||||
QString keyName() const;
|
QString keyName() const;
|
||||||
@ -133,12 +134,9 @@ class RDFeed : public QObject
|
|||||||
bool postXmlConditional(const QString &caption,QWidget *widget);
|
bool postXmlConditional(const QString &caption,QWidget *widget);
|
||||||
bool deleteXml(QString *err_msg);
|
bool deleteXml(QString *err_msg);
|
||||||
bool deleteImages(QString *err_msg);
|
bool deleteImages(QString *err_msg);
|
||||||
unsigned postCut(RDUser *user,RDStation *station,
|
unsigned postCut(const QString &cutname,Error *err);
|
||||||
const QString &cutname,Error *err,bool log_debug,
|
unsigned postFile(const QString &srcfile,Error *err);
|
||||||
RDConfig *config);
|
unsigned postLog(const QString &logname,Error *err);
|
||||||
unsigned postFile(RDUser *user,RDStation *station,const QString &srcfile,
|
|
||||||
Error *err,bool log_debug,RDConfig *config);
|
|
||||||
int totalPostSteps() const;
|
|
||||||
QString rssXml(QString *err_msg,bool *ok=NULL);
|
QString rssXml(QString *err_msg,bool *ok=NULL);
|
||||||
static unsigned create(const QString &keyname,bool enable_users,
|
static unsigned create(const QString &keyname,bool enable_users,
|
||||||
QString *err_msg);
|
QString *err_msg);
|
||||||
@ -150,6 +148,11 @@ class RDFeed : public QObject
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
void postProgressChanged(int step);
|
void postProgressChanged(int step);
|
||||||
|
void postProgressRangeChanged(int min,int max);
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void renderMessage(const QString &msg);
|
||||||
|
void renderLineStartedData(int lineno,int total_lines);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
unsigned CreateCast(QString *filename,int bytes,int msecs) const;
|
unsigned CreateCast(QString *filename,int bytes,int msecs) const;
|
||||||
|
@ -119,13 +119,13 @@ void RDListLogs::okButtonData()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
*list_logname=item->text(0);
|
*list_logname=item->text(0);
|
||||||
done(0);
|
done(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void RDListLogs::cancelButtonData()
|
void RDListLogs::cancelButtonData()
|
||||||
{
|
{
|
||||||
done(1);
|
done(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1168,7 +1168,7 @@ void EditRDAirPlay::selectData()
|
|||||||
QString logname=air_startlog_edit->text();
|
QString logname=air_startlog_edit->text();
|
||||||
|
|
||||||
RDListLogs *ll=new RDListLogs(&logname,RDLogFilter::NoFilter,this);
|
RDListLogs *ll=new RDListLogs(&logname,RDLogFilter::NoFilter,this);
|
||||||
if(ll->exec()==0) {
|
if(ll->exec()) {
|
||||||
air_startlog_edit->setText(logname);
|
air_startlog_edit->setText(logname);
|
||||||
}
|
}
|
||||||
delete ll;
|
delete ll;
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#include <rdconf.h>
|
#include <rdconf.h>
|
||||||
#include <rdcut_dialog.h>
|
#include <rdcut_dialog.h>
|
||||||
#include <rdescape_string.h>
|
#include <rdescape_string.h>
|
||||||
|
#include <rdlist_logs.h>
|
||||||
|
|
||||||
#include "edit_cast.h"
|
#include "edit_cast.h"
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
@ -67,12 +68,14 @@ ListCasts::ListCasts(unsigned feed_id,bool is_super,QWidget *parent)
|
|||||||
// Progress Dialog
|
// Progress Dialog
|
||||||
//
|
//
|
||||||
list_progress_dialog=
|
list_progress_dialog=
|
||||||
new QProgressDialog(tr("Uploading Audio..."),tr("Cancel"),0,
|
new QProgressDialog(tr("Uploading Audio..."),tr("Cancel"),0,1,this);
|
||||||
list_feed->totalPostSteps(),this);
|
|
||||||
list_progress_dialog->setWindowTitle("RDCastManager - "+tr("Progress"));
|
list_progress_dialog->setWindowTitle("RDCastManager - "+tr("Progress"));
|
||||||
|
list_progress_dialog->setCancelButton(NULL);
|
||||||
list_progress_dialog->setMinimumDuration(0);
|
list_progress_dialog->setMinimumDuration(0);
|
||||||
connect(list_feed,SIGNAL(postProgressChanged(int)),
|
connect(list_feed,SIGNAL(postProgressChanged(int)),
|
||||||
this,SLOT(postProgressChangedData(int)));
|
this,SLOT(postProgressChangedData(int)));
|
||||||
|
connect(list_feed,SIGNAL(postProgressRangeChanged(int,int)),
|
||||||
|
list_progress_dialog,SLOT(setRange(int,int)));
|
||||||
|
|
||||||
//
|
//
|
||||||
// Filter
|
// Filter
|
||||||
@ -156,6 +159,15 @@ ListCasts::ListCasts(unsigned feed_id,bool is_super,QWidget *parent)
|
|||||||
list_file_button->setDisabled(list_feed->isSuperfeed());
|
list_file_button->setDisabled(list_feed->isSuperfeed());
|
||||||
connect(list_file_button,SIGNAL(clicked()),this,SLOT(addFileData()));
|
connect(list_file_button,SIGNAL(clicked()),this,SLOT(addFileData()));
|
||||||
|
|
||||||
|
//
|
||||||
|
// Post Log Button
|
||||||
|
//
|
||||||
|
list_log_button=new QPushButton(this);
|
||||||
|
list_log_button->setFont(buttonFont());
|
||||||
|
list_log_button->setText(tr("Post From\nLog"));
|
||||||
|
list_log_button->setDisabled(list_feed->isSuperfeed());
|
||||||
|
connect(list_log_button,SIGNAL(clicked()),this,SLOT(addLogData()));
|
||||||
|
|
||||||
//
|
//
|
||||||
// Edit Button
|
// Edit Button
|
||||||
//
|
//
|
||||||
@ -219,9 +231,7 @@ void ListCasts::addCartData()
|
|||||||
}
|
}
|
||||||
delete cd;
|
delete cd;
|
||||||
RDFeed::Error err;
|
RDFeed::Error err;
|
||||||
unsigned cast_id=list_feed->postCut(rda->user(),rda->station(),cutname,&err,
|
unsigned cast_id=list_feed->postCut(cutname,&err);
|
||||||
rda->config()->logXloadDebugData(),
|
|
||||||
rda->config());
|
|
||||||
if(err!=RDFeed::ErrorOk) {
|
if(err!=RDFeed::ErrorOk) {
|
||||||
QMessageBox::warning(this,"RDCastManager - "+tr("Posting Error"),
|
QMessageBox::warning(this,"RDCastManager - "+tr("Posting Error"),
|
||||||
RDFeed::errorString(err));
|
RDFeed::errorString(err));
|
||||||
@ -246,9 +256,7 @@ void ListCasts::addFileData()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
RDFeed::Error err;
|
RDFeed::Error err;
|
||||||
unsigned cast_id=list_feed->postFile(rda->user(),rda->station(),srcfile,&err,
|
unsigned cast_id=list_feed->postFile(srcfile,&err);
|
||||||
rda->config()->logXloadDebugData(),
|
|
||||||
rda->config());
|
|
||||||
if(err!=RDFeed::ErrorOk) {
|
if(err!=RDFeed::ErrorOk) {
|
||||||
QMessageBox::warning(this,"RDCastManager - "+tr("Posting Error"),
|
QMessageBox::warning(this,"RDCastManager - "+tr("Posting Error"),
|
||||||
RDFeed::errorString(err));
|
RDFeed::errorString(err));
|
||||||
@ -265,6 +273,35 @@ void ListCasts::addFileData()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ListCasts::addLogData()
|
||||||
|
{
|
||||||
|
QString logname;
|
||||||
|
RDFeed::Error err=RDFeed::ErrorOk;
|
||||||
|
unsigned cast_id=0;
|
||||||
|
|
||||||
|
RDListLogs *d=new RDListLogs(&logname,RDLogFilter::UserFilter,this);
|
||||||
|
if(d->exec()) {
|
||||||
|
if((cast_id=list_feed->postLog(logname,&err))!=0) {
|
||||||
|
EditCast *cast=new EditCast(cast_id,this);
|
||||||
|
cast->exec();
|
||||||
|
RDListViewItem *item=new RDListViewItem(list_casts_view);
|
||||||
|
item->setId(cast_id);
|
||||||
|
RefreshItem(item);
|
||||||
|
list_casts_view->setSelected(item,true);
|
||||||
|
list_casts_view->ensureItemVisible(item);
|
||||||
|
//delete cast;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
QMessageBox::warning(this,"RDCastManager - "+tr("Posting Error"),
|
||||||
|
RDFeed::errorString(err));
|
||||||
|
delete d;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
delete d;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void ListCasts::editData()
|
void ListCasts::editData()
|
||||||
{
|
{
|
||||||
RDListViewItem *item=(RDListViewItem *)list_casts_view->selectedItem();
|
RDListViewItem *item=(RDListViewItem *)list_casts_view->selectedItem();
|
||||||
@ -298,7 +335,8 @@ void ListCasts::deleteData()
|
|||||||
|
|
||||||
QProgressDialog *pd=
|
QProgressDialog *pd=
|
||||||
new QProgressDialog(tr("Deleting Podcast..."),"Cancel",0,2,this);
|
new QProgressDialog(tr("Deleting Podcast..."),"Cancel",0,2,this);
|
||||||
pd->setCaption(tr("Progress"));
|
pd->setWindowTitle(tr("Progress"));
|
||||||
|
pd->setCancelButton(NULL);
|
||||||
pd->setMinimumDuration(0);
|
pd->setMinimumDuration(0);
|
||||||
pd->setValue(0);
|
pd->setValue(0);
|
||||||
qApp->processEvents();
|
qApp->processEvents();
|
||||||
@ -407,8 +445,9 @@ void ListCasts::resizeEvent(QResizeEvent *e)
|
|||||||
list_casts_view->setGeometry(10,54,size().width()-20,size().height()-124);
|
list_casts_view->setGeometry(10,54,size().width()-20,size().height()-124);
|
||||||
list_cart_button->setGeometry(10,size().height()-60,80,50);
|
list_cart_button->setGeometry(10,size().height()-60,80,50);
|
||||||
list_file_button->setGeometry(100,size().height()-60,80,50);
|
list_file_button->setGeometry(100,size().height()-60,80,50);
|
||||||
list_edit_button->setGeometry(190,size().height()-60,80,50);
|
list_log_button->setGeometry(190,size().height()-60,80,50);
|
||||||
list_delete_button->setGeometry(280,size().height()-60,80,50);
|
list_edit_button->setGeometry(300,size().height()-60,80,50);
|
||||||
|
list_delete_button->setGeometry(390,size().height()-60,80,50);
|
||||||
list_close_button->setGeometry(size().width()-90,size().height()-60,80,50);
|
list_close_button->setGeometry(size().width()-90,size().height()-60,80,50);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// List Rivendell Casts
|
// List Rivendell Casts
|
||||||
//
|
//
|
||||||
// (C) Copyright 2002-2019 Fred Gleason <fredg@paravelsystems.com>
|
// (C) Copyright 2002-2020 Fred Gleason <fredg@paravelsystems.com>
|
||||||
//
|
//
|
||||||
// This program is free software; you can redistribute it and/or modify
|
// This program is free software; you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License version 2 as
|
// it under the terms of the GNU General Public License version 2 as
|
||||||
@ -40,6 +40,7 @@ class ListCasts : public RDDialog
|
|||||||
private slots:
|
private slots:
|
||||||
void addCartData();
|
void addCartData();
|
||||||
void addFileData();
|
void addFileData();
|
||||||
|
void addLogData();
|
||||||
void editData();
|
void editData();
|
||||||
void deleteData();
|
void deleteData();
|
||||||
void doubleClickedData(Q3ListViewItem *item,const QPoint &pt,int col);
|
void doubleClickedData(Q3ListViewItem *item,const QPoint &pt,int col);
|
||||||
@ -60,6 +61,7 @@ class ListCasts : public RDDialog
|
|||||||
RDListView *list_casts_view;
|
RDListView *list_casts_view;
|
||||||
QPushButton *list_cart_button;
|
QPushButton *list_cart_button;
|
||||||
QPushButton *list_file_button;
|
QPushButton *list_file_button;
|
||||||
|
QPushButton *list_log_button;
|
||||||
QPushButton *list_edit_button;
|
QPushButton *list_edit_button;
|
||||||
QPushButton *list_delete_button;
|
QPushButton *list_delete_button;
|
||||||
QPushButton *list_close_button;
|
QPushButton *list_close_button;
|
||||||
|
@ -317,6 +317,11 @@ Podcast trotzdem löschen?</translation>
|
|||||||
<source>Feed</source>
|
<source>Feed</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Post From
|
||||||
|
Log</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>MainWidget</name>
|
<name>MainWidget</name>
|
||||||
|
@ -302,6 +302,11 @@ Podcast trotzdem löschen?</translation>
|
|||||||
<source>Feed</source>
|
<source>Feed</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Post From
|
||||||
|
Log</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>MainWidget</name>
|
<name>MainWidget</name>
|
||||||
|
@ -257,6 +257,11 @@ Suscripción</translation>
|
|||||||
<source>Feed</source>
|
<source>Feed</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Post From
|
||||||
|
Log</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>MainWidget</name>
|
<name>MainWidget</name>
|
||||||
|
@ -214,6 +214,11 @@ Car&t/Cut</source>
|
|||||||
<source>Feed</source>
|
<source>Feed</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Post From
|
||||||
|
Log</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>MainWidget</name>
|
<name>MainWidget</name>
|
||||||
|
@ -297,6 +297,11 @@ Vil du halda fram med å sletta podkasten?</translation>
|
|||||||
<source>Feed</source>
|
<source>Feed</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Post From
|
||||||
|
Log</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>MainWidget</name>
|
<name>MainWidget</name>
|
||||||
|
@ -297,6 +297,11 @@ Vil du halda fram med å sletta podkasten?</translation>
|
|||||||
<source>Feed</source>
|
<source>Feed</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Post From
|
||||||
|
Log</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>MainWidget</name>
|
<name>MainWidget</name>
|
||||||
|
@ -267,6 +267,11 @@ Continuar deletando cast?</translation>
|
|||||||
<source>Feed</source>
|
<source>Feed</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Post From
|
||||||
|
Log</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>MainWidget</name>
|
<name>MainWidget</name>
|
||||||
|
@ -93,7 +93,7 @@ void EditChain::selectLogData()
|
|||||||
|
|
||||||
RDListLogs *d=
|
RDListLogs *d=
|
||||||
new RDListLogs(&logname,RDLogFilter::UserFilter,this);
|
new RDListLogs(&logname,RDLogFilter::UserFilter,this);
|
||||||
if(d->exec()!=0) {
|
if(!d->exec()) {
|
||||||
delete d;
|
delete d;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user