2020-07-02 Fred Gleason <fredg@paravelsystems.com>

* Added a 'FEEDS.CHANNEL_SUB_CATEGORY' field to the database.
	* Incremented the database version to 327.
	* Added 'RDFeed::channelSubCategory()' and
	'RDFeed::setChannelSubCategory()' methods.
	* Added a 'RDRssCategoryBox' widget.
	* Updated the 'Edit Feed' dialog in rdadmin(1) to use the
	'RDRssCategoryBox' widget.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason 2020-07-02 17:26:39 -04:00
parent 65597281a1
commit 8bae1332c0
21 changed files with 524 additions and 20 deletions

View File

@ -20068,3 +20068,11 @@
* Fixed a bug in rdadmin(1) that caused the 'Public URL' column in
the 'List Feeds' dialog to display incorrect data after editing
a feed.
2020-07-02 Fred Gleason <fredg@paravelsystems.com>
* Added a 'FEEDS.CHANNEL_SUB_CATEGORY' field to the database.
* Incremented the database version to 327.
* Added 'RDFeed::channelSubCategory()' and
'RDFeed::setChannelSubCategory()' methods.
* Added a 'RDRssCategoryBox' widget.
* Updated the 'Edit Feed' dialog in rdadmin(1) to use the
'RDRssCategoryBox' widget.

View File

@ -11,6 +11,7 @@ AUDIENCE_METRICS enum('N','Y')
CHANNEL_TITLE varchar(191)
CHANNEL_DESCRIPTION text
CHANNEL_CATEGORY varchar(64)
CHANNEL_SUB_CATEGORY varchar(64)
CHANNEL_LINK varchar(191)
CHANNEL_COPYRIGHT varchar(64)
CHANNEL_EDITOR varchar(64)

View File

@ -201,6 +201,7 @@ dist_librd_la_SOURCES = dbversion.h\
rdringbuffer.cpp rdringbuffer.h\
rdripc.cpp rdripc.h\
rdrssschemas.cpp rdrssschemas.h\
rdrsscategorybox.cpp rdrsscategorybox.h\
rdschedcartlist.cpp rdschedcartlist.h\
rdschedcode.cpp rdschedcode.h\
rdschedcodes_dialog.cpp rdschedcodes_dialog.h\
@ -325,6 +326,7 @@ nodist_librd_la_SOURCES = moc_rdadd_cart.cpp\
moc_rdrenderer.cpp\
moc_rdripc.cpp\
moc_rdschedcodes_dialog.cpp\
moc_rdrsscategorybox.cpp\
moc_rdsegmeter.cpp\
moc_rdsimpleplayer.cpp\
moc_rdslider.cpp\

View File

@ -24,7 +24,7 @@
/*
* Current Database Version
*/
#define RD_VERSION_DATABASE 326
#define RD_VERSION_DATABASE 327
#endif // DBVERSION_H

View File

@ -143,6 +143,7 @@ SOURCES += rdrenderer.cpp
SOURCES += rdreport.cpp
SOURCES += rdripc.cpp
SOURCES += rdrssschemas.cpp
SOURCES += rdrsscategorybox.cpp
SOURCES += rdschedcode.cpp
SOURCES += rdsegmeter.cpp
SOURCES += rdsettings.cpp
@ -284,6 +285,7 @@ HEADERS += rdrenderer.h
HEADERS += rdreport.h
HEADERS += rdripc.h
HEADERS += rdrssschemas.h
HEADERS += rdrsscategorybox.h
HEADERS += rdschedcode.h
HEADERS += rdsegmeter.h
HEADERS += rdsettings.h

View File

