Ticket #3842: 3842-head-v1.patch
File 3842-head-v1.patch, 12.9 KB (added by , 17 years ago) |
---|
-
libs/libmythtv/videosource.h
110 110 { 111 111 Q_OBJECT 112 112 public: 113 DataDirect_config(const VideoSource& _parent, int _ source = DD_ZAP2IT);113 DataDirect_config(const VideoSource& _parent, int _ddsource); 114 114 115 115 virtual void load(void); 116 116 -
libs/libmythtv/datadirect.h
13 13 14 14 enum DD_PROVIDERS 15 15 { 16 DD_ZAP2IT = 0, 17 DD_PROVIDER_COUNT, 16 DD_ZAP2IT = 0, 17 DD_SCHEDULES_DIRECT = 1, 18 DD_PROVIDER_COUNT = 2, 18 19 }; 19 20 20 21 class DataDirectURLs -
libs/libmythtv/datadirect.cpp
542 542 "http://datadirect.webservices.zap2it.com/tvlistings/xtvdService", 543 543 "http://labs.zap2it.com", 544 544 "/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"); 545 551 providers.push_back(urls0); 552 providers.push_back(urls1); 546 553 547 554 QString tmpDir = "/tmp"; 548 555 tmpPostFile = makeTempFile(tmpDir + "/mythtv_post_XXXXXX"); … … 1083 1090 " channelMinor char(3) )"; 1084 1091 1085 1092 dd_tables["dd_schedule"] = 1086 "( programid char( 12), stationid char(12), "1093 "( programid char(40), stationid char(12), " 1087 1094 " scheduletime datetime, duration time, " 1088 1095 " isrepeat bool, stereo bool, " 1089 1096 " subtitled bool, hdtv bool, " … … 1093 1100 "INDEX progidx (programid) )"; 1094 1101 1095 1102 dd_tables["dd_program"] = 1096 "( programid char( 12) NOT NULL, seriesid char(12), "1103 "( programid char(40) NOT NULL, seriesid char(12), " 1097 1104 " title varchar(120), subtitle varchar(150), " 1098 1105 " description text, mpaarating char(5), " 1099 1106 " starrating char(5), runtime time, " … … 1115 1122 " partnumber int, parttotal int, " 1116 1123 " seriesid char(12), originalairdate date, " 1117 1124 " showtype varchar(30), colorcode varchar(20), " 1118 " syndicatedepisodenumber varchar(20), programid char( 12), "1125 " syndicatedepisodenumber varchar(20), programid char(40), " 1119 1126 " tvrating char(5), mpaarating char(5), " 1120 1127 "INDEX progidx (programid))"; 1121 1128 1122 1129 dd_tables["dd_productioncrew"] = 1123 "( programid char( 12), role char(30), "1130 "( programid char(40), role char(30), " 1124 1131 " givenname char(20), surname char(20), " 1125 1132 " fullname char(41), " 1126 1133 "INDEX progidx (programid), " 1127 1134 "INDEX nameidx (fullname))"; 1128 1135 1129 1136 dd_tables["dd_genre"] = 1130 "( programid char( 12) NOT NULL, class char(30), "1137 "( programid char(40) NOT NULL, class char(30), " 1131 1138 " relevance char(1), " 1132 1139 "INDEX progidx (programid))"; 1133 1140 -
libs/libmythtv/videosource.cpp
20 20 #include <qmap.h> 21 21 #include <qdir.h> 22 22 #include <qprocess.h> 23 #include <qdatetime.h> 23 24 24 25 // MythTV headers 25 26 #include "mythconfig.h" … … 44 45 #include "videodev_myth.h" 45 46 #endif 46 47 48 static bool is_grabber_external(const QString &grabber) 49 { 50 return !(grabber == "datadirect" || 51 grabber == "eitonly" || 52 grabber == "schedulesdirect1" || 53 grabber == "/bin/true"); 54 } 55 47 56 VideoSourceSelector::VideoSourceSelector(uint _initial_sourceid, 48 57 const QString &_card_types, 49 58 bool _must_have_mplexid) : … … 295 304 { 296 305 public: 297 306 DataDirectPassword(const VideoSource &parent) : 298 LineEditSetting(this), VideoSourceDBStorage(this, parent, "password") 307 LineEditSetting(this, true), 308 VideoSourceDBStorage(this, parent, "password") 299 309 { 310 SetPasswordEcho(true); 300 311 setLabel(QObject::tr("Password")); 301 312 } 302 313 }; … … 307 318 { 308 319 (void) uid; 309 320 (void) pwd; 310 (void) _source;311 321 #ifdef USING_BACKEND 312 322 if (uid.isEmpty() || pwd.isEmpty()) 313 323 return; … … 348 358 void DataDirect_config::load() 349 359 { 350 360 VerticalConfigurationGroup::load(); 351 if ((userid->getValue() != lastloadeduserid) || 352 (password->getValue() != lastloadedpassword)) 361 bool is_sd_userid = userid->getValue().contains("@") > 0; 362 bool match = ((is_sd_userid && (source == DD_SCHEDULES_DIRECT)) || 363 (!is_sd_userid && (source == DD_ZAP2IT))); 364 if (((userid->getValue() != lastloadeduserid) || 365 (password->getValue() != lastloadedpassword)) && match) 353 366 { 354 367 lineupselector->fillSelections(userid->getValue(), 355 368 password->getValue(), … … 442 455 "instead of just 'mythfilldatabase'.\nYour grabber does not provide " 443 456 "channel numbers, so you have to set them manually."); 444 457 445 if (grabber != "datadirect" && grabber != "eitonly" && 446 grabber != "/bin/true") 458 if (is_grabber_external(grabber)) 447 459 { 448 460 VERBOSE(VB_IMPORTANT, "\n" << err_msg); 449 461 MythPopupBox::showOkPopup( … … 508 520 // only save settings for the selected grabber 509 521 setSaveAll(false); 510 522 511 addTarget("datadirect", new DataDirect_config(parent)); 512 grabber->addSelection("North America (DataDirect) (Internal)", "datadirect"); 523 addTarget("schedulesdirect1", 524 new DataDirect_config(parent, DD_SCHEDULES_DIRECT)); 525 grabber->addSelection("North America (SchedulesDirect.org) " 526 "(Internal)", "schedulesdirect1"); 513 527 528 #if 1 529 addTarget("datadirect", new DataDirect_config(parent, DD_ZAP2IT)); 530 grabber->addSelection( 531 "North America (TMS Labs) (Internal)", "datadirect"); 532 #endif 533 514 534 addTarget("eitonly", new EITOnly_config(parent)); 515 535 grabber->addSelection("Transmitted guide only (EIT)", "eitonly"); 516 536 -
libs/libmyth/settings.cpp
639 639 connect(edit, SIGNAL(changeHelpText(QString)), cg, 640 640 SIGNAL(changeHelpText(QString))); 641 641 642 edit->setRW(rw); 642 setRW(rw); 643 SetPasswordEcho(password_echo); 643 644 644 645 return widget; 645 646 } … … 664 665 } 665 666 } 666 667 668 void LineEditSetting::SetPasswordEcho(bool b) 669 { 670 password_echo = b; 671 if (edit) 672 edit->setEchoMode(b ? QLineEdit::Password : QLineEdit::Normal); 673 } 674 667 675 QWidget* SliderSetting::configWidget(ConfigurationGroup *cg, QWidget* parent, 668 676 const char* widgetName) { 669 677 QHBox* widget; -
libs/libmyth/mythcontext.h
208 208 209 209 /// Update this whenever the plug-in API changes. 210 210 /// Including changes in the libmythtv class methods used by plug-ins. 211 #define MYTH_BINARY_VERSION "0.20.20070 717-1"211 #define MYTH_BINARY_VERSION "0.20.20070816-1" 212 212 213 213 /** \brief Increment this whenever the MythTV network protocol changes. 214 214 * -
libs/libmyth/settings.h
200 200 { 201 201 protected: 202 202 LineEditSetting(Storage *_storage, bool readwrite = true) : 203 Setting(_storage), edit(NULL), rw(readwrite) { }203 Setting(_storage), edit(NULL), rw(readwrite), password_echo(false) { } 204 204 205 205 public: 206 206 virtual QWidget* configWidget(ConfigurationGroup *cg, QWidget* parent, … … 217 217 218 218 virtual void setEnabled(bool b); 219 219 virtual void setVisible(bool b); 220 virtual void SetPasswordEcho(bool b); 220 221 221 222 private: 222 223 MythLineEdit* edit; 223 224 bool rw; 225 bool password_echo; 224 226 }; 225 227 226 228 // TODO: set things up so that setting the value as a string emits -
programs/mythfilldatabase/filldata.cpp
26 26 // filldata headers 27 27 #include "filldata.h" 28 28 29 bool is_grabber_external(const QString &grabber) 30 { 31 return !(grabber == "datadirect" || 32 grabber == "eitonly" || 33 grabber == "schedulesdirect1" || 34 grabber == "/bin/true"); 35 } 36 37 bool is_grabber_datadirect(const QString &grabber) 38 { 39 return (grabber == "datadirect") || (grabber == "schedulesdirect1"); 40 } 41 42 bool is_grabber_labs(const QString &grabber) 43 { 44 return grabber == "datadirect"; 45 } 46 29 47 // DataDirect stuff 30 48 void FillData::DataDirectStationUpdate(Source source, bool update_icons) 31 49 { … … 44 62 icon_data.UpdateSourceIcons(source.id); 45 63 46 64 // Unselect channels not in users lineup for DVB, HDTV 47 if (!insert_channels && (new_channels > 0)) 65 if (!insert_channels && (new_channels > 0) && 66 is_grabber_labs(source.xmltvgrabber)) 48 67 { 49 68 bool ok0 = (logged_in == source.userid); 50 69 bool ok1 = (raw_lineup == source.id); … … 69 88 70 89 bool FillData::DataDirectUpdateChannels(Source source) 71 90 { 91 if (!is_grabber_labs(source.xmltvgrabber)) 92 { 93 VERBOSE(VB_IMPORTANT, "FillData: We only support " 94 "DataDirectUpdateChannels with TMS Labs channel editor"); 95 return false; 96 } 97 72 98 ddprocessor.SetListingsProvider(DD_ZAP2IT); 73 99 ddprocessor.SetUserID(source.userid); 74 100 ddprocessor.SetPassword(source.password); … … 251 277 252 278 if (xmltv_grabber == "datadirect") 253 279 return grabDDData(source, offset, *qCurrentDate, DD_ZAP2IT); 280 if (xmltv_grabber == "schedulesdirect1") 281 return grabDDData(source, offset, *qCurrentDate, DD_SCHEDULES_DIRECT); 254 282 255 283 char tempfilename[] = "/tmp/mythXXXXXX"; 256 284 if (mkstemp(tempfilename) == -1) … … 486 514 487 515 bool hasprefmethod = false; 488 516 489 if ( xmltv_grabber != "datadirect")517 if (is_grabber_external(xmltv_grabber)) 490 518 { 491 519 492 520 QProcess grabber_capabilities_proc(xmltv_grabber); … … 584 612 } 585 613 } 586 614 587 need_post_grab_proc |= (xmltv_grabber != "datadirect");615 need_post_grab_proc |= !is_grabber_datadirect(xmltv_grabber); 588 616 589 if ( (xmltv_grabber == "datadirect") && dd_grab_all)617 if (is_grabber_labs(xmltv_grabber) && dd_grab_all) 590 618 { 591 619 if (only_update_channels) 592 620 DataDirectUpdateChannels(*it); … … 601 629 if (!grabData(*it, 0)) 602 630 ++failures; 603 631 } 604 else if ((*it).xmltvgrabber_baseline || xmltv_grabber == "datadirect") 632 else if ((*it).xmltvgrabber_baseline || 633 is_grabber_datadirect(xmltv_grabber)) 605 634 { 606 635 607 636 QDate qCurrentDate = QDate::currentDate(); … … 612 641 613 642 if (maxDays > 0) // passed with --max-days 614 643 grabdays = maxDays; 615 else if ( xmltv_grabber == "datadirect")644 else if (is_grabber_datadirect(xmltv_grabber)) 616 645 grabdays = 14; 617 646 618 647 grabdays = (only_update_channels) ? 1 : grabdays; … … 620 649 if (grabdays == 1) 621 650 refresh_today = true; 622 651 623 if ( (xmltv_grabber == "datadirect") && only_update_channels)652 if (is_grabber_labs(xmltv_grabber) && only_update_channels) 624 653 { 625 654 DataDirectUpdateChannels(*it); 626 655 grabdays = 0; -
programs/mythfilldatabase/main.cpp
579 579 newsource.xmltvgrabber_prefmethod = ""; 580 580 581 581 sourcelist.append(newsource); 582 if (newsource.xmltvgrabber == "datadirect") 583 usingDataDirect = true; 582 usingDataDirect = 583 ((newsource.xmltvgrabber == "datadirect") || 584 (newsource.xmltvgrabber == "schedulesdirect1")); 584 585 } 585 586 } 586 587 else