Ticket #3842: 3842-fixes-v1.patch

File 3842-fixes-v1.patch, 12.8 KB (added by danielk, 17 years ago)

Same patch backported to 0.20-fixes

  • libs/libmythtv/videosource.h

     
    6262{
    6363    Q_OBJECT
    6464  public:
    65     DataDirect_config(const VideoSource& _parent, int _source = DD_ZAP2IT);
     65    DataDirect_config(const VideoSource& _parent, int _ddsource);
    6666
    6767    virtual void load(void);
    6868
  • libs/libmythtv/datadirect.h

     
    1111
    1212enum DD_PROVIDERS
    1313{
    14     DD_ZAP2IT = 0,
    15     DD_PROVIDER_COUNT,
     14    DD_ZAP2IT           = 0,
     15    DD_SCHEDULES_DIRECT = 1,
     16    DD_PROVIDER_COUNT   = 2,
    1617};
    1718
    1819class DataDirectURLs
  • libs/libmythtv/datadirect.cpp

     
    542542        "http://datadirect.webservices.zap2it.com/tvlistings/xtvdService",
    543543        "http://labs.zap2it.com",
    544544        "/ztvws/ztvws_login/1,1059,TMS01-1,00.html");
     545    DataDirectURLs urls1(
     546        "Schedules Direct",
     547        "http://webservices.schedulesdirect.tmsdatadirect.com"
     548        "/schedulesdirect/tvlistings/xtvdService",
     549        "http://schedulesdirect.org",
     550        "/login/index.php");
    545551    providers.push_back(urls0);
     552    providers.push_back(urls1);
    546553
    547554    QString tmpDir = "/tmp";
    548555    tmpPostFile   = makeTempFile(tmpDir + "/mythtv_post_XXXXXX");
     
    10181025        "  channelMinor char(3) )";
    10191026
    10201027    dd_tables["dd_schedule"] =
    1021         "( programid char(12),           stationid char(12), "
     1028        "( programid char(40),           stationid char(12), "
    10221029        "  scheduletime datetime,        duration time,      "
    10231030        "  isrepeat bool,                stereo bool,        "
    10241031        "  subtitled bool,               hdtv bool,          "
     
    10281035        "INDEX progidx (programid) )";
    10291036
    10301037    dd_tables["dd_program"] =
    1031         "( programid char(12) NOT NULL,  seriesid char(12),     "
     1038        "( programid char(40) NOT NULL,  seriesid char(12),     "
    10321039        "  title varchar(120),           subtitle varchar(150), "
    10331040        "  description text,             mpaarating char(5),    "
    10341041        "  starrating char(5),           runtime time,          "
     
    10501057        "  partnumber int,               parttotal int,               "
    10511058        "  seriesid char(12),            originalairdate date,        "
    10521059        "  showtype varchar(30),         colorcode varchar(20),       "
    1053         "  syndicatedepisodenumber varchar(20), programid char(12),   "
     1060        "  syndicatedepisodenumber varchar(20), programid char(40),   "
    10541061        "  tvrating char(5),             mpaarating char(5),          "
    10551062        "INDEX progidx (programid))";
    10561063
    10571064    dd_tables["dd_productioncrew"] =
    1058         "( programid char(12),           role char(30),    "
     1065        "( programid char(40),           role char(30),    "
    10591066        "  givenname char(20),           surname char(20), "
    10601067        "  fullname char(41), "
    10611068        "INDEX progidx (programid), "
    10621069        "INDEX nameidx (fullname))";
    10631070
    10641071    dd_tables["dd_genre"] =
    1065         "( programid char(12) NOT NULL,  class char(30), "
     1072        "( programid char(40) NOT NULL,  class char(30), "
    10661073        "  relevance char(1), "
    10671074        "INDEX progidx (programid))";
    10681075
  • libs/libmythtv/videosource.cpp

     
    1919#include <qmap.h>
    2020#include <qdir.h>
    2121#include <qprocess.h>
     22#include <qdatetime.h>
    2223
    2324// MythTV headers
    2425#include "mythconfig.h"
     
    4243#include "videodev_myth.h"
    4344#endif
    4445
     46static bool is_grabber_external(const QString &grabber)
     47{
     48    return !(grabber == "datadirect" ||
     49             grabber == "eitonly" ||
     50             grabber == "schedulesdirect1" ||
     51             grabber == "/bin/true");
     52}
     53
    4554class RecorderOptions: public ConfigurationWizard
    4655{
    4756  public:
     
    148157class DataDirectPassword: public LineEditSetting, public VSSetting {
    149158  public:
    150159    DataDirectPassword(const VideoSource& parent):
    151         VSSetting(parent, "password") {
     160        VSSetting(parent, "password")
     161    {
     162        SetPasswordEcho(true);
    152163        setLabel(QObject::tr("Password"));
    153164    };
    154165};
     
    159170{
    160171    (void) uid;
    161172    (void) pwd;
    162     (void) _source;
    163173#ifdef USING_BACKEND
    164174    if (uid.isEmpty() || pwd.isEmpty())
    165175        return;
     
    200210void DataDirect_config::load()
    201211{
    202212    VerticalConfigurationGroup::load();
    203     if ((userid->getValue() != lastloadeduserid) ||
    204         (password->getValue() != lastloadedpassword))
     213    bool is_sd_userid = userid->getValue().contains("@") > 0;
     214    bool match = ((is_sd_userid  && (source == DD_SCHEDULES_DIRECT)) ||
     215                  (!is_sd_userid && (source == DD_ZAP2IT)));
     216    if (((userid->getValue() != lastloadeduserid) ||
     217         (password->getValue() != lastloadedpassword)) && match)
    205218    {
    206219        lineupselector->fillSelections(userid->getValue(),
    207220                                       password->getValue(),
     
    296309        "instead of just 'mythfilldatabase'.\nYour grabber does not provide "
    297310        "channel numbers, so you have to set them manually.");
    298311
    299     if (grabber != "datadirect" && grabber != "eitonly" &&
    300         grabber != "/bin/true")
     312    if (is_grabber_external(grabber))
    301313    {
    302314        VERBOSE(VB_IMPORTANT, "\n" << err_msg);
    303315        MythPopupBox::showOkPopup(
     
    365377    // only save settings for the selected grabber
    366378    setSaveAll(false);
    367379
    368     addTarget("datadirect", new DataDirect_config(parent));
    369     grabber->addSelection("North America (DataDirect) (Internal)", "datadirect");
     380    addTarget("schedulesdirect1",
     381              new DataDirect_config(parent, DD_SCHEDULES_DIRECT));
     382    grabber->addSelection("North America (SchedulesDirect.org) "
     383                          "(Internal)", "schedulesdirect1");
    370384
     385#if 1
     386    addTarget("datadirect", new DataDirect_config(parent, DD_ZAP2IT));
     387    grabber->addSelection(
     388        "North America (TMS Labs) (Internal)", "datadirect");
     389#endif
     390
    371391    addTarget("eitonly", new EITOnly_config(parent));
    372392    grabber->addSelection("Transmitted guide only (EIT)", "eitonly");
    373393
  • libs/libmyth/settings.cpp

     
    494494        connect(edit, SIGNAL(changeHelpText(QString)), cg,
    495495                SIGNAL(changeHelpText(QString)));
    496496
    497     edit->setRW(rw);
     497    setRW(rw);
     498    SetPasswordEcho(password_echo);
    498499
    499500    return widget;
    500501}
     
    519520    }
    520521}
    521522
     523void LineEditSetting::SetPasswordEcho(bool b)
     524{
     525    password_echo = b;
     526    if (edit)
     527        edit->setEchoMode(b ? QLineEdit::Password : QLineEdit::Normal);
     528}
     529
    522530QWidget* SliderSetting::configWidget(ConfigurationGroup *cg, QWidget* parent,
    523531                                     const char* widgetName) {
    524532    QHBox* widget;
  • libs/libmyth/mythcontext.h

     
    224224
    225225/// Update this whenever the plug-in API changes.
    226226/// Including changes in the libmythtv class methods used by plug-ins.
    227 #define MYTH_BINARY_VERSION "0.20.20060828-4"
     227#define MYTH_BINARY_VERSION "0.20.20070816-2"
    228228
    229229/** \brief Increment this whenever the MythTV network protocol changes.
    230230 *
  • libs/libmyth/settings.h

     
    276276
    277277class LineEditSetting: virtual public Setting {
    278278protected:
    279     LineEditSetting(bool readwrite = true) : edit(NULL) { rw = readwrite; };
     279    LineEditSetting(bool readwrite = true) :
     280        edit(NULL), rw(readwrite),  password_echo(false) { }
    280281public:
    281282    virtual QWidget* configWidget(ConfigurationGroup *cg, QWidget* parent,
    282283                                  const char* widgetName = 0);
     
    292293
    293294    virtual void setEnabled(bool b);
    294295    virtual void setVisible(bool b);
     296    virtual void SetPasswordEcho(bool b);
    295297
    296298private:
    297299    MythLineEdit* edit;
    298300    bool rw;
     301    bool password_echo;
    299302};
    300303
    301304// TODO: set things up so that setting the value as a string emits
  • programs/mythfilldatabase/filldata.cpp

     
    834834    return insert_channels;
    835835}
    836836
     837bool is_grabber_external(const QString &grabber)
     838{
     839    return !(grabber == "datadirect" ||
     840             grabber == "eitonly" ||
     841             grabber == "schedulesdirect1" ||
     842             grabber == "/bin/true");
     843}
     844
     845bool is_grabber_datadirect(const QString &grabber)
     846{
     847    return (grabber == "datadirect") || (grabber == "schedulesdirect1");
     848}
     849
     850bool is_grabber_labs(const QString &grabber)
     851{
     852    return grabber == "datadirect";
     853}
     854
    837855// DataDirect stuff
    838856void DataDirectStationUpdate(Source source, bool update_icons = true)
    839857{
     
    852870        UpdateSourceIcons(source.id);
    853871
    854872    // Unselect channels not in users lineup for DVB, HDTV
    855     if (!insert_channels && (new_channels > 0))
     873    if (!insert_channels && (new_channels > 0) &&
     874        is_grabber_labs(source.xmltvgrabber))
    856875    {
    857876        bool ok0 = (logged_in == source.userid);
    858877        bool ok1 = (raw_lineup == source.id);
     
    877896
    878897bool DataDirectUpdateChannels(Source source)
    879898{
     899    if (!is_grabber_labs(source.xmltvgrabber))
     900    {
     901        VERBOSE(VB_IMPORTANT, "FillData: We only support "
     902                "DataDirectUpdateChannels with TMS Labs channel editor");
     903        return false;
     904    }
     905
    880906    ddprocessor.SetListingsProvider(DD_ZAP2IT);
    881907    ddprocessor.SetUserID(source.userid);
    882908    ddprocessor.SetPassword(source.password);
     
    25312557
    25322558    if (xmltv_grabber == "datadirect")
    25332559        return grabDDData(source, offset, *qCurrentDate, DD_ZAP2IT);
     2560    else if (xmltv_grabber == "schedulesdirect1")
     2561        return grabDDData(source, offset, *qCurrentDate, DD_SCHEDULES_DIRECT);
    25342562    else if (xmltv_grabber == "technovera")
    25352563    {
    25362564        VERBOSE(VB_ALL, "This grabber is no longer supported");
     
    28572885                                  .arg((*it).xmltvgrabber));
    28582886
    28592887        QString xmltv_grabber = (*it).xmltvgrabber;
    2860         need_post_grab_proc |= (xmltv_grabber != "datadirect");
     2888        need_post_grab_proc |= !is_grabber_datadirect(xmltv_grabber);
    28612889
    28622890        if (xmltv_grabber == "tv_grab_uk" || xmltv_grabber == "tv_grab_uk_rt" ||
    28632891            xmltv_grabber == "tv_grab_fi" || xmltv_grabber == "tv_grab_es" ||
     
    28722900            if (!grabData(*it, 0))
    28732901                ++failures;
    28742902        }
    2875         else if ((xmltv_grabber == "datadirect") && dd_grab_all)
     2903        else if (is_grabber_labs(xmltv_grabber) && dd_grab_all)
    28762904        {
    28772905            if (only_update_channels)
    28782906                DataDirectUpdateChannels(*it);
     
    28822910                grabData(*it, 0, &qCurrentDate);
    28832911            }
    28842912        }
    2885         else if (xmltv_grabber == "datadirect" ||
     2913        else if (is_grabber_datadirect(xmltv_grabber) ||
    28862914                 xmltv_grabber == "tv_grab_se_swedb" ||
    28872915                 xmltv_grabber == "tv_grab_no" ||
    28882916                 xmltv_grabber == "tv_grab_de_tvtoday" ||
     
    29062934            // often decided by the person maintaining the grabbers.
    29072935            if (maxDays > 0) // passed with --max-days
    29082936                grabdays = maxDays;
    2909             else if (xmltv_grabber == "datadirect")
     2937            else if (is_grabber_datadirect(xmltv_grabber))
    29102938                grabdays = 14;
    29112939            else if (xmltv_grabber == "tv_grab_se_swedb")
    29122940                grabdays = 10;
     
    29222950            if (grabdays == 1)
    29232951                refresh_today = true;
    29242952
    2925             if ((xmltv_grabber == "datadirect") && only_update_channels)
     2953            if (is_grabber_labs(xmltv_grabber) && only_update_channels)
    29262954            {
    29272955                DataDirectUpdateChannels(*it);
    29282956                grabdays = 0;
     
    38603888                       newsource.lineupid = sourcequery.value(5).toString();
    38613889
    38623890                       sourcelist.append(newsource);
    3863                        if (newsource.xmltvgrabber == "datadirect")
    3864                            usingDataDirect = true;
     3891                       usingDataDirect =
     3892                           is_grabber_datadirect(newsource.xmltvgrabber);
     3893                           
    38653894                  }
    38663895             }
    38673896             else