mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-08-02 08:59:33 +02:00
2018-02-06 Fred Gleason <fredg@paravelsystems.com>
* Refactored the RDCartDialog class to use RDApplication.
This commit is contained in:
parent
2d2d52e408
commit
e9926053c8
@ -16677,3 +16677,5 @@
|
||||
2018-02-06 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Refactored the RDListLogs class to use RDApplication.
|
||||
* Converted rdadmin(1) to use RDApplication.
|
||||
2018-02-06 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Refactored the RDCartDialog class to use RDApplication.
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// A widget to select a Rivendell Cart.
|
||||
//
|
||||
// (C) Copyright 2002-2004,2016 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2002-2004,2016-2018 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
|
||||
@ -30,17 +30,18 @@
|
||||
#include <qfiledialog.h>
|
||||
#include <qmessagebox.h>
|
||||
|
||||
#include <rdconf.h>
|
||||
#include <rdcart_dialog.h>
|
||||
#include <rdcart_search_text.h>
|
||||
#include <rdtextvalidator.h>
|
||||
#include <rdprofile.h>
|
||||
#include <rddb.h>
|
||||
#include <rdgroup.h>
|
||||
#include <rdapplication.h>
|
||||
#ifndef WIN32
|
||||
#include <rdaudioimport.h>
|
||||
#endif // WIN32
|
||||
#include <rdcart_dialog.h>
|
||||
#include <rdcart_search_text.h>
|
||||
#include <rdconf.h>
|
||||
#include <rddb.h>
|
||||
#include <rdgroup.h>
|
||||
#include <rdprofile.h>
|
||||
#include <rdsettings.h>
|
||||
#include <rdtextvalidator.h>
|
||||
#endif // WIN32
|
||||
#include <rdwavefile.h>
|
||||
|
||||
//
|
||||
@ -50,8 +51,7 @@
|
||||
#include "../icons/rml5.xpm"
|
||||
|
||||
RDCartDialog::RDCartDialog(QString *filter,QString *group,QString *schedcode,
|
||||
RDCae *cae,RDRipc *ripc,RDStation *station,
|
||||
RDSystem *system,RDConfig *config,QWidget *parent)
|
||||
QWidget *parent)
|
||||
: QDialog(parent,"",true)
|
||||
{
|
||||
//
|
||||
@ -60,9 +60,6 @@ RDCartDialog::RDCartDialog(QString *filter,QString *group,QString *schedcode,
|
||||
setMinimumWidth(sizeHint().width());
|
||||
setMinimumHeight(sizeHint().height());
|
||||
|
||||
cart_station=station;
|
||||
cart_system=system;
|
||||
cart_config=config;
|
||||
cart_cartnum=NULL;
|
||||
cart_type=RDCart::All;
|
||||
cart_group=group;
|
||||
@ -74,7 +71,7 @@ RDCartDialog::RDCartDialog(QString *filter,QString *group,QString *schedcode,
|
||||
#ifdef WIN32
|
||||
cart_filter_mode=RDStation::FilterSynchronous;
|
||||
#else
|
||||
cart_filter_mode=station->filterMode();
|
||||
cart_filter_mode=rda->station()->filterMode();
|
||||
#endif // WIN32
|
||||
|
||||
if(filter==NULL) {
|
||||
@ -248,13 +245,13 @@ RDCartDialog::RDCartDialog(QString *filter,QString *group,QString *schedcode,
|
||||
// Audition Player
|
||||
//
|
||||
#ifndef WIN32
|
||||
if((cae==NULL)||(station->cueCard()<0)||(station->cuePort()<0)) {
|
||||
if((rda->station()->cueCard()<0)||(rda->station()->cuePort()<0)) {
|
||||
cart_player=NULL;
|
||||
}
|
||||
else {
|
||||
cart_player=
|
||||
new RDSimplePlayer(cae,ripc,station->cueCard(),station->cuePort(),
|
||||
station->cueStartCart(),station->cueStopCart(),this);
|
||||
new RDSimplePlayer(rda->cae(),rda->ripc(),rda->station()->cueCard(),rda->station()->cuePort(),
|
||||
rda->station()->cueStartCart(),rda->station()->cueStopCart(),this);
|
||||
cart_player->playButton()->setDisabled(true);
|
||||
cart_player->stopButton()->setDisabled(true);
|
||||
cart_player->stopButton()->setOnColor(red);
|
||||
@ -267,7 +264,7 @@ RDCartDialog::RDCartDialog(QString *filter,QString *group,QString *schedcode,
|
||||
cart_editor_button=new QPushButton(tr("Send to\n&Editor"),this);
|
||||
cart_editor_button->setFont(button_font);
|
||||
connect(cart_editor_button,SIGNAL(clicked()),this,SLOT(editorData()));
|
||||
if(station->editorPath().isEmpty()) {
|
||||
if(rda->station()->editorPath().isEmpty()) {
|
||||
cart_editor_button->hide();
|
||||
}
|
||||
|
||||
@ -277,7 +274,7 @@ RDCartDialog::RDCartDialog(QString *filter,QString *group,QString *schedcode,
|
||||
cart_file_button=new QPushButton(tr("Load From\n&File"),this);
|
||||
cart_file_button->setFont(button_font);
|
||||
connect(cart_file_button,SIGNAL(clicked()),this,SLOT(loadFileData()));
|
||||
if(station->editorPath().isEmpty()) {
|
||||
if(rda->station()->editorPath().isEmpty()) {
|
||||
cart_file_button->hide();
|
||||
}
|
||||
#ifdef WIN32
|
||||
@ -335,7 +332,7 @@ int RDCartDialog::exec(int *cartnum,RDCart::Type type,QString *svcname,
|
||||
switch(cart_type) {
|
||||
case RDCart::All:
|
||||
case RDCart::Audio:
|
||||
if(cart_station->editorPath().isEmpty()) {
|
||||
if(rda->station()->editorPath().isEmpty()) {
|
||||
cart_editor_button->hide();
|
||||
}
|
||||
else {
|
||||
@ -512,7 +509,7 @@ void RDCartDialog::editorData()
|
||||
delete q;
|
||||
return;
|
||||
}
|
||||
QString cmd=cart_station->editorPath();
|
||||
QString cmd=rda->station()->editorPath();
|
||||
cmd.replace("%f",RDCut::pathName(q->value(0).toString()));
|
||||
cmd.replace("%n",QString().sprintf("%06u",item->text(1).toUInt()));
|
||||
cmd.replace("%h",QString().sprintf("%d",q->value(1).toInt()));
|
||||
@ -561,7 +558,7 @@ void RDCartDialog::loadFileData()
|
||||
//
|
||||
// Create Cart
|
||||
//
|
||||
if((cartnum=RDCart::create(cart_system->tempCartGroup(),RDCart::Audio,
|
||||
if((cartnum=RDCart::create(rda->system()->tempCartGroup(),RDCart::Audio,
|
||||
&err_msg))==0) {
|
||||
delete cart;
|
||||
QMessageBox::warning(this,tr("Cart Error"),
|
||||
@ -570,7 +567,7 @@ void RDCartDialog::loadFileData()
|
||||
return;
|
||||
}
|
||||
cart=new RDCart(cartnum);
|
||||
cart->setOwner(cart_station->name());
|
||||
cart->setOwner(rda->station()->name());
|
||||
cut=new RDCut(cartnum,1,true);
|
||||
|
||||
//
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// A widget to select a Rivendell Cart.
|
||||
//
|
||||
// (C) Copyright 2002-2004,2016 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2002-2004,2016-2018 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,16 +28,10 @@
|
||||
#include <qprogressdialog.h>
|
||||
#include <qcheckbox.h>
|
||||
|
||||
#include <rdcae.h>
|
||||
#include <rdconfig.h>
|
||||
#include <rdripc.h>
|
||||
#include <rdsystem.h>
|
||||
#include <rdsimpleplayer.h>
|
||||
#include <rdlistviewitem.h>
|
||||
#include <rdcart.h>
|
||||
#include <rdstation.h>
|
||||
#include <rdcombobox.h>
|
||||
#include <rduser.h>
|
||||
#include <rdbusydialog.h>
|
||||
|
||||
#define RDCART_DIALOG_STEP_SIZE 1000
|
||||
@ -47,9 +41,7 @@ class RDCartDialog : public QDialog
|
||||
Q_OBJECT
|
||||
public:
|
||||
RDCartDialog(QString *filter,QString *group,QString *schedcode,
|
||||
RDCae *cae,RDRipc *ripc,RDStation *station,RDSystem *system,
|
||||
RDConfig *config,QWidget *parent=0);
|
||||
|
||||
QWidget *parent=0);
|
||||
~RDCartDialog();
|
||||
QSize sizeHint() const;
|
||||
QSizePolicy sizePolicy() const;
|
||||
@ -116,9 +108,6 @@ class RDCartDialog : public QDialog
|
||||
QString cart_import_path;
|
||||
QString cart_import_file_filter;
|
||||
bool *cart_temp_allowed;
|
||||
RDStation *cart_station;
|
||||
RDSystem *cart_system;
|
||||
RDConfig *cart_config;
|
||||
QString cart_user_name;
|
||||
QString cart_user_password;
|
||||
RDBusyDialog *cart_busy_dialog;
|
||||
|
@ -196,8 +196,7 @@ MainWidget::MainWidget(QWidget *parent)
|
||||
// Cart Dialog
|
||||
//
|
||||
admin_cart_dialog=
|
||||
new RDCartDialog(&admin_filter,&admin_group,&admin_schedcode,NULL,
|
||||
rda->ripc(),rda->station(),rda->system(),rda->config(),this);
|
||||
new RDCartDialog(&admin_filter,&admin_group,&admin_schedcode,this);
|
||||
|
||||
//
|
||||
// User Labels
|
||||
|
@ -405,8 +405,7 @@ MainWidget::MainWidget(QWidget *parent)
|
||||
// Cart Picker
|
||||
//
|
||||
rdcart_dialog=
|
||||
new RDCartDialog(&air_add_filter,&air_add_group,&air_add_schedcode,
|
||||
rda->cae(),rda->ripc(),rda->station(),rda->system(),rda->config(),this);
|
||||
new RDCartDialog(&air_add_filter,&air_add_group,&air_add_schedcode,this);
|
||||
|
||||
//
|
||||
// Wall Clock
|
||||
|
@ -114,10 +114,8 @@ MainWidget::MainWidget(QWidget *parent)
|
||||
//
|
||||
// Dialogs
|
||||
//
|
||||
panel_cart_dialog=new RDCartDialog(&panel_filter,&panel_group,
|
||||
&panel_schedcode,rda->cae(),rda->ripc(),
|
||||
rda->station(),rda->system(),rda->config(),
|
||||
this);
|
||||
panel_cart_dialog=
|
||||
new RDCartDialog(&panel_filter,&panel_group,&panel_schedcode,this);
|
||||
panel_slot_dialog=new RDSlotDialog(tr("RDCartSlots"),this);
|
||||
panel_cue_dialog=new RDCueEditDialog(rda->cae(),rda->station()->cueCard(),
|
||||
rda->station()->cuePort(),
|
||||
|
@ -378,10 +378,8 @@ order by CHANNEL",(const char *)q->value(0).toString().lower());
|
||||
//
|
||||
// Cart Picker
|
||||
//
|
||||
catch_cart_dialog=new RDCartDialog(&catch_filter,&catch_group,
|
||||
&catch_schedcode,rda->cae(),rda->ripc(),
|
||||
rda->station(),rda->system(),rda->config(),
|
||||
this);
|
||||
catch_cart_dialog=
|
||||
new RDCartDialog(&catch_filter,&catch_group,&catch_schedcode,this);
|
||||
|
||||
//
|
||||
// Cart List
|
||||
|
@ -70,20 +70,7 @@ EditLogLine::EditLogLine(RDLogLine *line,QString *filter,QString *group,
|
||||
//
|
||||
// Cart Picker
|
||||
//
|
||||
#ifdef WIN32
|
||||
/*
|
||||
edit_cart_dialog=new RDCartDialog(&edit_filter,&edit_group,&edit_schedcode,
|
||||
NULL,NULL,rdstation_conf,rdsystem,
|
||||
log_config,this);
|
||||
*/
|
||||
edit_cart_dialog=new RDCartDialog(edit_filter,edit_group,edit_schedcode,
|
||||
NULL,NULL,rda->station(),rda->system(),
|
||||
rda->config(),this);
|
||||
#else
|
||||
edit_cart_dialog=new RDCartDialog(edit_filter,edit_group,edit_schedcode,
|
||||
rda->cae(),rda->ripc(),rda->station(),rda->system(),
|
||||
rda->config(),this);
|
||||
#endif
|
||||
edit_cart_dialog=new RDCartDialog(edit_filter,edit_group,edit_schedcode,this);
|
||||
|
||||
//
|
||||
// Time Type
|
||||
|
@ -170,8 +170,7 @@ MainWidget::MainWidget(QWidget *parent)
|
||||
// Cart Picker
|
||||
//
|
||||
panel_cart_dialog=
|
||||
new RDCartDialog(&panel_filter,&panel_group,&panel_schedcode,rda->cae(),
|
||||
rda->ripc(),rda->station(),rda->system(),rda->config(),this);
|
||||
new RDCartDialog(&panel_filter,&panel_group,&panel_schedcode,this);
|
||||
|
||||
//
|
||||
// Sound Panel Array
|
||||
|
Loading…
x
Reference in New Issue
Block a user