Ticket #435: rename_recordings.patch

File rename_recordings.patch, 5.3 KB (added by Aaron McCarthy <mccarthy.aaron@…>, 20 years ago)
  • libs/libmythtv/programinfo.h

     
    145145    void FinishedRecording(bool prematurestop);
    146146    void UpdateRecordingEnd(void);
    147147    void ApplyRecordRecGroupChange(const QString &newrecgroup);
     148    void ApplyRecordRecTitleChange(const QString &newTitle,
     149                                   const QString &newSubtitle);
    148150
    149151    // Quick gets
    150152    QString CreateRecordBasename(const QString &ext) const;
  • libs/libmythtv/programinfo.cpp

     
    987987    recgroup = newrecgroup;
    988988}
    989989
     990/** \fn ProgramInfo::ApplyRecordRecTitleChange(const QString &newTitle, const QString &newSubtitle)
     991 *  \brief Sets the recording title and subtitle, both in this ProgramInfo
     992 *         and in the database.
     993 *  \param newTitle New recording title.
     994 *  \param newSubtitle New recording subtitle
     995 */
     996void ProgramInfo::ApplyRecordRecTitleChange(const QString &newTitle, const QString &newSubtitle)
     997{
     998    MSqlQuery query(MSqlQuery::InitCon());
     999
     1000    query.prepare("UPDATE recorded"
     1001                  " SET title = :TITLE, subtitle = :SUBTITLE"
     1002                  " WHERE chanid = :CHANID"
     1003                  " AND starttime = :START ;");
     1004    query.bindValue(":TITLE", newTitle.utf8());
     1005    query.bindValue(":SUBTITLE", newSubtitle.utf8());
     1006    query.bindValue(":CHANID", chanid);
     1007    query.bindValue(":START", recstartts.toString("yyyyMMddhhmm00"));
     1008
     1009    if (!query.exec())
     1010        MythContext::DBError("RecTitle update", query);
     1011
     1012    title = newTitle;
     1013    subtitle = newSubtitle;
     1014}
     1015
     1016
    9901017/** \fn ProgramInfo::ToggleRecord()
    9911018 *  \brief Cycles through recording types.
    9921019 *
  • programs/mythfrontend/playbackbox.cpp

     
    23812381    QButton *changeButton = popup->addButton(tr("Change Recording Group"), this,
    23822382                     SLOT(showRecGroupChanger()));
    23832383
     2384    popup->addButton(tr("Change Recording Title"), this,
     2385                     SLOT(showRecTitleChanger()));
     2386
    23842387    popup->addButton(tr("Edit Recording Schedule"), this,
    23852388                     SLOT(doEditScheduled()));
    23862389   
     
    39953998    closeRecGroupPopup(result == MythDialog::Accepted);
    39963999}
    39974000
     4001void PlaybackBox::showRecTitleChanger()
     4002{
     4003    if (!expectingPopup)
     4004        return;
     4005
     4006    cancelPopup();
     4007
     4008    initRecGroupPopup(tr("Change Recording Title"), "showRecTitleChanger");
     4009
     4010    recGroupPopup->addLabel(tr("Title"));
     4011    recGroupLineEdit = new MythLineEdit(recGroupPopup);
     4012    recGroupLineEdit->setText(delitem->title);
     4013    recGroupLineEdit->selectAll();
     4014    recGroupPopup->addWidget(recGroupLineEdit);
     4015
     4016    recGroupPopup->addLabel(tr("Subtitle"));
     4017    recGroupLineEdit1 = new MythLineEdit(recGroupPopup);
     4018    recGroupLineEdit1->setText(delitem->subtitle);
     4019    recGroupLineEdit1->selectAll();
     4020    recGroupPopup->addWidget(recGroupLineEdit1);
     4021
     4022    recGroupLineEdit->setFocus();
     4023
     4024    connect(recGroupLineEdit, SIGNAL(returnPressed()), recGroupPopup, SLOT(accept()));
     4025    connect(recGroupLineEdit1, SIGNAL(returnPressed()), recGroupPopup, SLOT(accept()));
     4026
     4027    int result = recGroupPopup->ExecPopup();
     4028
     4029    if (result == MythDialog::Accepted)
     4030        setRecTitle();
     4031
     4032    closeRecGroupPopup(result == MythDialog::Accepted);
     4033
     4034    delete delitem;
     4035    delitem = NULL;
     4036}
     4037
    39984038void PlaybackBox::setRecGroup(void)
    39994039{
    40004040    QString newRecGroup = recGroupLineEdit->text();
     
    40224062    }
    40234063}
    40244064
     4065void PlaybackBox::setRecTitle()
     4066{
     4067    QString newRecTitle = recGroupLineEdit->text();
     4068    QString newRecSubtitle = recGroupLineEdit1->text();
     4069
     4070    if (newRecTitle == "")
     4071        return;
     4072
     4073    delitem->ApplyRecordRecTitleChange(newRecTitle, newRecSubtitle);
     4074
     4075    inTitle = gContext->GetNumSetting("PlaybackBoxStartInTitle", 0);
     4076    titleIndex = 0;
     4077    progIndex = 0;
     4078
     4079    connected = FillList();
     4080    skipUpdate = false;
     4081    update(fullRect);
     4082}
     4083
    40254084void PlaybackBox::recGroupChangerListBoxChanged(void)
    40264085{
    40274086    if (!recGroupPopup || !recGroupListBox || !recGroupLineEdit)
  • programs/mythfrontend/playbackbox.h

     
    5656    void showMenu();
    5757    void showActionsSelected();
    5858    void showRecGroupChanger();
     59    void showRecTitleChanger();
    5960    void showRecGroupChooser();
    6061    void showRecGroupPasswordChanger();
    6162    void showPlayFromPopup();
     
    99100    void recGroupChangerListBoxChanged(void);
    100101    void recGroupChooserListBoxChanged(void);
    101102    void setRecGroup(void);
     103    void setRecTitle(void);
    102104    void setRecGroupPassword();
    103105    void recGroupOldPasswordChanged(const QString &newText);
    104106
     
    293295    MythPopupBox *recGroupPopup;
    294296    MythListBox *recGroupListBox;
    295297    MythLineEdit *recGroupLineEdit;
     298    MythLineEdit *recGroupLineEdit1;
    296299    MythLineEdit *recGroupOldPassword;
    297300    MythLineEdit *recGroupNewPassword;
    298301    MythPushButton *recGroupOkButton;