Example #1
0
bool UIListBtnType::incSearchStart(void)
{
    MythPopupBox *popup = new MythPopupBox(GetMythMainWindow(),
                                           "incserach_popup");

    QLabel *caption = popup->addLabel(tr("Search"), MythPopupBox::Large);
    caption->setAlignment(Qt::AlignCenter);

    MythComboBox *modeCombo = new MythComboBox(false, popup, "mode_combo" );
    modeCombo->insertItem(tr("Starts with text"));
    modeCombo->insertItem(tr("Contains text"));
    popup->addWidget(modeCombo);

    MythLineEdit *searchEdit = new MythLineEdit(false, popup, "mode_combo");
    searchEdit->setText(m_incSearch);
    popup->addWidget(searchEdit);
    searchEdit->setFocus();

    popup->addButton(tr("Search"));
    popup->addButton(tr("Cancel"), popup, SLOT(reject()));

    DialogCode res = popup->ExecPopup();

    if (kDialogCodeButton0 == res)
    {
        m_incSearch = searchEdit->text();
        m_bIncSearchContains = (modeCombo->currentIndex() == 1);
        incSearchNext();
    }

    popup->hide();
    popup->deleteLater();

    return (kDialogCodeButton0 == res);
}
Example #2
0
SGPopupResult StorageGroupPopup::showPopup(MythMainWindow *parent,
                                 QString title, QString message, QString& text)
{
    MythPopupBox *popup = new MythPopupBox(parent, title.toAscii().constData());
    popup->addLabel(message);

    MythLineEdit *textEdit = new MythLineEdit(popup, "chooseEdit");
    textEdit->setText(text);
    popup->addWidget(textEdit);

    popup->addButton(QObject::tr("OK"),     popup, SLOT(accept()));
    popup->addButton(QObject::tr("Cancel"), popup, SLOT(reject()));

    textEdit->setFocus();

    bool ok = (MythDialog::Accepted == popup->ExecPopup());
    if (ok)
    {
        text = textEdit->text();
        text.detach();
    }

    popup->hide();
    popup->deleteLater();

    return (ok) ? SGPopup_OK : SGPopup_CANCEL;
}
Example #3
0
bool DeviceTree::RunTypeDialog(DiSEqCDevDevice::dvbdev_t &type)
{
    MythPopupBox *popup = new MythPopupBox(GetMythMainWindow(), "");
    popup->addLabel(tr("Select Type of Device"));

    MythListBox *list = new MythListBox(popup);
    list->insertItem(tr("Switch"));
    list->insertItem(tr("Rotor"));
    list->insertItem(tr("Unicable"));
    list->insertItem(tr("LNB"));
    list->setCurrentRow(0, QItemSelectionModel::Select);

    popup->addWidget(list);
    connect(list,  SIGNAL(accepted(int)),
            popup, SLOT(  AcceptItem(int)));
    list->setFocus();

    DialogCode res = popup->ExecPopup();
    type = (DiSEqCDevDevice::dvbdev_t)(list->currentRow());

    popup->hide();
    popup->deleteLater();

    return kDialogCodeRejected != res;
}