Ticket #3842: 3842-fixes-v1.patch
File 3842-fixes-v1.patch, 12.8 KB (added by , 17 years ago) |
---|
-
libs/libmythtv/videosource.h
62 62 { 63 63 Q_OBJECT 64 64 public: 65 DataDirect_config(const VideoSource& _parent, int _ source = DD_ZAP2IT);65 DataDirect_config(const VideoSource& _parent, int _ddsource); 66 66 67 67 virtual void load(void); 68 68 -
libs/libmythtv/datadirect.h
11 11 12 12 enum DD_PROVIDERS 13 13 { 14 DD_ZAP2IT = 0, 15 DD_PROVIDER_COUNT, 14 DD_ZAP2IT = 0, 15 DD_SCHEDULES_DIRECT = 1, 16 DD_PROVIDER_COUNT = 2, 16 17 }; 17 18 18 19 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"); … … 1018 1025 " channelMinor char(3) )"; 1019 1026 1020 1027 dd_tables["dd_schedule"] = 1021 "( programid char( 12), stationid char(12), "1028 "( programid char(40), stationid char(12), " 1022 1029 " scheduletime datetime, duration time, " 1023 1030 " isrepeat bool, stereo bool, " 1024 1031 " subtitled bool, hdtv bool, " … … 1028 1035 "INDEX progidx (programid) )"; 1029 1036 1030 1037 dd_tables["dd_program"] = 1031 "( programid char( 12) NOT NULL, seriesid char(12), "1038 "( programid char(40) NOT NULL, seriesid char(12), " 1032 1039 " title varchar(120), subtitle varchar(150), " 1033 1040 " description text, mpaarating char(5), " 1034 1041 " starrating char(5), runtime time, " … … 1050 1057 " partnumber int, parttotal int, " 1051 1058 " seriesid char(12), originalairdate date, " 1052 1059 " showtype varchar(30), colorcode varchar(20), " 1053 " syndicatedepisodenumber varchar(20), programid char( 12), "1060 " syndicatedepisodenumber varchar(20), programid char(40), " 1054 1061 " tvrating char(5), mpaarating char(5), " 1055 1062 "INDEX progidx (programid))"; 1056 1063 1057 1064 dd_tables["dd_productioncrew"] = 1058 "( programid char( 12), role char(30), "1065 "( programid char(40), role char(30), " 1059 1066 " givenname char(20), surname char(20), " 1060 1067 " fullname char(41), " 1061 1068 "INDEX progidx (programid), " 1062 1069 "INDEX nameidx (fullname))"; 1063 1070 1064 1071 dd_tables["dd_genre"] = 1065 "( programid char( 12) NOT NULL, class char(30), "1072 "( programid char(40) NOT NULL, class char(30), " 1066 1073 " relevance char(1), " 1067 1074 "INDEX progidx (programid))"; 1068 1075 -
libs/libmythtv/videosource.cpp
19 19 #include <qmap.h> 20 20 #include <qdir.h> 21 21 #include <qprocess.h> 22 #include <qdatetime.h> 22 23 23 24 // MythTV headers 24 25 #include "mythconfig.h" … … 42 43 #include "videodev_myth.h" 43 44 #endif 44 45 46 static bool is_grabber_external(const QString &grabber) 47 { 48 return !(grabber == "datadirect" || 49 grabber == "eitonly" || 50 grabber == "schedulesdirect1" || 51 grabber == "/bin/true"); 52 } 53 45 54 class RecorderOptions: public ConfigurationWizard 46 55 { 47 56 public: … … 148 157 class DataDirectPassword: public LineEditSetting, public VSSetting { 149 158 public: 150 159 DataDirectPassword(const VideoSource& parent): 151 VSSetting(parent, "password") { 160 VSSetting(parent, "password") 161 { 162 SetPasswordEcho(true); 152 163 setLabel(QObject::tr("Password")); 153 164 }; 154 165 }; … … 159 170 { 160 171 (void) uid; 161 172 (void) pwd; 162 (void) _source;163 173 #ifdef USING_BACKEND 164 174 if (uid.isEmpty() || pwd.isEmpty()) 165 175 return; … … 200 210 void DataDirect_config::load() 201 211 { 202 212 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) 205 218 { 206 219 lineupselector->fillSelections(userid->getValue(), 207 220 password->getValue(), … … 296 309 "instead of just 'mythfilldatabase'.\nYour grabber does not provide " 297 310 "channel numbers, so you have to set them manually."); 298 311 299 if (grabber != "datadirect" && grabber != "eitonly" && 300 grabber != "/bin/true") 312 if (is_grabber_external(grabber)) 301 313 { 302 314 VERBOSE(VB_IMPORTANT, "\n" << err_msg); 303 315 MythPopupBox::showOkPopup( … … 365 377 // only save settings for the selected grabber 366 378 setSaveAll(false); 367 379 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"); 370 384 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 371 391 addTarget("eitonly", new EITOnly_config(parent)); 372 392 grabber->addSelection("Transmitted guide only (EIT)", "eitonly"); 373 393 -
libs/libmyth/settings.cpp
494 494 connect(edit, SIGNAL(changeHelpText(QString)), cg, 495 495 SIGNAL(changeHelpText(QString))); 496 496 497 edit->setRW(rw); 497 setRW(rw); 498 SetPasswordEcho(password_echo); 498 499 499 500 return widget; 500 501 } … … 519 520 } 520 521 } 521 522 523 void LineEditSetting::SetPasswordEcho(bool b) 524 { 525 password_echo = b; 526 if (edit) 527 edit->setEchoMode(b ? QLineEdit::Password : QLineEdit::Normal); 528 } 529 522 530 QWidget* SliderSetting::configWidget(ConfigurationGroup *cg, QWidget* parent, 523 531 const char* widgetName) { 524 532 QHBox* widget; -
libs/libmyth/mythcontext.h
224 224 225 225 /// Update this whenever the plug-in API changes. 226 226 /// Including changes in the libmythtv class methods used by plug-ins. 227 #define MYTH_BINARY_VERSION "0.20.200 60828-4"227 #define MYTH_BINARY_VERSION "0.20.20070816-2" 228 228 229 229 /** \brief Increment this whenever the MythTV network protocol changes. 230 230 * -
libs/libmyth/settings.h
276 276 277 277 class LineEditSetting: virtual public Setting { 278 278 protected: 279 LineEditSetting(bool readwrite = true) : edit(NULL) { rw = readwrite; }; 279 LineEditSetting(bool readwrite = true) : 280 edit(NULL), rw(readwrite), password_echo(false) { } 280 281 public: 281 282 virtual QWidget* configWidget(ConfigurationGroup *cg, QWidget* parent, 282 283 const char* widgetName = 0); … … 292 293 293 294 virtual void setEnabled(bool b); 294 295 virtual void setVisible(bool b); 296 virtual void SetPasswordEcho(bool b); 295 297 296 298 private: 297 299 MythLineEdit* edit; 298 300 bool rw; 301 bool password_echo; 299 302 }; 300 303 301 304 // TODO: set things up so that setting the value as a string emits -
programs/mythfilldatabase/filldata.cpp
834 834 return insert_channels; 835 835 } 836 836 837 bool is_grabber_external(const QString &grabber) 838 { 839 return !(grabber == "datadirect" || 840 grabber == "eitonly" || 841 grabber == "schedulesdirect1" || 842 grabber == "/bin/true"); 843 } 844 845 bool is_grabber_datadirect(const QString &grabber) 846 { 847 return (grabber == "datadirect") || (grabber == "schedulesdirect1"); 848 } 849 850 bool is_grabber_labs(const QString &grabber) 851 { 852 return grabber == "datadirect"; 853 } 854 837 855 // DataDirect stuff 838 856 void DataDirectStationUpdate(Source source, bool update_icons = true) 839 857 { … … 852 870 UpdateSourceIcons(source.id); 853 871 854 872 // 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)) 856 875 { 857 876 bool ok0 = (logged_in == source.userid); 858 877 bool ok1 = (raw_lineup == source.id); … … 877 896 878 897 bool DataDirectUpdateChannels(Source source) 879 898 { 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 880 906 ddprocessor.SetListingsProvider(DD_ZAP2IT); 881 907 ddprocessor.SetUserID(source.userid); 882 908 ddprocessor.SetPassword(source.password); … … 2531 2557 2532 2558 if (xmltv_grabber == "datadirect") 2533 2559 return grabDDData(source, offset, *qCurrentDate, DD_ZAP2IT); 2560 else if (xmltv_grabber == "schedulesdirect1") 2561 return grabDDData(source, offset, *qCurrentDate, DD_SCHEDULES_DIRECT); 2534 2562 else if (xmltv_grabber == "technovera") 2535 2563 { 2536 2564 VERBOSE(VB_ALL, "This grabber is no longer supported"); … … 2857 2885 .arg((*it).xmltvgrabber)); 2858 2886 2859 2887 QString xmltv_grabber = (*it).xmltvgrabber; 2860 need_post_grab_proc |= (xmltv_grabber != "datadirect");2888 need_post_grab_proc |= !is_grabber_datadirect(xmltv_grabber); 2861 2889 2862 2890 if (xmltv_grabber == "tv_grab_uk" || xmltv_grabber == "tv_grab_uk_rt" || 2863 2891 xmltv_grabber == "tv_grab_fi" || xmltv_grabber == "tv_grab_es" || … … 2872 2900 if (!grabData(*it, 0)) 2873 2901 ++failures; 2874 2902 } 2875 else if ( (xmltv_grabber == "datadirect") && dd_grab_all)2903 else if (is_grabber_labs(xmltv_grabber) && dd_grab_all) 2876 2904 { 2877 2905 if (only_update_channels) 2878 2906 DataDirectUpdateChannels(*it); … … 2882 2910 grabData(*it, 0, &qCurrentDate); 2883 2911 } 2884 2912 } 2885 else if ( xmltv_grabber == "datadirect"||2913 else if (is_grabber_datadirect(xmltv_grabber) || 2886 2914 xmltv_grabber == "tv_grab_se_swedb" || 2887 2915 xmltv_grabber == "tv_grab_no" || 2888 2916 xmltv_grabber == "tv_grab_de_tvtoday" || … … 2906 2934 // often decided by the person maintaining the grabbers. 2907 2935 if (maxDays > 0) // passed with --max-days 2908 2936 grabdays = maxDays; 2909 else if ( xmltv_grabber == "datadirect")2937 else if (is_grabber_datadirect(xmltv_grabber)) 2910 2938 grabdays = 14; 2911 2939 else if (xmltv_grabber == "tv_grab_se_swedb") 2912 2940 grabdays = 10; … … 2922 2950 if (grabdays == 1) 2923 2951 refresh_today = true; 2924 2952 2925 if ( (xmltv_grabber == "datadirect") && only_update_channels)2953 if (is_grabber_labs(xmltv_grabber) && only_update_channels) 2926 2954 { 2927 2955 DataDirectUpdateChannels(*it); 2928 2956 grabdays = 0; … … 3860 3888 newsource.lineupid = sourcequery.value(5).toString(); 3861 3889 3862 3890 sourcelist.append(newsource); 3863 if (newsource.xmltvgrabber == "datadirect") 3864 usingDataDirect = true; 3891 usingDataDirect = 3892 is_grabber_datadirect(newsource.xmltvgrabber); 3893 3865 3894 } 3866 3895 } 3867 3896 else