Ticket #1653: mythtv-frequency_table_comboboxes.patch

File mythtv-frequency_table_comboboxes.patch, 3.0 KB (added by sphery <mtdean@…>, 14 years ago)

Different approach for populating comboboxes (fixes the original issue with a different approach)

  • usr/local/src/mdean/Myth/src/mythtv/setup/backendsettings.cpp

     
    11#include <cstdio>
    22
    33#include "backendsettings.h"
     4#include "frequencies.h"
    45#include "libmyth/mythcontext.h"
    56#include "libmyth/settings.h"
    67#include <unistd.h>
     
    110111{
    111112    GlobalComboBox *gc = new GlobalComboBox("FreqTable");
    112113    gc->setLabel(QObject::tr("Channel frequency table"));
    113     gc->addSelection("us-cable");
    114     gc->addSelection("us-bcast");
    115     gc->addSelection("us-cable-hrc");
    116     gc->addSelection("us-cable-irc");
    117     gc->addSelection("japan-bcast");
    118     gc->addSelection("japan-cable");
    119     gc->addSelection("europe-west");
    120     gc->addSelection("europe-east");
    121     gc->addSelection("italy");
    122     gc->addSelection("newzealand");
    123     gc->addSelection("australia");
    124     gc->addSelection("ireland");
    125     gc->addSelection("france");
    126     gc->addSelection("china-bcast");
    127     gc->addSelection("southafrica");
    128     gc->addSelection("argentina");
    129     gc->addSelection("australia-optus");
     114
     115    int i = 0;
     116    char *listname = NULL;
     117    while ((listname = (char *)chanlists[i].name) != NULL)
     118    {
     119        gc->addSelection(listname);
     120        i++;
     121    }
     122
    130123    gc->setHelpText(QObject::tr("Select the appropriate frequency table for "
    131124                    "your system.  If you have an antenna, use a \"-bcast\" "
    132125                    "frequency."));
  • usr/local/src/mdean/Myth/src/mythtv/libs/libmythtv/videosource.cpp

     
    2929#include "scanwizard.h"
    3030#include "cardutil.h"
    3131#include "sourceutil.h"
     32#include "frequencies.h"
    3233
    3334#ifdef USING_DVB
    3435#include <linux/dvb/frontend.h>
     
    116117{
    117118    setLabel(QObject::tr("Channel frequency table"));
    118119    addSelection("default");
    119     addSelection("us-cable");
    120     addSelection("us-bcast");
    121     addSelection("us-cable-hrc");
    122     addSelection("japan-bcast");
    123     addSelection("japan-cable");
    124     addSelection("europe-west");
    125     addSelection("europe-east");
    126     addSelection("italy");
    127     addSelection("newzealand");
    128     addSelection("australia");
    129     addSelection("ireland");
    130     addSelection("france");
    131     addSelection("china-bcast");
    132     addSelection("southafrica");
    133     addSelection("argentina");
    134     addSelection("australia-optus");
     120
     121    int i = 0;
     122    char *listname = NULL;
     123    while ((listname = (char *)chanlists[i].name) != NULL)
     124    {
     125        addSelection(listname);
     126        i++;
     127    }
     128
    135129    setHelpText(QObject::tr("Use default unless this source uses a "
    136130                "different frequency table than the system wide table "
    137131                "defined in the General settings."));