2024-08-26 Fred Gleason <fredg@paravelsystems.com>

* Modified the 'Select Log' dialog in the voice tracker in
	rdairplay(1) so as to retain previous service selection across
	invocations.
	* Modified the 'Podcast Item List' dialog in rdcastmanager(1) so as
	to retain previous service selection across invocations.
	* Modified the 'Edit Log Chain' dialog in rdlogedit(1) so as
	to retain previous user group selection across invocations.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason 2024-08-26 12:14:48 -04:00
parent 4afb55452e
commit 7599ec34ae
13 changed files with 78 additions and 69 deletions

View File

@ -24872,3 +24872,11 @@
2024-08-26 Fred Gleason <fredg@paravelsystems.com>
* Fixed a bug in rdairplay(1) that caused the voice tracker to be
left in an undefined state after attempting to load a locked log.
2024-08-26 Fred Gleason <fredg@paravelsystems.com>
* Modified the 'Select Log' dialog in the voice tracker in
rdairplay(1) so as to retain previous service selection across
invocations.
* Modified the 'Podcast Item List' dialog in rdcastmanager(1) so as
to retain previous service selection across invocations.
* Modified the 'Edit Log Chain' dialog in rdlogedit(1) so as
to retain previous user group selection across invocations.

View File

@ -2,7 +2,7 @@
//
// Select a Rivendell Log
//
// (C) Copyright 2002-2022 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2002-2024 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
@ -23,12 +23,10 @@
#include "rdescape_string.h"
#include "rdlist_logs.h"
RDListLogs::RDListLogs(QString *logname,RDLogFilter::FilterMode mode,
const QString &caption,QWidget *parent)
RDListLogs::RDListLogs(RDLogFilter::FilterMode mode,const QString &caption,
QWidget *parent)
: RDDialog(parent)
{
list_logname=logname;
//
// Fix the Window Size
//
@ -73,9 +71,6 @@ RDListLogs::RDListLogs(QString *logname,RDLogFilter::FilterMode mode,
list_cancel_button->setText(tr("Cancel"));
list_cancel_button->setDefault(true);
connect(list_cancel_button,SIGNAL(clicked()),this,SLOT(cancelButtonData()));
list_log_model->setFilterSql(list_filter_widget->whereSql(),
list_filter_widget->limitSql());
}
@ -91,6 +86,18 @@ QSizePolicy RDListLogs::sizePolicy() const
}
int RDListLogs::exec(QString *logname)
{
list_logname=logname;
list_filter_widget->changeUser();
list_log_model->setFilterSql(list_filter_widget->whereSql(),
list_filter_widget->limitSql());
return QDialog::exec();
}
void RDListLogs::closeEvent(QCloseEvent *e)
{
cancelButtonData();
@ -114,7 +121,8 @@ void RDListLogs::okButtonData()
if(list_log_view->selectionModel()->selectedRows().size()!=1) {
return;
}
*list_logname=list_log_model->logName(list_log_view->selectionModel()->selectedRows().at(0));
*list_logname=list_log_model->
logName(list_log_view->selectionModel()->selectedRows().at(0));
done(true);
}

View File

