Browse Source

2022-08-25 Fred Gleason <fredg@paravelsystems.com>

* Added an Online Feed Report to rdcastmanager(1).

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
pull/849/head
Fred Gleason 7 months ago
parent
commit
40f52e7ca1
  1. 2
      .gitignore
  2. 2
      ChangeLog
  3. 1
      configure.ac
  4. 46
      rdcastmanager/rdcastmanager.cpp
  5. 8
      rdcastmanager/rdcastmanager.h
  6. 9
      rdcastmanager/rdcastmanager_cs.ts
  7. 9
      rdcastmanager/rdcastmanager_de.ts
  8. 9
      rdcastmanager/rdcastmanager_es.ts
  9. 9
      rdcastmanager/rdcastmanager_fr.ts
  10. 9
      rdcastmanager/rdcastmanager_nb.ts
  11. 9
      rdcastmanager/rdcastmanager_nn.ts
  12. 9
      rdcastmanager/rdcastmanager_pt_BR.ts
  13. 5
      rivendell.spec.in
  14. 3
      web/Makefile.am
  15. 33
      web/stylesheets/Makefile.am
  16. 150
      web/stylesheets/rdcastmanager-report.xsl

2
.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

2
ChangeLog

@ -20905,3 +20905,5 @@
2022-08-18 Fred Gleason <fredg@paravelsystems.com>
* Removed superfluous line from
'apis/pypad/scripts/pypad_udp.exemplar'.
2022-08-25 Fred Gleason <fredg@paravelsystems.com>
* Added an Online Feed Report to rdcastmanager(1).

1
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 \

46
rdcastmanager/rdcastmanager.cpp

@ -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);
}
}

8
rdcastmanager/rdcastmanager.h

@ -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;
};

9
rdcastmanager/rdcastmanager_cs.ts

@ -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>

9
rdcastmanager/rdcastmanager_de.ts

@ -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>

9
rdcastmanager/rdcastmanager_es.ts

@ -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>

9
rdcastmanager/rdcastmanager_fr.ts

@ -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>

9
rdcastmanager/rdcastmanager_nb.ts

@ -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>

9
rdcastmanager/rdcastmanager_nn.ts

@ -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>

9
rdcastmanager/rdcastmanager_pt_BR.ts

@ -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>

5
rivendell.spec.in

@ -1,7 +1,7 @@
## rivendell.spec.in
##
## The Rivendell Radio Automation System
## Copyright (C) 2002-2020 Fred Gleason <fredg@paravelsystems.com>
## Copyright (C) 2002-2022 Fred Gleason <fredg@paravelsystems.com>
##
## 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 <fredg@paravelsystems.com>
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

3
web/Makefile.am

@ -2,7 +2,7 @@
##
## Automake.am for rivendell/web
##
## (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 as
@ -22,6 +22,7 @@
SUBDIRS = common\
rdxport\
stylesheets\
tests\
webget

33
web/stylesheets/Makefile.am

@ -0,0 +1,33 @@
## Makefile.am
##
## Automake.am for rivendell/web/stylesheets
##
## (C) Copyright 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
## 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

150
web/stylesheets/rdcastmanager-report.xsl

@ -0,0 +1,150 @@
<!-- rdcastmanager-report.xsl
Stylesheet for generating the Online Feed Report in rdcastmanager(1).
Copyright (C) 2002-2022 Fred Gleason <fredg@paravelsystems.com>
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
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., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">
<xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><xsl:value-of select="/rss/channel/title"/> RSS Feed</title>
<meta charset="UTF-8" />
<meta http-equiv="x-ua-compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1,shrink-to-fit=no" />
<style type="text/css">
body {
background-color: darkgray;
}
.rounded-block {
background-color: white;
width: 800px;
border-style: solid;
border-width: 2px;
border-radius: 10px;
margin-bottom: 5px;
}
.image {
vertical-align: text-top;
margin-left: 5px;
margin-right: 5px;
}
.center-aligned {
font-family: Verdana,san serif;
text-align: center;
margin-top: 5px;
margin-bottom: 5px;
margin-left: 5px;
margin-right: 5px;
}
.left-aligned {
font-family: Helvetica,serif;
text-align: left;
margin-top: 5px;
margin-left: 5px;
margin-right: 5px;
}
.datetime {
font-family: Helvetica,serif;
text-align: right;
margin-top: 5px;
margin-left: 5px;
margin-right: 5px;
}
</style>
</head>
<body>
<header>
<table class="rounded-block">
<tr>
<td width="1024" colspan="2">
<h1 class="center-aligned">Rivendell Podcast Report</h1>
</td>
</tr>
</table>
</header>
<main>
<!-- Channel Info -->
<table class="rounded-block">
<tr>
<td class="image" width="96">
<img class="image" width="96" height="96">
<xsl:attribute name="src">
<xsl:value-of select="/rss/channel/image/url" />
</xsl:attribute>
</img>
</td>
<td>
<table>
<tr>
<td class="left-aligned">
<h2>
<a target="_blank">
<xsl:attribute name="href">
<xsl:value-of select="/rss/channel/link"/>
</xsl:attribute>
<xsl:attribute name="hreflang">
<xsl:value-of select="/rss/channel/language"/>
</xsl:attribute>
<xsl:value-of select="/rss/channel/title"/>
</a>
</h2>
</td>
</tr>
<tr>
<td class="left-aligned">
<xsl:value-of select="/rss/channel/description"/></td>
</tr>
</table>
</td>
</tr>
</table>
<!-- Item Info -->
<xsl:for-each select="/rss/channel/item">
<table class="rounded-block">
<tr>
<td><h3>
<a class="left-aligned" target="_blank">
<xsl:attribute name="href">
<xsl:value-of select="enclosure/@url"/>
</xsl:attribute>
<xsl:attribute name="hreflang">
<xsl:value-of select="/rss/channel/language"/>
</xsl:attribute>
<xsl:value-of select="title"/>
</a>
</h3></td>
<td class="datetime"><h4>
<time class="datetime">
<xsl:value-of select="pubDate" />
</time>
</h4></td>
</tr>
<tr>
<td class="left-aligned" colspan="2">
<xsl:value-of select="description"/>
</td>
</tr>
</table>
</xsl:for-each>
</main>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Loading…
Cancel
Save