Example #1
0
/**
*  \brief Creates a dialog for editing the recording schedule
*/
void ScheduleCommon::EditScheduled(RecordingInfo *recinfo)
{
    MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
    ScheduleEditor *schededit = new ScheduleEditor(mainStack, recinfo);
    if (schededit->Create())
        mainStack->AddScreen(schededit);
    else
    {
        delete schededit;
        ShowOkPopup(tr("Recording rule does not exist."));
    }
}
void MainWindow::on_RunDialogBt_clicked()
{
    if (ui->FunctionsLW->currentIndex().row() == 0) {
        ScheduleEditor *sched = new ScheduleEditor(this);
        sched->show();
//    } else if (ui->FunctionsLW->currentIndex().row() == 1) {
//        ui->Description_l->setText(QString::fromUtf8("Выбранный вами модуль находится в разработке."));
    } else if (ui->FunctionsLW->currentIndex().row() == 1) {
        ReferenceEditor *sett = new ReferenceEditor(this);
        sett->show();
    } else if (ui->FunctionsLW->currentIndex().row() == 2) {
        SettingsEditor *sett = new SettingsEditor();
        sett->show();
    } else if (ui->FunctionsLW->currentIndex().row() == 3)
        info();
}
Example #3
0
void ManualSchedule::recordClicked(void)
{
    QDateTime endts = m_startDateTime
        .addSecs(max(m_durationSpin->GetIntValue() * 60, 60));

    ProgramInfo p(m_titleEdit->GetText().trimmed(),
                  m_chanids[m_channelList->GetCurrentPos()],
                  m_startDateTime, endts);

    RecordingRule *record = new RecordingRule();
    record->LoadByProgram(&p);
    record->m_searchType = kManualSearch;

    MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
    ScheduleEditor *schededit = new ScheduleEditor(mainStack, record);
    if (schededit->Create())
    {
        mainStack->AddScreen(schededit);
        connect(schededit, SIGNAL(ruleSaved(int)), SLOT(scheduleCreated(int)));
    }
    else
        delete schededit;
}
Example #4
0
void ProgramRecPriority::newTemplate(QString category)
{
    category = category.trimmed();
    if (category.isEmpty())
        return;

    // Try to find an existing template and use it.
    QMap<int, ProgramRecPriorityInfo>::Iterator it;
    for (it = m_programData.begin(); it != m_programData.end(); ++it)
    {
        ProgramRecPriorityInfo *progInfo = &(*it);
        if (progInfo->GetRecordingRuleType() == kTemplateRecord &&
            category.compare(progInfo->GetCategory(),
                             Qt::CaseInsensitive) == 0)
        {
            m_programList->SetValueByData(qVariantFromValue(progInfo));
            edit(m_programList->GetItemCurrent());
            return;
        }
    }

    RecordingRule *record = new RecordingRule();
    if (!record)
        return;
    record->MakeTemplate(category);

    MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
    ScheduleEditor *schededit = new ScheduleEditor(mainStack, record);
    if (schededit->Create())
    {
        mainStack->AddScreen(schededit);
        connect(schededit, SIGNAL(ruleSaved(int)), SLOT(scheduleChanged(int)));
        connect(schededit, SIGNAL(ruleDeleted(int)), SLOT(scheduleChanged(int)));
    }
    else
        delete schededit;
}