mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-05-19 14:43:30 +02:00
2022-02-28 Fred Gleason <fredg@paravelsystems.com>
* Updated 'RDCartDialog' to eliminate superfluous SQL filter updates. * Updated 'RDCutDialog' to eliminate superfluous SQL filter updates. * Updated rdlibrary(1) to eliminate superfluous SQL filter updates. * Updated rdlogedit(1) to eliminate superfluous SQL filter updates. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
parent
c8eb9be8f0
commit
37f9559c37
@ -22895,3 +22895,8 @@
|
|||||||
cart libraries.
|
cart libraries.
|
||||||
2022-02-27 Fred Gleason <fredg@paravelsystems.com>
|
2022-02-27 Fred Gleason <fredg@paravelsystems.com>
|
||||||
* Added an 'RDTimeProbe' class.
|
* Added an 'RDTimeProbe' class.
|
||||||
|
2022-02-28 Fred Gleason <fredg@paravelsystems.com>
|
||||||
|
* Updated 'RDCartDialog' to eliminate superfluous SQL filter updates.
|
||||||
|
* Updated 'RDCutDialog' to eliminate superfluous SQL filter updates.
|
||||||
|
* Updated rdlibrary(1) to eliminate superfluous SQL filter updates.
|
||||||
|
* Updated rdlogedit(1) to eliminate superfluous SQL filter updates.
|
||||||
|
@ -86,13 +86,13 @@ RDCartDialog::RDCartDialog(QString *filter,QString *group,QString *schedcode,
|
|||||||
// Cart List
|
// Cart List
|
||||||
//
|
//
|
||||||
cart_cart_view=new RDTableView(this);
|
cart_cart_view=new RDTableView(this);
|
||||||
|
cart_cart_view->setSortingEnabled(true);
|
||||||
|
cart_cart_view->sortByColumn(0,Qt::AscendingOrder);
|
||||||
cart_cart_model=new RDLibraryModel(this);
|
cart_cart_model=new RDLibraryModel(this);
|
||||||
cart_cart_model->setFont(font());
|
cart_cart_model->setFont(font());
|
||||||
cart_cart_model->setPalette(palette());
|
cart_cart_model->setPalette(palette());
|
||||||
cart_cart_view->setModel(cart_cart_model);
|
cart_cart_view->setModel(cart_cart_model);
|
||||||
cart_cart_filter->setModel(cart_cart_model);
|
cart_cart_filter->setModel(cart_cart_model);
|
||||||
cart_cart_view->setSortingEnabled(true);
|
|
||||||
cart_cart_view->sortByColumn(0,Qt::AscendingOrder);
|
|
||||||
connect(cart_cart_model,SIGNAL(modelReset()),this,SLOT(modelResetData()));
|
connect(cart_cart_model,SIGNAL(modelReset()),this,SLOT(modelResetData()));
|
||||||
connect(cart_cart_view,SIGNAL(doubleClicked(const QModelIndex &)),
|
connect(cart_cart_view,SIGNAL(doubleClicked(const QModelIndex &)),
|
||||||
this,SLOT(cartDoubleClickedData(const QModelIndex &)));
|
this,SLOT(cartDoubleClickedData(const QModelIndex &)));
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// Filter widget for picking Rivendell carts.
|
// Filter widget for picking Rivendell carts.
|
||||||
//
|
//
|
||||||
// (C) Copyright 2021 Fred Gleason <fredg@paravelsystems.com>
|
// (C) Copyright 2021-2022 Fred Gleason <fredg@paravelsystems.com>
|
||||||
//
|
//
|
||||||
// This program is free software; you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License version 2 as
|
||||||
@ -337,8 +337,6 @@ void RDCartFilter::setShowCartType(RDCart::Type type)
|
|||||||
d_showmacro_label->hide();
|
d_showmacro_label->hide();
|
||||||
}
|
}
|
||||||
d_show_cart_type=type;
|
d_show_cart_type=type;
|
||||||
|
|
||||||
emit filterChanged(filterSql(),cartLimit());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -353,7 +351,6 @@ void RDCartFilter::setShowTrackCarts(bool state)
|
|||||||
{
|
{
|
||||||
if(state!=d_show_track_carts) {
|
if(state!=d_show_track_carts) {
|
||||||
d_show_track_carts=state;
|
d_show_track_carts=state;
|
||||||
emit filterChanged(filterSql(),cartLimit());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -384,7 +381,6 @@ void RDCartFilter::setService(const QString &svc)
|
|||||||
if(!d_service.isEmpty()) {
|
if(!d_service.isEmpty()) {
|
||||||
LoadServiceGroups();
|
LoadServiceGroups();
|
||||||
}
|
}
|
||||||
emit filterChanged(filterSql(),cartLimit());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -456,7 +452,7 @@ void RDCartFilter::changeUser()
|
|||||||
delete q;
|
delete q;
|
||||||
d_search_button->setDisabled(true);
|
d_search_button->setDisabled(true);
|
||||||
|
|
||||||
emit filterChanged(filterSql(),cartLimit());
|
UpdateModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -486,7 +482,7 @@ void RDCartFilter::searchClickedData()
|
|||||||
else {
|
else {
|
||||||
d_clear_button->setEnabled(true);
|
d_clear_button->setEnabled(true);
|
||||||
}
|
}
|
||||||
emit filterChanged(filterSql(),cartLimit());
|
UpdateModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -683,6 +679,13 @@ QString RDCartFilter::typeFilter(bool incl_audio,bool incl_macro,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void RDCartFilter::showEvent(QShowEvent *e)
|
||||||
|
{
|
||||||
|
UpdateModel();
|
||||||
|
QWidget::showEvent(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void RDCartFilter::LoadUserGroups()
|
void RDCartFilter::LoadUserGroups()
|
||||||
{
|
{
|
||||||
QString sql;
|
QString sql;
|
||||||
@ -726,3 +729,14 @@ void RDCartFilter::LoadServiceGroups()
|
|||||||
}
|
}
|
||||||
delete q;
|
delete q;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void RDCartFilter::UpdateModel()
|
||||||
|
{
|
||||||
|
if(isVisible()&&
|
||||||
|
((filterSql()!=d_model_filter_sql)||(cartLimit()!=d_model_cart_limit))) {
|
||||||
|
d_model_filter_sql=filterSql();
|
||||||
|
d_model_cart_limit=cartLimit();
|
||||||
|
emit filterChanged(d_model_filter_sql,d_model_cart_limit);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -88,10 +88,12 @@ class RDCartFilter : public RDWidget
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
void resizeEvent(QResizeEvent *e);
|
void resizeEvent(QResizeEvent *e);
|
||||||
|
void showEvent(QShowEvent *e);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void LoadUserGroups();
|
void LoadUserGroups();
|
||||||
void LoadServiceGroups();
|
void LoadServiceGroups();
|
||||||
|
void UpdateModel();
|
||||||
RDLibraryModel *d_cart_model;
|
RDLibraryModel *d_cart_model;
|
||||||
RDGroupListModel *d_group_model;
|
RDGroupListModel *d_group_model;
|
||||||
QLineEdit *d_filter_edit;
|
QLineEdit *d_filter_edit;
|
||||||
@ -124,6 +126,9 @@ class RDCartFilter : public RDWidget
|
|||||||
QString d_default_group;
|
QString d_default_group;
|
||||||
bool d_user_is_admin;
|
bool d_user_is_admin;
|
||||||
QString d_service;
|
QString d_service;
|
||||||
|
|
||||||
|
QString d_model_filter_sql;
|
||||||
|
int d_model_cart_limit;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// A widget to select a Rivendell Cut.
|
// A widget to select a Rivendell Cut.
|
||||||
//
|
//
|
||||||
// (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
|
// 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
|
// it under the terms of the GNU General Public License version 2 as
|
||||||
@ -147,9 +147,6 @@ RDCutDialog::RDCutDialog(QString *filter,QString *group,QString *schedcode,
|
|||||||
cart_cancel_button->setFont(buttonFont());
|
cart_cancel_button->setFont(buttonFont());
|
||||||
connect(cart_cancel_button,SIGNAL(clicked()),this,SLOT(cancelData()));
|
connect(cart_cancel_button,SIGNAL(clicked()),this,SLOT(cancelData()));
|
||||||
|
|
||||||
cart_cart_model->
|
|
||||||
setFilterSql(cart_cart_filter->filterSql(),cart_cart_filter->cartLimit());
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Fix the Window Size
|
// Fix the Window Size
|
||||||
//
|
//
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
#include "rdconf.h"
|
#include "rdconf.h"
|
||||||
#include "rdescape_string.h"
|
#include "rdescape_string.h"
|
||||||
#include "rdlibrarymodel.h"
|
#include "rdlibrarymodel.h"
|
||||||
|
#include "rdtimeprobe.h"
|
||||||
|
|
||||||
RDLibraryModel::RDLibraryModel(QObject *parent)
|
RDLibraryModel::RDLibraryModel(QObject *parent)
|
||||||
: QAbstractItemModel(parent)
|
: QAbstractItemModel(parent)
|
||||||
@ -35,6 +36,7 @@ RDLibraryModel::RDLibraryModel(QObject *parent)
|
|||||||
d_sort_order=Qt::AscendingOrder;
|
d_sort_order=Qt::AscendingOrder;
|
||||||
d_sort_clauses[Qt::AscendingOrder]="asc";
|
d_sort_clauses[Qt::AscendingOrder]="asc";
|
||||||
d_sort_clauses[Qt::DescendingOrder]="desc";
|
d_sort_clauses[Qt::DescendingOrder]="desc";
|
||||||
|
d_filter_set=false;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Column Attributes
|
// Column Attributes
|
||||||
@ -317,7 +319,9 @@ void RDLibraryModel::sort(int col,Qt::SortOrder order)
|
|||||||
{
|
{
|
||||||
d_sort_column=col;
|
d_sort_column=col;
|
||||||
d_sort_order=order;
|
d_sort_order=order;
|
||||||
setFilterSql(d_filter_sql,d_cart_limit);
|
if(d_filter_set) {
|
||||||
|
setFilterSql(d_filter_sql,d_cart_limit);
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
printf("RDLibraryModel::sort():\n");
|
printf("RDLibraryModel::sort():\n");
|
||||||
printf(" d_filter_sql: %s\n",d_filter_sql.toUtf8().constData());
|
printf(" d_filter_sql: %s\n",d_filter_sql.toUtf8().constData());
|
||||||
@ -546,6 +550,8 @@ void RDLibraryModel::setFilterSql(const QString &sql,int cart_limit)
|
|||||||
d_sort_clauses.value(d_sort_order);
|
d_sort_clauses.value(d_sort_order);
|
||||||
}
|
}
|
||||||
fsql+=", `CUTS`.`PLAY_ORDER` asc ";
|
fsql+=", `CUTS`.`PLAY_ORDER` asc ";
|
||||||
|
d_filter_set=true;
|
||||||
|
printf("***** FILTER SQL SET *****\n");
|
||||||
|
|
||||||
updateModel(fsql);
|
updateModel(fsql);
|
||||||
}
|
}
|
||||||
@ -553,6 +559,14 @@ void RDLibraryModel::setFilterSql(const QString &sql,int cart_limit)
|
|||||||
|
|
||||||
void RDLibraryModel::updateModel(const QString &filter_sql)
|
void RDLibraryModel::updateModel(const QString &filter_sql)
|
||||||
{
|
{
|
||||||
|
if(!d_filter_set) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
printf("%p - filter_sql: %s\n",this,filter_sql.toUtf8().constData());
|
||||||
|
|
||||||
|
RDTimeProbe *probe=new RDTimeProbe();
|
||||||
|
probe->printWaypoint("updateModel - 1");
|
||||||
|
|
||||||
QString sql;
|
QString sql;
|
||||||
RDSqlQuery *q=NULL;
|
RDSqlQuery *q=NULL;
|
||||||
|
|
||||||
@ -568,6 +582,8 @@ void RDLibraryModel::updateModel(const QString &filter_sql)
|
|||||||
QList<QList<QVariant> > list_list;
|
QList<QList<QVariant> > list_list;
|
||||||
list_list.push_back(list);
|
list_list.push_back(list);
|
||||||
|
|
||||||
|
probe->printWaypoint("updateModel - 2");
|
||||||
|
|
||||||
//
|
//
|
||||||
// Reload the color table
|
// Reload the color table
|
||||||
//
|
//
|
||||||
@ -582,6 +598,8 @@ void RDLibraryModel::updateModel(const QString &filter_sql)
|
|||||||
}
|
}
|
||||||
delete q;
|
delete q;
|
||||||
|
|
||||||
|
probe->printWaypoint("updateModel - 3");
|
||||||
|
|
||||||
sql=sqlFields()+
|
sql=sqlFields()+
|
||||||
filter_sql;
|
filter_sql;
|
||||||
beginResetModel();
|
beginResetModel();
|
||||||
@ -595,6 +613,10 @@ void RDLibraryModel::updateModel(const QString &filter_sql)
|
|||||||
d_icons.clear();
|
d_icons.clear();
|
||||||
unsigned prev_cartnum=0;
|
unsigned prev_cartnum=0;
|
||||||
int carts_loaded=0;
|
int carts_loaded=0;
|
||||||
|
|
||||||
|
probe->printWaypoint("updateModel - 4");
|
||||||
|
|
||||||
|
// printf("RDLibraryModel::updateModel() SQL: %s\n",sql.toUtf8().constData());
|
||||||
q=new RDSqlQuery(sql);
|
q=new RDSqlQuery(sql);
|
||||||
while(q->next()&&(carts_loaded<d_cart_limit)) {
|
while(q->next()&&(carts_loaded<d_cart_limit)) {
|
||||||
if(q->value(0).toUInt()!=prev_cartnum) {
|
if(q->value(0).toUInt()!=prev_cartnum) {
|
||||||
@ -610,10 +632,21 @@ void RDLibraryModel::updateModel(const QString &filter_sql)
|
|||||||
prev_cartnum=q->value(0).toUInt();
|
prev_cartnum=q->value(0).toUInt();
|
||||||
carts_loaded++;
|
carts_loaded++;
|
||||||
}
|
}
|
||||||
|
// printf("carts_loaded: %d\n",carts_loaded);
|
||||||
}
|
}
|
||||||
delete q;
|
delete q;
|
||||||
|
|
||||||
|
probe->printWaypoint("updateModel - 5");
|
||||||
|
|
||||||
endResetModel();
|
endResetModel();
|
||||||
|
|
||||||
|
probe->printWaypoint("updateModel - 6");
|
||||||
|
|
||||||
emit rowCountChanged(d_texts.size());
|
emit rowCountChanged(d_texts.size());
|
||||||
|
|
||||||
|
probe->printWaypoint("updateModel - 7");
|
||||||
|
|
||||||
|
delete probe;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -106,6 +106,7 @@ class RDLibraryModel : public QAbstractItemModel
|
|||||||
QList<unsigned> d_cart_numbers;
|
QList<unsigned> d_cart_numbers;
|
||||||
QList<RDCart::Type> d_cart_types;
|
QList<RDCart::Type> d_cart_types;
|
||||||
QMap<QString,QVariant> d_group_colors;
|
QMap<QString,QVariant> d_group_colors;
|
||||||
|
bool d_filter_set;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -30,6 +30,8 @@
|
|||||||
LibraryView::LibraryView(QWidget *parent)
|
LibraryView::LibraryView(QWidget *parent)
|
||||||
: RDTreeView(parent)
|
: RDTreeView(parent)
|
||||||
{
|
{
|
||||||
|
setSortingEnabled(true);
|
||||||
|
sortByColumn(0,Qt::AscendingOrder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -159,8 +159,6 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent)
|
|||||||
lib_cart_model->setPalette(palette());
|
lib_cart_model->setPalette(palette());
|
||||||
lib_cart_filter->setModel(lib_cart_model);
|
lib_cart_filter->setModel(lib_cart_model);
|
||||||
lib_cart_view->setModel(lib_cart_model);
|
lib_cart_view->setModel(lib_cart_model);
|
||||||
lib_cart_view->setSortingEnabled(true);
|
|
||||||
lib_cart_view->sortByColumn(0,Qt::AscendingOrder);
|
|
||||||
connect(lib_cart_view,SIGNAL(doubleClicked(const QModelIndex &)),
|
connect(lib_cart_view,SIGNAL(doubleClicked(const QModelIndex &)),
|
||||||
this,SLOT(cartDoubleClickedData(const QModelIndex &)));
|
this,SLOT(cartDoubleClickedData(const QModelIndex &)));
|
||||||
connect(lib_cart_filter,SIGNAL(dragEnabledChanged(bool)),
|
connect(lib_cart_filter,SIGNAL(dragEnabledChanged(bool)),
|
||||||
@ -275,8 +273,6 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent)
|
|||||||
lib_macro_events=new RDMacroEvent(rda->station()->address(),rda->ripc(),this);
|
lib_macro_events=new RDMacroEvent(rda->station()->address(),rda->ripc(),this);
|
||||||
|
|
||||||
dragsChangedData(lib_cart_filter->dragEnabled());
|
dragsChangedData(lib_cart_filter->dragEnabled());
|
||||||
lib_cart_model->
|
|
||||||
setFilterSql(lib_cart_filter->filterSql(),lib_cart_model->cartLimit());
|
|
||||||
|
|
||||||
LoadGeometry();
|
LoadGeometry();
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// Edit a Rivendell Log Chain Entry
|
// Edit a Rivendell Log Chain Entry
|
||||||
//
|
//
|
||||||
// (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
|
// 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
|
// it under the terms of the GNU General Public License version 2 as
|
||||||
@ -27,8 +27,8 @@
|
|||||||
|
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
|
|
||||||
EditChain::EditChain(RDLogLine *line,QWidget *parent)
|
EditChain::EditChain(QWidget *parent)
|
||||||
: EditEvent(line,parent)
|
: EditEvent(parent)
|
||||||
{
|
{
|
||||||
setWindowTitle("RDLogEdit - "+tr("Edit Log Chain"));
|
setWindowTitle("RDLogEdit - "+tr("Edit Log Chain"));
|
||||||
|
|
||||||
@ -63,12 +63,6 @@ EditChain::EditChain(RDLogLine *line,QWidget *parent)
|
|||||||
edit_comment_edit->setReadOnly(true);
|
edit_comment_edit->setReadOnly(true);
|
||||||
edit_comment_label=new QLabel(tr("Log Description"),this);
|
edit_comment_label=new QLabel(tr("Log Description"),this);
|
||||||
edit_comment_label->setFont(labelFont());
|
edit_comment_label->setFont(labelFont());
|
||||||
|
|
||||||
//
|
|
||||||
// Populate Data
|
|
||||||
//
|
|
||||||
edit_label_edit->setText(logLine()->markerLabel());
|
|
||||||
labelChangedData(edit_label_edit->text());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -84,6 +78,16 @@ QSizePolicy EditChain::sizePolicy() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int EditChain::exec(RDLogLine *ll)
|
||||||
|
{
|
||||||
|
setLogLine(ll);
|
||||||
|
edit_label_edit->setText(logLine()->markerLabel());
|
||||||
|
labelChangedData(edit_label_edit->text());
|
||||||
|
|
||||||
|
return EditEvent::exec();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void EditChain::selectLogData()
|
void EditChain::selectLogData()
|
||||||
{
|
{
|
||||||
QString logname;
|
QString logname;
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// Edit a Rivendell Chain-To event
|
// Edit a Rivendell Chain-To event
|
||||||
//
|
//
|
||||||
// (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
|
// 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
|
// it under the terms of the GNU General Public License version 2 as
|
||||||
@ -21,14 +21,6 @@
|
|||||||
#ifndef EDIT_CHAIN_H
|
#ifndef EDIT_CHAIN_H
|
||||||
#define EDIT_CHAIN_H
|
#define EDIT_CHAIN_H
|
||||||
|
|
||||||
#include <qbuttongroup.h>
|
|
||||||
#include <qcombobox.h>
|
|
||||||
#include <qcheckbox.h>
|
|
||||||
#include <qdatetimeedit.h>
|
|
||||||
#include <qgroupbox.h>
|
|
||||||
#include <qpushbutton.h>
|
|
||||||
#include <qradiobutton.h>
|
|
||||||
|
|
||||||
#include <rddialog.h>
|
#include <rddialog.h>
|
||||||
#include <rdlog_line.h>
|
#include <rdlog_line.h>
|
||||||
#include <rdtimeedit.h>
|
#include <rdtimeedit.h>
|
||||||
@ -39,12 +31,15 @@ class EditChain : public EditEvent
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
EditChain(RDLogLine *,QWidget *parent=0);
|
EditChain(QWidget *parent=0);
|
||||||
QSize sizeHint() const;
|
QSize sizeHint() const;
|
||||||
QSizePolicy sizePolicy() const;
|
QSizePolicy sizePolicy() const;
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
int exec(RDLogLine *ll);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void selectLogData();
|
void selectLogData();
|
||||||
void labelChangedData(const QString &);
|
void labelChangedData(const QString &);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// Base class for rdlogedit(1) event editor dialogs
|
// Base class for rdlogedit(1) event editor dialogs
|
||||||
//
|
//
|
||||||
// (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
|
// 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
|
// it under the terms of the GNU General Public License version 2 as
|
||||||
@ -24,13 +24,12 @@
|
|||||||
#include <rdlist_logs.h>
|
#include <rdlist_logs.h>
|
||||||
|
|
||||||
#include "edit_event.h"
|
#include "edit_event.h"
|
||||||
|
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
|
|
||||||
EditEvent::EditEvent(RDLogLine *line,QWidget *parent)
|
EditEvent::EditEvent(QWidget *parent)
|
||||||
: RDDialog(parent)
|
: RDDialog(parent)
|
||||||
{
|
{
|
||||||
edit_logline=line;
|
// edit_logline=line;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Time Type
|
// Time Type
|
||||||
@ -101,10 +100,11 @@ EditEvent::EditEvent(RDLogLine *line,QWidget *parent)
|
|||||||
edit_cancel_button->setFont(buttonFont());
|
edit_cancel_button->setFont(buttonFont());
|
||||||
edit_cancel_button->setText(tr("Cancel"));
|
edit_cancel_button->setText(tr("Cancel"));
|
||||||
connect(edit_cancel_button,SIGNAL(clicked()),this,SLOT(cancelData()));
|
connect(edit_cancel_button,SIGNAL(clicked()),this,SLOT(cancelData()));
|
||||||
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// Populate Data
|
int EditEvent::exec()
|
||||||
//
|
{
|
||||||
edit_time_edit->setTime(edit_logline->startTime(RDLogLine::Logged));
|
edit_time_edit->setTime(edit_logline->startTime(RDLogLine::Logged));
|
||||||
if(edit_logline->timeType()==RDLogLine::Hard) {
|
if(edit_logline->timeType()==RDLogLine::Hard) {
|
||||||
edit_timetype_box->setChecked(true);
|
edit_timetype_box->setChecked(true);
|
||||||
@ -132,6 +132,8 @@ EditEvent::EditEvent(RDLogLine *line,QWidget *parent)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
edit_transtype_box->setCurrentIndex(edit_logline->transType());
|
edit_transtype_box->setCurrentIndex(edit_logline->transType());
|
||||||
|
|
||||||
|
return QDialog::exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -241,6 +243,12 @@ RDLogLine *EditEvent::logLine()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void EditEvent::setLogLine(RDLogLine *ll)
|
||||||
|
{
|
||||||
|
edit_logline=ll;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void EditEvent::resizeEvent(QResizeEvent *e)
|
void EditEvent::resizeEvent(QResizeEvent *e)
|
||||||
{
|
{
|
||||||
edit_timetype_box->setGeometry(10,22,15,15);
|
edit_timetype_box->setGeometry(10,22,15,15);
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// Base class for rdlogedit(1) event editor dialogs
|
// Base class for rdlogedit(1) event editor dialogs
|
||||||
//
|
//
|
||||||
// (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
|
// 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
|
// it under the terms of the GNU General Public License version 2 as
|
||||||
@ -21,13 +21,11 @@
|
|||||||
#ifndef EDIT_EVENT_H
|
#ifndef EDIT_EVENT_H
|
||||||
#define EDIT_EVENT_H
|
#define EDIT_EVENT_H
|
||||||
|
|
||||||
#include <qbuttongroup.h>
|
#include <QButtonGroup>
|
||||||
#include <qcombobox.h>
|
#include <QCheckBox>
|
||||||
#include <qcheckbox.h>
|
#include <QComboBox>
|
||||||
#include <qdatetimeedit.h>
|
#include <QGroupBox>
|
||||||
#include <qgroupbox.h>
|
#include <QRadioButton>
|
||||||
#include <qpushbutton.h>
|
|
||||||
#include <qradiobutton.h>
|
|
||||||
|
|
||||||
#include <rddialog.h>
|
#include <rddialog.h>
|
||||||
#include <rdlog_line.h>
|
#include <rdlog_line.h>
|
||||||
@ -37,7 +35,7 @@ class EditEvent : public RDDialog
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
protected:
|
protected:
|
||||||
EditEvent(RDLogLine *,QWidget *parent=0);
|
EditEvent(QWidget *parent=0);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void timeChangedData(const QTime &);
|
void timeChangedData(const QTime &);
|
||||||
@ -48,7 +46,9 @@ class EditEvent : public RDDialog
|
|||||||
void cancelData();
|
void cancelData();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
int exec();
|
||||||
RDLogLine *logLine();
|
RDLogLine *logLine();
|
||||||
|
void setLogLine(RDLogLine *ll);
|
||||||
virtual bool saveData()=0;
|
virtual bool saveData()=0;
|
||||||
void resizeEvent(QResizeEvent *e);
|
void resizeEvent(QResizeEvent *e);
|
||||||
void closeEvent(QCloseEvent *e);
|
void closeEvent(QCloseEvent *e);
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// Edit a Rivendell Log
|
// Edit 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
|
// 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
|
// it under the terms of the GNU General Public License version 2 as
|
||||||
@ -27,35 +27,23 @@
|
|||||||
#include <rdtextvalidator.h>
|
#include <rdtextvalidator.h>
|
||||||
|
|
||||||
#include "add_meta.h"
|
#include "add_meta.h"
|
||||||
#include "edit_chain.h"
|
|
||||||
#include "edit_log.h"
|
#include "edit_log.h"
|
||||||
#include "edit_logline.h"
|
|
||||||
#include "edit_marker.h"
|
|
||||||
#include "edit_track.h"
|
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
|
|
||||||
EditLog::EditLog(QString logname,QString *filter,QString *group,
|
EditLog::EditLog(QString *filter,QString *group,QString *schedcode,
|
||||||
QString *schedcode,QList<RDLogLine> *clipboard,
|
QList<RDLogLine> *clipboard,QWidget *parent)
|
||||||
QStringList *new_logs,QWidget *parent)
|
|
||||||
: RDDialog(parent)
|
: RDDialog(parent)
|
||||||
{
|
{
|
||||||
QString sql;
|
|
||||||
RDSqlQuery *q;
|
|
||||||
QStringList services_list;
|
|
||||||
QColor system_mid_color=palette().mid().color();
|
QColor system_mid_color=palette().mid().color();
|
||||||
QColor system_button_color=palette().button().color();
|
QColor system_button_color=palette().button().color();
|
||||||
|
|
||||||
edit_logname=logname;
|
|
||||||
edit_filter=filter;
|
edit_filter=filter;
|
||||||
edit_group=group;
|
edit_group=group;
|
||||||
edit_schedcode=schedcode;
|
edit_schedcode=schedcode;
|
||||||
edit_clipboard=clipboard;
|
edit_clipboard=clipboard;
|
||||||
edit_newlogs=new_logs;
|
|
||||||
edit_default_trans=RDLogLine::Play;
|
edit_default_trans=RDLogLine::Play;
|
||||||
bool adding_allowed=rda->user()->addtoLog();
|
edit_log=NULL;
|
||||||
bool deleting_allowed=rda->user()->removefromLog();
|
edit_log_lock=NULL;
|
||||||
bool editing_allowed=rda->user()->arrangeLog();
|
|
||||||
bool saveas_allowed=rda->user()->createLog();
|
|
||||||
|
|
||||||
setWindowTitle("RDLogEdit - "+tr("Edit Log"));
|
setWindowTitle("RDLogEdit - "+tr("Edit Log"));
|
||||||
|
|
||||||
@ -78,29 +66,24 @@ EditLog::EditLog(QString logname,QString *filter,QString *group,
|
|||||||
// Dialogs
|
// Dialogs
|
||||||
//
|
//
|
||||||
edit_render_dialog=new RenderDialog(this);
|
edit_render_dialog=new RenderDialog(this);
|
||||||
|
edit_logline_dialog=
|
||||||
|
new EditLogLine(edit_filter,edit_group,edit_schedcode,this);
|
||||||
|
edit_marker_dialog=new EditMarker(this);
|
||||||
|
edit_track_dialog=new EditTrack(this);
|
||||||
|
edit_chain_dialog=new EditChain(this);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Text Validator
|
// Text Validator
|
||||||
//
|
//
|
||||||
RDTextValidator *validator=new RDTextValidator(this);
|
RDTextValidator *validator=new RDTextValidator(this);
|
||||||
|
|
||||||
//
|
|
||||||
// Log Header
|
|
||||||
//
|
|
||||||
edit_log=new RDLog(edit_logname);
|
|
||||||
|
|
||||||
//
|
|
||||||
// Log Data Structures
|
|
||||||
//
|
|
||||||
edit_log_lock=new RDLogLock(edit_logname,rda->user(),rda->station(),this);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Log Name
|
// Log Name
|
||||||
//
|
//
|
||||||
edit_modified_label=new QLabel(this);
|
edit_modified_label=new QLabel(this);
|
||||||
edit_modified_label->setAlignment(Qt::AlignCenter|Qt::AlignVCenter);
|
edit_modified_label->setAlignment(Qt::AlignCenter|Qt::AlignVCenter);
|
||||||
edit_modified_label->setFont(progressFont());
|
edit_modified_label->setFont(progressFont());
|
||||||
edit_logname_label=new QLabel(logname,this);
|
edit_logname_label=new QLabel(this);
|
||||||
edit_logname_label->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);
|
edit_logname_label->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);
|
||||||
edit_logname_label_label=new QLabel(tr("Log Name:"),this);
|
edit_logname_label_label=new QLabel(tr("Log Name:"),this);
|
||||||
edit_logname_label_label->setFont(labelFont());
|
edit_logname_label_label->setFont(labelFont());
|
||||||
@ -118,10 +101,7 @@ EditLog::EditLog(QString logname,QString *filter,QString *group,
|
|||||||
//
|
//
|
||||||
// Log Origin
|
// Log Origin
|
||||||
//
|
//
|
||||||
edit_origin_label=
|
edit_origin_label=new QLabel(this);
|
||||||
new QLabel(edit_log->originUser()+QString(" - ")+
|
|
||||||
edit_log->originDatetime().toString("MM/dd/yyyy - hh:mm:ss"),
|
|
||||||
this);
|
|
||||||
edit_origin_label->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);
|
edit_origin_label->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);
|
||||||
edit_origin_label_label=new QLabel(tr("Origin:"),this);
|
edit_origin_label_label=new QLabel(tr("Origin:"),this);
|
||||||
edit_origin_label_label->setFont(labelFont());
|
edit_origin_label_label->setFont(labelFont());
|
||||||
@ -257,12 +237,10 @@ EditLog::EditLog(QString logname,QString *filter,QString *group,
|
|||||||
edit_log_view->setShowGrid(false);
|
edit_log_view->setShowGrid(false);
|
||||||
edit_log_view->setSortingEnabled(false);
|
edit_log_view->setSortingEnabled(false);
|
||||||
edit_log_view->setWordWrap(false);
|
edit_log_view->setWordWrap(false);
|
||||||
edit_log_model=new LogModel(edit_logname,this);
|
edit_log_model=new LogModel(this);
|
||||||
edit_log_model->setFont(defaultFont());
|
edit_log_model->setFont(defaultFont());
|
||||||
edit_log_model->setPalette(palette());
|
edit_log_model->setPalette(palette());
|
||||||
edit_log_model->load(true);
|
|
||||||
edit_log_view->setModel(edit_log_model);
|
edit_log_view->setModel(edit_log_model);
|
||||||
edit_log_view->resizeColumnsToContents();
|
|
||||||
connect(edit_log_model,
|
connect(edit_log_model,
|
||||||
SIGNAL(dataChanged(const QModelIndex &,const QModelIndex &)),
|
SIGNAL(dataChanged(const QModelIndex &,const QModelIndex &)),
|
||||||
this,SLOT(dataChangedData(const QModelIndex &,const QModelIndex &)));
|
this,SLOT(dataChangedData(const QModelIndex &,const QModelIndex &)));
|
||||||
@ -437,10 +415,59 @@ EditLog::EditLog(QString logname,QString *filter,QString *group,
|
|||||||
edit_cancel_button->setFont(buttonFont());
|
edit_cancel_button->setFont(buttonFont());
|
||||||
edit_cancel_button->setText(tr("Cancel"));
|
edit_cancel_button->setText(tr("Cancel"));
|
||||||
connect(edit_cancel_button,SIGNAL(clicked()),this,SLOT(cancelData()));
|
connect(edit_cancel_button,SIGNAL(clicked()),this,SLOT(cancelData()));
|
||||||
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// Populate Data
|
EditLog::~EditLog()
|
||||||
//
|
{
|
||||||
|
delete edit_log_model;
|
||||||
|
delete edit_log_lock;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QSize EditLog::sizeHint() const
|
||||||
|
{
|
||||||
|
return global_logedit_window_size;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//int EditLog::exec()
|
||||||
|
int EditLog::exec(const QString &logname,QStringList *new_logs)
|
||||||
|
{
|
||||||
|
QString sql;
|
||||||
|
RDSqlQuery *q;
|
||||||
|
QString username;
|
||||||
|
QString stationname;
|
||||||
|
QHostAddress addr;
|
||||||
|
bool adding_allowed=rda->user()->addtoLog();
|
||||||
|
bool deleting_allowed=rda->user()->removefromLog();
|
||||||
|
bool editing_allowed=rda->user()->arrangeLog();
|
||||||
|
bool saveas_allowed=rda->user()->createLog();
|
||||||
|
QStringList services_list;
|
||||||
|
|
||||||
|
edit_logname=logname;
|
||||||
|
edit_newlogs=new_logs;
|
||||||
|
if(edit_log!=NULL) {
|
||||||
|
delete edit_log;
|
||||||
|
}
|
||||||
|
edit_log=new RDLog(edit_logname);
|
||||||
|
edit_logname_label->setText(edit_logname);
|
||||||
|
edit_log_model->setLogName(edit_logname);
|
||||||
|
edit_log_model->load(true);
|
||||||
|
edit_log_view->resizeColumnsToContents();
|
||||||
|
edit_origin_label->
|
||||||
|
setText(edit_log->originUser()+QString(" - ")+
|
||||||
|
edit_log->originDatetime().toString("MM/dd/yyyy - hh:mm:ss"));
|
||||||
|
edit_log_lock=new RDLogLock(edit_logname,rda->user(),rda->station(),this);
|
||||||
|
if(!edit_log_lock->tryLock(&username,&stationname,&addr)) {
|
||||||
|
QString msg=tr("Log already being edited by")+" "+username+"@"+stationname;
|
||||||
|
if(stationname!=addr.toString()) {
|
||||||
|
msg+=" ["+addr.toString()+"]";
|
||||||
|
}
|
||||||
|
msg+=".";
|
||||||
|
QMessageBox::warning(this,"RDLogEdit - "+tr("Log Locked"),msg);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
edit_description_edit->setText(edit_log->description());
|
edit_description_edit->setText(edit_log->description());
|
||||||
|
|
||||||
QDate purge_date=edit_log->purgeDate();
|
QDate purge_date=edit_log->purgeDate();
|
||||||
@ -542,37 +569,6 @@ EditLog::EditLog(QString logname,QString *filter,QString *group,
|
|||||||
edit_copy_button->setEnabled(adding_allowed&&editing_allowed);
|
edit_copy_button->setEnabled(adding_allowed&&editing_allowed);
|
||||||
edit_paste_button->setEnabled(adding_allowed&&editing_allowed);
|
edit_paste_button->setEnabled(adding_allowed&&editing_allowed);
|
||||||
edit_saveas_button->setEnabled(saveas_allowed);
|
edit_saveas_button->setEnabled(saveas_allowed);
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
EditLog::~EditLog()
|
|
||||||
{
|
|
||||||
delete edit_log_model;
|
|
||||||
delete edit_log_lock;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
QSize EditLog::sizeHint() const
|
|
||||||
{
|
|
||||||
return global_logedit_window_size;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int EditLog::exec()
|
|
||||||
{
|
|
||||||
QString username;
|
|
||||||
QString stationname;
|
|
||||||
QHostAddress addr;
|
|
||||||
|
|
||||||
if(!edit_log_lock->tryLock(&username,&stationname,&addr)) {
|
|
||||||
QString msg=tr("Log already being edited by")+" "+username+"@"+stationname;
|
|
||||||
if(stationname!=addr.toString()) {
|
|
||||||
msg+=" ["+addr.toString()+"]";
|
|
||||||
}
|
|
||||||
msg+=".";
|
|
||||||
QMessageBox::warning(this,"RDLogEdit - "+tr("Log Locked"),msg);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return QDialog::exec();
|
return QDialog::exec();
|
||||||
}
|
}
|
||||||
@ -681,21 +677,18 @@ void EditLog::insertCartButtonData()
|
|||||||
edit_log_model->logLine(line)->setTransType(edit_default_trans);
|
edit_log_model->logLine(line)->setTransType(edit_default_trans);
|
||||||
edit_log_model->logLine(line)->setFadeupGain(-3000);
|
edit_log_model->logLine(line)->setFadeupGain(-3000);
|
||||||
edit_log_model->logLine(line)->setFadedownGain(-3000);
|
edit_log_model->logLine(line)->setFadedownGain(-3000);
|
||||||
EditLogLine *edit=
|
printf("CARTNUM: %06u\n",edit_log_model->logLine(line)->cartNumber());
|
||||||
new EditLogLine(edit_log_model->logLine(line),edit_filter,edit_group,
|
int ret=edit_logline_dialog->
|
||||||
edit_schedcode,edit_service_box->currentText(),
|
exec(edit_service_box->currentText(),edit_log_model,
|
||||||
edit_log_model,line,this);
|
edit_log_model->logLine(line),line);
|
||||||
int ret=edit->exec();
|
|
||||||
if(ret>=0) {
|
if(ret>=0) {
|
||||||
edit_log_model->update(line);
|
edit_log_model->update(line);
|
||||||
SetLogModified(true);
|
SetLogModified(true);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
edit_log_model->remove(line,1);
|
edit_log_model->remove(line,1);
|
||||||
delete edit;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
delete edit;
|
|
||||||
UpdateCounters();
|
UpdateCounters();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -709,17 +702,12 @@ void EditLog::insertMarkerButtonData()
|
|||||||
}
|
}
|
||||||
|
|
||||||
int ret;
|
int ret;
|
||||||
EditMarker *edit_marker;
|
|
||||||
EditTrack *edit_track;
|
|
||||||
EditChain *edit_chain;
|
|
||||||
|
|
||||||
AddMeta *meta=new AddMeta(this);
|
AddMeta *meta=new AddMeta(this);
|
||||||
switch((RDLogLine::Type)meta->exec()) {
|
switch((RDLogLine::Type)meta->exec()) {
|
||||||
case RDLogLine::Marker:
|
case RDLogLine::Marker:
|
||||||
edit_log_model->insert(line,1);
|
edit_log_model->insert(line,1);
|
||||||
edit_log_model->logLine(line)->setType(RDLogLine::Marker);
|
edit_log_model->logLine(line)->setType(RDLogLine::Marker);
|
||||||
edit_marker=new EditMarker(edit_log_model->logLine(line),this);
|
ret=edit_marker_dialog->exec(edit_log_model->logLine(line));
|
||||||
ret=edit_marker->exec();
|
|
||||||
if(ret>=0) {
|
if(ret>=0) {
|
||||||
edit_log_model->update(line);
|
edit_log_model->update(line);
|
||||||
SetLogModified(true);
|
SetLogModified(true);
|
||||||
@ -727,7 +715,6 @@ void EditLog::insertMarkerButtonData()
|
|||||||
else {
|
else {
|
||||||
edit_log_model->remove(line,1);
|
edit_log_model->remove(line,1);
|
||||||
}
|
}
|
||||||
delete edit_marker;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RDLogLine::Track:
|
case RDLogLine::Track:
|
||||||
@ -735,8 +722,7 @@ void EditLog::insertMarkerButtonData()
|
|||||||
edit_log_model->logLine(line)->setType(RDLogLine::Track);
|
edit_log_model->logLine(line)->setType(RDLogLine::Track);
|
||||||
edit_log_model->logLine(line)->setTransType(RDLogLine::Segue);
|
edit_log_model->logLine(line)->setTransType(RDLogLine::Segue);
|
||||||
edit_log_model->logLine(line)->setMarkerComment(tr("Voice Track"));
|
edit_log_model->logLine(line)->setMarkerComment(tr("Voice Track"));
|
||||||
edit_track=new EditTrack(edit_log_model->logLine(line),this);
|
ret=edit_track_dialog->exec(edit_log_model->logLine(line));
|
||||||
ret=edit_track->exec();
|
|
||||||
if(ret>=0) {
|
if(ret>=0) {
|
||||||
edit_log_model->update(line);
|
edit_log_model->update(line);
|
||||||
SetLogModified(true);
|
SetLogModified(true);
|
||||||
@ -744,14 +730,12 @@ void EditLog::insertMarkerButtonData()
|
|||||||
else {
|
else {
|
||||||
edit_log_model->remove(line,1);
|
edit_log_model->remove(line,1);
|
||||||
}
|
}
|
||||||
delete edit_track;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RDLogLine::Chain:
|
case RDLogLine::Chain:
|
||||||
edit_log_model->insert(line,1);
|
edit_log_model->insert(line,1);
|
||||||
edit_log_model->logLine(line)->setType(RDLogLine::Chain);
|
edit_log_model->logLine(line)->setType(RDLogLine::Chain);
|
||||||
edit_chain=new EditChain(edit_log_model->logLine(line),this);
|
ret=edit_chain_dialog->exec(edit_log_model->logLine(line));
|
||||||
ret=edit_chain->exec();
|
|
||||||
if(ret>=0) {
|
if(ret>=0) {
|
||||||
edit_log_model->update(line);
|
edit_log_model->update(line);
|
||||||
SetLogModified(true);
|
SetLogModified(true);
|
||||||
@ -759,7 +743,6 @@ void EditLog::insertMarkerButtonData()
|
|||||||
else {
|
else {
|
||||||
edit_log_model->remove(line,1);
|
edit_log_model->remove(line,1);
|
||||||
}
|
}
|
||||||
delete edit_chain;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -813,10 +796,6 @@ void EditLog::doubleClickedData(const QModelIndex &index)
|
|||||||
|
|
||||||
void EditLog::editButtonData()
|
void EditLog::editButtonData()
|
||||||
{
|
{
|
||||||
EditLogLine *edit_cart;
|
|
||||||
EditMarker *edit_marker;
|
|
||||||
EditTrack *edit_track;
|
|
||||||
EditChain *edit_chain;
|
|
||||||
int line;
|
int line;
|
||||||
|
|
||||||
if((line=SingleSelectionLine())<0) {
|
if((line=SingleSelectionLine())<0) {
|
||||||
@ -826,39 +805,29 @@ void EditLog::editButtonData()
|
|||||||
switch(edit_log_model->logLine(line)->type()) {
|
switch(edit_log_model->logLine(line)->type()) {
|
||||||
case RDLogLine::Cart:
|
case RDLogLine::Cart:
|
||||||
case RDLogLine::Macro:
|
case RDLogLine::Macro:
|
||||||
edit_cart=
|
if(edit_logline_dialog->exec(edit_service_box->currentText(),edit_log_model,
|
||||||
new EditLogLine(edit_log_model->logLine(line),edit_filter,edit_group,
|
edit_log_model->logLine(line),line)>=0) {
|
||||||
edit_schedcode,edit_service_box->currentText(),
|
|
||||||
edit_log_model,line,this);
|
|
||||||
if(edit_cart->exec()>=0) {
|
|
||||||
edit_log_model->update(line);
|
edit_log_model->update(line);
|
||||||
SetLogModified(true);
|
SetLogModified(true);
|
||||||
}
|
}
|
||||||
delete edit_cart;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RDLogLine::Marker:
|
case RDLogLine::Marker:
|
||||||
edit_marker=new EditMarker(edit_log_model->logLine(line),this);
|
if(edit_marker_dialog->exec(edit_log_model->logLine(line))>=0) {
|
||||||
if(edit_marker->exec()>=0) {
|
|
||||||
SetLogModified(true);
|
SetLogModified(true);
|
||||||
}
|
}
|
||||||
delete edit_marker;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RDLogLine::Track:
|
case RDLogLine::Track:
|
||||||
edit_track=new EditTrack(edit_log_model->logLine(line),this);
|
if(edit_track_dialog->exec(edit_log_model->logLine(line))>=0) {
|
||||||
if(edit_track->exec()>=0) {
|
|
||||||
SetLogModified(true);
|
SetLogModified(true);
|
||||||
}
|
}
|
||||||
delete edit_track;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RDLogLine::Chain:
|
case RDLogLine::Chain:
|
||||||
edit_chain=new EditChain(edit_log_model->logLine(line),this);
|
if(edit_chain_dialog->exec(edit_log_model->logLine(line))>=0) {
|
||||||
if(edit_chain->exec()>=0) {
|
|
||||||
SetLogModified(true);
|
SetLogModified(true);
|
||||||
}
|
}
|
||||||
delete edit_chain;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -1097,6 +1066,8 @@ void EditLog::okData()
|
|||||||
for(int i=0;i<edit_clipboard->size();i++) {
|
for(int i=0;i<edit_clipboard->size();i++) {
|
||||||
(*edit_clipboard)[i].clearExternalData();
|
(*edit_clipboard)[i].clearExternalData();
|
||||||
}
|
}
|
||||||
|
delete edit_log_lock;
|
||||||
|
edit_log_lock=NULL;
|
||||||
done(true);
|
done(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1128,6 +1099,8 @@ void EditLog::cancelData()
|
|||||||
for(int i=0;i<edit_clipboard->size();i++) {
|
for(int i=0;i<edit_clipboard->size();i++) {
|
||||||
(*edit_clipboard)[i].clearExternalData();
|
(*edit_clipboard)[i].clearExternalData();
|
||||||
}
|
}
|
||||||
|
delete edit_log_lock;
|
||||||
|
edit_log_lock=NULL;
|
||||||
done(false);
|
done(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// Edit a Rivendell Log
|
// Edit 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
|
// 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
|
// it under the terms of the GNU General Public License version 2 as
|
||||||
@ -25,12 +25,15 @@
|
|||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
|
||||||
|
|
||||||
#include <rdcart_dialog.h>
|
#include <rdcart_dialog.h>
|
||||||
#include <rddateedit.h>
|
#include <rddateedit.h>
|
||||||
#include <rddialog.h>
|
#include <rddialog.h>
|
||||||
#include <rdloglock.h>
|
#include <rdloglock.h>
|
||||||
|
|
||||||
|
#include "edit_chain.h"
|
||||||
|
#include "edit_logline.h"
|
||||||
|
#include "edit_marker.h"
|
||||||
|
#include "edit_track.h"
|
||||||
#include "list_reports.h"
|
#include "list_reports.h"
|
||||||
#include "logmodel.h"
|
#include "logmodel.h"
|
||||||
#include "logtableview.h"
|
#include "logtableview.h"
|
||||||
@ -43,14 +46,13 @@ class EditLog : public RDDialog
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
EditLog(QString logname,QString *filter,QString *group,QString *schedcode,
|
EditLog(QString *filter,QString *group,QString *schedcode,
|
||||||
QList<RDLogLine> *clipboard,QStringList *new_logs,
|
QList<RDLogLine> *clipboard,QWidget *parent=0);
|
||||||
QWidget *parent=0);
|
|
||||||
~EditLog();
|
~EditLog();
|
||||||
QSize sizeHint() const;
|
QSize sizeHint() const;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
int exec();
|
int exec(const QString &logname,QStringList *new_logs);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void dataChangedData(const QModelIndex &top_left,
|
void dataChangedData(const QModelIndex &top_left,
|
||||||
@ -169,6 +171,10 @@ class EditLog : public RDDialog
|
|||||||
RDLogLock *edit_log_lock;
|
RDLogLock *edit_log_lock;
|
||||||
QPushButton *edit_renderas_button;
|
QPushButton *edit_renderas_button;
|
||||||
RenderDialog *edit_render_dialog;
|
RenderDialog *edit_render_dialog;
|
||||||
|
EditLogLine *edit_logline_dialog;
|
||||||
|
EditMarker *edit_marker_dialog;
|
||||||
|
EditTrack *edit_track_dialog;
|
||||||
|
EditChain *edit_chain_dialog;
|
||||||
LogTableView *edit_log_view;
|
LogTableView *edit_log_view;
|
||||||
LogModel *edit_log_model;
|
LogModel *edit_log_model;
|
||||||
};
|
};
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// Edit a Rivendell Log Entry
|
// Edit a Rivendell Log Entry
|
||||||
//
|
//
|
||||||
// (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
|
// 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
|
// it under the terms of the GNU General Public License version 2 as
|
||||||
@ -22,10 +22,9 @@
|
|||||||
|
|
||||||
#include "edit_logline.h"
|
#include "edit_logline.h"
|
||||||
|
|
||||||
EditLogLine::EditLogLine(RDLogLine *line,QString *filter,QString *group,
|
EditLogLine::EditLogLine(QString *filter,QString *group,QString *schedcode,
|
||||||
QString *schedcode,QString svcname,
|
QWidget *parent)
|
||||||
LogModel *model,int lineno,QWidget *parent)
|
: EditEvent(parent)
|
||||||
: EditEvent(line,parent)
|
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Fix the Window Size
|
// Fix the Window Size
|
||||||
@ -38,9 +37,6 @@ EditLogLine::EditLogLine(RDLogLine *line,QString *filter,QString *group,
|
|||||||
edit_filter=filter;
|
edit_filter=filter;
|
||||||
edit_group=group;
|
edit_group=group;
|
||||||
edit_schedcode=schedcode;
|
edit_schedcode=schedcode;
|
||||||
edit_service=svcname;
|
|
||||||
edit_log_model=model;
|
|
||||||
edit_line=lineno;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Cart Picker
|
// Cart Picker
|
||||||
@ -95,28 +91,6 @@ EditLogLine::EditLogLine(RDLogLine *line,QString *filter,QString *group,
|
|||||||
button->setFont(buttonFont());
|
button->setFont(buttonFont());
|
||||||
button->setText(tr("Select\nCart"));
|
button->setText(tr("Select\nCart"));
|
||||||
connect(button,SIGNAL(clicked()),this,SLOT(selectCartData()));
|
connect(button,SIGNAL(clicked()),this,SLOT(selectCartData()));
|
||||||
|
|
||||||
//
|
|
||||||
// Populate Data
|
|
||||||
//
|
|
||||||
if(logLine()->segueStartPoint(RDLogLine::LogPointer)<0
|
|
||||||
&& logLine()->segueEndPoint(RDLogLine::LogPointer)<0
|
|
||||||
&& logLine()->endPoint(RDLogLine::LogPointer)<0
|
|
||||||
&& logLine()->fadedownPoint(RDLogLine::LogPointer)<0) {
|
|
||||||
edit_overlap_box->setEnabled(true);
|
|
||||||
edit_overlap_label->setEnabled(true);
|
|
||||||
if(logLine()->segueGain()==0) {
|
|
||||||
edit_overlap_box->setChecked(true);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
edit_overlap_box->setChecked(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
edit_overlap_box->setEnabled(false);
|
|
||||||
edit_overlap_label->setEnabled(false);
|
|
||||||
}
|
|
||||||
FillCart(logLine()->cartNumber());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -138,6 +112,37 @@ QSizePolicy EditLogLine::sizePolicy() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int EditLogLine::exec(const QString &svcname,LogModel *model,
|
||||||
|
RDLogLine *ll,int lineno)
|
||||||
|
{
|
||||||
|
edit_service=svcname;
|
||||||
|
edit_log_model=model;
|
||||||
|
edit_line=lineno;
|
||||||
|
setLogLine(ll);
|
||||||
|
|
||||||
|
if(logLine()->segueStartPoint(RDLogLine::LogPointer)<0
|
||||||
|
&& logLine()->segueEndPoint(RDLogLine::LogPointer)<0
|
||||||
|
&& logLine()->endPoint(RDLogLine::LogPointer)<0
|
||||||
|
&& logLine()->fadedownPoint(RDLogLine::LogPointer)<0) {
|
||||||
|
edit_overlap_box->setEnabled(true);
|
||||||
|
edit_overlap_label->setEnabled(true);
|
||||||
|
if(logLine()->segueGain()==0) {
|
||||||
|
edit_overlap_box->setChecked(true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
edit_overlap_box->setChecked(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
edit_overlap_box->setEnabled(false);
|
||||||
|
edit_overlap_label->setEnabled(false);
|
||||||
|
}
|
||||||
|
FillCart(logLine()->cartNumber());
|
||||||
|
|
||||||
|
return EditEvent::exec();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void EditLogLine::selectCartData()
|
void EditLogLine::selectCartData()
|
||||||
{
|
{
|
||||||
bool ok;
|
bool ok;
|
||||||
@ -186,11 +191,16 @@ bool EditLogLine::saveData()
|
|||||||
|
|
||||||
void EditLogLine::FillCart(int cartnum)
|
void EditLogLine::FillCart(int cartnum)
|
||||||
{
|
{
|
||||||
RDCart *cart=new RDCart(cartnum);
|
if(cartnum==0) {
|
||||||
if(cartnum!=0) {
|
edit_cart_edit->setText("");
|
||||||
edit_cart_edit->setText(QString::asprintf("%05u",cartnum));
|
edit_title_edit->setText("");
|
||||||
|
edit_artist_edit->setText("");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
RDCart *cart=new RDCart(cartnum);
|
||||||
|
edit_cart_edit->setText(QString::asprintf("%05u",cartnum));
|
||||||
|
edit_title_edit->setText(cart->title());
|
||||||
|
edit_artist_edit->setText(cart->artist());
|
||||||
|
delete cart;
|
||||||
}
|
}
|
||||||
edit_title_edit->setText(cart->title());
|
|
||||||
edit_artist_edit->setText(cart->artist());
|
|
||||||
delete cart;
|
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// Edit a Rivendell cart event
|
// Edit a Rivendell cart event
|
||||||
//
|
//
|
||||||
// (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
|
// 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
|
// it under the terms of the GNU General Public License version 2 as
|
||||||
@ -30,12 +30,15 @@ class EditLogLine : public EditEvent
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
EditLogLine(RDLogLine *,QString *filter,QString *group,QString *schedcode,
|
EditLogLine(QString *filter,QString *group,QString *schedcode,
|
||||||
QString svcname,LogModel *model,int lineno,QWidget *parent=0);
|
QWidget *parent=0);
|
||||||
~EditLogLine();
|
~EditLogLine();
|
||||||
QSize sizeHint() const;
|
QSize sizeHint() const;
|
||||||
QSizePolicy sizePolicy() const;
|
QSizePolicy sizePolicy() const;
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
int exec(const QString &svcname,LogModel *model,RDLogLine *ll,int lineno);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void selectCartData();
|
void selectCartData();
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// Edit a Rivendell marker event
|
// Edit a Rivendell marker event
|
||||||
//
|
//
|
||||||
// (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
|
// 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
|
// it under the terms of the GNU General Public License version 2 as
|
||||||
@ -20,8 +20,8 @@
|
|||||||
|
|
||||||
#include "edit_marker.h"
|
#include "edit_marker.h"
|
||||||
|
|
||||||
EditMarker::EditMarker(RDLogLine *line,QWidget *parent)
|
EditMarker::EditMarker(QWidget *parent)
|
||||||
: EditEvent(line,parent)
|
: EditEvent(parent)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Fix the Window Size
|
// Fix the Window Size
|
||||||
@ -52,12 +52,6 @@ EditMarker::EditMarker(RDLogLine *line,QWidget *parent)
|
|||||||
label=new QLabel(tr("Label"),this);
|
label=new QLabel(tr("Label"),this);
|
||||||
label->setFont(labelFont());
|
label->setFont(labelFont());
|
||||||
label->setGeometry(12,140,60,14);
|
label->setGeometry(12,140,60,14);
|
||||||
|
|
||||||
//
|
|
||||||
// Populate Data
|
|
||||||
//
|
|
||||||
edit_comment_edit->setText(logLine()->markerComment());
|
|
||||||
edit_label_edit->setText(logLine()->markerLabel());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -73,6 +67,16 @@ QSizePolicy EditMarker::sizePolicy() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int EditMarker::exec(RDLogLine *ll)
|
||||||
|
{
|
||||||
|
setLogLine(ll);
|
||||||
|
edit_comment_edit->setText(logLine()->markerComment());
|
||||||
|
edit_label_edit->setText(logLine()->markerLabel());
|
||||||
|
|
||||||
|
return EditEvent::exec();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool EditMarker::saveData()
|
bool EditMarker::saveData()
|
||||||
{
|
{
|
||||||
logLine()->setMarkerComment(edit_comment_edit->text());
|
logLine()->setMarkerComment(edit_comment_edit->text());
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// Edit a Rivendell marker event
|
// Edit a Rivendell marker event
|
||||||
//
|
//
|
||||||
// (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
|
// 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
|
// it under the terms of the GNU General Public License version 2 as
|
||||||
@ -21,7 +21,7 @@
|
|||||||
#ifndef EDIT_MARKER_H
|
#ifndef EDIT_MARKER_H
|
||||||
#define EDIT_MARKER_H
|
#define EDIT_MARKER_H
|
||||||
|
|
||||||
#include <qlineedit.h>
|
#include <QLineEdit>
|
||||||
|
|
||||||
#include "edit_event.h"
|
#include "edit_event.h"
|
||||||
|
|
||||||
@ -29,10 +29,13 @@ class EditMarker : public EditEvent
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
EditMarker(RDLogLine *,QWidget *parent=0);
|
EditMarker(QWidget *parent=0);
|
||||||
QSize sizeHint() const;
|
QSize sizeHint() const;
|
||||||
QSizePolicy sizePolicy() const;
|
QSizePolicy sizePolicy() const;
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
int exec(RDLogLine *ll);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool saveData();
|
bool saveData();
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// Edit a Rivendell Voice Track Log Entry
|
// Edit a Rivendell Voice Track Log Entry
|
||||||
//
|
//
|
||||||
// (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
|
// 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
|
// it under the terms of the GNU General Public License version 2 as
|
||||||
@ -20,8 +20,8 @@
|
|||||||
|
|
||||||
#include "edit_track.h"
|
#include "edit_track.h"
|
||||||
|
|
||||||
EditTrack::EditTrack(RDLogLine *line,QWidget *parent)
|
EditTrack::EditTrack(QWidget *parent)
|
||||||
: EditEvent(line,parent)
|
: EditEvent(parent)
|
||||||
{
|
{
|
||||||
setWindowTitle("RDLogEdit - "+tr("Edit Voice Track Marker"));
|
setWindowTitle("RDLogEdit - "+tr("Edit Voice Track Marker"));
|
||||||
|
|
||||||
@ -40,11 +40,6 @@ EditTrack::EditTrack(RDLogLine *line,QWidget *parent)
|
|||||||
QLabel *label=new QLabel(tr("Comment"),this);
|
QLabel *label=new QLabel(tr("Comment"),this);
|
||||||
label->setFont(labelFont());
|
label->setFont(labelFont());
|
||||||
label->setGeometry(12,100,70,14);
|
label->setGeometry(12,100,70,14);
|
||||||
|
|
||||||
//
|
|
||||||
// Populate Data
|
|
||||||
//
|
|
||||||
edit_comment_edit->setText(logLine()->markerComment());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -60,6 +55,15 @@ QSizePolicy EditTrack::sizePolicy() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int EditTrack::exec(RDLogLine *ll)
|
||||||
|
{
|
||||||
|
setLogLine(ll);
|
||||||
|
edit_comment_edit->setText(logLine()->markerComment());
|
||||||
|
|
||||||
|
return EditEvent::exec();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool EditTrack::saveData()
|
bool EditTrack::saveData()
|
||||||
{
|
{
|
||||||
logLine()->setMarkerComment(edit_comment_edit->text());
|
logLine()->setMarkerComment(edit_comment_edit->text());
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// Edit a Rivendell Voice Track Log Entry
|
// Edit a Rivendell Voice Track Log Entry
|
||||||
//
|
//
|
||||||
// (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
|
// 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
|
// it under the terms of the GNU General Public License version 2 as
|
||||||
@ -21,7 +21,7 @@
|
|||||||
#ifndef EDIT_TRACK_H
|
#ifndef EDIT_TRACK_H
|
||||||
#define EDIT_TRACK_H
|
#define EDIT_TRACK_H
|
||||||
|
|
||||||
#include <qlineedit.h>
|
#include <QLineEdit>
|
||||||
|
|
||||||
#include "edit_event.h"
|
#include "edit_event.h"
|
||||||
|
|
||||||
@ -29,10 +29,13 @@ class EditTrack : public EditEvent
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
EditTrack(RDLogLine *,QWidget *parent=0);
|
EditTrack(QWidget *parent=0);
|
||||||
QSize sizeHint() const;
|
QSize sizeHint() const;
|
||||||
QSizePolicy sizePolicy() const;
|
QSizePolicy sizePolicy() const;
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
int exec(RDLogLine *ll);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool saveData();
|
bool saveData();
|
||||||
|
|
||||||
|
@ -27,6 +27,13 @@ LogModel::LogModel(const QString &logname,QObject *parent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
LogModel::LogModel(QObject *parent)
|
||||||
|
: RDLogModel(parent)
|
||||||
|
{
|
||||||
|
d_group_list=new RDGroupList();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
LogModel::~LogModel()
|
LogModel::~LogModel()
|
||||||
{
|
{
|
||||||
delete d_group_list;
|
delete d_group_list;
|
||||||
|
@ -29,6 +29,7 @@ class LogModel : public RDLogModel
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
LogModel(const QString &logname,QObject *parent=0);
|
LogModel(const QString &logname,QObject *parent=0);
|
||||||
|
LogModel(QObject *parent=0);
|
||||||
~LogModel();
|
~LogModel();
|
||||||
QString serviceName() const;
|
QString serviceName() const;
|
||||||
bool groupIsValid(const QString &grpname) const;
|
bool groupIsValid(const QString &grpname) const;
|
||||||
|
@ -111,6 +111,9 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent)
|
|||||||
//
|
//
|
||||||
// Dialogs
|
// Dialogs
|
||||||
//
|
//
|
||||||
|
log_edit_dialog=
|
||||||
|
new EditLog(&log_filter,&log_group,&log_schedcode,&log_clipboard,this);
|
||||||
|
|
||||||
log_tracker_dialog=new VoiceTracker(&log_import_path,this);
|
log_tracker_dialog=new VoiceTracker(&log_import_path,this);
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -268,11 +271,7 @@ void MainWidget::addData()
|
|||||||
}
|
}
|
||||||
LockList();
|
LockList();
|
||||||
SendNotification(RDNotification::AddAction,logname);
|
SendNotification(RDNotification::AddAction,logname);
|
||||||
EditLog *editlog=new EditLog(logname,&log_filter,&log_group,&log_schedcode,
|
log_edit_dialog->exec(logname,&newlogs);
|
||||||
&log_clipboard,&newlogs,this);
|
|
||||||
editlog->exec();
|
|
||||||
delete editlog;
|
|
||||||
|
|
||||||
row=log_log_model->addLog(logname);
|
row=log_log_model->addLog(logname);
|
||||||
log_log_view->selectRow(row.row());
|
log_log_view->selectRow(row.row());
|
||||||
UnlockList();
|
UnlockList();
|
||||||
@ -290,14 +289,10 @@ void MainWidget::editData()
|
|||||||
QString logname=log_log_model->logName(row);
|
QString logname=log_log_model->logName(row);
|
||||||
QStringList newlogs;
|
QStringList newlogs;
|
||||||
LockList();
|
LockList();
|
||||||
EditLog *log=
|
if(log_edit_dialog->exec(logname,&newlogs)) {
|
||||||
new EditLog(logname,&log_filter,&log_group,&log_schedcode,
|
|
||||||
&log_clipboard,&newlogs,this);
|
|
||||||
if(log->exec()) {
|
|
||||||
log_log_model->refresh(row);
|
log_log_model->refresh(row);
|
||||||
}
|
}
|
||||||
UnlockList();
|
UnlockList();
|
||||||
delete log;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
#include <rdtableview.h>
|
#include <rdtableview.h>
|
||||||
#include <rdwidget.h>
|
#include <rdwidget.h>
|
||||||
|
|
||||||
|
#include "edit_log.h"
|
||||||
#include "voice_tracker.h"
|
#include "voice_tracker.h"
|
||||||
|
|
||||||
#define RDLOGEDIT_DEFAULT_WIDTH 640
|
#define RDLOGEDIT_DEFAULT_WIDTH 640
|
||||||
@ -91,6 +92,7 @@ class MainWidget : public RDMainWindow
|
|||||||
bool log_resize;
|
bool log_resize;
|
||||||
bool log_list_locked;
|
bool log_list_locked;
|
||||||
QStringList log_deleted_logs;
|
QStringList log_deleted_logs;
|
||||||
|
EditLog *log_edit_dialog;
|
||||||
VoiceTracker *log_tracker_dialog;
|
VoiceTracker *log_tracker_dialog;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user