mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-05-19 14:43:30 +02:00
2022-03-09 Fred Gleason <fredg@paravelsystems.com>
* Refactored the 'RDAddLog' dialog to allow for instance reuse. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
parent
0c8acd502a
commit
3a41e13afd
@ -22941,3 +22941,5 @@
|
||||
* Fixed a regression in rdlogedit(1) that caused events from
|
||||
previously viewed logs to be prepended to subsequent logs viewed
|
||||
during the same session.
|
||||
2022-03-09 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Refactored the 'RDAddLog' dialog to allow for instance reuse.
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Create a Rivendell Log
|
||||
//
|
||||
// (C) Copyright 2002-2021 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,16 +26,14 @@
|
||||
#include "rdidvalidator.h"
|
||||
#include "rdadd_log.h"
|
||||
|
||||
RDAddLog::RDAddLog(QString *logname,QString *svcname,
|
||||
RDLogFilter::FilterMode mode,const QString &caption,
|
||||
RDAddLog::RDAddLog(RDLogFilter::FilterMode mode,const QString &caption,
|
||||
QWidget *parent)
|
||||
: RDDialog(parent)
|
||||
{
|
||||
QStringList services_list;
|
||||
QString sql;
|
||||
RDSqlQuery *q;
|
||||
log_name=logname;
|
||||
log_svc=svcname;
|
||||
log_name=NULL;
|
||||
log_svc=NULL;
|
||||
log_filter_mode=mode;
|
||||
|
||||
//
|
||||
// Fix the Window Size
|
||||
@ -43,7 +41,7 @@ RDAddLog::RDAddLog(QString *logname,QString *svcname,
|
||||
setMinimumSize(sizeHint());
|
||||
setMinimumSize(sizeHint());
|
||||
|
||||
setWindowTitle(tr("Create Log"));
|
||||
setWindowTitle(caption);
|
||||
|
||||
//
|
||||
// Validator
|
||||
@ -96,32 +94,6 @@ RDAddLog::RDAddLog(QString *logname,QString *svcname,
|
||||
add_cancel_button->setFont(buttonFont());
|
||||
add_cancel_button->setText(tr("Cancel"));
|
||||
connect(add_cancel_button,SIGNAL(clicked()),this,SLOT(cancelData()));
|
||||
|
||||
//
|
||||
// Populate Data
|
||||
//
|
||||
switch(mode) {
|
||||
case RDLogFilter::NoFilter:
|
||||
sql=QString("select `NAME` from `SERVICES` order by `NAME`");
|
||||
break;
|
||||
|
||||
case RDLogFilter::UserFilter:
|
||||
sql=QString("select `SERVICE_NAME` from `USER_SERVICE_PERMS` where ")+
|
||||
"`USER_NAME`='"+RDEscapeString(rda->user()->name())+"' "+
|
||||
"order by `SERVICE_NAME`";
|
||||
break;
|
||||
|
||||
case RDLogFilter::StationFilter:
|
||||
sql=QString("select `SERVICE_NAME` from `SERVICE_PERMS` where ")+
|
||||
"`STATION_NAME`='"+RDEscapeString(rda->station()->name())+"' "+
|
||||
"order by `SERVICE_NAME`";
|
||||
break;
|
||||
}
|
||||
q=new RDSqlQuery(sql);
|
||||
while(q->next()) {
|
||||
add_service_box->
|
||||
insertItem(add_service_box->count(),q->value(0).toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -143,6 +115,44 @@ QSizePolicy RDAddLog::sizePolicy() const
|
||||
}
|
||||
|
||||
|
||||
int RDAddLog::exec(QString *logname,QString *svcname)
|
||||
{
|
||||
QString sql;
|
||||
RDSqlQuery *q;
|
||||
log_name=logname;
|
||||
log_svc=svcname;
|
||||
|
||||
switch(log_filter_mode) {
|
||||
case RDLogFilter::NoFilter:
|
||||
sql=QString("select `NAME` from `SERVICES` order by `NAME`");
|
||||
break;
|
||||
|
||||
case RDLogFilter::UserFilter:
|
||||
sql=QString("select `SERVICE_NAME` from `USER_SERVICE_PERMS` where ")+
|
||||
"`USER_NAME`='"+RDEscapeString(rda->user()->name())+"' "+
|
||||
"order by `SERVICE_NAME`";
|
||||
break;
|
||||
|
||||
case RDLogFilter::StationFilter:
|
||||
sql=QString("select `SERVICE_NAME` from `SERVICE_PERMS` where ")+
|
||||
"`STATION_NAME`='"+RDEscapeString(rda->station()->name())+"' "+
|
||||
"order by `SERVICE_NAME`";
|
||||
break;
|
||||
}
|
||||
q=new RDSqlQuery(sql);
|
||||
add_service_box->clear();
|
||||
while(q->next()) {
|
||||
add_service_box->
|
||||
insertItem(add_service_box->count(),q->value(0).toString());
|
||||
if(q->value(0).toString()==*log_svc) {
|
||||
add_service_box->setCurrentIndex(add_service_box->count()-1);
|
||||
}
|
||||
}
|
||||
add_name_edit->setText(*logname);
|
||||
return QDialog::exec();
|
||||
}
|
||||
|
||||
|
||||
void RDAddLog::okData()
|
||||
{
|
||||
if(add_service_box->currentText().isEmpty()){
|
||||
|
@ -5,7 +5,7 @@
|
||||
// This class creates a basic dialog requesting from the user a name and
|
||||
// corresponding service that is later used to create a new log.
|
||||
//
|
||||
// (C) Copyright 2002-2019 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
|
||||
@ -24,9 +24,9 @@
|
||||
#ifndef ADD_LOG_H
|
||||
#define ADD_LOG_H
|
||||
|
||||
#include <qcombobox.h>
|
||||
#include <qlineedit.h>
|
||||
#include <qpushbutton.h>
|
||||
#include <QComboBox>
|
||||
#include <QLineEdit>
|
||||
#include <QPushButton>
|
||||
|
||||
#include <rddialog.h>
|
||||
#include <rdlog.h>
|
||||
@ -36,12 +36,15 @@ class RDAddLog : public RDDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
RDAddLog(QString *logname,QString *svcname,RDLogFilter::FilterMode mode,
|
||||
const QString &caption,QWidget *parent=0);
|
||||
RDAddLog(RDLogFilter::FilterMode mode,const QString &caption,
|
||||
QWidget *parent=0);
|
||||
~RDAddLog();
|
||||
QSize sizeHint() const;
|
||||
QSizePolicy sizePolicy() const;
|
||||
|
||||
|
||||
public slots:
|
||||
int exec(QString *logname,QString *svcname);
|
||||
|
||||
private slots:
|
||||
void okData();
|
||||
void cancelData();
|
||||
@ -57,6 +60,7 @@ class RDAddLog : public RDDialog
|
||||
QPushButton *add_cancel_button;
|
||||
QString *log_name;
|
||||
QString *log_svc;
|
||||
RDLogFilter::FilterMode log_filter_mode;
|
||||
};
|
||||
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Abstract a Rivendell RSS Feed
|
||||
//
|
||||
// (C) Copyright 2002-2021 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
|
||||
@ -1452,7 +1452,8 @@ unsigned RDFeed::postLog(const QString &logname,const QTime &start_time,
|
||||
//
|
||||
// Open Log
|
||||
//
|
||||
log_model=new RDLogModel(logname,false,this);
|
||||
log_model=new RDLogModel(false,this);
|
||||
log_model->setLogName(logname);
|
||||
log_model->load();
|
||||
if(!log_model->exists()) {
|
||||
*err=RDFeed::ErrorNoLog;
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Abstract a Rivendell Log.
|
||||
//
|
||||
// (C) Copyright 2002-2021 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
|
||||
@ -465,7 +465,9 @@ int RDLog::removeTracks(RDStation *station,RDUser *user,RDConfig *config) const
|
||||
|
||||
RDLogModel *RDLog::createLogEvent() const
|
||||
{
|
||||
return new RDLogModel(name(),false);
|
||||
RDLogModel *model=new RDLogModel(false);
|
||||
model->setLogName(name());
|
||||
return model;
|
||||
}
|
||||
|
||||
|
||||
@ -616,6 +618,12 @@ bool RDLog::remove(const QString &name,RDStation *station,RDUser *user,
|
||||
}
|
||||
|
||||
|
||||
bool RDLog::remove(const QString &name)
|
||||
{
|
||||
return RDLog::remove(name,rda->station(),rda->user(),rda->config());
|
||||
}
|
||||
|
||||
|
||||
int RDLog::GetIntValue(const QString &field) const
|
||||
{
|
||||
QString sql;
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Abstract a Rivendell Log
|
||||
//
|
||||
// (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
|
||||
@ -84,6 +84,7 @@ class RDLog
|
||||
static bool exists(const QString &name);
|
||||
static bool remove(const QString &name,RDStation *station,RDUser *user,
|
||||
RDConfig *config);
|
||||
static bool remove(const QString &name);
|
||||
|
||||
private:
|
||||
int GetIntValue(const QString &field) const;
|
||||
|
@ -158,6 +158,15 @@ QString RDLogFilter::whereSql() const
|
||||
}
|
||||
|
||||
|
||||
QString RDLogFilter::currentServiceName() const
|
||||
{
|
||||
if(filter_service_box->currentText()==tr("ALL")) {
|
||||
return QString();
|
||||
}
|
||||
return filter_service_box->currentText();
|
||||
}
|
||||
|
||||
|
||||
void RDLogFilter::changeUser()
|
||||
{
|
||||
if(filter_filter_mode==RDLogFilter::UserFilter) {
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Filter widget for picking Rivendell logs.
|
||||
//
|
||||
// (C) Copyright 2017-2018 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2017-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
|
||||
@ -21,15 +21,14 @@
|
||||
#ifndef RDLOGFILTER_H
|
||||
#define RDLOGFILTER_H
|
||||
|
||||
#include <qcheckbox.h>
|
||||
#include <qcombobox.h>
|
||||
#include <qlineedit.h>
|
||||
#include <qlabel.h>
|
||||
#include <qpushbutton.h>
|
||||
#include <qstringlist.h>
|
||||
#include <qwidget.h>
|
||||
//Added by qt3to4:
|
||||
#include <QCheckBox>
|
||||
#include <QComboBox>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QPushButton>
|
||||
#include <QResizeEvent>
|
||||
#include <QStringList>
|
||||
#include <QWidget>
|
||||
|
||||
class RDLogFilter : public QWidget
|
||||
{
|
||||
@ -41,6 +40,7 @@ class RDLogFilter : public QWidget
|
||||
QSize sizeHint() const;
|
||||
QSizePolicy sizePolicy() const;
|
||||
QString whereSql() const;
|
||||
QString currentServiceName() const;
|
||||
|
||||
public slots:
|
||||
void changeUser();
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Data model for Rivendell logs
|
||||
//
|
||||
// (C) Copyright 2020-2021 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2020-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
|
||||
@ -25,10 +25,9 @@
|
||||
#include "rdlog_line.h"
|
||||
#include "rdlogmodel.h"
|
||||
|
||||
RDLogModel::RDLogModel(const QString &logname,bool read_only,QObject *parent)
|
||||
RDLogModel::RDLogModel(bool read_only,QObject *parent)
|
||||
: QAbstractTableModel(parent)
|
||||
{
|
||||
d_log_name=logname;
|
||||
d_read_only=read_only;
|
||||
|
||||
MakeModel();
|
||||
@ -247,13 +246,11 @@ QString RDLogModel::logName() const
|
||||
|
||||
void RDLogModel::setLogName(QString logname)
|
||||
{
|
||||
if(d_log_name.toLower()!=logname) {
|
||||
clear();
|
||||
printf("RDLogModel::setLogName(%s)\n",logname.toUtf8().constData());
|
||||
RDLog *log=new RDLog(logname);
|
||||
d_log_name=log->name(); // So we normalize the case
|
||||
delete log;
|
||||
}
|
||||
clear();
|
||||
printf("RDLogModel::setLogName(%s)\n",logname.toUtf8().constData());
|
||||
RDLog *log=new RDLog(logname);
|
||||
d_log_name=log->name(); // So we normalize the case
|
||||
delete log;
|
||||
}
|
||||
|
||||
|
||||
@ -356,6 +353,7 @@ int RDLogModel::append(const QString &logname,bool track_ptrs)
|
||||
|
||||
void RDLogModel::clear()
|
||||
{
|
||||
printf("RDLogModel::clear()\n");
|
||||
if(d_log_lines.size()>0) {
|
||||
beginResetModel();
|
||||
for(int i=0;i<d_log_lines.size();i++) {
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Data model for Rivendell logs
|
||||
//
|
||||
// (C) Copyright 2002-2021 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
|
||||
@ -35,7 +35,7 @@ class RDLogModel : public QAbstractTableModel
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum StartTimeStyle {Estimated=0,Scheduled=1};
|
||||
RDLogModel(const QString &logname,bool read_only,QObject *parent=0);
|
||||
RDLogModel(bool read_only,QObject *parent=0);
|
||||
RDLogModel(QObject *parent=0);
|
||||
~RDLogModel();
|
||||
QPalette palette();
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Abstract a Rivendell Service.
|
||||
//
|
||||
// (C) Copyright 2002-2021 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
|
||||
@ -1008,8 +1008,10 @@ bool RDSvc::linkLog(RDSvc::ImportSource src,const QDate &date,
|
||||
//
|
||||
// Iterate Through the Log
|
||||
//
|
||||
src_model=new RDLogModel(logname,true,this);
|
||||
dst_model=new RDLogModel(logname,true,this);
|
||||
src_model=new RDLogModel(true,this);
|
||||
src_model->setLogName(logname);
|
||||
dst_model=new RDLogModel(true,this);
|
||||
dst_model->setLogName(logname);
|
||||
src_model->load();
|
||||
for(int i=0;i<src_model->lineCount();i++) {
|
||||
logline=src_model->logLine(i);
|
||||
@ -1163,8 +1165,10 @@ bool RDSvc::clearLogLinks(RDSvc::ImportSource src,const QString &logname,
|
||||
break;
|
||||
}
|
||||
|
||||
RDLogModel *src_model=new RDLogModel(logname,false,this);
|
||||
RDLogModel *dst_model=new RDLogModel(logname,false,this);
|
||||
RDLogModel *src_model=new RDLogModel(false,this);
|
||||
src_model->setLogName(logname);
|
||||
RDLogModel *dst_model=new RDLogModel(false,this);
|
||||
dst_model->setLogName(logname);
|
||||
src_model->load();
|
||||
RDLogLine *logline=NULL;
|
||||
for(int i=0;i<src_model->lineCount();i++) {
|
||||
@ -1810,7 +1814,8 @@ bool RDSvc::ResolveInlineEvents(const QString &logname,QString *err_msg)
|
||||
|
||||
switch(subEventInheritance()) {
|
||||
case RDSvc::ParentEvent:
|
||||
model=new RDLogModel(logname,false,this);
|
||||
model=new RDLogModel(false,this);
|
||||
model->setLogName(logname);
|
||||
model->load();
|
||||
ok=true;
|
||||
for(int i=0;i<model->lineCount();i++) {
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Select a Rivendell Log
|
||||
//
|
||||
// (C) Copyright 2002-2021 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
|
||||
@ -38,6 +38,9 @@ ListLogs::ListLogs(RDLogPlay *log,QWidget *parent)
|
||||
list_log=log;
|
||||
setWindowTitle("RDAirPlay - "+tr("Select Log"));
|
||||
|
||||
list_addlog_dialog=new RDAddLog(RDLogFilter::StationFilter,
|
||||
"RDAirPlay - "+tr("Rename Log"),this);
|
||||
|
||||
//
|
||||
// Filter Widget
|
||||
//
|
||||
@ -181,14 +184,9 @@ void ListLogs::saveAsButtonData()
|
||||
{
|
||||
QString logname;
|
||||
QString svcname=*list_svcname;
|
||||
RDAddLog *log;
|
||||
log=new RDAddLog(&logname,&svcname,RDLogFilter::StationFilter,
|
||||
tr("Rename Log"),this);
|
||||
if(log->exec()<0) {
|
||||
delete log;
|
||||
if(list_addlog_dialog->exec(&logname,&svcname)<0) {
|
||||
return;
|
||||
}
|
||||
delete log;
|
||||
*list_logname=logname;
|
||||
*list_svcname=svcname;
|
||||
done(ListLogs::SaveAs);
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Select a Rivendell Log
|
||||
//
|
||||
// (C) Copyright 2002-2021 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
|
||||
@ -23,6 +23,7 @@
|
||||
|
||||
#include <QPushButton>
|
||||
|
||||
#include <rdadd_log.h>
|
||||
#include <rddialog.h>
|
||||
#include <rdlogfilter.h>
|
||||
#include <rdloglistmodel.h>
|
||||
@ -70,6 +71,7 @@ class ListLogs : public RDDialog
|
||||
QPushButton *list_cancel_button;
|
||||
RDLogPlay *list_log;
|
||||
RDLogLock **list_log_lock;
|
||||
RDAddLog *list_addlog_dialog;
|
||||
};
|
||||
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// List Rivendell Casts
|
||||
//
|
||||
// (C) Copyright 2002-2021 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
|
||||
@ -247,7 +247,8 @@ void ListCasts::addLogData()
|
||||
RDListLogs *lld=
|
||||
new RDListLogs(&logname,RDLogFilter::UserFilter,"RDCastManager",this);
|
||||
if(lld->exec()) {
|
||||
RDLogModel *model=new RDLogModel(logname,true,this);
|
||||
RDLogModel *model=new RDLogModel(true,this);
|
||||
model->setLogName(logname);
|
||||
model->load();
|
||||
QTime start_time;
|
||||
bool ignore_stops=true;
|
||||
@ -398,12 +399,6 @@ void ListCasts::userChangedData()
|
||||
}
|
||||
|
||||
|
||||
void ListCasts::filterChangedData(const QString &str)
|
||||
{
|
||||
// RefreshList();
|
||||
}
|
||||
|
||||
|
||||
void ListCasts::modelResetData()
|
||||
{
|
||||
list_casts_view->resizeColumnsToContents();
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// List Rivendell Casts
|
||||
//
|
||||
// (C) Copyright 2002-2021 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
|
||||
@ -50,7 +50,6 @@ class ListCasts : public RDDialog
|
||||
void deleteData();
|
||||
void doubleClickedData(const QModelIndex &index);
|
||||
void userChangedData();
|
||||
void filterChangedData(const QString &str);
|
||||
void modelResetData();
|
||||
void rowsInsertedData(const QModelIndex &parent,int start,int end);
|
||||
void postProgressChangedData(int step);
|
||||
|
@ -175,7 +175,6 @@ EditLog::EditLog(QString *filter,QString *group,QString *schedcode,
|
||||
connect(edit_startdate_edit,SIGNAL(dateChanged(const QDate &)),
|
||||
this,SLOT(dateValueChangedData(const QDate &)));
|
||||
|
||||
|
||||
//
|
||||
// End Date
|
||||
//
|
||||
@ -431,7 +430,6 @@ QSize EditLog::sizeHint() const
|
||||
}
|
||||
|
||||
|
||||
//int EditLog::exec()
|
||||
int EditLog::exec(const QString &logname,QStringList *new_logs)
|
||||
{
|
||||
QString sql;
|
||||
@ -980,9 +978,8 @@ void EditLog::saveasData()
|
||||
QString err_msg;
|
||||
|
||||
if(rda->user()->createLog()) {
|
||||
log=new RDAddLog(&logname,&svcname,RDLogFilter::UserFilter,
|
||||
tr("Add Log"),this);
|
||||
if(log->exec()<0) {
|
||||
log=new RDAddLog(RDLogFilter::UserFilter,"RDLogEdit",this);
|
||||
if(log->exec(&logname,&svcname)<0) {
|
||||
return;
|
||||
}
|
||||
if(!RDLog::create(logname,svcname,QDate(),rda->ripc()->user(),&err_msg,
|
||||
@ -1073,6 +1070,8 @@ void EditLog::okData()
|
||||
|
||||
void EditLog::cancelData()
|
||||
{
|
||||
bool ret=false;
|
||||
|
||||
if(edit_changed) {
|
||||
switch(QMessageBox::question(this,
|
||||
tr("RDLogEdit"),
|
||||
@ -1086,6 +1085,7 @@ void EditLog::cancelData()
|
||||
return;
|
||||
}
|
||||
SaveLog();
|
||||
ret=true;
|
||||
break;
|
||||
|
||||
case QMessageBox::Cancel:
|
||||
@ -1100,7 +1100,7 @@ void EditLog::cancelData()
|
||||
}
|
||||
delete edit_log_lock;
|
||||
edit_log_lock=NULL;
|
||||
done(false);
|
||||
done(ret);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
// logmodel.cpp
|
||||
//
|
||||
// Data model for Rivendell logs in RDLogEdit
|
||||
// Data model for Rivendell logs for RDLogEdit(1)
|
||||
//
|
||||
// (C) Copyright 2020 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2020-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
|
||||
@ -20,13 +20,6 @@
|
||||
|
||||
#include "logmodel.h"
|
||||
|
||||
LogModel::LogModel(const QString &logname,QObject *parent)
|
||||
: RDLogModel(logname,false,parent)
|
||||
{
|
||||
d_group_list=new RDGroupList();
|
||||
}
|
||||
|
||||
|
||||
LogModel::LogModel(QObject *parent)
|
||||
: RDLogModel(parent)
|
||||
{
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Data model for Rivendell logs in RDLogEdit
|
||||
//
|
||||
// (C) Copyright 2020 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2020-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
|
||||
@ -28,7 +28,6 @@ class LogModel : public RDLogModel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
LogModel(const QString &logname,QObject *parent=0);
|
||||
LogModel(QObject *parent=0);
|
||||
~LogModel();
|
||||
QString serviceName() const;
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// The Log Editor Utility for Rivendell.
|
||||
//
|
||||
// (C) Copyright 2002-2021 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,7 +22,6 @@
|
||||
#include <QMessageBox>
|
||||
#include <QTranslator>
|
||||
|
||||
#include <rdadd_log.h>
|
||||
#include <rdconf.h>
|
||||
#include <rdescape_string.h>
|
||||
#include <rdprofile.h>
|
||||
@ -105,8 +104,6 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent)
|
||||
//
|
||||
log_filter_widget=
|
||||
new RDLogFilter(RDLogFilter::UserFilter,this);
|
||||
connect(log_filter_widget,SIGNAL(filterChanged(const QString &)),
|
||||
this,SLOT(filterChangedData(const QString &)));
|
||||
|
||||
//
|
||||
// Dialogs
|
||||
@ -115,6 +112,8 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent)
|
||||
new EditLog(&log_filter,&log_group,&log_schedcode,&log_clipboard,this);
|
||||
|
||||
log_tracker_dialog=new VoiceTracker(&log_import_path,this);
|
||||
log_addlog_dialog=
|
||||
new RDAddLog(RDLogFilter::UserFilter,"RDLogEdit - "+tr("Add Log"),this);
|
||||
|
||||
//
|
||||
// Log List
|
||||
@ -229,7 +228,6 @@ void MainWidget::userData()
|
||||
log_filter_widget->changeUser();
|
||||
log_log_model->setFilterSql(log_filter_widget->whereSql());
|
||||
log_log_view->resizeColumnsToContents();
|
||||
// RefreshList();
|
||||
|
||||
//
|
||||
// Set Control Perms
|
||||
@ -240,28 +238,17 @@ void MainWidget::userData()
|
||||
}
|
||||
|
||||
|
||||
void MainWidget::recentData(bool state)
|
||||
{
|
||||
// RefreshList();
|
||||
}
|
||||
|
||||
|
||||
void MainWidget::addData()
|
||||
{
|
||||
QString logname;
|
||||
QString svcname;
|
||||
QString svcname=log_filter_widget->currentServiceName();
|
||||
QStringList newlogs;
|
||||
RDAddLog *log;
|
||||
QModelIndex row;
|
||||
|
||||
if(rda->user()->createLog()) {
|
||||
log=new RDAddLog(&logname,&svcname,RDLogFilter::UserFilter,
|
||||
tr("Add Log"),this);
|
||||
if(log->exec()!=0) {
|
||||
delete log;
|
||||
if(log_addlog_dialog->exec(&logname,&svcname)!=0) {
|
||||
return;
|
||||
}
|
||||
delete log;
|
||||
QString username(rda->ripc()->user());
|
||||
QString err_msg;
|
||||
if(!RDLog::create(logname,svcname,QDate(),username,&err_msg,
|
||||
@ -270,10 +257,14 @@ void MainWidget::addData()
|
||||
return;
|
||||
}
|
||||
LockList();
|
||||
SendNotification(RDNotification::AddAction,logname);
|
||||
log_edit_dialog->exec(logname,&newlogs);
|
||||
row=log_log_model->addLog(logname);
|
||||
log_log_view->selectRow(row.row());
|
||||
if(log_edit_dialog->exec(logname,&newlogs)) {
|
||||
SendNotification(RDNotification::AddAction,logname);
|
||||
row=log_log_model->addLog(logname);
|
||||
log_log_view->selectRow(row.row());
|
||||
}
|
||||
else {
|
||||
RDLog::remove(logname);
|
||||
}
|
||||
UnlockList();
|
||||
}
|
||||
}
|
||||
@ -424,23 +415,6 @@ void MainWidget::trackData()
|
||||
UnlockList();
|
||||
}
|
||||
|
||||
/*
|
||||
void MainWidget::trackData()
|
||||
{
|
||||
QModelIndex row=SingleSelectedRow();
|
||||
|
||||
if(!row.isValid()) {
|
||||
return;
|
||||
}
|
||||
LockList();
|
||||
VoiceTracker *dialog=
|
||||
new VoiceTracker(log_log_model->logName(row),&log_import_path);
|
||||
dialog->exec();
|
||||
delete dialog;
|
||||
log_log_model->refresh(row);
|
||||
UnlockList();
|
||||
}
|
||||
*/
|
||||
|
||||
void MainWidget::reportData()
|
||||
{
|
||||
@ -564,12 +538,6 @@ void MainWidget::reportData()
|
||||
}
|
||||
|
||||
|
||||
void MainWidget::filterChangedData(const QString &str)
|
||||
{
|
||||
// RefreshList();
|
||||
}
|
||||
|
||||
|
||||
void MainWidget::selectionChangedData(const QItemSelection &selected,
|
||||
const QItemSelection &deselected)
|
||||
{
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// The Log Editor 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
|
||||
@ -23,6 +23,7 @@
|
||||
|
||||
#include <QList>
|
||||
|
||||
#include <rdadd_log.h>
|
||||
#include <rdlog_line.h>
|
||||
#include <rdlogfilter.h>
|
||||
#include <rdloglistmodel.h>
|
||||
@ -50,13 +51,11 @@ class MainWidget : public RDMainWindow
|
||||
private slots:
|
||||
void caeConnectedData(bool state);
|
||||
void userData();
|
||||
void recentData(bool state);
|
||||
void addData();
|
||||
void editData();
|
||||
void deleteData();
|
||||
void trackData();
|
||||
void reportData();
|
||||
void filterChangedData(const QString &str);
|
||||
void selectionChangedData(const QItemSelection &selected,
|
||||
const QItemSelection &deselected);
|
||||
void doubleClickedData(const QModelIndex &index);
|
||||
@ -94,6 +93,7 @@ class MainWidget : public RDMainWindow
|
||||
QStringList log_deleted_logs;
|
||||
EditLog *log_edit_dialog;
|
||||
VoiceTracker *log_tracker_dialog;
|
||||
RDAddLog *log_addlog_dialog;
|
||||
};
|
||||
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Generate a Rivendell Log
|
||||
//
|
||||
// (C) Copyright 2002-2021 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
|
||||
@ -329,7 +329,8 @@ void GenerateLog::createData()
|
||||
//
|
||||
// Generate Exception Report
|
||||
//
|
||||
RDLogModel *model=new RDLogModel(logname,false,this);
|
||||
RDLogModel *model=new RDLogModel(false,this);
|
||||
model->setLogName(logname);
|
||||
model->load();
|
||||
if((model->validate(&report,gen_date_edit->date())==0)&&
|
||||
unused_report.isEmpty()) {
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Generate/merge logs from the command line.
|
||||
//
|
||||
// (C) Copyright 2018-2021 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2018-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
|
||||
@ -107,7 +107,8 @@ void LogObject::userData()
|
||||
//
|
||||
// Generate Exception Report
|
||||
//
|
||||
RDLogModel *model=new RDLogModel(logname,false,this);
|
||||
RDLogModel *model=new RDLogModel(false,this);
|
||||
model->setLogName(logname);
|
||||
model->load();
|
||||
if((model->validate(&report,start_date)!=0)||
|
||||
(!unused_report.isEmpty())) {
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// A command-line log editor for Rivendell
|
||||
//
|
||||
// (C) Copyright 2016-2021 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2016-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
|
||||
@ -250,7 +250,8 @@ void MainObject::Load(QString logname)
|
||||
|
||||
edit_log=new RDLog(logname);
|
||||
if(edit_log->exists()) {
|
||||
edit_log_model=new RDLogModel(logname,false,this);
|
||||
edit_log_model=new RDLogModel(false,this);
|
||||
edit_log_model->setLogName(logname);
|
||||
edit_log_model->load();
|
||||
edit_description=edit_log->description();
|
||||
edit_service=edit_log->service();
|
||||
@ -362,7 +363,8 @@ void MainObject::New(const QString &logname)
|
||||
}
|
||||
edit_log=new RDLog(logname);
|
||||
if(!edit_log->exists()) {
|
||||
edit_log_model=new RDLogModel(logname,false,this);
|
||||
edit_log_model=new RDLogModel(false,this);
|
||||
edit_log_model->setLogName(logname);
|
||||
edit_description=logname+" log";
|
||||
sql=QString("select `NAME` from `SERVICES`");
|
||||
q=new RDSqlQuery(sql);
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Render a Rivendell log.
|
||||
//
|
||||
// (C) Copyright 2017-2021 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2017-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
|
||||
@ -287,7 +287,8 @@ void MainObject::userData()
|
||||
fprintf(stderr,"rdrender: no such log\n");
|
||||
exit(1);
|
||||
}
|
||||
RDLogModel *log_model=new RDLogModel(render_logname,false,this);
|
||||
RDLogModel *log_model=new RDLogModel(false,this);
|
||||
log_model->setLogName(render_logname);
|
||||
log_model->load();
|
||||
|
||||
//
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Rivendell web service portal -- Log services
|
||||
//
|
||||
// (C) Copyright 2013-2021 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2013-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
|
||||
@ -292,7 +292,9 @@ void Xport::SaveLog()
|
||||
//
|
||||
// Logline Data
|
||||
//
|
||||
RDLogModel *logmodel=new RDLogModel(log_name,false,this);
|
||||
// RDLogModel *logmodel=new RDLogModel(log_name,false,this);
|
||||
RDLogModel *logmodel=new RDLogModel(false,this);
|
||||
logmodel->setLogName(log_name);
|
||||
for(int i=0;i<line_quantity;i++) {
|
||||
logmodel->insert(i,1);
|
||||
RDLogLine *ll=logmodel->logLine(i);
|
||||
|
Loading…
x
Reference in New Issue
Block a user