@ -236,6 +236,19 @@ void RDFeed::setChannelCategory(const QString &str) const
}
QString RDFeed::channelSubCategory() const
{
return RDGetSqlValue("FEEDS","KEY_NAME",feed_keyname,"CHANNEL_SUB_CATEGORY").
toString();
}
void RDFeed::setChannelSubCategory(const QString &str) const
{
SetRow("CHANNEL_SUB_CATEGORY",str);
}
QString RDFeed::channelLink() const
{
return RDGetSqlValue("FEEDS","KEY_NAME",feed_keyname,"CHANNEL_LINK").

View File

@ -58,6 +58,8 @@ class RDFeed : public QObject
void setChannelDescription(const QString &str) const;
QString channelCategory() const;
void setChannelCategory(const QString &str) const;
QString channelSubCategory() const;
void setChannelSubCategory(const QString &str) const;
QString channelLink() const;
void setChannelLink(const QString &str) const;
QString channelCopyright() const;

160
lib/rdrsscategorybox.cpp Normal file
View File

@ -0,0 +1,160 @@
// rdrsscategorybox.cpp
//
// A Combo Box widget for RSS categories.
//
// (C) Copyright 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
// 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.
//
#include "rdrsscategorybox.h"
RDRssCategoryBox::RDRssCategoryBox(RDRssSchemas *schemas,QWidget *parent)
: RDWidget(parent)
{
c_schemas=schemas;
c_schema=RDRssSchemas::CustomSchema;
//
// Category
//
c_box=new QComboBox(this);
connect(c_box,SIGNAL(activated(const QString &)),
this,SLOT(boxActivatedData(const QString &)));
c_edit=new QLineEdit(this);
c_edit->setMaxLength(64);
//
// Seperator
//
c_seperator_label=new QLabel(":",this);
c_seperator_label->setFont(labelFont());
c_seperator_label->setAlignment(Qt::AlignCenter|Qt::AlignVCenter);
//
// Subcategory
//
c_sub_box=new QComboBox(this);
c_sub_edit=new QLineEdit(this);
c_sub_edit->setMaxLength(64);
connect(c_sub_box,SIGNAL(activated(const QString &)),
c_sub_edit,SLOT(setText(const QString &)));
}
RDRssCategoryBox::~RDRssCategoryBox()
{
delete c_box;
delete c_sub_box;
delete c_seperator_label;
delete c_edit;
delete c_sub_edit;
}
RDRssSchemas::RssSchema RDRssCategoryBox::schema() const
{
return c_schema;
}
void RDRssCategoryBox::setSchema(RDRssSchemas::RssSchema schema)
{
if(schema!=c_schema) {
RefreshCategories(schema,c_edit->text(),c_sub_edit->text());
c_schema=schema;
}
}
QString RDRssCategoryBox::category() const
{
return c_edit->text();
}
QString RDRssCategoryBox::subCategory() const
{
return c_sub_edit->text();
}
void RDRssCategoryBox::setCategory(const QString &category,
const QString &sub_category)
{
c_edit->setText(category);
c_sub_edit->setText(sub_category);
RefreshCategories(c_schema,category,sub_category);
}
void RDRssCategoryBox::boxActivatedData(const QString str)
{
c_edit->setText(str);
RefreshSubcategories(c_schema,str,c_sub_edit->text());
}
void RDRssCategoryBox::resizeEvent(QResizeEvent *e)
{
int w=e->size().width();
int h=e->size().height();
c_box->setGeometry(0,0,w/2-3,h);
c_edit->setGeometry(0,0,w/2-3,h);
c_seperator_label->setGeometry(w/2-2,0,5,h);
c_sub_box->setGeometry(w/2+3,0,w/2-2,h);
c_sub_edit->setGeometry(w/2+3,0,w/2-2,h);
}
void RDRssCategoryBox::RefreshCategories(RDRssSchemas::RssSchema schema,
const QString &category,
const QString &sub_category)
{
QStringList categories=c_schemas->categories(schema);
c_edit->setVisible(categories.size()==0);
c_sub_edit->setVisible(categories.size()==0);
c_box->setVisible(categories.size()>0);
c_sub_box->setVisible(categories.size()>0);
if(categories.size()>0) { // Update categories list
c_box->clear();
for(int i=0;i<categories.size();i++) {
c_box->insertItem(c_box->count(),categories.at(i));
if(category==categories.at(i)) {
c_box->setCurrentIndex(i);
}
}
c_edit->setText(c_box->currentText());
RefreshSubcategories(schema,c_edit->text(),sub_category);
}
}
void RDRssCategoryBox::RefreshSubcategories(RDRssSchemas::RssSchema schema,
const QString &category,
const QString &sub_category)
{
QStringList subcategories=c_schemas->subCategories(schema,category);
c_sub_box->clear();
for(int i=0;i<subcategories.size();i++) {
c_sub_box->insertItem(c_sub_box->count(),subcategories.at(i));
if(subcategories.at(i)==sub_category) {
c_sub_box->setCurrentIndex(i);
}
}
c_sub_edit->setText(c_sub_box->currentText());
c_sub_box->setDisabled(c_sub_box->count()==0);
}

68
lib/rdrsscategorybox.h Normal file
View File

@ -0,0 +1,68 @@
// rdrsscategorybox.h
//
// A Combo Box widget for RSS categories.
//
// (C) Copyright 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
// 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.
//
#ifndef RDRSSCATEGORYBOX_H
#define RDRSSCATEGORYBOX_H
#include <qcombobox.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <QResizeEvent>
#include <rdrssschemas.h>
#include <rdwidget.h>
class RDRssCategoryBox : public RDWidget
{
Q_OBJECT
public:
RDRssCategoryBox(RDRssSchemas *schemas,QWidget *parent=0);
~RDRssCategoryBox();
RDRssSchemas::RssSchema schema() const;
void setSchema(RDRssSchemas::RssSchema schema);
QString category() const;
QString subCategory() const;
public slots:
void setCategory(const QString &category,const QString &sub_category);
private slots:
void boxActivatedData(const QString str);
protected:
void resizeEvent(QResizeEvent *e);
private:
void RefreshCategories(RDRssSchemas::RssSchema schema,const QString &category,
const QString &sub_category);
void RefreshSubcategories(RDRssSchemas::RssSchema schema,
const QString &category,
const QString &sub_category);
RDRssSchemas *c_schemas;
RDRssSchemas::RssSchema c_schema;
QComboBox *c_box;
QComboBox *c_sub_box;
QLabel *c_seperator_label;
QLineEdit *c_edit;
QLineEdit *c_sub_edit;
};
#endif // RDRSSCATEGORYBOX_H

View File

@ -18,6 +18,8 @@
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
#include <stdio.h>
#include "rdrssschemas.h"
RDRssSchemas::RDRssSchemas()
@ -48,7 +50,6 @@ RDRssSchemas::RDRssSchemas()
c_maximum_image_sizes.push_back(QSize(3000,3000)); // AppleSchema
c_maximum_image_sizes.push_back(QSize(3000,3000)); // AppleSuperfeedSchema
//
// Header Templates
//
@ -110,6 +111,178 @@ RDRssSchemas::RDRssSchemas()
// AppleSuperfeedSchema
c_item_templates.push_back("<superfeed:channelTitle>%ITEM_CHANNEL_TITLE%</superfeed:channelTitle>\n<superfeed:channelDescription>%ITEM_CHANNEL_DESCRIPTION%</superfeed:channelDescription>\n<title>%ITEM_TITLE%</title>\n<itunes:title>%ITEM_TITLE%</itunes:title>\n<link>%ITEM_LINK%</link>\n<guid isPermaLink=\"false\">%ITEM_GUID%</guid>\n<description>%ITEM_DESCRIPTION%</description>\n<itunes:summary>%ITEM_DESCRIPTION%</itunes:summary>\n<author>%ITEM_AUTHOR%</author>\n<itunes:author>%ITEM_AUTHOR%</itunes:author>\n<comments>%ITEM_COMMENTS%</comments>\n<source url=\"%ITEM_SOURCE_URL%\">%ITEM_SOURCE_TEXT%</source>\n<enclosure url=\"%ITEM_AUDIO_URL%\" length=\"%ITEM_AUDIO_LENGTH%\" type=\"audio/mpeg\" />\n<category>%ITEM_CATEGORY%</category>\n<pubDate>%ITEM_PUBLISH_DATE%</pubDate>\n<itunes:duration>%ITEM_AUDIO_SECONDS%</itunes:duration>\n<itunes:image href=\"%ITEM_IMAGE_URL%\" />\n<itunes:explicit>%ITEM_EXPLICIT%</itunes:explicit>");
//
// Categories
//
QMap<QString,QStringList> empty_sub_category;
c_categories.push_back(QStringList()); // CustomSchema
c_sub_categories.push_back(empty_sub_category);
c_categories.push_back(QStringList()); // Rss202Schema
c_sub_categories.push_back(empty_sub_category);
QStringList apple_categories;
QMap<QString,QStringList> apple_sub_categories;
//
// Apple categories are from
// https://help.apple.com/itc/podcasts_connect/#/itc9267a2f12
//
apple_categories.push_back("Arts");
apple_sub_categories["Arts"]=QStringList();
apple_sub_categories["Arts"].push_back("Books");
apple_sub_categories["Arts"].push_back("Design");
apple_sub_categories["Arts"].push_back("Fashion & Beauty");
apple_sub_categories["Arts"].push_back("Food");
apple_sub_categories["Arts"].push_back("Performing Arts");
apple_sub_categories["Arts"].push_back("Visual Arts");
apple_categories.push_back("Business");
apple_sub_categories["Business"]=QStringList();
apple_sub_categories["Business"].push_back("Careers");
apple_sub_categories["Business"].push_back("Entrepreneurship");
apple_sub_categories["Business"].push_back("Investing");
apple_sub_categories["Business"].push_back("Management");
apple_sub_categories["Business"].push_back("Marketing");
apple_sub_categories["Business"].push_back("Non-Profit");
apple_categories.push_back("Comedy");
apple_sub_categories["Comedy"]=QStringList();
apple_sub_categories["Comedy"].push_back("Comedy Interviews");
apple_sub_categories["Comedy"].push_back("Improv");
apple_sub_categories["Comedy"].push_back("Stand-Up");
apple_categories.push_back("Education");
apple_sub_categories["Education"]=QStringList();
apple_sub_categories["Education"].push_back("Courses");
apple_sub_categories["Education"].push_back("How To");
apple_sub_categories["Education"].push_back("Language Learning");
apple_sub_categories["Education"].push_back("Self-Improvement");
apple_categories.push_back("Fiction");
apple_sub_categories["Fiction"]=QStringList();
apple_sub_categories["Fiction"].push_back("Comedy Fiction");
apple_sub_categories["Fiction"].push_back("Drama");
apple_sub_categories["Fiction"].push_back("Science Fiction");
apple_categories.push_back("Government");
apple_sub_categories["Government"]=QStringList();
apple_categories.push_back("History");
apple_sub_categories["History"]=QStringList();
apple_categories.push_back("Health & Fitness");
apple_sub_categories["Health & Fitness"]=QStringList();
apple_sub_categories["Health & Fitness"].push_back("Alternative Health");
apple_sub_categories["Health & Fitness"].push_back("Fitness");
apple_sub_categories["Health & Fitness"].push_back("Medicine");
apple_sub_categories["Health & Fitness"].push_back("Mental Health");
apple_sub_categories["Health & Fitness"].push_back("Nutrition");
apple_sub_categories["Health & Fitness"].push_back("Sexuality");
apple_categories.push_back("Kids & Family");
apple_sub_categories["Kids & Family"]=QStringList();
apple_sub_categories["Kids & Family"].push_back("Education for Kids");
apple_sub_categories["Kids & Family"].push_back("Parenting");
apple_sub_categories["Kids & Family"].push_back("Pets & Animals");
apple_sub_categories["Kids & Family"].push_back("Stories for Kids");
apple_categories.push_back("Leisure");
apple_sub_categories["Leisure"]=QStringList();
apple_sub_categories["Leisure"].push_back("Animation & Manga");
apple_sub_categories["Leisure"].push_back("Automotive");
apple_sub_categories["Leisure"].push_back("Aviation");
apple_sub_categories["Leisure"].push_back("Crafts");
apple_sub_categories["Leisure"].push_back("Games");
apple_sub_categories["Leisure"].push_back("Hobbies");
apple_sub_categories["Leisure"].push_back("Home & Garden");
apple_sub_categories["Leisure"].push_back("Video Games");
apple_categories.push_back("Music");
apple_sub_categories["Music"]=QStringList();
apple_sub_categories["Music"].push_back("Music Commentary");
apple_sub_categories["Music"].push_back("Music History");
apple_sub_categories["Music"].push_back("Music Interviews");
apple_categories.push_back("News");
apple_sub_categories["News"]=QStringList();
apple_sub_categories["News"].push_back("Business News");
apple_sub_categories["News"].push_back("Daily News");
apple_sub_categories["News"].push_back("Entertainment News");
apple_sub_categories["News"].push_back("News Commentary");
apple_sub_categories["News"].push_back("Politics");
apple_sub_categories["News"].push_back("Sports News");
apple_sub_categories["News"].push_back("Tech News");
apple_categories.push_back("Religion & Spirituality");
apple_sub_categories["Religion & Spirituality"]=QStringList();
apple_sub_categories["Religion & Spirituality"].push_back("Buddhism");
apple_sub_categories["Religion & Spirituality"].push_back("Christianity");
apple_sub_categories["Religion & Spirituality"].push_back("Hinduism");
apple_sub_categories["Religion & Spirituality"].push_back("Islam");
apple_sub_categories["Religion & Spirituality"].push_back("Judaism");
apple_sub_categories["Religion & Spirituality"].push_back("Religion");
apple_sub_categories["Religion & Spirituality"].push_back("Spirituality");
apple_categories.push_back("Science");
apple_sub_categories["Science"]=QStringList();
apple_sub_categories["Science"].push_back("Astronomy");
apple_sub_categories["Science"].push_back("Chemistry");
apple_sub_categories["Science"].push_back("Earth Sciences");
apple_sub_categories["Science"].push_back("Life Sciences");
apple_sub_categories["Science"].push_back("Mathematics");
apple_sub_categories["Science"].push_back("Natural Sciences");
apple_sub_categories["Science"].push_back("Nature");
apple_sub_categories["Science"].push_back("Physics");
apple_sub_categories["Science"].push_back("Social Sciences");
apple_categories.push_back("Society & Culture");
apple_sub_categories["Society & Culture"]=QStringList();
apple_sub_categories["Society & Culture"].push_back("Documentary");
apple_sub_categories["Society & Culture"].push_back("Personal Journals");
apple_sub_categories["Society & Culture"].push_back("Philosophy");
apple_sub_categories["Society & Culture"].push_back("Places & Travel");
apple_sub_categories["Society & Culture"].push_back("Relationships");
apple_categories.push_back("Sports");
apple_sub_categories["Sports"]=QStringList();
apple_sub_categories["Sports"].push_back("Baseball");
apple_sub_categories["Sports"].push_back("Basketball");
apple_sub_categories["Sports"].push_back("Cricket");
apple_sub_categories["Sports"].push_back("Fantasy Sports");
apple_sub_categories["Sports"].push_back("Football");
apple_sub_categories["Sports"].push_back("Golf");
apple_sub_categories["Sports"].push_back("Hockey");
apple_sub_categories["Sports"].push_back("Rugby");
apple_sub_categories["Sports"].push_back("Running");
apple_sub_categories["Sports"].push_back("Soccer");
apple_sub_categories["Sports"].push_back("Swimming");
apple_sub_categories["Sports"].push_back("Tennis");
apple_sub_categories["Sports"].push_back("Volleyball");
apple_sub_categories["Sports"].push_back("Wilderness");
apple_sub_categories["Sports"].push_back("Wrestling");
apple_categories.push_back("Technology");
apple_sub_categories["Technology"]=QStringList();
apple_categories.push_back("True Crime");
apple_sub_categories["True Crime"]=QStringList();
apple_categories.push_back("TV & Film");
apple_sub_categories["TV & Film"]=QStringList();
apple_sub_categories["TV & Film"].push_back("After Shows");
apple_sub_categories["TV & Film"].push_back("Film History");
apple_sub_categories["TV & Film"].push_back("Film Interviews");
apple_sub_categories["TV & Film"].push_back("Film Reviews");
apple_sub_categories["TV & Film"].push_back("TV Reviews");
c_categories.push_back(apple_categories); // AppleSchema
c_sub_categories.push_back(apple_sub_categories);
c_categories.push_back(apple_categories); // AppleSuperfeedSchema
c_sub_categories.push_back(apple_sub_categories);
}
@ -153,3 +326,20 @@ bool RDRssSchemas::supportsItemImages(RssSchema schema) const
{
return c_supports_item_images.at(schema);
}
QStringList RDRssSchemas::categories(RDRssSchemas::RssSchema schema) const
{
return c_categories.at((int)schema);
}
QStringList RDRssSchemas::subCategories(RssSchema schema,
const QString &category) const
{
printf("subCategories: schema: %d category: %s subSize: %d\n",
schema,category.toUtf8().constData(),
c_sub_categories.at((int)schema).value(category).size());
return c_sub_categories.at((int)schema).value(category);
}

