Skip to content

Commit

Permalink
Don't show the "Preset tuner to channel" option in mythtv-setup, if the
Browse files Browse the repository at this point in the history
input type is not a tuner.

Fixes #11761
  • Loading branch information
jpoet committed Aug 18, 2013
1 parent 137ca04 commit a3cdcf5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
9 changes: 4 additions & 5 deletions mythtv/libs/libmythtv/cardutil.cpp
Expand Up @@ -1109,7 +1109,7 @@ QString CardUtil::GetStartInput(uint nCardID)
MSqlQuery query(MSqlQuery::InitCon());
query.prepare("SELECT inputname "
"FROM cardinput "
"WHERE cardinput.cardid = :CARDID "
"WHERE cardinput.cardid = :CARDID "
"ORDER BY livetvorder = 0, livetvorder, cardinputid "
"LIMIT 1");
query.bindValue(":CARDID", nCardID);
Expand Down Expand Up @@ -2072,7 +2072,6 @@ void CardUtil::GetCardInputs(
vector<CardInput*> &cardInputs)
{
QStringList inputs;
bool is_dtv = !IsEncoder(cardtype) && !IsUnscanable(cardtype);

if (IsSingleInputCard(cardtype))
inputs += "MPEG2TS";
Expand All @@ -2084,7 +2083,7 @@ void CardUtil::GetCardInputs(
QStringList::iterator it = inputs.begin();
for (; it != inputs.end(); ++it)
{
CardInput *cardinput = new CardInput(is_dtv, false, false, cardid);
CardInput *cardinput = new CardInput(cardtype, false, cardid);
cardinput->loadByInput(cardid, (*it));
inputLabels.push_back(
dev_label + QString(" (%1) -> %2")
Expand All @@ -2103,7 +2102,7 @@ void CardUtil::GetCardInputs(
InputNames::const_iterator it;
for (it = list.begin(); it != list.end(); ++it)
{
CardInput *cardinput = new CardInput(is_dtv, true, false, cardid);
CardInput *cardinput = new CardInput(cardtype, false, cardid);
cardinput->loadByInput(cardid, *it);
inputLabels.push_back(
dev_label + QString(" (%1) -> %2")
Expand All @@ -2114,7 +2113,7 @@ void CardUtil::GetCardInputs(
// plus add one "new" input
if (needs_conf)
{
CardInput *newcard = new CardInput(is_dtv, true, true, cardid);
CardInput *newcard = new CardInput(cardtype, true, cardid);
QString newname = QString("DVBInput #%1").arg(list.size() + 1);
newcard->loadByInput(cardid, newname);
inputLabels.push_back(dev_label + " " + QObject::tr("New Input"));
Expand Down
9 changes: 5 additions & 4 deletions mythtv/libs/libmythtv/videosource.cpp
Expand Up @@ -2860,7 +2860,7 @@ class DishNetEIT : public CheckBoxSetting, public CardInputDBStorage
};
};

CardInput::CardInput(bool isDTVcard, bool isDVBcard,
CardInput::CardInput(const QString & cardtype,
bool isNewInput, int _cardid) :
id(new ID()),
cardid(new CardID(*this)),
Expand Down Expand Up @@ -2891,17 +2891,18 @@ CardInput::CardInput(bool isDTVcard, bool isDVBcard,
basic->addChild(new InputDisplayName(*this));
basic->addChild(sourceid);

if (!isDTVcard)
if (CardUtil::IsEncoder(cardtype) || CardUtil::IsUnscanable(cardtype))
{
basic->addChild(new ExternalChannelCommand(*this));
basic->addChild(new PresetTuner(*this));
if (!CardUtil::IsEncoder(cardtype))
basic->addChild(new PresetTuner(*this));
}
else
{
ConfigurationGroup *chgroup =
new HorizontalConfigurationGroup(false, false, true, true);
chgroup->addChild(new QuickTune(*this));
if (isDVBcard)
if ("DVB" == cardtype)
chgroup->addChild(new DishNetEIT(*this));
basic->addChild(chgroup);
}
Expand Down
3 changes: 1 addition & 2 deletions mythtv/libs/libmythtv/videosource.h
Expand Up @@ -785,8 +785,7 @@ class CardInput : public QObject, public ConfigurationWizard
{
Q_OBJECT
public:
CardInput(bool is_dtv_card, bool is_dvb_card,
bool is_new_input, int cardid);
CardInput(const QString & cardtype, bool is_new_input, int cardid);
~CardInput();

int getInputID(void) const { return id->intValue(); };
Expand Down

0 comments on commit a3cdcf5

Please sign in to comment.