mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-11 17:13:47 +02:00
2021-02-23 Fred Gleason <fredg@paravelsystems.com>
* Removed the Qt3Support library from the build system. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// Edit Rivendell CartSlot Configuration
|
||||
//
|
||||
// (C) Copyright 2012-2019 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2012-2021 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
|
||||
@@ -18,9 +18,8 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
|
||||
#include <qmessagebox.h>
|
||||
#include <QCloseEvent>
|
||||
#include <QLabel>
|
||||
#include <qmessagebox.h>
|
||||
|
||||
#include <rd.h>
|
||||
#include <rdapplication.h>
|
||||
@@ -70,7 +69,7 @@ EditCartSlots::EditCartSlots(RDStation *station,RDStation *cae_station,
|
||||
edit_slot_columns_spin->setRange(1,RDCARTSLOTS_MAX_COLUMNS);
|
||||
connect(edit_slot_columns_spin,SIGNAL(valueChanged(int)),
|
||||
this,SLOT(quantityChangedData(int)));
|
||||
label=new QLabel(edit_slot_columns_spin,tr("Slot Columns:"),this);
|
||||
label=new QLabel(tr("Slot Columns:"),this);
|
||||
label->setGeometry(10,32,112,20);
|
||||
label->setFont(labelFont());
|
||||
label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
|
||||
@@ -83,7 +82,7 @@ EditCartSlots::EditCartSlots(RDStation *station,RDStation *cae_station,
|
||||
edit_slot_rows_spin->setRange(1,RDCARTSLOTS_MAX_ROWS);
|
||||
connect(edit_slot_rows_spin,SIGNAL(valueChanged(int)),
|
||||
this,SLOT(quantityChangedData(int)));
|
||||
label=new QLabel(edit_slot_rows_spin,tr("Slot Rows:"),this);
|
||||
label=new QLabel(tr("Slot Rows:"),this);
|
||||
label->setGeometry(10,54,112,20);
|
||||
label->setFont(labelFont());
|
||||
label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
|
||||
@@ -95,7 +94,7 @@ EditCartSlots::EditCartSlots(RDStation *station,RDStation *cae_station,
|
||||
edit_slot_box->setGeometry(107,98,60,20);
|
||||
connect(edit_slot_box,SIGNAL(activated(int)),
|
||||
this,SLOT(slotChangedData(int)));
|
||||
label=new QLabel(edit_slot_box,tr("Slot"),this);
|
||||
label=new QLabel(tr("Slot"),this);
|
||||
label->setGeometry(10,98,92,20);
|
||||
label->setFont(sectionLabelFont());
|
||||
label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
|
||||
@@ -121,7 +120,7 @@ EditCartSlots::EditCartSlots(RDStation *station,RDStation *cae_station,
|
||||
edit_card_spin->setSpecialValueText(tr("None"));
|
||||
connect(edit_card_spin,SIGNAL(valueChanged(int)),
|
||||
this,SLOT(cardChangedData(int)));
|
||||
label=new QLabel(edit_card_spin,tr("Card:"),this);
|
||||
label=new QLabel(tr("Card:"),this);
|
||||
label->setGeometry(10,145,112,20);
|
||||
label->setFont(labelFont());
|
||||
label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
|
||||
@@ -133,7 +132,7 @@ EditCartSlots::EditCartSlots(RDStation *station,RDStation *cae_station,
|
||||
edit_input_spin->setGeometry(127,167,50,20);
|
||||
edit_input_spin->setRange(-1,RD_MAX_PORTS-1);
|
||||
edit_input_spin->setSpecialValueText(tr("None"));
|
||||
label=new QLabel(edit_input_spin,tr("Input Port:"),this);
|
||||
label=new QLabel(tr("Input Port:"),this);
|
||||
label->setGeometry(10,167,112,20);
|
||||
label->setFont(labelFont());
|
||||
label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
|
||||
@@ -145,7 +144,7 @@ EditCartSlots::EditCartSlots(RDStation *station,RDStation *cae_station,
|
||||
edit_output_spin->setGeometry(127,189,50,20);
|
||||
edit_output_spin->setRange(-1,RD_MAX_PORTS-1);
|
||||
edit_output_spin->setSpecialValueText(tr("None"));
|
||||
label=new QLabel(edit_output_spin,tr("Output Port:"),this);
|
||||
label=new QLabel(tr("Output Port:"),this);
|
||||
label->setGeometry(10,189,112,20);
|
||||
label->setFont(labelFont());
|
||||
label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
|
||||
@@ -163,15 +162,15 @@ EditCartSlots::EditCartSlots(RDStation *station,RDStation *cae_station,
|
||||
//
|
||||
edit_service_box=new QComboBox(this);
|
||||
edit_service_box->setGeometry(127,240,120,20);
|
||||
edit_service_label=
|
||||
new QLabel(edit_service_box,tr("Service:"),this);
|
||||
edit_service_label=new QLabel(tr("Service:"),this);
|
||||
edit_service_label->setGeometry(10,240,112,20);
|
||||
edit_service_label->setFont(labelFont());
|
||||
edit_service_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
|
||||
sql="select NAME from SERVICES order by NAME";
|
||||
q=new RDSqlQuery(sql);
|
||||
while(q->next()) {
|
||||
edit_service_box->insertItem(q->value(0).toString());
|
||||
edit_service_box->
|
||||
insertItem(edit_service_box->count(),q->value(0).toString());
|
||||
}
|
||||
delete q;
|
||||
|
||||
@@ -180,12 +179,13 @@ EditCartSlots::EditCartSlots(RDStation *station,RDStation *cae_station,
|
||||
//
|
||||
edit_mode_box=new QComboBox(this);
|
||||
edit_mode_box->setGeometry(127,262,150,20);
|
||||
edit_mode_box->insertItem(tr("User previous mode"));
|
||||
edit_mode_box->insertItem(0,tr("User previous mode"));
|
||||
for(int i=0;i<RDSlotOptions::LastMode;i++) {
|
||||
edit_mode_box->insertItem(RDSlotOptions::modeText((RDSlotOptions::Mode)i));
|
||||
edit_mode_box->insertItem(edit_mode_box->count(),
|
||||
RDSlotOptions::modeText((RDSlotOptions::Mode)i));
|
||||
}
|
||||
connect(edit_mode_box,SIGNAL(activated(int)),this,SLOT(modeData(int)));
|
||||
label=new QLabel(edit_mode_box,tr("Slot Mode:"),this);
|
||||
label=new QLabel(tr("Slot Mode:"),this);
|
||||
label->setGeometry(10,262,112,20);
|
||||
label->setFont(labelFont());
|
||||
label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
|
||||
@@ -195,10 +195,10 @@ EditCartSlots::EditCartSlots(RDStation *station,RDStation *cae_station,
|
||||
//
|
||||
edit_play_mode_box=new QComboBox(this);
|
||||
edit_play_mode_box->setGeometry(127,284,150,20);
|
||||
edit_play_mode_box->insertItem(tr("Use previous mode"));
|
||||
edit_play_mode_box->insertItem(tr("Full"));
|
||||
edit_play_mode_box->insertItem(tr("Hook"));
|
||||
edit_play_mode_label=new QLabel(edit_play_mode_box,tr("Play Mode:"),this);
|
||||
edit_play_mode_box->insertItem(0,tr("Use previous mode"));
|
||||
edit_play_mode_box->insertItem(1,tr("Full"));
|
||||
edit_play_mode_box->insertItem(2,tr("Hook"));
|
||||
edit_play_mode_label=new QLabel(tr("Play Mode:"),this);
|
||||
edit_play_mode_label->setGeometry(10,284,112,20);
|
||||
edit_play_mode_label->setFont(labelFont());
|
||||
edit_play_mode_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
|
||||
@@ -208,13 +208,12 @@ EditCartSlots::EditCartSlots(RDStation *station,RDStation *cae_station,
|
||||
//
|
||||
edit_cartaction_box=new QComboBox(this);
|
||||
edit_cartaction_box->setGeometry(127,306,150,20);
|
||||
edit_cartaction_box->insertItem(tr("Use previous cart"));
|
||||
edit_cartaction_box->insertItem(tr("Do Nothing"));
|
||||
edit_cartaction_box->insertItem(tr("Load Specified Cart"));
|
||||
edit_cartaction_box->insertItem(0,tr("Use previous cart"));
|
||||
edit_cartaction_box->insertItem(1,tr("Do Nothing"));
|
||||
edit_cartaction_box->insertItem(2,tr("Load Specified Cart"));
|
||||
connect(edit_cartaction_box,SIGNAL(activated(int)),
|
||||
this,SLOT(cartActionData(int)));
|
||||
edit_cartaction_label=
|
||||
new QLabel(edit_cartaction_box,tr("At Startup:"),this);
|
||||
edit_cartaction_label=new QLabel(tr("At Startup:"),this);
|
||||
edit_cartaction_label->setGeometry(10,306,112,20);
|
||||
edit_cartaction_label->setFont(labelFont());
|
||||
edit_cartaction_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
|
||||
@@ -225,7 +224,7 @@ EditCartSlots::EditCartSlots(RDStation *station,RDStation *cae_station,
|
||||
edit_cart_edit=new QLineEdit(this);
|
||||
edit_cart_edit->setGeometry(147,333,60,20);
|
||||
edit_cart_edit->setReadOnly(true);
|
||||
edit_cart_label=new QLabel(edit_cart_edit,tr("Cart:"),this);
|
||||
edit_cart_label=new QLabel(tr("Cart:"),this);
|
||||
edit_cart_label->setGeometry(10,333,132,20);
|
||||
edit_cart_label->setFont(labelFont());
|
||||
edit_cart_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
|
||||
@@ -239,12 +238,13 @@ EditCartSlots::EditCartSlots(RDStation *station,RDStation *cae_station,
|
||||
//
|
||||
edit_stop_action_box=new QComboBox(this);
|
||||
edit_stop_action_box->setGeometry(127,360,150,20);
|
||||
edit_stop_action_box->insertItem(tr("Use previous action"));
|
||||
edit_stop_action_box->insertItem(0,tr("Use previous action"));
|
||||
for(int i=0;i<RDSlotOptions::LastStop;i++) {
|
||||
edit_stop_action_box->
|
||||
insertItem(RDSlotOptions::stopActionText((RDSlotOptions::StopAction)i));
|
||||
insertItem(edit_stop_action_box->count(),
|
||||
RDSlotOptions::stopActionText((RDSlotOptions::StopAction)i));
|
||||
}
|
||||
edit_stop_action_label=new QLabel(edit_stop_action_box,tr("At Playout End:"),this);
|
||||
edit_stop_action_label=new QLabel(tr("At Playout End:"),this);
|
||||
edit_stop_action_label->setGeometry(10,360,112,20);
|
||||
edit_stop_action_label->setFont(labelFont());
|
||||
edit_stop_action_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
|
||||
@@ -263,7 +263,7 @@ EditCartSlots::EditCartSlots(RDStation *station,RDStation *cae_station,
|
||||
edit_slot_columns_spin->setValue(station->cartSlotColumns());
|
||||
edit_slot_rows_spin->setValue(station->cartSlotRows());
|
||||
quantityChangedData(0);
|
||||
ReadSlot(edit_slot_box->currentItem());
|
||||
ReadSlot(edit_slot_box->currentIndex());
|
||||
}
|
||||
|
||||
|
||||
@@ -280,15 +280,16 @@ QSize EditCartSlots::sizeHint() const
|
||||
|
||||
void EditCartSlots::quantityChangedData(int index)
|
||||
{
|
||||
int slot=edit_slot_box->currentItem();
|
||||
int slot=edit_slot_box->currentIndex();
|
||||
int slot_quan=
|
||||
edit_slot_columns_spin->value()*edit_slot_rows_spin->value();
|
||||
|
||||
edit_slot_box->clear();
|
||||
for(int i=0;i<slot_quan;i++) {
|
||||
edit_slot_box->insertItem(QString().sprintf("%d",i+1));
|
||||
edit_slot_box->insertItem(edit_slot_box->count(),
|
||||
QString().sprintf("%d",i+1));
|
||||
if(i==slot) {
|
||||
edit_slot_box->setCurrentItem(i);
|
||||
edit_slot_box->setCurrentIndex(i);
|
||||
}
|
||||
}
|
||||
if(slot>slot_quan) {
|
||||
@@ -338,7 +339,7 @@ void EditCartSlots::modeData(int mode)
|
||||
cartActionData(0);
|
||||
}
|
||||
else {
|
||||
cartActionData(edit_cartaction_box->currentItem());
|
||||
cartActionData(edit_cartaction_box->currentIndex());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -365,7 +366,7 @@ void EditCartSlots::closeData()
|
||||
{
|
||||
edit_station->setCartSlotColumns(edit_slot_columns_spin->value());
|
||||
edit_station->setCartSlotRows(edit_slot_rows_spin->value());
|
||||
WriteSlot(edit_slot_box->currentItem());
|
||||
WriteSlot(edit_slot_box->currentIndex());
|
||||
done(0);
|
||||
}
|
||||
|
||||
@@ -398,27 +399,27 @@ void EditCartSlots::ReadSlot(unsigned slotnum)
|
||||
edit_input_spin->setValue(q->value(1).toInt());
|
||||
edit_output_spin->setValue(q->value(2).toInt());
|
||||
cardChangedData(edit_card_spin->value());
|
||||
edit_mode_box->setCurrentItem(q->value(3).toInt()+1);
|
||||
edit_play_mode_box->setCurrentItem(q->value(4).toInt()+1);
|
||||
edit_stop_action_box->setCurrentItem(q->value(5).toInt()+1);
|
||||
edit_mode_box->setCurrentIndex(q->value(3).toInt()+1);
|
||||
edit_play_mode_box->setCurrentIndex(q->value(4).toInt()+1);
|
||||
edit_stop_action_box->setCurrentIndex(q->value(5).toInt()+1);
|
||||
switch(q->value(6).toInt()) {
|
||||
case -1:
|
||||
edit_cartaction_box->setCurrentItem(0);
|
||||
edit_cartaction_box->setCurrentIndex(0);
|
||||
break;
|
||||
|
||||
case 0:
|
||||
edit_cartaction_box->setCurrentItem(1);
|
||||
edit_cartaction_box->setCurrentIndex(1);
|
||||
break;
|
||||
|
||||
default:
|
||||
edit_cartaction_box->setCurrentItem(2);
|
||||
edit_cartaction_box->setCurrentIndex(2);
|
||||
edit_cart_edit->setText(QString().sprintf("%06d",q->value(6).toInt()));
|
||||
}
|
||||
cartActionData(edit_cartaction_box->currentItem());
|
||||
modeData(edit_mode_box->currentItem());
|
||||
cartActionData(edit_cartaction_box->currentIndex());
|
||||
modeData(edit_mode_box->currentIndex());
|
||||
for(int i=0;i<edit_service_box->count();i++) {
|
||||
if(q->value(7).toString()==edit_service_box->text(i)) {
|
||||
edit_service_box->setCurrentItem(i);
|
||||
if(q->value(7).toString()==edit_service_box->itemData(i).toString()) {
|
||||
edit_service_box->setCurrentIndex(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -437,12 +438,12 @@ void EditCartSlots::WriteSlot(unsigned slotnum)
|
||||
edit_input_spin->value(),
|
||||
edit_output_spin->value())+
|
||||
QString().sprintf("DEFAULT_MODE=%d,",
|
||||
edit_mode_box->currentItem()-1)+
|
||||
edit_mode_box->currentIndex()-1)+
|
||||
QString().sprintf("DEFAULT_HOOK_MODE=%d,",
|
||||
edit_play_mode_box->currentItem()-1)+
|
||||
edit_play_mode_box->currentIndex()-1)+
|
||||
QString().sprintf("DEFAULT_STOP_ACTION=%d,",
|
||||
edit_stop_action_box->currentItem()-1);
|
||||
switch(edit_cartaction_box->currentItem()) {
|
||||
edit_stop_action_box->currentIndex()-1);
|
||||
switch(edit_cartaction_box->currentIndex()) {
|
||||
case 0:
|
||||
sql+="DEFAULT_CART_NUMBER=-1,";
|
||||
break;
|
||||
|
Reference in New Issue
Block a user