View File

@ -22,6 +22,7 @@
#define RDRSSSCHEMAS_H
#include <qlist.h>
#include <qmap.h>
#include <qstring.h>
#include <qsize.h>
#include <qstringlist.h>
@ -39,6 +40,8 @@ class RDRssSchemas
QString channelTemplate(RssSchema schema) const;
QString itemTemplate(RssSchema schema) const;
bool supportsItemImages(RssSchema schema) const;
QStringList categories(RssSchema schema) const;
QStringList subCategories(RssSchema schema,const QString &category) const;
private:
QStringList c_names;
@ -48,6 +51,8 @@ class RDRssSchemas
QStringList c_channel_templates;
QStringList c_item_templates;
QList<bool> c_supports_item_images;
QList<QStringList> c_categories;
QList<QMap<QString,QStringList> > c_sub_categories;
};

View File

@ -63,7 +63,7 @@ EditFeed::EditFeed(const QString &feed,QWidget *parent)
feed_is_superfeed_box->insertItem(0,tr("No"));
feed_is_superfeed_box->insertItem(1,tr("Yes"));
connect(feed_is_superfeed_box,SIGNAL(activated(int)),
this,SLOT(comboboxActivatedData(int)));
this,SLOT(superfeedActivatedData(int)));
feed_is_superfeed_label=new QLabel(tr("Is Superfeed")+":",this);
feed_is_superfeed_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
feed_is_superfeed_label->setFont(labelFont());
@ -107,13 +107,11 @@ EditFeed::EditFeed(const QString &feed,QWidget *parent)
//
// Channel Category
//
feed_channel_category_edit=new QLineEdit(this);
feed_channel_category_edit->setMaxLength(64);
feed_channel_category_label=
new QLabel(feed_channel_category_edit,tr("Category:"),this);
feed_channel_category_box=
new RDRssCategoryBox(feed_feed->rssSchemas(),this);
feed_channel_category_label=new QLabel(tr("Category:"),this);
feed_channel_category_label->setFont(labelFont());
feed_channel_category_label->
setAlignment(Qt::AlignRight|Qt::AlignVCenter);
feed_channel_category_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
//
// Channel Link
@ -409,7 +407,7 @@ EditFeed::EditFeed(const QString &feed,QWidget *parent)
feed_feed->rssSchemas()->name((RDRssSchemas::RssSchema)i),i);
}
connect(feed_rss_schema_box,SIGNAL(activated(int)),
this,SLOT(comboboxActivatedData(int)));
this,SLOT(schemaActivatedData(int)));
feed_rss_schema_label=new QLabel(tr("RSS Schema")+":",this);
feed_rss_schema_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
feed_rss_schema_label->setFont(labelFont());
@ -485,7 +483,9 @@ EditFeed::EditFeed(const QString &feed,QWidget *parent)
feed_redirect_check->setEnabled(feed_audience_metrics_check->isChecked());
feed_redirect_label->setEnabled(feed_audience_metrics_check->isChecked());
feed_channel_title_edit->setText(feed_feed->channelTitle());
feed_channel_category_edit->setText(feed_feed->channelCategory());
feed_channel_category_box->setSchema(feed_feed->rssSchema());
feed_channel_category_box->
setCategory(feed_feed->channelCategory(),feed_feed->channelSubCategory());
feed_channel_link_edit->setText(feed_feed->channelLink());
feed_channel_copyright_edit->setText(feed_feed->channelCopyright());
feed_channel_editor_edit->setText(feed_feed->channelEditor());
@ -562,12 +562,20 @@ QSizePolicy EditFeed::sizePolicy() const
void EditFeed::comboboxActivatedData(int n)
void EditFeed::superfeedActivatedData(int n)
{
UpdateControlState();
}
void EditFeed::schemaActivatedData(int n)
{
feed_channel_category_box->setSchema((RDRssSchemas::RssSchema)n);
UpdateControlState();
}
void EditFeed::checkboxToggledData(bool state)
{
UpdateControlState();
@ -660,7 +668,8 @@ void EditFeed::okData()
feed_feed->setIsSuperfeed(feed_is_superfeed_box->currentItem());
feed_feed->setAudienceMetrics(feed_audience_metrics_check->isChecked());
feed_feed->setChannelTitle(feed_channel_title_edit->text());
feed_feed->setChannelCategory(feed_channel_category_edit->text());
feed_feed->setChannelCategory(feed_channel_category_box->category());
feed_feed->setChannelSubCategory(feed_channel_category_box->subCategory());
feed_feed->setChannelLink(feed_channel_link_edit->text());
feed_feed->setChannelCopyright(feed_channel_copyright_edit->text());
feed_feed->setChannelEditor(feed_channel_editor_edit->text());
@ -738,7 +747,7 @@ void EditFeed::resizeEvent(QResizeEvent *e)
feed_channel_section_groupbox->setGeometry(10,77,sizeHint().width()/2-10,355);
feed_channel_title_edit->setGeometry(115,92,375,19);
feed_channel_title_label->setGeometry(20,92,90,19);
feed_channel_category_edit->setGeometry(115,114,375,19);
feed_channel_category_box->setGeometry(115,114,375,19);
feed_channel_category_label->setGeometry(20,114,90,19);
feed_channel_link_edit->setGeometry(115,136,375,19);
feed_channel_link_label->setGeometry(20,136,90,19);
@ -761,9 +770,11 @@ void EditFeed::resizeEvent(QResizeEvent *e)
feed_channel_language_edit->setGeometry(115,289,60,19);
feed_channel_language_label->setGeometry(20,289,90,19);
feed_channel_explicit_check->setGeometry(205,291,15,15);
feed_channel_explicit_label->setGeometry(225,289,260,19);
feed_channel_explicit_label->setGeometry(225,291,260,19);
feed_channel_description_edit->setGeometry(115,311,375,76);
feed_channel_description_label->setGeometry(20,311,90,19);
feed_channel_image_box->setGeometry(115,389,375,38);
feed_channel_image_box->setIconSize(QSize(36,36));
feed_channel_image_label->setGeometry(20,389,90,19);
@ -859,7 +870,7 @@ void EditFeed::UpdateControlState()
feed_channel_title_edit->setDisabled(redirected);
feed_channel_description_edit->setDisabled(redirected);
feed_channel_category_edit->setDisabled(redirected);
feed_channel_category_box->setDisabled(redirected);
feed_channel_link_edit->setDisabled(redirected);
feed_channel_copyright_edit->setDisabled(redirected);
feed_channel_editor_label->setDisabled(redirected);

View File

@ -34,6 +34,7 @@
#include <rdfeed.h>
#include <rdimagepickerbox.h>
#include <rdsettings.h>
#include <rdrsscategorybox.h>
#include <rdstation.h>
#include "list_images.h"
@ -48,7 +49,8 @@ class EditFeed : public RDDialog
QSizePolicy sizePolicy() const;
private slots:
void comboboxActivatedData(int n);
void superfeedActivatedData(int n);
void schemaActivatedData(int n);
void checkboxToggledData(bool state);
void lineeditChangedData(const QString &str);
void selectSubfeedsData();
@ -73,7 +75,8 @@ class EditFeed : public RDDialog
QComboBox *feed_is_superfeed_box;
QLineEdit *feed_channel_title_edit;
QTextEdit *feed_channel_description_edit;
QLineEdit *feed_channel_category_edit;
QLabel *feed_channel_category_label;
RDRssCategoryBox *feed_channel_category_box;
QLineEdit *feed_channel_link_edit;
QLineEdit *feed_channel_copyright_edit;
QLabel *feed_channel_editor_label;
@ -120,7 +123,6 @@ class EditFeed : public RDDialog
QPushButton *feed_format_button;
QGroupBox *feed_channel_section_groupbox;
QLabel *feed_channel_title_label;
QLabel *feed_channel_category_label;
QLabel *feed_channel_link_label;
QLabel *feed_channel_copyright_label;
QLabel *feed_channel_language_label;

View File

@ -1701,6 +1701,10 @@ Feeds</source>
<source>Superfeed must have at least one subfeed assigned!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>[none]</source>
<translation type="obsolete">[žádný]</translation>
</message>
</context>
<context>
<name>EditFeedPerms</name>

View File

@ -1580,6 +1580,10 @@ Feeds</source>
<source>Superfeed must have at least one subfeed assigned!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>[none]</source>
<translation type="obsolete">[keine]</translation>
</message>
</context>
<context>
<name>EditFeedPerms</name>

View File

@ -1542,6 +1542,10 @@ Feeds</source>
<source>Superfeed must have at least one subfeed assigned!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>[none]</source>
<translation type="obsolete">[ingen]</translation>
</message>
</context>
<context>
<name>EditFeedPerms</name>

View File

@ -1542,6 +1542,10 @@ Feeds</source>
<source>Superfeed must have at least one subfeed assigned!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>[none]</source>
<translation type="obsolete">[ingen]</translation>
</message>
</context>
<context>
<name>EditFeedPerms</name>

View File

@ -1552,6 +1552,10 @@ Feeds</source>
<source>Superfeed must have at least one subfeed assigned!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>[none]</source>
<translation type="obsolete">[Nenhum]</translation>
</message>
</context>
<context>
<name>EditFeedPerms</name>

View File

@ -41,6 +41,15 @@ bool MainObject::RevertSchema(int cur_schema,int set_schema,QString *err_msg)
//
// Revert 327
//
if((cur_schema==327)&&(set_schema<cur_schema)) {
DropColumn("FEEDS","CHANNEL_SUB_CATEGORY");
WriteSchemaVersion(--cur_schema);
}
//
// Revert 326
//

View File

@ -161,7 +161,7 @@ void MainObject::InitializeSchemaMap() {
global_version_map["3.2"]=311;
global_version_map["3.3"]=314;
global_version_map["3.4"]=317;
global_version_map["3.5"]=326;
global_version_map["3.5"]=327;
}

View File

@ -10093,6 +10093,17 @@ bool MainObject::UpdateSchema(int cur_schema,int set_schema,QString *err_msg)
WriteSchemaVersion(++cur_schema);
}
if((cur_schema<327)&&(set_schema>cur_schema)) {
sql=QString("alter table FEEDS ")+
"add column CHANNEL_SUB_CATEGORY varchar(64) "+
"after CHANNEL_CATEGORY";
if(!RDSqlQuery::apply(sql,err_msg)) {
return false;
}
WriteSchemaVersion(++cur_schema);
}
// NEW SCHEMA UPDATES GO HERE...