From 40f52e7ca15e81ed7b875b5a09112c021ec35efd Mon Sep 17 00:00:00 2001 From: Fred Gleason Date: Thu, 25 Aug 2022 13:03:30 -0400 Subject: [PATCH] 2022-08-25 Fred Gleason * Added an Online Feed Report to rdcastmanager(1). Signed-off-by: Fred Gleason --- .gitignore | 2 +- ChangeLog | 2 + configure.ac | 1 + rdcastmanager/rdcastmanager.cpp | 46 ++++++- rdcastmanager/rdcastmanager.h | 8 +- rdcastmanager/rdcastmanager_cs.ts | 9 ++ rdcastmanager/rdcastmanager_de.ts | 9 ++ rdcastmanager/rdcastmanager_es.ts | 9 ++ rdcastmanager/rdcastmanager_fr.ts | 9 ++ rdcastmanager/rdcastmanager_nb.ts | 9 ++ rdcastmanager/rdcastmanager_nn.ts | 9 ++ rdcastmanager/rdcastmanager_pt_BR.ts | 9 ++ rivendell.spec.in | 5 +- web/Makefile.am | 3 +- web/stylesheets/Makefile.am | 33 +++++ web/stylesheets/rdcastmanager-report.xsl | 150 +++++++++++++++++++++++ 16 files changed, 306 insertions(+), 7 deletions(-) create mode 100644 web/stylesheets/Makefile.am create mode 100644 web/stylesheets/rdcastmanager-report.xsl diff --git a/.gitignore b/.gitignore index 7ee1976b..802dd6ed 100644 --- a/.gitignore +++ b/.gitignore @@ -14,7 +14,6 @@ *.rlm *.rpm *.so -*.xsl rivendell-*.tar.gz rivendell-*.zip .AppleDouble @@ -60,6 +59,7 @@ docs/opsguide/whiteball.png docs/rivwebcapi/*.7 docs/rivwebcapi/*.html docs/rivwebcapi/*.pdf +docs/stylesheets/*.xsl helpers/cwrap helpers/docbook helpers/install_python.sh diff --git a/ChangeLog b/ChangeLog index c97f8cdf..87934fc6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -20905,3 +20905,5 @@ 2022-08-18 Fred Gleason * Removed superfluous line from 'apis/pypad/scripts/pypad_udp.exemplar'. +2022-08-25 Fred Gleason + * Added an Online Feed Report to rdcastmanager(1). diff --git a/configure.ac b/configure.ac index 47c4da84..7d9db165 100644 --- a/configure.ac +++ b/configure.ac @@ -520,6 +520,7 @@ AC_CONFIG_FILES([rivendell.spec \ web/Makefile \ web/common/Makefile \ web/rdxport/Makefile \ + web/stylesheets/Makefile \ web/tests/Makefile \ web/webget/Makefile \ conf/Makefile \ diff --git a/rdcastmanager/rdcastmanager.cpp b/rdcastmanager/rdcastmanager.cpp index 7a3f28aa..4895a6a2 100644 --- a/rdcastmanager/rdcastmanager.cpp +++ b/rdcastmanager/rdcastmanager.cpp @@ -2,7 +2,7 @@ // // A PodCast Management Utility for Rivendell. // -// (C) Copyright 2002-2020 Fred Gleason +// (C) Copyright 2002-2022 Fred Gleason // // 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 #include #include +#include #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;isetGeometry(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); } } diff --git a/rdcastmanager/rdcastmanager.h b/rdcastmanager/rdcastmanager.h index 0b2ddc3c..63601d40 100644 --- a/rdcastmanager/rdcastmanager.h +++ b/rdcastmanager/rdcastmanager.h @@ -2,7 +2,7 @@ // // A RSS Feed Management Utility for Rivendell. // -// (C) Copyright 2002-2020 Fred Gleason +// (C) Copyright 2002-2022 Fred Gleason // // 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 +#include #include #include +#include #include #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 cast_temp_directories; }; diff --git a/rdcastmanager/rdcastmanager_cs.ts b/rdcastmanager/rdcastmanager_cs.ts index 3be1a20e..4f0d06fe 100644 --- a/rdcastmanager/rdcastmanager_cs.ts +++ b/rdcastmanager/rdcastmanager_cs.ts @@ -574,6 +574,15 @@ Clipboard [superfeed] + + Unable to create temporary directory. + + + + Online Feed +Report + + PickReportDates diff --git a/rdcastmanager/rdcastmanager_de.ts b/rdcastmanager/rdcastmanager_de.ts index abe4fb70..be5f06d7 100644 --- a/rdcastmanager/rdcastmanager_de.ts +++ b/rdcastmanager/rdcastmanager_de.ts @@ -559,6 +559,15 @@ Clipboard [superfeed] + + Unable to create temporary directory. + + + + Online Feed +Report + + PickReportDates diff --git a/rdcastmanager/rdcastmanager_es.ts b/rdcastmanager/rdcastmanager_es.ts index 8814d758..c242d963 100644 --- a/rdcastmanager/rdcastmanager_es.ts +++ b/rdcastmanager/rdcastmanager_es.ts @@ -513,6 +513,15 @@ Clipboard [superfeed] + + Unable to create temporary directory. + + + + Online Feed +Report + + PickReportDates diff --git a/rdcastmanager/rdcastmanager_fr.ts b/rdcastmanager/rdcastmanager_fr.ts index 2c1f1a5b..c9e17d5d 100644 --- a/rdcastmanager/rdcastmanager_fr.ts +++ b/rdcastmanager/rdcastmanager_fr.ts @@ -397,6 +397,15 @@ Clipboard [superfeed] + + Unable to create temporary directory. + + + + Online Feed +Report + + RenderDialog diff --git a/rdcastmanager/rdcastmanager_nb.ts b/rdcastmanager/rdcastmanager_nb.ts index d1fba85e..a98f3a09 100644 --- a/rdcastmanager/rdcastmanager_nb.ts +++ b/rdcastmanager/rdcastmanager_nb.ts @@ -541,6 +541,15 @@ Clipboard [superfeed] + + Unable to create temporary directory. + + + + Online Feed +Report + + PickReportDates diff --git a/rdcastmanager/rdcastmanager_nn.ts b/rdcastmanager/rdcastmanager_nn.ts index d1fba85e..a98f3a09 100644 --- a/rdcastmanager/rdcastmanager_nn.ts +++ b/rdcastmanager/rdcastmanager_nn.ts @@ -541,6 +541,15 @@ Clipboard [superfeed] + + Unable to create temporary directory. + + + + Online Feed +Report + + PickReportDates diff --git a/rdcastmanager/rdcastmanager_pt_BR.ts b/rdcastmanager/rdcastmanager_pt_BR.ts index 41765759..db02df8f 100644 --- a/rdcastmanager/rdcastmanager_pt_BR.ts +++ b/rdcastmanager/rdcastmanager_pt_BR.ts @@ -519,6 +519,15 @@ Clipboard [superfeed] + + Unable to create temporary directory. + + + + Online Feed +Report + + PickReportDates diff --git a/rivendell.spec.in b/rivendell.spec.in index 302e0fd6..1e5d0f4c 100644 --- a/rivendell.spec.in +++ b/rivendell.spec.in @@ -1,7 +1,7 @@ ## rivendell.spec.in ## ## The Rivendell Radio Automation System -## Copyright (C) 2002-2020 Fred Gleason +## Copyright (C) 2002-2022 Fred Gleason ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of version 2 of the GNU General Public License as @@ -28,7 +28,7 @@ Release: @RPM_RELEASE@ License: GPL Packager: Fred Gleason Source: rivendell-@VERSION@.tar.gz -Requires: @MYSQL_PKG@, @QT4_MYSQL_PKG@, @APACHE_PKG@, curl, @USERMODE_PKG@, rivendell-pypad = @VERSION@, rsyslog +Requires: @MYSQL_PKG@, @QT4_MYSQL_PKG@, @APACHE_PKG@, curl, @USERMODE_PKG@, rivendell-pypad = @VERSION@, rsyslog libxslt BuildRoot: /var/tmp/rivendell-@VERSION@ Obsoletes: rivendell-base rivendell-opsguide Conflicts: rivendell-opsguide @@ -289,6 +289,7 @@ rm -rf $RPM_BUILD_ROOT @LOCAL_PREFIX@/bin/rdmemcheck.sh @LOCAL_PREFIX@/bin/rdrender @LOCAL_PREFIX@/share/rivendell/*.qm +@LOCAL_PREFIX@/share/rivendell/*.xsl @LOCAL_PREFIX@/share/icons/hicolor/16x16/apps/rivendell.png @LOCAL_PREFIX@/share/icons/hicolor/16x16/apps/rdadmin.png @LOCAL_PREFIX@/share/icons/hicolor/16x16/apps/rdairplay.png diff --git a/web/Makefile.am b/web/Makefile.am index 6cee3088..90eb4e42 100644 --- a/web/Makefile.am +++ b/web/Makefile.am @@ -2,7 +2,7 @@ ## ## Automake.am for rivendell/web ## -## (C) Copyright 2002-2020 Fred Gleason +## (C) Copyright 2002-2022 Fred Gleason ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as @@ -22,6 +22,7 @@ SUBDIRS = common\ rdxport\ + stylesheets\ tests\ webget diff --git a/web/stylesheets/Makefile.am b/web/stylesheets/Makefile.am new file mode 100644 index 00000000..9055f37f --- /dev/null +++ b/web/stylesheets/Makefile.am @@ -0,0 +1,33 @@ +## Makefile.am +## +## Automake.am for rivendell/web/stylesheets +## +## (C) Copyright 2022 Fred Gleason +## +## 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 +## published by the Free Software Foundation. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public +## License along with this program; if not, write to the Free Software +## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +## +## Use automake to process this into a Makefile.in + +install-exec-am: + mkdir -p $(DESTDIR)/usr/share/rivendell + cp rdcastmanager-report.xsl $(DESTDIR)/usr/share/rivendell/ + +uninstall-local: + rm -f $(DESTDIR)/usr/share/rivendell/rdcastmanager-report.xsl + +EXTRA_DIST = rdcastmanager-report.xsl + +CLEANFILES = *~ +MAINTAINERCLEANFILES = *~\ + Makefile.in diff --git a/web/stylesheets/rdcastmanager-report.xsl b/web/stylesheets/rdcastmanager-report.xsl new file mode 100644 index 00000000..1e1e5825 --- /dev/null +++ b/web/stylesheets/rdcastmanager-report.xsl @@ -0,0 +1,150 @@ + + + + + + + + <xsl:value-of select="/rss/channel/title"/> RSS Feed + + + + + + +
+ + + + +
+

Rivendell Podcast Report

+
+
+
+ + + + + + +
+ + + + + + + + + + + + + +
+

+ + + + + + + + + +

+
+
+
+ + + + + + + + + + + +

+ + + + + + + + + +

+ +

+ +
+
+
+ + +
+