@ -37,11 +37,14 @@ class RDListLogs : public RDDialog
{
Q_OBJECT
public:
RDListLogs(QString *logname,RDLogFilter::FilterMode mode,
const QString &caption,QWidget *parent=0);
RDListLogs(RDLogFilter::FilterMode mode,const QString &caption,
QWidget *parent);
QSize sizeHint() const;
QSizePolicy sizePolicy() const;
public slots:
int exec(QString *logname);
private slots:
void doubleClickedData(const QModelIndex &index);
void closeEvent(QCloseEvent *);

View File

@ -2,7 +2,7 @@
//
// Filter widget for picking Rivendell logs.
//
// (C) Copyright 2017-2022 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2017-2024 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
@ -184,18 +184,22 @@ QString RDLogFilter::limitSql() const
void RDLogFilter::changeUser()
{
if(filter_filter_mode==RDLogFilter::UserFilter) {
filter_service_box->clear();
filter_service_box->insertItem(filter_service_box->count(),tr("ALL"));
QString sql=QString("select `SERVICE_NAME` from `USER_SERVICE_PERMS` where ")+
"`USER_NAME`='"+RDEscapeString(rda->user()->name())+"' "+
"order by `SERVICE_NAME`";
RDSqlQuery *q=new RDSqlQuery(sql);
while(q->next()) {
filter_service_box->
insertItem(filter_service_box->count(),rda->iconEngine()->serviceIcon(),
q->value(0).toString());
if(filter_current_username!=rda->user()->name()) {
filter_service_box->clear();
filter_service_box->insertItem(filter_service_box->count(),tr("ALL"));
QString sql=
QString("select `SERVICE_NAME` from `USER_SERVICE_PERMS` where ")+
"`USER_NAME`='"+RDEscapeString(rda->user()->name())+"' "+
"order by `SERVICE_NAME`";
RDSqlQuery *q=new RDSqlQuery(sql);
while(q->next()) {
filter_service_box->insertItem(filter_service_box->count(),
rda->iconEngine()->serviceIcon(),
q->value(0).toString());
}
delete q;
filter_current_username=rda->user()->name();
}
delete q;
}
}

View File

@ -2,7 +2,7 @@
//
// Filter widget for picking Rivendell logs.
//
// (C) Copyright 2017-2022 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2017-2024 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
@ -69,6 +69,7 @@ class RDLogFilter : public QWidget
QPushButton *filter_clear_button;
QCheckBox *filter_recent_check;
QLabel *filter_recent_label;
QString filter_current_username;
};

View File

@ -2,7 +2,7 @@
//
// Edit an RDAirPlay Configuration
//
// (C) Copyright 2002-2022 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2002-2024 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,11 +26,9 @@
#include <rd.h>
#include <rddb.h>
#include <rdescape_string.h>
#include <rdlist_logs.h>
#include <rdtextvalidator.h>
#include "edit_rdairplay.h"
//#include "edit_hotkeys.h"
#include "edit_channelgpios.h"
#include "globals.h"
@ -50,7 +48,8 @@ EditRDAirPlay::EditRDAirPlay(RDStation *station,RDStation *cae_station,
setMaximumSize(sizeHint());
air_conf=new RDAirPlayConf(station->name(),"RDAIRPLAY");
air_listlogs_dialog=new RDListLogs(RDLogFilter::NoFilter,"RDAdmin",this);
//
// Text Validator
//
@ -1179,23 +1178,11 @@ void EditRDAirPlay::selectData()
{
QString logname=air_startlog_edit->text();
RDListLogs *ll=new RDListLogs(&logname,RDLogFilter::NoFilter,"RDAdmin",this);
if(ll->exec()) {
if(air_listlogs_dialog->exec(&logname)) {
air_startlog_edit->setText(logname);
}
delete ll;
}
/*
void EditRDAirPlay::editHotKeys()
{
QString module_name = QString("airplay");
EditHotkeys *edit_hotkeys=
new EditHotkeys(air_conf->station(),(const char *)module_name,this);
edit_hotkeys->exec();
delete edit_hotkeys;
}
*/
void EditRDAirPlay::selectSkinData()
{

View File

@ -31,6 +31,7 @@
#include <rdairplay_conf.h>
#include <rdcardselector.h>
#include <rddialog.h>
#include <rdlist_logs.h>
#include <rdservicelistmodel.h>
#include <rdstation.h>
@ -150,6 +151,7 @@ class EditRDAirPlay : public RDDialog
QComboBox *air_virtual_logstartmode_box;
int air_virtual_logstartmachine;
RDAirPlayConf::OpMode air_virtual_opmodes[RD_RDVAIRPLAY_LOG_QUAN];
RDListLogs *air_listlogs_dialog;
RDServiceListModel *air_service_model;
};

View File

@ -18,14 +18,14 @@
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
#include <rdlist_logs.h>
#include "colors.h"
#include "voicetracker.h"
VoiceTracker::VoiceTracker(QWidget *parent)
: RDWidget(parent)
{
d_listlogs_dialog=new RDListLogs(RDLogFilter::StationFilter,"RDAirPlay",this);
d_tracker_widget=new RDTrackerWidget(&d_import_path,this);
if(rda->airplayConf()->barAction()==RDAirPlayConf::StartNext) {
d_tracker_widget->setFocusPolicy(Qt::NoFocus);
@ -57,16 +57,15 @@ void VoiceTracker::loadData()
{
QString logname;
RDListLogs *d=new RDListLogs(&logname,RDLogFilter::StationFilter,"RDAirPlay",
this);
if(d->exec()) {
printf("HERE1\n");
if(d_listlogs_dialog->exec(&logname)) {
printf("HERE2: %s\n",logname.toUtf8().constData());
if(d_tracker_widget->load(logname)) {
d_load_button->disconnect();
connect(d_load_button,SIGNAL(clicked()),this,SLOT(unloadData()));
d_load_button->setText(tr("Unload\nLog"));
}
}
delete d;
}

View File

@ -24,6 +24,7 @@
#include <QLabel>
#include <QPushButton>
#include <rdlist_logs.h>
#include <rdtrackerwidget.h>
#include <rdwidget.h>
@ -43,6 +44,7 @@ class VoiceTracker : public RDWidget
void paintEvent(QPaintEvent *e);
private:
RDListLogs *d_listlogs_dialog;
RDTrackerWidget *d_tracker_widget;
QPushButton *d_load_button;
QString d_import_path;

View File

@ -2,7 +2,7 @@
//
// List Rivendell Casts
//
// (C) Copyright 2002-2023 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2002-2024 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
@ -24,7 +24,6 @@
#include <rdconf.h>
#include <rdescape_string.h>
#include <rdlist_logs.h>
#include <rdpodcast.h>
#include "edit_cast.h"
@ -54,6 +53,9 @@ ListCasts::ListCasts(unsigned feed_id,QWidget *parent)
//
list_render_dialog=new RenderDialog(this);
list_listlogs_dialog=
new RDListLogs(RDLogFilter::UserFilter,"RDCastManager",this);
list_cut_dialog=new RDCutDialog(&cast_filter,&cast_group,&cast_schedcode,
false,false,false,"RDCastManager",false,this);
list_progress_dialog=
@ -242,9 +244,7 @@ void ListCasts::addLogData()
QString err_msg;
unsigned cast_id=0;
RDListLogs *lld=
new RDListLogs(&logname,RDLogFilter::UserFilter,"RDCastManager",this);
if(lld->exec()) {
if(list_listlogs_dialog->exec(&logname)) {
RDLogModel *model=new RDLogModel(logname,true,this);
model->load();
QTime start_time;
@ -272,17 +272,13 @@ void ListCasts::addLogData()
else {
QMessageBox::warning(this,"RDCastManager - "+tr("Posting Error"),
err_msg);
delete lld;
delete model;
return;
}
delete model;
}
else { // Render dialog was canceled!
}
}
delete lld;
}

View File

@ -2,7 +2,7 @@
//
// List Rivendell Casts
//
// (C) Copyright 2002-2022 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2002-2024 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
@ -27,6 +27,7 @@
#include <rdcut_dialog.h>
#include <rddialog.h>
#include <rdfeed.h>
#include <rdlist_logs.h>
#include <rdpodcastlistmodel.h>
#include <rdpodcastfilter.h>
#include <rdtableview.h>
@ -74,6 +75,7 @@ class ListCasts : public RDDialog
RDPodcastFilter *list_casts_filter;
QProgressDialog *list_progress_dialog;
RenderDialog *list_render_dialog;
RDListLogs *list_listlogs_dialog;
RDFeed *list_feed;
};

View File

@ -2,7 +2,7 @@
//
// Edit a Rivendell Log Chain Entry
//
// (C) Copyright 2002-2022 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2002-2024 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
@ -21,10 +21,8 @@
#include <rdapplication.h>
#include <rddb.h>
#include <rdescape_string.h>
#include <rdlist_logs.h>
#include <edit_chain.h>
#include "edit_chain.h"
#include "globals.h"
EditChain::EditChain(QWidget *parent)
@ -32,6 +30,8 @@ EditChain::EditChain(QWidget *parent)
{
setWindowTitle("RDLogEdit - "+tr("Edit Log Chain"));
edit_listlogs_dialog=new RDListLogs(RDLogFilter::UserFilter,"RDLogEdit",this);
//
// Fix the Window Size
//
@ -92,15 +92,10 @@ void EditChain::selectLogData()
{
QString logname;
RDListLogs *d=
new RDListLogs(&logname,RDLogFilter::UserFilter,"RDLogEdit",this);
if(!d->exec()) {
delete d;
return;
if(edit_listlogs_dialog->exec(&logname)) {
edit_label_edit->setText(logname);
labelChangedData(logname);
}
delete d;
edit_label_edit->setText(logname);
labelChangedData(logname);
}

View File

@ -22,6 +22,7 @@
#define EDIT_CHAIN_H
#include <rddialog.h>
#include <rdlist_logs.h>
#include <rdlog_line.h>
#include <rdtimeedit.h>
@ -52,6 +53,7 @@ class EditChain : public EditEvent
QLabel *edit_label_label;
QLineEdit *edit_label_edit;
QPushButton *edit_select_button;
RDListLogs *edit_listlogs_dialog;
};