mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-15 07:01:20 +02: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);
|
||||
}
|
||||
}
|
||||
|
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// A RSS Feed 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
|
||||
@@ -22,9 +22,11 @@
|
||||
#define RDCASTMANAGER_H
|
||||
|
||||
#include <qpushbutton.h>
|
||||
#include <qlist.h>
|
||||
|
||||
#include <rdconfig.h>
|
||||
#include <rdlog_line.h>
|
||||
#include <rdtempdirectory.h>
|
||||
#include <rdwidget.h>
|
||||
|
||||
#define RDCASTMANAGER_USAGE "\n"
|
||||
@@ -40,6 +42,7 @@ class MainWidget : public RDWidget
|
||||
private slots:
|
||||
void openData();
|
||||
void copyData();
|
||||
void reportData();
|
||||
void userChangedData();
|
||||
void feedClickedData(Q3ListViewItem *item);
|
||||
void feedDoubleclickedData(Q3ListViewItem *item,const QPoint &pt,int col);
|
||||
@@ -47,6 +50,7 @@ class MainWidget : public RDWidget
|
||||
void quitMainWidget();
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent *e);
|
||||
void resizeEvent(QResizeEvent *e);
|
||||
|
||||
private:
|
||||
@@ -59,8 +63,10 @@ class MainWidget : public RDWidget
|
||||
QPixmap *cast_rdcastmanager_32x32_map;
|
||||
QPushButton *cast_open_button;
|
||||
QPushButton *cast_copy_button;
|
||||
QPushButton *cast_report_button;
|
||||
QPushButton *cast_close_button;
|
||||
bool cast_resize;
|
||||
QList<RDTempDirectory *> cast_temp_directories;
|
||||
};
|
||||
|
||||
|
||||
|
@@ -574,6 +574,15 @@ Clipboard</source>
|
||||
<source>[superfeed]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to create temporary directory.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Online Feed
|
||||
Report</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>PickReportDates</name>
|
||||
|
@@ -559,6 +559,15 @@ Clipboard</source>
|
||||
<source>[superfeed]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to create temporary directory.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Online Feed
|
||||
Report</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>PickReportDates</name>
|
||||
|
@@ -513,6 +513,15 @@ Clipboard</source>
|
||||
<source>[superfeed]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to create temporary directory.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Online Feed
|
||||
Report</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>PickReportDates</name>
|
||||
|
@@ -397,6 +397,15 @@ Clipboard</source>
|
||||
<source>[superfeed]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to create temporary directory.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Online Feed
|
||||
Report</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>RenderDialog</name>
|
||||
|
@@ -541,6 +541,15 @@ Clipboard</source>
|
||||
<source>[superfeed]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to create temporary directory.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Online Feed
|
||||
Report</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>PickReportDates</name>
|
||||
|
@@ -541,6 +541,15 @@ Clipboard</source>
|
||||
<source>[superfeed]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to create temporary directory.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Online Feed
|
||||
Report</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>PickReportDates</name>
|
||||
|
@@ -519,6 +519,15 @@ Clipboard</source>
|
||||
<source>[superfeed]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to create temporary directory.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Online Feed
|
||||
Report</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>PickReportDates</name>
|
||||
|
Reference in New Issue
Block a user