24static bool checkPath(QString path, QStringList &probs)
29 probs.push_back(QObject::tr(
"Path \"%1\" doesn't exist.").arg(path));
33 QFile test(path.append(
"/.test"));
34 if (test.open(QIODevice::WriteOnly))
40 probs.push_back(QObject::tr(
"Unable to create file \"%1\" - directory "
41 "is not writable?").arg(path));
53 bool problemFound =
false;
57 query.
prepare(
"SELECT count(groupname) FROM storagegroup;");
64 if (query.
value(0).toInt() == 0)
67 QObject::tr(
"No Storage Group directories are defined. You "
68 "must add at least one directory to the Default "
69 "Storage Group where new recordings will be "
71 probs.push_back(trMesg);
72 LOG(VB_GENERAL, LOG_ERR, trMesg);
76 query.
prepare(
"SELECT groupname, dirname "
78 "WHERE hostname = :HOSTNAME;");
91 QObject::tr(
"No Storage Group directories are defined. "
92 "You must add at least one directory to the "
93 "Default Storage Group where new recordings "
95 probs.push_back(trMesg);
96 LOG(VB_GENERAL, LOG_ERR, trMesg);
109 dirname = QString::fromUtf8(query.
value(1)
110 .toByteArray().constData());
111 QStringList tokens = dirname.split(
",");
113 while (curToken < tokens.size())
115 checkDir.setPath(tokens[curToken]);
129 bool problemFound =
false;
133 query.
prepare(
"SELECT groupname "
135 "WHERE hostname = :HOSTNAME;");
142 if (query.
size() < 1)
150 groups += query.
value(0).toString();
153 if (groups.contains(
"Videos"))
155 if (groups.contains(
"Fanart") &&
156 groups.contains(
"Coverart") &&
157 groups.contains(
"Screenshots") &&
158 groups.contains(
"Banners"))
160 problemFound =
false;
165 QObject::tr(
"You have a Video Storage "
166 "Group, but have not set up "
167 "all Image Groups. If you continue, "
168 "video image downloads will be saved in "
169 "your Videos Storage Group. Do you want "
170 "to store them in their own groups?");
171 probs.push_back(trMesg);
172 LOG(VB_GENERAL, LOG_ERR, trMesg);
186 bool problemFound =
false;
190 query.
prepare(
"SELECT cardid, startchan, sourceid, inputname, parentid"
191 " FROM capturecard;");
201 int cardid = query.
value(0).toInt();
202 QString startchan = query.
value(1).toString();
203 int sourceid = query.
value(2).toInt();
204 int parentid = query.
value(4).toInt();
212 probs.push_back(QObject::tr(
"Card %1 (%2) No video source connected")
213 .arg(cardid).arg(query.
value(3).toString()));
220 if (!newchan.isEmpty())
222 if (newchan.compare(startchan) != 0)
226 QString(
"start channel from %1 to %2 ").arg(startchan, newchan) +
227 QString(
"for card %1 (%2)").arg(cardid).arg(query.
value(3).toString());
230 LOG(VB_GENERAL, LOG_INFO,
231 QString(
"CheckSetup[%1]: ").arg(cardid) +
"Changed " + msg);
235 LOG(VB_GENERAL, LOG_ERR,
236 QString(
"CheckSetup[%1]: ").arg(cardid) +
"Failed to change " + msg);
242 probs.push_back(QObject::tr(
"Card %1 (%2) No visible channels found")
243 .arg(cardid).arg(query.
value(3).toString()));
256 bool problemFound =
false;
260 query.
prepare(
"SELECT count(*) total, "
261 " count(distinct right(if(displayname<>'',"
262 " displayname, NULL), 2)) uniq "
264 "WHERE parentid = 0");
272 int total = query.
value(0).toInt();
273 int uniq = query.
value(1).toInt();
276 probs.push_back(QObject::tr(
277 "The display names for one or more inputs are not "
278 "sufficiently unique. They must be set and the "
279 "last two characters must be unique because some "
280 "themes use them to identify the input."));
300 bool needsReminder =
false;
303 query.
prepare(
"SELECT sourceid "
305 "WHERE xmltvgrabber LIKE 'tv_grab_%';");
310 else if (query.
size() >= 1)
312 needsReminder =
true;
315 return needsReminder;
bool checkImageStoragePaths(QStringList &probs)
bool checkInputDisplayNames(QStringList &probs)
bool checkChannelPresets(QStringList &probs)
bool checkStoragePaths(QStringList &probs)
Do the Storage Group filesystem paths exist? Are they writable? Is the Live TV filesystem large enoug...
bool CheckSetup(QStringList &problems)
Build up a string of common problems that the user should correct in the MythTV-Setup program.
static bool checkPath(QString path, QStringList &probs)
Check that a directory path exists and is writable.
static QString GetStartChannel(uint inputid)
static bool SetStartChannel(uint inputid, const QString &channum)
QSqlQuery wrapper that fetches a DB connection from the connection pool.
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
QVariant value(int i) const
bool isActive(void) const
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
QString GetHostName(void)
bool IsMasterHost(void)
is this the same host as the master
static void DBError(const QString &where, const MSqlQuery &query)
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)