mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-16 15:41:13 +02:00
2022-09-29 Fred Gleason <fredg@paravelsystems.com>
* Added an 'RDCart::prettyText()' method. * Added 'RDCut::prettyText()' methods. * Fixed a bug in rdcatch(1) that caused the 'Edit Upload' dialog to fail to be completely cleared when creating a new event. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
@@ -245,6 +245,7 @@ QSizePolicy EditUpload::sizePolicy() const
|
||||
|
||||
int EditUpload::exec(int id,std::vector<int> *adds)
|
||||
{
|
||||
printf("exec(%d)\n",id);
|
||||
edit_added_events=adds;
|
||||
if(edit_added_events==NULL) {
|
||||
event_saveas_button->hide();
|
||||
@@ -263,9 +264,13 @@ int EditUpload::exec(int id,std::vector<int> *adds)
|
||||
edit_username_edit->setText(edit_recording->urlUsername());
|
||||
edit_password_edit->setText(edit_recording->urlPassword());
|
||||
edit_use_id_file_check->setChecked(edit_recording->urlUseIdFile());
|
||||
edit_cutname=edit_recording->cutName();
|
||||
if(!edit_recording->cutName().isEmpty()) {
|
||||
edit_source_edit->setText("Cut "+edit_recording->cutName());
|
||||
edit_source_cutname=edit_recording->cutName();
|
||||
if(edit_source_cutname.isEmpty()) {
|
||||
edit_source_edit->clear();
|
||||
}
|
||||
else {
|
||||
edit_source_edit->
|
||||
setText("Cut "+RDCut::prettyText(edit_source_cutname));
|
||||
}
|
||||
edit_metadata_box->setChecked(edit_recording->enableMetadata());
|
||||
edit_dow_selector->fromRecording(edit_recording->id());
|
||||
@@ -380,12 +385,10 @@ void EditUpload::useIdFileData(bool state)
|
||||
|
||||
void EditUpload::selectCartData()
|
||||
{
|
||||
QString str;
|
||||
|
||||
if(catch_cut_dialog->exec(&edit_cutname)) {
|
||||
edit_description_edit->setText(RDCutPath(edit_cutname));
|
||||
str=QString(tr("Cut"));
|
||||
edit_source_edit->setText(tr("Cut")+" "+edit_cutname);
|
||||
if(catch_cut_dialog->exec(&edit_source_cutname)) {
|
||||
edit_description_edit->setText(RDCutPath(edit_source_cutname));
|
||||
edit_source_edit->
|
||||
setText(tr("Cut")+" "+RDCut::prettyText(edit_source_cutname));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -581,7 +584,7 @@ void EditUpload::Save()
|
||||
edit_recording->setStartTime(edit_event_widget->startTime());
|
||||
edit_recording->setType(RDRecording::Upload);
|
||||
edit_recording->setDescription(edit_description_edit->text());
|
||||
edit_recording->setCutName(edit_source_edit->text().right(10));
|
||||
edit_recording->setCutName(edit_source_cutname);
|
||||
edit_recording->setUrl(edit_url_edit->text());
|
||||
edit_recording->setUrlUsername(edit_username_edit->text());
|
||||
edit_recording->setUrlPassword(edit_password_edit->text());
|
||||
@@ -616,6 +619,11 @@ void EditUpload::Save()
|
||||
}
|
||||
|
||||
|
||||
void EditUpload::Clear()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
bool EditUpload::CheckEvent(bool include_myself)
|
||||
{
|
||||
QString sql=QString("select `ID` from `RECORDINGS` where ")+
|
||||
@@ -624,7 +632,7 @@ bool EditUpload::CheckEvent(bool include_myself)
|
||||
"(`START_TIME`='"+
|
||||
edit_event_widget->startTime().toString("hh:mm:ss")+"')&&"+
|
||||
"(`URL`='"+RDEscapeString(edit_url_edit->text())+"')&&"+
|
||||
"(`CUT_NAME`='"+RDEscapeString(edit_source_edit->text().right(10))+
|
||||
"(`CUT_NAME`='"+RDEscapeString(edit_source_cutname)+
|
||||
"')";
|
||||
if(edit_dow_selector->dayOfWeekEnabled(7)) {
|
||||
sql+="&&(`SUN`='Y')";
|
||||
|
@@ -67,6 +67,7 @@ class EditUpload : public RDDialog
|
||||
|
||||
private:
|
||||
void Save();
|
||||
void Clear();
|
||||
bool CheckEvent(bool include_myself);
|
||||
bool CheckFormat();
|
||||
RDDeck *edit_deck;
|
||||
@@ -87,9 +88,9 @@ class EditUpload : public RDDialog
|
||||
QLineEdit *edit_password_edit;
|
||||
QCheckBox *edit_use_id_file_check;;
|
||||
QLabel *edit_use_id_file_label;
|
||||
QString edit_cutname;
|
||||
QLabel *edit_source_label;
|
||||
QLineEdit *edit_source_edit;
|
||||
QString edit_source_cutname;
|
||||
QLabel *edit_format_label;
|
||||
QLineEdit *edit_format_edit;
|
||||
QPushButton *edit_format_set_button;
|
||||
@@ -100,25 +101,7 @@ class EditUpload : public RDDialog
|
||||
QLabel *edit_normalize_unit;
|
||||
QCheckBox *edit_metadata_box;
|
||||
QLabel *edit_metadata_label;
|
||||
|
||||
DowSelector *edit_dow_selector;
|
||||
/*
|
||||
QGroupBox *edit_dow_group;
|
||||
QCheckBox *edit_sun_button;
|
||||
QLabel *edit_sun_label;
|
||||
QCheckBox *edit_mon_button;
|
||||
QLabel *edit_mon_label;
|
||||
QCheckBox *edit_tue_button;
|
||||
QLabel *edit_tue_label;
|
||||
QCheckBox *edit_wed_button;
|
||||
QLabel *edit_wed_label;
|
||||
QCheckBox *edit_thu_button;
|
||||
QLabel *edit_thu_label;
|
||||
QCheckBox *edit_fri_button;
|
||||
QLabel *edit_fri_label;
|
||||
QCheckBox *edit_sat_button;
|
||||
QLabel *edit_sat_label;
|
||||
*/
|
||||
QLabel *edit_eventoffset_label;
|
||||
QSpinBox *edit_eventoffset_spin;
|
||||
QLabel *edit_eventoffset_unit_label;
|
||||
|
@@ -234,7 +234,12 @@ void EventWidget::fromRecording(unsigned record_id)
|
||||
break;
|
||||
|
||||
case EventWidget::OtherEvent:
|
||||
d_time_edit->setTime(q->value(3).toTime());
|
||||
if(q->value(3).toTime().isValid()) {
|
||||
d_time_edit->setTime(q->value(3).toTime());
|
||||
}
|
||||
else {
|
||||
d_time_edit->setTime(QTime(0,0,0));
|
||||
}
|
||||
d_location_box->setCurrentText(q->value(1).toString());
|
||||
d_current_station_name=q->value(1).toString();
|
||||
d_current_deck_number=-1;
|
||||
|
@@ -732,7 +732,7 @@ void RecordListModel::updateRow(int row,RDSqlQuery *q)
|
||||
break;
|
||||
}
|
||||
|
||||
texts[6]=CutText(q->value(6).toString());
|
||||
texts[6]=RDCut::prettyText(q->value(6).toString());
|
||||
icons[6]=rda->iconEngine()->catchIcon(RDRecording::Playout);
|
||||
sql=QString("select ")+
|
||||
"`SWITCH_STATION`,"+ // 00
|
||||
@@ -770,7 +770,7 @@ void RecordListModel::updateRow(int row,RDSqlQuery *q)
|
||||
texts[3]=tr("Len")+": "+RDGetTimeLength(cut->length(),false,false);
|
||||
}
|
||||
delete cut;
|
||||
texts[5]=CutText(q->value(6).toString());
|
||||
texts[5]=RDCut::prettyText(q->value(6).toString());
|
||||
icons[5]=rda->iconEngine()->catchIcon(RDRecording::Playout);
|
||||
break;
|
||||
|
||||
@@ -778,7 +778,7 @@ void RecordListModel::updateRow(int row,RDSqlQuery *q)
|
||||
texts[1]=q->value(3).toString();
|
||||
texts[2]=tr("Hard")+": "+q->value(4).toTime().
|
||||
toString(QString::asprintf("hh:mm:ss"));
|
||||
texts[5]=CartText(q->value(22).toUInt());
|
||||
texts[5]=RDCart::prettyText(q->value(22).toUInt());
|
||||
icons[5]=rda->iconEngine()->catchIcon(RDRecording::MacroEvent);
|
||||
break;
|
||||
|
||||
@@ -805,7 +805,7 @@ void RecordListModel::updateRow(int row,RDSqlQuery *q)
|
||||
texts[2]=tr("Hard")+": "+rda->timeString(q->value(4).toTime());
|
||||
texts[5]=q->value(37).toString();
|
||||
icons[5]=rda->iconEngine()->listIcon(RDIconEngine::Url);
|
||||
texts[6]=CutText(q->value(6).toString());
|
||||
texts[6]=RDCut::prettyText(q->value(6).toString());
|
||||
icons[6]=rda->iconEngine()->catchIcon(RDRecording::Playout);
|
||||
texts[16]=LevelText(-q->value(17).toUInt()); // Autotrim
|
||||
texts[17]=LevelText(q->value(18).toInt()); // Normalization
|
||||
@@ -814,7 +814,7 @@ void RecordListModel::updateRow(int row,RDSqlQuery *q)
|
||||
case RDRecording::Upload:
|
||||
texts[1]=q->value(3).toString();
|
||||
texts[2]=tr("Hard")+": "+rda->timeString(q->value(4).toTime());
|
||||
texts[5]=CutText(q->value(6).toString());
|
||||
texts[5]=RDCut::prettyText(q->value(6).toString());
|
||||
icons[5]=rda->iconEngine()->catchIcon(RDRecording::Playout);
|
||||
if(q->value(39).toString().isEmpty()) {
|
||||
texts[6]=q->value(37).toString();
|
||||
@@ -1025,19 +1025,6 @@ void RecordListModel::UpdateStatus(int line)
|
||||
}
|
||||
|
||||
|
||||
QString RecordListModel::CartText(unsigned cartnum) const
|
||||
{
|
||||
return QString::asprintf("%06u",cartnum);
|
||||
}
|
||||
|
||||
|
||||
QString RecordListModel::CutText(const QString &cutname) const
|
||||
{
|
||||
return QString::asprintf("%06u:%03d",RDCut::cartNumber(cutname),
|
||||
RDCut::cutNumber(cutname));
|
||||
}
|
||||
|
||||
|
||||
QString RecordListModel::LevelText(int lvl) const
|
||||
{
|
||||
QString ret=tr("[none]");
|
||||
|
@@ -82,8 +82,6 @@ class RecordListModel : public QAbstractTableModel
|
||||
QString GetSourceName(QString station,int matrix,int input,bool *ok);
|
||||
QString GetDestinationName(QString station,int matrix,int output);
|
||||
void UpdateStatus(int line);
|
||||
QString CartText(unsigned cartnum) const;
|
||||
QString CutText(const QString &cutname) const;
|
||||
QString LevelText(int lvl) const;
|
||||
int d_sort_column;
|
||||
Qt::SortOrder d_sort_order;
|
||||
|
Reference in New Issue
Block a user