MythTV master
restoredata.h
Go to the documentation of this file.
1/*
2 * $Id$
3 * vim: set expandtab tabstop=4 shiftwidth=4:
4 *
5 * Original Project
6 * MythTV http://www.mythtv.org
7 *
8 *
9 * Description:
10 * Postprocessing of channelscan result
11 *
12 * When all channels are deleted and a new scan is done then
13 * all the non-scanned data is lost.
14 * This are the following fields:
15 * xmltvid Channel identification for XMLTV including Schedules Direct
16 * iconpath File name of icon for this channel
17 * visible Visible status
18 * When a channel is deleted it is not immediately deleted from the database;
19 * it is kept for a while with the "deleted" field set to the date at which it
20 * is deleted.
21 * This makes it possible to retrieve this data from the deleted records
22 * when the same channel is found again in a new scan.
23 *
24 *
25 * This program is free software; you can redistribute it and/or
26 * modify it under the terms of the GNU General Public License
27 * as published by the Free Software Foundation; either version 2
28 * of the License, or (at your option) any later version.
29 *
30 * This program is distributed in the hope that it will be useful,
31 * but WITHOUT ANY WARRANTY; without even the implied warranty of
32 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 * GNU General Public License for more details.
34 *
35 * You should have received a copy of the GNU General Public License
36 * along with this program; if not, write to the Free Software
37 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
38 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
39 *
40 */
41
42#ifndef RESTOREDATA_H
43#define RESTOREDATA_H
44
45#include <vector>
46
50
51#include "cardutil.h"
52#include "mythtvexp.h"
53#include "videosource.h"
54
55class VideoSourceShow;
56class MythUIType;
57class RestoreXMLTVID;
58class RestoreVisible;
59class RestoreIcon;
60
62{
68 QString channum;
69 QString name;
70 QString xmltvid;
71 QString icon;
72 int visible {0};
73 QString deleted;
74 bool found_xmltvid {false};
75 bool found_icon {false};
76 bool found_visible {false};
77};
78
79// Page for updating the fields with non-scanned data
80// from deleted channel data.
81//
83{
84 Q_OBJECT
85 public:
86 explicit RestoreData(uint sourceid, bool useGUI = true);
87 static RestoreData * getInstance(uint sourceid);
88 static void freeInstance();
89 void Load(void) override; // StandardSetting
90 void Save(void) override; // StandardSetting
91 bool doSave(void);
92 QString doRestore(bool do_xmltvid, bool do_icon, bool do_visible);
93
94 public slots:
95 void Restore(void);
96
97 private:
99 VideoSourceShow *m_videosource {nullptr};
100 RestoreXMLTVID *m_restoreXMLTVID {nullptr};
101 RestoreVisible *m_restoreVisible {nullptr};
102 RestoreIcon *m_restoreIcon {nullptr};
103
104 uint m_sourceid {0};
105 bool m_useGUI {false};
106
107 std::vector<OldChannelData> m_ocd;
108
109 public:
110 // Return values for the API
111 int m_num_channels {0};
112 int m_num_xmltvid {0};
113 int m_num_icon {0};
114 int m_num_visible {0};
115
116};
117
118#endif // RESTOREDATA_H
The base class on which all widgets and screens are based.
Definition: mythuitype.h:86
std::vector< OldChannelData > m_ocd
Definition: restoredata.h:107
static RestoreData * s_Instance
Definition: restoredata.h:98
virtual void Save(void)
virtual void Load(void)
unsigned int uint
Definition: freesurround.h:24
#define MTV_PUBLIC
Definition: mythtvexp.h:15
QString xmltvid
Definition: restoredata.h:70
bool found_xmltvid
Definition: restoredata.h:74
QString deleted
Definition: restoredata.h:73
bool found_visible
Definition: restoredata.h:76
QString channum
Definition: restoredata.h:68
QString icon
Definition: restoredata.h:71
QString name
Definition: restoredata.h:69