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:
Fred Gleason
2020-08-02 10:54:07 -04:00
parent 44b5d7f7c2
commit f13cb9ee89
16 changed files with 268 additions and 49 deletions

View File

@@ -26,6 +26,7 @@
#include <rdconf.h>
#include <rdcut_dialog.h>
#include <rdescape_string.h>
#include <rdlist_logs.h>
#include "edit_cast.h"
#include "globals.h"
@@ -67,12 +68,14 @@ ListCasts::ListCasts(unsigned feed_id,bool is_super,QWidget *parent)
// Progress Dialog
//
list_progress_dialog=
new QProgressDialog(tr("Uploading Audio..."),tr("Cancel"),0,
list_feed->totalPostSteps(),this);
new QProgressDialog(tr("Uploading Audio..."),tr("Cancel"),0,1,this);
list_progress_dialog->setWindowTitle("RDCastManager - "+tr("Progress"));
list_progress_dialog->setCancelButton(NULL);
list_progress_dialog->setMinimumDuration(0);
connect(list_feed,SIGNAL(postProgressChanged(int)),
this,SLOT(postProgressChangedData(int)));
connect(list_feed,SIGNAL(postProgressRangeChanged(int,int)),
list_progress_dialog,SLOT(setRange(int,int)));
//
// Filter
@@ -156,6 +159,15 @@ ListCasts::ListCasts(unsigned feed_id,bool is_super,QWidget *parent)
list_file_button->setDisabled(list_feed->isSuperfeed());
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
//
@@ -219,9 +231,7 @@ void ListCasts::addCartData()
}
delete cd;
RDFeed::Error err;
unsigned cast_id=list_feed->postCut(rda->user(),rda->station(),cutname,&err,
rda->config()->logXloadDebugData(),
rda->config());
unsigned cast_id=list_feed->postCut(cutname,&err);
if(err!=RDFeed::ErrorOk) {
QMessageBox::warning(this,"RDCastManager - "+tr("Posting Error"),
RDFeed::errorString(err));
@@ -246,9 +256,7 @@ void ListCasts::addFileData()
return;
}
RDFeed::Error err;
unsigned cast_id=list_feed->postFile(rda->user(),rda->station(),srcfile,&err,
rda->config()->logXloadDebugData(),
rda->config());
unsigned cast_id=list_feed->postFile(srcfile,&err);
if(err!=RDFeed::ErrorOk) {
QMessageBox::warning(this,"RDCastManager - "+tr("Posting Error"),
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()
{
RDListViewItem *item=(RDListViewItem *)list_casts_view->selectedItem();
@@ -298,7 +335,8 @@ void ListCasts::deleteData()
QProgressDialog *pd=
new QProgressDialog(tr("Deleting Podcast..."),"Cancel",0,2,this);
pd->setCaption(tr("Progress"));
pd->setWindowTitle(tr("Progress"));
pd->setCancelButton(NULL);
pd->setMinimumDuration(0);
pd->setValue(0);
qApp->processEvents();
@@ -407,8 +445,9 @@ void ListCasts::resizeEvent(QResizeEvent *e)
list_casts_view->setGeometry(10,54,size().width()-20,size().height()-124);
list_cart_button->setGeometry(10,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_delete_button->setGeometry(280,size().height()-60,80,50);
list_log_button->setGeometry(190,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);
}

View File

@@ -2,7 +2,7 @@
//
// 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
// it under the terms of the GNU General Public License version 2 as
@@ -40,6 +40,7 @@ class ListCasts : public RDDialog
private slots:
void addCartData();
void addFileData();
void addLogData();
void editData();
void deleteData();
void doubleClickedData(Q3ListViewItem *item,const QPoint &pt,int col);
@@ -60,6 +61,7 @@ class ListCasts : public RDDialog
RDListView *list_casts_view;
QPushButton *list_cart_button;
QPushButton *list_file_button;
QPushButton *list_log_button;
QPushButton *list_edit_button;
QPushButton *list_delete_button;
QPushButton *list_close_button;

View File

@@ -317,6 +317,11 @@ Podcast trotzdem löschen?</translation>
<source>Feed</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Post From
Log</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainWidget</name>

View File

@@ -302,6 +302,11 @@ Podcast trotzdem löschen?</translation>
<source>Feed</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Post From
Log</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainWidget</name>

View File

@@ -257,6 +257,11 @@ Suscripción</translation>
<source>Feed</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Post From
Log</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainWidget</name>

View File

@@ -214,6 +214,11 @@ Car&amp;t/Cut</source>
<source>Feed</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Post From
Log</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainWidget</name>

View File

@@ -297,6 +297,11 @@ Vil du halda fram med å sletta podkasten?</translation>
<source>Feed</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Post From
Log</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainWidget</name>

View File

@@ -297,6 +297,11 @@ Vil du halda fram med å sletta podkasten?</translation>
<source>Feed</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Post From
Log</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainWidget</name>

View File

@@ -267,6 +267,11 @@ Continuar deletando cast?</translation>
<source>Feed</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Post From
Log</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainWidget</name>