2 #include <QHostAddress>
3 #include <QNetworkInterface>
14 #include "libmythbase/mythversion.h"
15 #include "libmythbase/version.h"
33 qRegisterMetaType<V2ConnectionInfo*>(
"V2ConnectionInfo");
34 qRegisterMetaType<V2CountryList*>(
"V2CountryList");
35 qRegisterMetaType<V2Country*>(
"V2Country");
36 qRegisterMetaType<V2LanguageList*>(
"V2LanguageList");
37 qRegisterMetaType<V2Language*>(
"V2Language");
38 qRegisterMetaType<V2DatabaseStatus*>(
"V2DatabaseStatus");
39 qRegisterMetaType<V2SystemEvent*>(
"V2SystemEvent");
40 qRegisterMetaType<V2SystemEventList*>(
"V2SystemEventList");
53 const QString &
Password,
const QString &
Name,
int Port,
bool DoTest,
54 bool LocalEnabled,
const QString &LocalHostName,
bool WOLEnabled,
55 int WOLReconnect,
int WOLRetry,
const QString &WOLCommand)
59 QString db(
"mythconverg");
119 pInfo->setConnected(connected);
124 bool haveSchema =
GetMythDB()->HaveSchema();
125 pInfo->setHaveDatabase(haveSchema);
130 pInfo->setSchemaVersion(QString(MYTH_DATABASE_VERSION).toInt());
133 pInfo->setSchemaVersion(0);
137 pInfo->setHaveDatabase(
false);
138 pInfo->setSchemaVersion(0);
151 QStringList locales = localesMap.values();
156 for (
const auto& country : qAsConst(locales))
158 const QString code = localesMap.key(country);
161 V2Country *pCountry = pList->AddNewCountry();
162 pCountry->setCode(code);
163 pCountry->setCountry(country);
164 pCountry->setNativeCountry(nativeCountry);
165 pCountry->setImage(QString(
"%1.png").arg(code.toLower()));
177 QStringList langs = langMap.values();
182 for (
const auto& nativeLang : qAsConst(langs))
184 const QString code = langMap.key(nativeLang);
187 V2Language *pLanguage = pList->AddNewLanguage();
188 pLanguage->setCode(code);
189 pLanguage->setLanguage(language);
190 pLanguage->setNativeLanguage(nativeLang);
191 pLanguage->setImage(QString(
"%1.png").arg(code));
203 QString protocol = Protocol;
205 if (protocol !=
"IPv4" && protocol !=
"IPv6")
210 QList<QHostAddress> list = QNetworkInterface::allAddresses();
211 QList<QHostAddress>::iterator it;
213 for (it = list.begin(); it != list.end(); ++it)
215 if (((*it).protocol() == QAbstractSocket::IPv4Protocol && protocol ==
"IPv4") ||
216 ((*it).protocol() == QAbstractSocket::IPv6Protocol && protocol ==
"IPv6") || protocol ==
"All")
218 it->setScopeId(QString());
219 oList.append((*it).toString());
234 QMap <QString, QString> settings;
236 QMap<QString, QString>::const_iterator it;
237 for (it = settings.constBegin(); it != settings.constEnd(); ++it)
240 event->setKey(it.key());
241 event->setLocalizedName(it.value());