mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-12-30 08:28:38 +01:00
2022-08-25 Fred Gleason <fredg@paravelsystems.com>
* Added an Online Feed Report to rdcastmanager(1). Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// A PodCast Management Utility for Rivendell.
|
||||
//
|
||||
// (C) Copyright 2002-2020 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2002-2022 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
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <rdconf.h>
|
||||
#include <rdescape_string.h>
|
||||
#include <rdpodcast.h>
|
||||
#include <rdtextfile.h>
|
||||
|
||||
#include "globals.h"
|
||||
#include "list_casts.h"
|
||||
@@ -153,6 +154,15 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent)
|
||||
cast_copy_button->setDisabled(true);
|
||||
connect(cast_copy_button,SIGNAL(clicked()),this,SLOT(copyData()));
|
||||
|
||||
//
|
||||
// Report Button
|
||||
//
|
||||
cast_report_button=new QPushButton(this);
|
||||
cast_report_button->setFont(buttonFont());
|
||||
cast_report_button->setText(tr("Online Feed\nReport"));
|
||||
cast_report_button->setDisabled(true);
|
||||
connect(cast_report_button,SIGNAL(clicked()),this,SLOT(reportData()));
|
||||
|
||||
//
|
||||
// Close Button
|
||||
//
|
||||
@@ -193,6 +203,7 @@ void MainWidget::feedClickedData(Q3ListViewItem *item)
|
||||
{
|
||||
cast_open_button->setDisabled(item==NULL);
|
||||
cast_copy_button->setDisabled(item==NULL);
|
||||
cast_report_button->setDisabled(item==NULL);
|
||||
}
|
||||
|
||||
|
||||
@@ -220,6 +231,27 @@ void MainWidget::copyData()
|
||||
}
|
||||
|
||||
|
||||
void MainWidget::reportData()
|
||||
{
|
||||
RDListViewItem *item=(RDListViewItem *)cast_feed_list->selectedItem();
|
||||
if(item==NULL) {
|
||||
return;
|
||||
}
|
||||
QString err_msg;
|
||||
cast_temp_directories.push_back(new RDTempDirectory("rdcastmanager-report"));
|
||||
if(!cast_temp_directories.last()->create(&err_msg)) {
|
||||
QMessageBox::warning(this,"RDCastManager - "+tr("Error"),
|
||||
tr("Unable to create temporary directory.")+"\n"+
|
||||
"["+err_msg+"]");
|
||||
return;
|
||||
}
|
||||
QString tmpfile=cast_temp_directories.last()->path()+"/report.html";
|
||||
QString cmd="curl -f -s "+item->text(4)+" | xsltproc --encoding utf-8 /usr/share/rivendell/rdcastmanager-report.xsl - > "+tmpfile;
|
||||
system(cmd.toUtf8());
|
||||
RDWebBrowser("file://"+tmpfile);
|
||||
}
|
||||
|
||||
|
||||
void MainWidget::feedDoubleclickedData(Q3ListViewItem *,const QPoint &,int)
|
||||
{
|
||||
openData();
|
||||
@@ -256,16 +288,26 @@ void MainWidget::notificationReceivedData(RDNotification *notify)
|
||||
|
||||
void MainWidget::quitMainWidget()
|
||||
{
|
||||
for(int i=0;i<cast_temp_directories.size();i++) {
|
||||
delete cast_temp_directories.at(i);
|
||||
}
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
void MainWidget::closeEvent(QCloseEvent *e)
|
||||
{
|
||||
quitMainWidget();
|
||||
}
|
||||
|
||||
|
||||
void MainWidget::resizeEvent(QResizeEvent *e)
|
||||
{
|
||||
if(cast_resize) {
|
||||
cast_feed_list->setGeometry(10,10,size().width()-20,size().height()-70);
|
||||
cast_open_button->setGeometry(10,size().height()-55,80,50);
|
||||
cast_copy_button->setGeometry(120,size().height()-55,100,50);
|
||||
cast_copy_button->setGeometry(110,size().height()-55,100,50);
|
||||
cast_report_button->setGeometry(230,size().height()-55,100,50);
|
||||
cast_close_button->setGeometry(size().width()-90,size().height()-55,80,50);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user