00001 /* -*- Mode: c++ -*- 00002 * vim: set expandtab tabstop=4 shiftwidth=4: 00003 * 00004 * Original Project 00005 * MythTV http://www.mythtv.org 00006 * 00007 * Copyright (c) 2008 Daniel Kristjansson 00008 * 00009 * Description: 00010 * Collection of classes to provide channel scanning functionallity 00011 * 00012 * This program is free software; you can redistribute it and/or 00013 * modify it under the terms of the GNU General Public License 00014 * as published by the Free Software Foundation; either version 2 00015 * of the License, or (at your option) any later version. 00016 * 00017 * This program is distributed in the hope that it will be useful, 00018 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00020 * GNU General Public License for more details. 00021 * 00022 * You should have received a copy of the GNU General Public License 00023 * along with this program; if not, write to the Free Software 00024 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00025 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html 00026 * 00027 */ 00028 00029 #ifndef _PANE_EXISTING_SCAN_IMPORT_H_ 00030 #define _PANE_EXISTING_SCAN_IMPORT_H_ 00031 00032 // Qt headers 00033 #include <QString> 00034 #include <QObject> 00035 00036 // MythTV headers 00037 #include "channelscanmiscsettings.h" 00038 #include "scaninfo.h" 00039 00040 class PaneExistingScanImport : public VerticalConfigurationGroup 00041 { 00042 public: 00043 PaneExistingScanImport() : 00044 VerticalConfigurationGroup(false,false,true,false), 00045 sourceid(0), scanSelect(new TransComboBoxSetting()) 00046 { 00047 scanSelect->setLabel(QObject::tr("Scan to Import")); 00048 addChild(scanSelect); 00049 } 00050 00051 virtual void load(void) 00052 { 00053 scanSelect->clearSelections(); 00054 if (!sourceid) 00055 return; 00056 00057 vector<ScanInfo> scans = LoadScanList(); 00058 for (uint i = 0; i < scans.size(); i++) 00059 { 00060 if (scans[i].sourceid != sourceid) 00061 continue; 00062 00063 QString scanDate = scans[i].scandate.toString(); 00064 QString proc = (scans[i].processed) ? 00065 QObject::tr("processed") : QObject::tr("unprocessed"); 00066 00067 scanSelect->addSelection( 00068 QString("%1 %2").arg(scanDate).arg(proc), 00069 QString::number(scans[i].scanid)); 00070 } 00071 } 00072 00073 void SetSourceID(uint _sourceid) 00074 { 00075 sourceid = _sourceid; 00076 load(); 00077 } 00078 00079 uint GetScanID(void) const { return scanSelect->getValue().toUInt(); } 00080 00081 private: 00082 uint sourceid; 00083 TransComboBoxSetting *scanSelect; 00084 }; 00085 00086 #endif // _PANE_EXISTING_SCAN_IMPORT_H_
1.6.3