00001 #include <sys/stat.h>
00002 #include <qapplication.h>
00003 #include <qregexp.h>
00004 #include <qbuffer.h>
00005 #include <qfileinfo.h>
00006
00007 #include "mythwizard.h"
00008 #include "httpcomms.h"
00009 #include "importicons.h"
00010 #include "util.h"
00011 #include <qdir.h>
00012
00013 ImportIconsWizard::ImportIconsWizard(bool fRefresh, QString channelname)
00014 {
00015 m_fRefresh = fRefresh;
00016 m_strChannelname = channelname;
00017 m_closeDialog = false;
00018 m_missingCount=0;
00019 m_missingMaxCount=0;
00020
00021 }
00022
00023 MythDialog *ImportIconsWizard::dialogWidget(MythMainWindow *parent,
00024 const char *widgetName)
00025 {
00026 MythWizard *ret = (MythWizard*)ConfigurationWizard::dialogWidget(parent,widgetName);
00027 connect(ret->finishButton(), SIGNAL(pressed()), this, SLOT(finishButtonPressed()));
00028 return (MythDialog*)ret;
00029 }
00030
00031 int ImportIconsWizard::exec()
00032 {
00033 QString dirpath = MythContext::GetConfDir();
00034 QDir configDir(dirpath);
00035 if (!configDir.exists())
00036 {
00037 if (!configDir.mkdir(dirpath, true))
00038 {
00039 VERBOSE(VB_IMPORTANT, QString("Could not create %1").arg(dirpath));
00040 }
00041 }
00042
00043 m_strChannelDir = QString("%1/%2").arg(configDir.absPath()).arg("/channels");
00044 QDir strChannelDir(m_strChannelDir);
00045 if (!strChannelDir.exists())
00046 {
00047 if (!strChannelDir.mkdir(m_strChannelDir, true))
00048 {
00049 VERBOSE(VB_IMPORTANT, QString("Could not create %1").arg(m_strChannelDir));
00050 }
00051 }
00052 m_strChannelDir+="/";
00053
00054 if (initialLoad(m_strChannelname) > 0)
00055 {
00056 startDialog();
00057 m_missingIter=m_missingEntries.begin();
00058 doLoad();
00059 }
00060 else
00061 m_closeDialog=true;
00062
00063 if (m_closeDialog==false)
00064 while ((ConfigurationDialog::exec() == QDialog::Accepted) && (m_closeDialog == false)) {}
00065
00066 return QDialog::Rejected;
00067 }
00068
00069 void ImportIconsWizard::startDialog()
00070 {
00071 VerticalConfigurationGroup *manSearch =
00072 new VerticalConfigurationGroup(false,false,true,true);
00073
00074 manSearch->addChild(m_editName = new TransLineEditSetting(false));
00075 m_editName->setLabel(QObject::tr("Channel Name"));
00076 m_editName->setHelpText(QObject::tr("Name of the icon file"));
00077 m_editName->setEnabled(false);
00078
00079 manSearch->addChild(m_listIcons = new TransListBoxSetting());
00080 m_listIcons->setHelpText(QObject::tr("List of possible icon files"));
00081
00082 m_editManual = new TransLineEditSetting();
00083 m_editManual->setHelpText(QObject::tr("Enter text here for the manual search"));
00084
00085 m_buttonManual = new TransButtonSetting();
00086 m_buttonManual->setLabel(QObject::tr("&Search"));
00087 m_buttonManual->setHelpText(QObject::tr("Manually search for the text"));
00088
00089 m_buttonSkip = new TransButtonSetting();
00090 m_buttonSkip->setLabel(QObject::tr("S&kip"));
00091 m_buttonSkip->setHelpText(QObject::tr("Skip this icon"));
00092
00093 m_buttonSelect = new TransButtonSetting();
00094 m_buttonSelect->setLabel(QObject::tr("S&elect"));
00095 m_buttonSelect->setHelpText(QObject::tr("Select this icon"));
00096
00097 HorizontalConfigurationGroup *hrz1 =
00098 new HorizontalConfigurationGroup(false, false, true, true);
00099
00100 hrz1->addChild(m_editManual);
00101 hrz1->addChild(m_buttonManual);
00102 hrz1->addChild(m_buttonSkip);
00103 hrz1->addChild(m_buttonSelect);
00104 manSearch->addChild(hrz1);
00105
00106 addChild(manSearch);
00107
00108 connect(m_buttonManual, SIGNAL(pressed()), this, SLOT(manualSearch()));
00109 connect(m_buttonSkip, SIGNAL(pressed()), this, SLOT(skip()));
00110 connect(m_listIcons,SIGNAL(accepted(int)),this,
00111 SLOT(menuSelection(int)));
00112 connect(m_buttonSelect,SIGNAL(pressed()),this,
00113 SLOT(menuSelect()));
00114
00115 enableControls(STATE_NORMAL);
00116 }
00117
00118 const QString ImportIconsWizard::url="http://services.mythtv.org/channel-icon/";
00119
00120 void ImportIconsWizard::enableControls(dialogState state, bool selectEnabled)
00121 {
00122 switch (state)
00123 {
00124 case STATE_NORMAL:
00125 if (m_editManual->getValue())
00126 m_buttonManual->setEnabled(true);
00127 else
00128 m_buttonManual->setEnabled(false);
00129 if (m_missingCount < m_missingMaxCount)
00130 {
00131 if (m_missingMaxCount < 2)
00132 m_buttonSkip->setEnabled(false);
00133 else
00134 m_buttonSkip->setEnabled(true);
00135 m_editName->setEnabled(true);
00136 m_listIcons->setEnabled(true);
00137 m_editManual->setEnabled(true);
00138 m_buttonSelect->setEnabled(selectEnabled);
00139 }
00140 else
00141 {
00142 m_buttonSkip->setEnabled(false);
00143 m_editName->setEnabled(false);
00144 m_listIcons->setEnabled(false);
00145 m_editManual->setEnabled(false);
00146 m_buttonManual->setEnabled(false);
00147 m_buttonSelect->setEnabled(false);
00148 }
00149 break;
00150 case STATE_SEARCHING:
00151 m_buttonSkip->setEnabled(false);
00152 m_buttonSelect->setEnabled(false);
00153 m_buttonManual->setEnabled(false);
00154 m_listIcons->setEnabled(false);
00155 m_listIcons->clearSelections();
00156 m_listIcons->addSelection("Please wait...");
00157 m_editManual->setValue("");
00158 break;
00159 case STATE_DISABLED:
00160 m_buttonSkip->setEnabled(false);
00161 m_buttonSelect->setEnabled(false);
00162 m_buttonManual->setEnabled(false);
00163 m_listIcons->setEnabled(false);
00164 m_listIcons->clearSelections();
00165 m_editName->setEnabled(false);
00166 m_editName->setValue("");
00167 m_editManual->setEnabled(false);
00168 m_editManual->setValue("");
00169 m_listIcons->setFocus();
00170 break;
00171 }
00172 }
00173
00174 void ImportIconsWizard::manualSearch()
00175 {
00176 QString str = m_editManual->getValue();
00177 search(escape_csv(str));
00178 }
00179
00180 void ImportIconsWizard::skip()
00181 {
00182 if (m_missingMaxCount > 1)
00183 {
00184 m_missingCount++;
00185 m_missingIter++;
00186 doLoad();
00187 }
00188 }
00189
00190 void ImportIconsWizard::menuSelect()
00191 {
00192 menuSelection(m_listIcons->currentItem());
00193 }
00194
00195 void ImportIconsWizard::menuSelection(int nIndex)
00196 {
00197 enableControls(STATE_SEARCHING);
00198 SearchEntry entry = *(m_listSearch.at(nIndex));
00199
00200 CSVEntry entry2 = (*m_missingIter);
00201 m_strMatches += QString("%1,%2,%3,%4,%5,%6,%7,%8,%9\n").
00202 arg(escape_csv(entry.strID)).
00203 arg(escape_csv(entry2.strName)).
00204 arg(escape_csv(entry2.strXmlTvId)).
00205 arg(escape_csv(entry2.strCallsign)).
00206 arg(escape_csv(entry2.strTransportId)).
00207 arg(escape_csv(entry2.strAtscMajorChan)).
00208 arg(escape_csv(entry2.strAtscMinorChan)).
00209 arg(escape_csv(entry2.strNetworkId)).
00210 arg(escape_csv(entry2.strServiceId));
00211
00212 if ((!isBlocked(m_strMatches)) &&
00213 (checkAndDownload(entry.strLogo, entry2.strChanId)))
00214 {
00215
00216 if (m_missingMaxCount > 1)
00217 {
00218 m_missingCount++;
00219 m_missingIter++;
00220 doLoad();
00221 }
00222 else
00223 {
00224 enableControls(STATE_DISABLED);
00225 m_listIcons->addSelection(QString("Channel icon for %1 was downloaded successfully.")
00226 .arg(entry2.strName));
00227 m_listIcons->setFocus();
00228 if (!m_strMatches.isEmpty())
00229 submit(m_strMatches);
00230 m_closeDialog=true;
00231 }
00232 }
00233 else
00234 {
00235 MythPopupBox::showOkPopup(gContext->GetMainWindow(),
00236 QObject::tr("Error downloading"),
00237 QObject::tr("Failed to download the icon file"));
00238 enableControls(STATE_DISABLED);
00239 m_closeDialog=true;
00240 }
00241
00242 }
00243
00244 uint ImportIconsWizard::initialLoad(QString name)
00245 {
00246
00247 QString querystring=("SELECT chanid, name, xmltvid, callsign,"
00248 "dtv_multiplex.transportid, atsc_major_chan, "
00249 "atsc_minor_chan, dtv_multiplex.networkid, "
00250 "channel.serviceid, channel.mplexid,"
00251 "dtv_multiplex.mplexid, channel.icon, channel.visible "
00252 "FROM channel LEFT JOIN dtv_multiplex "
00253 "ON channel.mplexid = dtv_multiplex.mplexid "
00254 "WHERE");
00255 if (name.isEmpty()==false)
00256 querystring+=" name=\"" + name + "\"";
00257 else
00258 querystring+=" channel.visible";
00259 querystring+=" ORDER BY name";
00260
00261 MSqlQuery query(MSqlQuery::InitCon());
00262 query.prepare(querystring);
00263
00264 m_listEntries.clear();
00265 m_nCount=0;
00266 m_nMaxCount=0;
00267 m_missingMaxCount=0;
00268
00269 if (query.exec() && query.isActive() && query.size() > 0)
00270 {
00271 MythProgressDialog *progressDialog = new MythProgressDialog("Initialising, please wait...", query.size());
00272
00273 while(query.next())
00274 {
00275 CSVEntry entry;
00276
00277 if (m_fRefresh)
00278 {
00279 QFileInfo file(query.value(11).toString());
00280 if (file.exists())
00281 continue;
00282 }
00283
00284 entry.strChanId=query.value(0).toString();
00285 entry.strName=query.value(1).toString();
00286 entry.strXmlTvId=query.value(2).toString();
00287 entry.strCallsign=query.value(3).toString();
00288 entry.strTransportId=query.value(4).toString();
00289 entry.strAtscMajorChan=query.value(5).toString();
00290 entry.strAtscMinorChan=query.value(6).toString();
00291 entry.strNetworkId=query.value(7).toString();
00292 entry.strServiceId=query.value(8).toString();
00293 entry.strIconCSV= QString("%1,%2,%3,%4,%5,%6,%7,%8,%9\n").
00294 arg(escape_csv(entry.strChanId)).
00295 arg(escape_csv(entry.strName)).
00296 arg(escape_csv(entry.strXmlTvId)).
00297 arg(escape_csv(entry.strCallsign)).
00298 arg(escape_csv(entry.strTransportId)).
00299 arg(escape_csv(entry.strAtscMajorChan)).
00300 arg(escape_csv(entry.strAtscMinorChan)).
00301 arg(escape_csv(entry.strNetworkId)).
00302 arg(escape_csv(entry.strServiceId));
00303 entry.strNameCSV=escape_csv(entry.strName);
00304 VERBOSE(VB_CHANNEL,QString("chanid %1").arg(entry.strIconCSV));
00305
00306 m_listEntries.append(entry);
00307 m_nMaxCount++;
00308 progressDialog->setProgress(m_nMaxCount);
00309 }
00310
00311 progressDialog->Close();
00312 progressDialog->deleteLater();
00313 }
00314
00315 m_iter = m_listEntries.begin();
00316
00317 MythProgressDialog *progressDialog = new MythProgressDialog("Downloading, please wait...",
00318 m_listEntries.size(), true, this, SLOT(cancelPressed()));
00319 while (!m_closeDialog && (m_iter != m_listEntries.end()))
00320 {
00321 QString message = QString("Downloading %1 / %2 : ").arg(m_nCount+1)
00322 .arg(m_listEntries.size()) + (*m_iter).strName;
00323 if (m_missingEntries.size() > 0)
00324 message.append(QString("\nCould not find %1 icons.").arg(m_missingEntries.size()));
00325 progressDialog->setLabel(message);
00326 if (!findmissing((*m_iter).strIconCSV))
00327 {
00328 m_missingEntries.append((*m_iter));
00329 m_missingMaxCount++;
00330 }
00331
00332 m_nCount++;
00333 m_iter++;
00334 progressDialog->setProgress(m_nCount);
00335 }
00336 progressDialog->Close();
00337 progressDialog->deleteLater();
00338
00339 if (m_missingEntries.size() == 0)
00340 return 0;
00341
00342
00343 if (m_closeDialog)
00344 m_nMaxCount=0;
00345 return m_nMaxCount;
00346 }
00347
00348 bool ImportIconsWizard::doLoad()
00349 {
00350 VERBOSE(VB_CHANNEL, QString("Icons: Found %1 / Missing %2")
00351 .arg(m_missingCount)
00352 .arg(m_missingMaxCount));
00353 if (m_missingCount >= m_missingMaxCount)
00354 {
00355 VERBOSE(VB_CHANNEL, "doLoad Icon search complete");
00356 enableControls(STATE_DISABLED);
00357 if (!m_strMatches.isEmpty())
00358 submit(m_strMatches);
00359 m_closeDialog=true;
00360 return false;
00361 }
00362 else
00363 {
00364
00365 m_editName->setValue((*m_missingIter).strName);
00366 search((*m_missingIter).strNameCSV);
00367 return true;
00368 }
00369 }
00370
00371 QString ImportIconsWizard::escape_csv(const QString& str)
00372 {
00373 QRegExp rxDblForEscape("\"");
00374 QString str2 = str;
00375 str2.replace(rxDblForEscape,"\\\"");
00376 return "\""+str2+"\"";
00377 }
00378
00379 QStringList ImportIconsWizard::extract_csv(const QString& strLine)
00380 {
00381 QStringList ret;
00382
00383 QString str = strLine;
00384
00385 unsigned int pos = 0;
00386 bool fFinish = false;
00387 while(!fFinish)
00388 {
00389 str=str.stripWhiteSpace();
00390 while(!fFinish)
00391 {
00392 QString strLeft;
00393 switch (str.at(pos).unicode())
00394 {
00395 case '\\':
00396 if (pos>=1)
00397 str.left(pos-1)+str.mid(pos+1);
00398 else
00399 str=str.mid(pos+1);
00400 pos+=2;
00401 if (pos > str.length())
00402 {
00403 strLeft = str.left(pos);
00404 if (strLeft.startsWith("\"") && strLeft.endsWith("\""))
00405 strLeft=strLeft.mid(1,strLeft.length()-2);
00406 ret.append(strLeft);
00407 fFinish = true;
00408 }
00409 break;
00410 case ',':
00411 strLeft = str.left(pos);
00412 if (strLeft.startsWith("\"") && strLeft.endsWith("\""))
00413 strLeft=strLeft.mid(1,strLeft.length()-2);
00414 ret.append(strLeft);
00415 if ((pos+1) > str.length())
00416 fFinish = true;
00417 str=str.mid(pos+1);
00418 pos=0;
00419 break;
00420 default:
00421 pos++;
00422 if (pos > str.length())
00423 {
00424 strLeft = str.left(pos);
00425 if (strLeft.startsWith("\"") && strLeft.endsWith("\""))
00426 strLeft=strLeft.mid(1,strLeft.length()-2);
00427 ret.append(strLeft);
00428 fFinish = true;
00429 }
00430 }
00431 }
00432 }
00433 return ret;
00434 }
00435
00436
00437 QString ImportIconsWizard::wget(QUrl& url,const QString& strParam )
00438 {
00439 QByteArray raw;
00440 QTextStream rawStream(raw,IO_WriteOnly);
00441 rawStream << strParam;
00442
00443 QBuffer data(raw);
00444 QHttpRequestHeader header;
00445
00446 header.setContentType(QString("application/x-www-form-urlencoded"));
00447 header.setContentLength(raw.size());
00448
00449 header.setValue("User-Agent", "MythTV Channel Icon lookup bot");
00450
00451 QString str = HttpComms::postHttp(url,&header,&data);
00452
00453 return str;
00454 }
00455
00456 bool ImportIconsWizard::checkAndDownload(const QString& str, const QString& localChanId)
00457 {
00458
00459
00460 int iIndex = str.findRev('/');
00461 QString str2;
00462 if (iIndex < 0)
00463 str2=str;
00464 else
00465 str2=str.mid(iIndex+1);
00466
00467 QString str3 = str;
00468 QFileInfo file(m_strChannelDir+str2);
00469
00470 bool fRet;
00471 if (!file.exists())
00472 fRet = HttpComms::getHttpFile(m_strChannelDir+str2,str3);
00473 else
00474 fRet = true;
00475
00476 if (fRet)
00477 {
00478 MSqlQuery query(MSqlQuery::InitCon());
00479 QString qstr = "UPDATE channel SET icon = :ICON "
00480 "WHERE chanid = :CHANID";
00481
00482 query.prepare(qstr);
00483 query.bindValue(":ICON", m_strChannelDir+str2);
00484 query.bindValue(":CHANID", localChanId);
00485
00486 if (!query.exec())
00487 {
00488 MythContext::DBError("Error inserting channel icon", query);
00489 return false;
00490 }
00491
00492 }
00493
00494 return fRet;
00495 }
00496
00497 bool ImportIconsWizard::isBlocked(const QString& strParam)
00498 {
00499 QString strParam1 = strParam;
00500 QUrl::encode(strParam1);
00501 QUrl url(ImportIconsWizard::url+"/checkblock");
00502 QString str = wget(url,"csv="+strParam1);
00503
00504 if (str.startsWith("Error",false))
00505 {
00506 VERBOSE(VB_IMPORTANT, QString("Error from isBlocked : %1").arg(str));
00507 return true;
00508 }
00509 else if (str.isEmpty() || str.startsWith("\r\n") || str.startsWith("#"))
00510 return false;
00511 else
00512 {
00513 VERBOSE(VB_IMPORTANT, QString("isBlocked Error: %1").arg(str));
00514 VERBOSE(VB_CHANNEL, QString("Icon Import: Working isBlocked"));
00515 int nVal = MythPopupBox::showOkCancelPopup(gContext->GetMainWindow(),
00516 QObject::tr("Icon is blocked"),
00517 QObject::tr("This combination of channel and icon "
00518 "has been blocked by the MythTV "
00519 "admins. The most common reason for "
00520 "this is that there is a better match "
00521 "available.\n "
00522 "Are you still sure that you want to "
00523 "use this icon?"),
00524 true);
00525 if (nVal == 1)
00526 return false;
00527 else
00528 return true;
00529 }
00530 }
00531
00532
00533 bool ImportIconsWizard::lookup(const QString& strParam)
00534 {
00535 QString strParam1 = "callsign="+strParam;
00536 QUrl::encode(strParam1);
00537 QUrl url(ImportIconsWizard::url+"/lookup");
00538
00539 QString str = wget(url,strParam1);
00540 if (str.isEmpty() || str.startsWith("Error",false))
00541 {
00542 VERBOSE(VB_IMPORTANT, QString("Error from icon lookup : %1").arg(str));
00543 return true;
00544 }
00545 else
00546 {
00547 VERBOSE(VB_CHANNEL, QString("Icon Import: Working lookup : %1").arg(str));
00548 return false;
00549 }
00550 }
00551
00552 bool ImportIconsWizard::search(const QString& strParam)
00553 {
00554 QString strParam1 = strParam;
00555 bool retVal = false;
00556 enableControls(STATE_SEARCHING);
00557 QUrl::encode(strParam1);
00558 QUrl url(ImportIconsWizard::url+"/search");
00559
00560 QString str = wget(url,"s="+strParam1);
00561
00562 m_listSearch.clear();
00563 m_listIcons->clearSelections();
00564
00565 if (str.isEmpty() || str.startsWith("#") || str.startsWith("Error",false))
00566 {
00567 VERBOSE(VB_IMPORTANT, QString("Error from search : %1").arg(str));
00568 retVal=false;
00569 }
00570 else
00571 {
00572 VERBOSE(VB_CHANNEL, QString("Icon Import: Working search : %1").arg(str));
00573 QStringList strSplit=QStringList::split("\n",str);
00574
00575 QString prevIconName = "";
00576 int namei = 1;
00577
00578 for (QStringList::iterator begin=strSplit.begin();
00579 begin!=strSplit.end();begin++)
00580 {
00581 if (*begin != "#" )
00582 {
00583 QStringList ret = extract_csv(*begin);
00584 VERBOSE(VB_CHANNEL, QString("Icon Import: search : %1 %2 %3").arg(ret[0]).arg(ret[1]).arg(ret[2]));
00585 SearchEntry entry;
00586 entry.strID=ret[0];
00587 entry.strName=ret[1];
00588 entry.strLogo=ret[2];
00589 m_listSearch.append(entry);
00590 if (prevIconName == entry.strName)
00591 {
00592 QString newname = QString("%1 (%2)").arg(entry.strName)
00593 .arg(namei);
00594 m_listIcons->addSelection(newname);
00595 namei++;
00596 }
00597 else
00598 {
00599 m_listIcons->addSelection(entry.strName);
00600 namei=1;
00601 }
00602 prevIconName = entry.strName;
00603 }
00604 }
00605 retVal=true;
00606 }
00607 enableControls(STATE_NORMAL, retVal);
00608 return retVal;
00609 }
00610
00611 bool ImportIconsWizard::findmissing(const QString& strParam)
00612 {
00613 QString strParam1 = strParam;
00614 QUrl::encode(strParam1);
00615 QUrl url(ImportIconsWizard::url+"/findmissing");
00616
00617 QString str = wget(url,"csv="+strParam1);
00618 VERBOSE(VB_CHANNEL, QString("Icon Import: findmissing : strParam1 = %1. str = %2").arg(strParam1).arg(str));
00619 if (str.isEmpty() || str.startsWith("#") || str.startsWith("Error",false))
00620 {
00621 VERBOSE(VB_IMPORTANT, QString("Error from findmissing : %1").arg(str));
00622 return false;
00623 }
00624 else
00625 {
00626 VERBOSE(VB_CHANNEL, QString("Icon Import: Working findmissing : %1").arg(str));
00627 QStringList strSplit=QStringList::split("\n",str);
00628 for (QStringList::iterator begin=strSplit.begin();
00629 begin!=strSplit.end();begin++)
00630 {
00631 if (*begin != "#" )
00632 {
00633 QStringList ret = extract_csv(*begin);
00634 VERBOSE(VB_CHANNEL, QString("Icon Import: findmissing : %1 %2 %3 %4 %5").arg(ret[0]).arg(ret[1]).arg(ret[2]).arg(ret[3]).arg(ret[4]));
00635 checkAndDownload(ret[4], (*m_iter).strChanId);
00636 }
00637 }
00638 return true;
00639 }
00640 }
00641
00642 bool ImportIconsWizard::submit(const QString& strParam)
00643 {
00644 int nVal = MythPopupBox::showOkCancelPopup(
00645 gContext->GetMainWindow(),
00646 QObject::tr("Submit information"),
00647 QObject::tr("You now have the opportunity to "
00648 "transmit your choices back to "
00649 "mythtv.org so that others can "
00650 "benefit from your selections."),
00651 true);
00652 if (nVal == 0)
00653 {
00654 m_listIcons->addSelection("Icon choices not submitted.");
00655 return false;
00656 }
00657
00658 QString strParam1 = strParam;
00659 QUrl::encode(strParam1);
00660 QUrl url(ImportIconsWizard::url+"/submit");
00661
00662 QString str = wget(url,"csv="+strParam1);
00663 if (str.isEmpty() || str.startsWith("#") || str.startsWith("Error",false))
00664 {
00665 VERBOSE(VB_IMPORTANT, QString("Error from submit : %1").arg(str));
00666 m_listIcons->addSelection("Failed to submit icon choices.");
00667 return false;
00668 }
00669 else
00670 {
00671 VERBOSE(VB_CHANNEL, QString("Icon Import: Working submit : %1").arg(str));
00672 QStringList strSplit=QStringList::split("\n",str);
00673 unsigned atsc =0, dvb =0, callsign =0, tv =0, xmltvid=0;
00674 for (QStringList::iterator begin=strSplit.begin();
00675 begin!=strSplit.end();begin++)
00676 {
00677 if (*begin != "#" )
00678 {
00679 QStringList strSplit2=QStringList::split(":",*begin);
00680 QString s=strSplit2[0].stripWhiteSpace();
00681 if (s=="a")
00682 atsc=strSplit2[1].toUInt();
00683 else if (s=="c")
00684 callsign=strSplit2[1].toUInt();
00685 else if (s=="d")
00686 dvb=strSplit2[1].toUInt();
00687 else if (s=="t")
00688 tv=strSplit2[1].toUInt();
00689 else if (s=="x")
00690 xmltvid=strSplit2[1].toUInt();
00691 }
00692 }
00693 VERBOSE(VB_CHANNEL, QString("Icon Import: working submit : atsc=%1 callsign=%2 dvb=%3 tv=%4 xmltvid=%5")
00694 .arg(atsc).arg(callsign).arg(dvb).arg(tv).arg(xmltvid));
00695 m_listIcons->addSelection("Icon choices submitted successfully.");
00696 return true;
00697 }
00698 }
00699
00700 void ImportIconsWizard::cancelPressed()
00701 {
00702 m_closeDialog=true;
00703 }
00704
00705 void ImportIconsWizard::finishButtonPressed()
00706 {
00707 m_closeDialog = true;
00708 }