| 1 | diff --git a/mythtv/libs/libmythui/mythgenerictree.h b/mythtv/libs/libmythui/mythgenerictree.h
|
|---|
| 2 | index 5333e1f..15f6073 100644
|
|---|
| 3 | --- a/mythtv/libs/libmythui/mythgenerictree.h
|
|---|
| 4 | +++ b/mythtv/libs/libmythui/mythgenerictree.h
|
|---|
| 5 | @@ -123,12 +123,14 @@ class MUI_PUBLIC MythGenericTree
|
|---|
| 6 |
|
|---|
| 7 | virtual MythUIButtonListItem *CreateListButton(MythUIButtonList *list);
|
|---|
| 8 |
|
|---|
| 9 | + protected:
|
|---|
| 10 | + QMap<QString, TextProperties> m_strings;
|
|---|
| 11 | + QMap<QString, QString> m_imageFilenames;
|
|---|
| 12 | private:
|
|---|
| 13 | void reorderSubnodes(void);
|
|---|
| 14 |
|
|---|
| 15 | QString m_text;
|
|---|
| 16 | - QMap<QString, TextProperties> m_strings;
|
|---|
| 17 | - QMap<QString, QString> m_imageFilenames;
|
|---|
| 18 | +
|
|---|
| 19 | QMap<QString, QString> m_states;
|
|---|
| 20 | int m_int;
|
|---|
| 21 | QVariant m_data;
|
|---|
| 22 | diff --git a/mythtv/programs/mythfrontend/globalsettings.cpp b/mythtv/programs/mythfrontend/globalsettings.cpp
|
|---|
| 23 | index a379b8f..f1ffc15 100644
|
|---|
| 24 | --- a/mythtv/programs/mythfrontend/globalsettings.cpp
|
|---|
| 25 | +++ b/mythtv/programs/mythfrontend/globalsettings.cpp
|
|---|
| 26 | @@ -7,6 +7,10 @@
|
|---|
| 27 | #include <sys/types.h>
|
|---|
| 28 | #include <sys/stat.h>
|
|---|
| 29 |
|
|---|
| 30 | +//use by fabs I believe
|
|---|
| 31 | +#include <algorithm>
|
|---|
| 32 | +#include <cmath>
|
|---|
| 33 | +
|
|---|
| 34 | // Qt headers
|
|---|
| 35 | #include <QCoreApplication>
|
|---|
| 36 | #include <QEvent>
|
|---|
| 37 | @@ -24,7 +28,7 @@
|
|---|
| 38 | #include "mythcorecontext.h"
|
|---|
| 39 | #include "mythdbcon.h"
|
|---|
| 40 | #include "mythlogging.h"
|
|---|
| 41 | -#include "dbsettings.h"
|
|---|
| 42 | +//#include "dbsettings.h"
|
|---|
| 43 | #include "mythtranslation.h"
|
|---|
| 44 | #include "iso639.h"
|
|---|
| 45 | #include "playbackbox.h"
|
|---|
| 46 | @@ -39,9 +43,265 @@
|
|---|
| 47 | #include "mythdirs.h"
|
|---|
| 48 | #include "mythuihelper.h"
|
|---|
| 49 |
|
|---|
| 50 | -static HostCheckBox *DecodeExtraAudio()
|
|---|
| 51 | +/* This class have been copied from settingdb.h/.cpp and modified
|
|---|
| 52 | + I believe this is also used by mythtv-setup so
|
|---|
| 53 | +I did not want to break it by modifying the original*/
|
|---|
| 54 | +class MythDbSettings: public GroupSetting {
|
|---|
| 55 | +public:
|
|---|
| 56 | + MythDbSettings();
|
|---|
| 57 | +
|
|---|
| 58 | + void Load(void);
|
|---|
| 59 | + void Save(void);
|
|---|
| 60 | +
|
|---|
| 61 | +protected:
|
|---|
| 62 | + TransLineEditTree *dbHostName;
|
|---|
| 63 | + TransCheckBoxTree *dbHostPing;
|
|---|
| 64 | + TransLineEditTree *dbPort;
|
|---|
| 65 | + TransLineEditTree *dbName;
|
|---|
| 66 | + TransLineEditTree *dbUserName;
|
|---|
| 67 | + TransLineEditTree *dbPassword;
|
|---|
| 68 | + TransCheckBoxTree *localEnabled;
|
|---|
| 69 | + TransLineEditTree *localHostName;
|
|---|
| 70 | + TransCheckBoxTree *wolEnabled;
|
|---|
| 71 | + TransSpinBoxTree *wolReconnect;
|
|---|
| 72 | + TransSpinBoxTree *wolRetry;
|
|---|
| 73 | + TransLineEditTree *wolCommand;
|
|---|
| 74 | +};
|
|---|
| 75 | +
|
|---|
| 76 | +
|
|---|
| 77 | +
|
|---|
| 78 | +MythDbSettings::MythDbSettings() :
|
|---|
| 79 | + GroupSetting()
|
|---|
| 80 | +{
|
|---|
| 81 | +
|
|---|
| 82 | + setLabel(QObject::tr("Database Configuration"));
|
|---|
| 83 | +
|
|---|
| 84 | + MSqlQuery query(MSqlQuery::InitCon());
|
|---|
| 85 | + if (query.isConnected())
|
|---|
| 86 | + setHelpText(QObject::tr("All database settings take effect when "
|
|---|
| 87 | + "you restart this program."));
|
|---|
| 88 | + else
|
|---|
| 89 | + setHelpText(QObject::tr("MythTV could not connect to the database. "
|
|---|
| 90 | + "Please verify your database settings "
|
|---|
| 91 | + "below."));
|
|---|
| 92 | +
|
|---|
| 93 | + GroupSetting* dbServer = new GroupSetting();
|
|---|
| 94 | + dbServer->setLabel(QObject::tr("Database Server Settings"));
|
|---|
| 95 | + dbHostName = new TransLineEditTree();
|
|---|
| 96 | + dbHostName->setLabel(QObject::tr("Hostname"));
|
|---|
| 97 | + dbHostName->setHelpText(QObject::tr("The host name or IP address of "
|
|---|
| 98 | + "the machine hosting the database. "
|
|---|
| 99 | + "This information is required."));
|
|---|
| 100 | + dbServer->addChild(dbHostName);
|
|---|
| 101 | +
|
|---|
| 102 | +
|
|---|
| 103 | + dbHostPing = new TransCheckBoxTree();
|
|---|
| 104 | + dbHostPing->setLabel(QObject::tr("Ping test server?"));
|
|---|
| 105 | + dbHostPing->setHelpText(QObject::tr("Test basic host connectivity using "
|
|---|
| 106 | + "the ping command. Turn off if your "
|
|---|
| 107 | + "host or network don't support ping "
|
|---|
| 108 | + "(ICMP ECHO) packets"));
|
|---|
| 109 | + dbServer->addChild(dbHostPing);
|
|---|
| 110 | +
|
|---|
| 111 | +
|
|---|
| 112 | + dbPort = new TransLineEditTree();
|
|---|
| 113 | + dbPort->setLabel(QObject::tr("Port"));
|
|---|
| 114 | + dbPort->setHelpText(QObject::tr("The port number the database is running "
|
|---|
| 115 | + "on. Leave blank if using the default "
|
|---|
| 116 | + "port (3306)."));
|
|---|
| 117 | + dbServer->addChild(dbPort);
|
|---|
| 118 | +
|
|---|
| 119 | + dbName = new TransLineEditTree();
|
|---|
| 120 | + dbName->setLabel(QObject::tr("Database name"));
|
|---|
| 121 | + dbName->setHelpText(QObject::tr("The name of the database. "
|
|---|
| 122 | + "This information is required."));
|
|---|
| 123 | + dbServer->addChild(dbName);
|
|---|
| 124 | +
|
|---|
| 125 | + dbUserName = new TransLineEditTree();
|
|---|
| 126 | + dbUserName->setLabel(QObject::tr("User"));
|
|---|
| 127 | + dbUserName->setHelpText(QObject::tr("The user name to use while "
|
|---|
| 128 | + "connecting to the database. "
|
|---|
| 129 | + "This information is required."));
|
|---|
| 130 | + dbServer->addChild(dbUserName);
|
|---|
| 131 | +
|
|---|
| 132 | + dbPassword = new TransLineEditTree();
|
|---|
| 133 | + dbPassword->setLabel(QObject::tr("Password"));
|
|---|
| 134 | + dbPassword->setHelpText(QObject::tr("The password to use while "
|
|---|
| 135 | + "connecting to the database. "
|
|---|
| 136 | + "This information is required."));
|
|---|
| 137 | + dbServer->addChild(dbPassword);
|
|---|
| 138 | +
|
|---|
| 139 | + addChild(dbServer);
|
|---|
| 140 | +
|
|---|
| 141 | + localEnabled = new TransCheckBoxTree();
|
|---|
| 142 | + localEnabled->setLabel(QObject::tr("Use custom identifier for frontend "
|
|---|
| 143 | + "preferences"));
|
|---|
| 144 | + localEnabled->setHelpText(QObject::tr("If this frontend's host name "
|
|---|
| 145 | + "changes often, check this box "
|
|---|
| 146 | + "and provide a network-unique "
|
|---|
| 147 | + "name to identify it. "
|
|---|
| 148 | + "If unchecked, the frontend "
|
|---|
| 149 | + "machine's local host name will "
|
|---|
| 150 | + "be used to save preferences in "
|
|---|
| 151 | + "the database."));
|
|---|
| 152 | +
|
|---|
| 153 | + localHostName = new TransLineEditTree(true);
|
|---|
| 154 | + localHostName->setLabel(QObject::tr("Custom identifier"));
|
|---|
| 155 | + localHostName->setHelpText(QObject::tr("An identifier to use while "
|
|---|
| 156 | + "saving the settings for this "
|
|---|
| 157 | + "frontend."));
|
|---|
| 158 | + localEnabled->addChild(true, localHostName);
|
|---|
| 159 | +
|
|---|
| 160 | + wolEnabled = new TransCheckBoxTree();
|
|---|
| 161 | + wolEnabled->setLabel(QObject::tr("Enable database server wakeup"));
|
|---|
| 162 | + wolEnabled->setHelpText(QObject::tr("If enabled, the frontend will use "
|
|---|
| 163 | + "database wakeup parameters to "
|
|---|
| 164 | + "reconnect to the database server."));
|
|---|
| 165 | +
|
|---|
| 166 | + wolReconnect = new TransSpinBoxTree(0, 60, 1, true);
|
|---|
| 167 | + wolReconnect->setLabel(QObject::tr("Reconnect time"));
|
|---|
| 168 | + wolReconnect->setHelpText(QObject::tr("The time in seconds to wait for "
|
|---|
| 169 | + "the server to wake up."));
|
|---|
| 170 | +
|
|---|
| 171 | + wolEnabled->addChild(true, wolReconnect);
|
|---|
| 172 | +
|
|---|
| 173 | + wolRetry = new TransSpinBoxTree(1, 10, 1, true);
|
|---|
| 174 | + wolRetry->setLabel(QObject::tr("Retry attempts"));
|
|---|
| 175 | + wolRetry->setHelpText(QObject::tr("The number of retries to wake the "
|
|---|
| 176 | + "server before the frontend gives "
|
|---|
| 177 | + "up."));
|
|---|
| 178 | +
|
|---|
| 179 | + wolEnabled->addChild(true, wolReconnect);
|
|---|
| 180 | +
|
|---|
| 181 | + wolCommand = new TransLineEditTree(true);
|
|---|
| 182 | + wolCommand->setLabel(QObject::tr("Wake command"));
|
|---|
| 183 | + wolCommand->setHelpText(QObject::tr("The command executed on this "
|
|---|
| 184 | + "frontend to wake up the database "
|
|---|
| 185 | + "server (eg. sudo /etc/init.d/mysql "
|
|---|
| 186 | + "restart)."));
|
|---|
| 187 | +
|
|---|
| 188 | + wolEnabled->addChild(true, wolCommand);
|
|---|
| 189 | +
|
|---|
| 190 | + addChild(wolEnabled);
|
|---|
| 191 | +}
|
|---|
| 192 | +
|
|---|
| 193 | +void MythDbSettings::Load(void)
|
|---|
| 194 | +{
|
|---|
| 195 | + DatabaseParams params = gContext->GetDatabaseParams();
|
|---|
| 196 | +
|
|---|
| 197 | + if (params.dbHostName.isEmpty() ||
|
|---|
| 198 | + params.dbUserName.isEmpty() ||
|
|---|
| 199 | + params.dbPassword.isEmpty() ||
|
|---|
| 200 | + params.dbName.isEmpty())
|
|---|
| 201 | + setHelpText(getHelpText() + "\n" +
|
|---|
| 202 | + QObject::tr("Required fields are"
|
|---|
| 203 | + " marked with an asterisk (*)."));
|
|---|
| 204 | +
|
|---|
| 205 | + if (params.dbHostName.isEmpty())
|
|---|
| 206 | + {
|
|---|
| 207 | + dbHostName->setLabel("* " + dbHostName->getLabel());
|
|---|
| 208 | +//TODO? dbHostName->setValue(m_DBhostOverride);
|
|---|
| 209 | + }
|
|---|
| 210 | + else
|
|---|
| 211 | + dbHostName->setValue(params.dbHostName);
|
|---|
| 212 | +
|
|---|
| 213 | + dbHostPing->setValue(params.dbHostPing);
|
|---|
| 214 | +
|
|---|
| 215 | + if (params.dbPort)
|
|---|
| 216 | + dbPort->setValue(QString::number(params.dbPort));
|
|---|
| 217 | +
|
|---|
| 218 | + dbUserName->setValue(params.dbUserName);
|
|---|
| 219 | + if (params.dbUserName.isEmpty())
|
|---|
| 220 | + dbUserName->setLabel("* " + dbUserName->getLabel());
|
|---|
| 221 | + dbPassword->setValue(params.dbPassword);
|
|---|
| 222 | + if (params.dbPassword.isEmpty())
|
|---|
| 223 | + dbPassword->setLabel("* " + dbPassword->getLabel());
|
|---|
| 224 | + dbName->setValue(params.dbName);
|
|---|
| 225 | + if (params.dbName.isEmpty())
|
|---|
| 226 | + dbName->setLabel("* " + dbName->getLabel());
|
|---|
| 227 | +
|
|---|
| 228 | + localEnabled->setValue(params.localEnabled);
|
|---|
| 229 | + localHostName->setValue(params.localHostName);
|
|---|
| 230 | +
|
|---|
| 231 | + wolEnabled->setValue(params.wolEnabled);
|
|---|
| 232 | + wolReconnect->setValue(params.wolReconnect);
|
|---|
| 233 | + wolRetry->setValue(params.wolRetry);
|
|---|
| 234 | + wolCommand->setValue(params.wolCommand);
|
|---|
| 235 | +}
|
|---|
| 236 | +
|
|---|
| 237 | +void MythDbSettings::Save(void)
|
|---|
| 238 | +{
|
|---|
| 239 | + DatabaseParams params = gContext->GetDatabaseParams();
|
|---|
| 240 | +
|
|---|
| 241 | + params.dbHostName = dbHostName->getValue();
|
|---|
| 242 | + params.dbHostPing = dbHostPing->boolValue();
|
|---|
| 243 | + params.dbPort = dbPort->getValue().toInt();
|
|---|
| 244 | + params.dbUserName = dbUserName->getValue();
|
|---|
| 245 | + params.dbPassword = dbPassword->getValue();
|
|---|
| 246 | + params.dbName = dbName->getValue();
|
|---|
| 247 | + params.dbType = "QMYSQL";
|
|---|
| 248 | + params.localEnabled = localEnabled->boolValue();
|
|---|
| 249 | + params.localHostName = localHostName->getValue();
|
|---|
| 250 | + params.wolEnabled = wolEnabled->boolValue();
|
|---|
| 251 | + params.wolReconnect = wolReconnect->intValue();
|
|---|
| 252 | + params.wolRetry = wolRetry->intValue();
|
|---|
| 253 | + params.wolCommand = wolCommand->getValue();
|
|---|
| 254 | +
|
|---|
| 255 | + gContext->SaveDatabaseParams(params);
|
|---|
| 256 | +}
|
|---|
| 257 | +
|
|---|
| 258 | +/* this class have been copied from HostRefreshRateComboBox in settings.h */
|
|---|
| 259 | +
|
|---|
| 260 | +
|
|---|
| 261 | +
|
|---|
| 262 | +void HostRefreshRateComboBoxTree::ChangeResolution(const QString& resolution)
|
|---|
| 263 | +{
|
|---|
| 264 | + LOG(VB_GENERAL, LOG_ERR, QString("HostRefreshRateComboBoxTree::ChangeResolution()"));
|
|---|
| 265 | +
|
|---|
| 266 | + clearSelections();
|
|---|
| 267 | +
|
|---|
| 268 | + const vector<double> list = GetRefreshRates(resolution);
|
|---|
| 269 | + addSelection(QObject::tr("Any"), "0");
|
|---|
| 270 | + int hz50 = -1, hz60 = -1;
|
|---|
| 271 | + for (uint i=0; i<list.size(); ++i)
|
|---|
| 272 | + {
|
|---|
| 273 | + QString sel = QString::number((double) list[i],'f', 3);
|
|---|
| 274 | + addSelection(sel+" Hz", sel);
|
|---|
| 275 | + hz50 = (fabs(50.0 - list[i]) < 0.01) ? i : hz50;
|
|---|
| 276 | + hz60 = (fabs(60.0 - list[i]) < 0.01) ? i : hz60;
|
|---|
| 277 | + }
|
|---|
| 278 | +
|
|---|
| 279 | + setValue(0);
|
|---|
| 280 | + if ("640x480" == resolution || "720x480" == resolution)
|
|---|
| 281 | + setValue(hz60+1);
|
|---|
| 282 | + if ("640x576" == resolution || "720x576" == resolution)
|
|---|
| 283 | + setValue(hz50+1);
|
|---|
| 284 | +
|
|---|
| 285 | + setEnabled(list.size());
|
|---|
| 286 | +}
|
|---|
| 287 | +
|
|---|
| 288 | +const vector<double> HostRefreshRateComboBoxTree::GetRefreshRates(const QString &res)
|
|---|
| 289 | +{
|
|---|
| 290 | + QStringList slist = res.split("x");
|
|---|
| 291 | + int w = 0, h = 0;
|
|---|
| 292 | + bool ok0 = false, ok1 = false;
|
|---|
| 293 | + if (2 == slist.size())
|
|---|
| 294 | + {
|
|---|
| 295 | + w = slist[0].toInt(&ok0);
|
|---|
| 296 | + h = slist[1].toInt(&ok1);
|
|---|
| 297 | + }
|
|---|
| 298 | +
|
|---|
| 299 | + DisplayRes *display_res = DisplayRes::GetDisplayRes();
|
|---|
| 300 | + if (display_res && ok0 && ok1)
|
|---|
| 301 | + return display_res->GetRefreshRates(w, h);
|
|---|
| 302 | +
|
|---|
| 303 | + vector<double> list;
|
|---|
| 304 | + return list;
|
|---|
| 305 | +}
|
|---|
| 306 | +
|
|---|
| 307 | +static HostCheckBoxTree *DecodeExtraAudio()
|
|---|
| 308 | {
|
|---|
| 309 | - HostCheckBox *gc = new HostCheckBox("DecodeExtraAudio");
|
|---|
| 310 | + HostCheckBoxTree *gc = new HostCheckBoxTree("DecodeExtraAudio");
|
|---|
| 311 | gc->setLabel(QObject::tr("Extra audio buffering"));
|
|---|
| 312 | gc->setValue(true);
|
|---|
| 313 | gc->setHelpText(QObject::tr("Enable this setting if MythTV is playing "
|
|---|
| 314 | @@ -53,9 +313,9 @@ static HostCheckBox *DecodeExtraAudio()
|
|---|
| 315 | return gc;
|
|---|
| 316 | }
|
|---|
| 317 |
|
|---|
| 318 | -static HostComboBox *PIPLocationComboBox()
|
|---|
| 319 | +static HostComboBoxTree *PIPLocationComboBox()
|
|---|
| 320 | {
|
|---|
| 321 | - HostComboBox *gc = new HostComboBox("PIPLocation");
|
|---|
| 322 | + HostComboBoxTree *gc = new HostComboBoxTree("PIPLocation");
|
|---|
| 323 | gc->setLabel(QObject::tr("PIP video location"));
|
|---|
| 324 | for (uint loc = 0; loc < kPIP_END; ++loc)
|
|---|
| 325 | gc->addSelection(toString((PIPLocation) loc), QString::number(loc));
|
|---|
| 326 | @@ -63,9 +323,9 @@ static HostComboBox *PIPLocationComboBox()
|
|---|
| 327 | return gc;
|
|---|
| 328 | }
|
|---|
| 329 |
|
|---|
| 330 | -static HostComboBox *DisplayRecGroup()
|
|---|
| 331 | +static HostComboBoxTree *DisplayRecGroup()
|
|---|
| 332 | {
|
|---|
| 333 | - HostComboBox *gc = new HostComboBox("DisplayRecGroup");
|
|---|
| 334 | + HostComboBoxTree *gc = new HostComboBoxTree("DisplayRecGroup");
|
|---|
| 335 | gc->setLabel(QObject::tr("Default group filter to apply"));
|
|---|
| 336 |
|
|---|
| 337 | gc->addSelection(QObject::tr("All Programs"), QString("All Programs"));
|
|---|
| 338 | @@ -102,9 +362,9 @@ static HostComboBox *DisplayRecGroup()
|
|---|
| 339 | return gc;
|
|---|
| 340 | }
|
|---|
| 341 |
|
|---|
| 342 | -static HostCheckBox *QueryInitialFilter()
|
|---|
| 343 | +static HostCheckBoxTree *QueryInitialFilter()
|
|---|
| 344 | {
|
|---|
| 345 | - HostCheckBox *gc = new HostCheckBox("QueryInitialFilter");
|
|---|
| 346 | + HostCheckBoxTree *gc = new HostCheckBoxTree("QueryInitialFilter");
|
|---|
| 347 | gc->setLabel(QObject::tr("Always prompt for initial group filter"));
|
|---|
| 348 | gc->setValue(false);
|
|---|
| 349 | gc->setHelpText(QObject::tr("If enabled, always prompt the user for the "
|
|---|
| 350 | @@ -113,9 +373,9 @@ static HostCheckBox *QueryInitialFilter()
|
|---|
| 351 | return gc;
|
|---|
| 352 | }
|
|---|
| 353 |
|
|---|
| 354 | -static HostCheckBox *RememberRecGroup()
|
|---|
| 355 | +static HostCheckBoxTree *RememberRecGroup()
|
|---|
| 356 | {
|
|---|
| 357 | - HostCheckBox *gc = new HostCheckBox("RememberRecGroup");
|
|---|
| 358 | + HostCheckBoxTree *gc = new HostCheckBoxTree("RememberRecGroup");
|
|---|
| 359 | gc->setLabel(QObject::tr("Save current group filter when changed"));
|
|---|
| 360 | gc->setValue(true);
|
|---|
| 361 | gc->setHelpText(QObject::tr("If enabled, remember the last selected filter "
|
|---|
| 362 | @@ -124,9 +384,9 @@ static HostCheckBox *RememberRecGroup()
|
|---|
| 363 | return gc;
|
|---|
| 364 | }
|
|---|
| 365 |
|
|---|
| 366 | -static HostCheckBox *UseGroupNameAsAllPrograms()
|
|---|
| 367 | +static HostCheckBoxTree *UseGroupNameAsAllPrograms()
|
|---|
| 368 | {
|
|---|
| 369 | - HostCheckBox *gc = new HostCheckBox("DispRecGroupAsAllProg");
|
|---|
| 370 | + HostCheckBoxTree *gc = new HostCheckBoxTree("DispRecGroupAsAllProg");
|
|---|
| 371 | gc->setLabel(QObject::tr("Show filter name instead of \"All Programs\""));
|
|---|
| 372 | gc->setValue(false);
|
|---|
| 373 | gc->setHelpText(QObject::tr("If enabled, use the name of the display "
|
|---|
| 374 | @@ -135,9 +395,9 @@ static HostCheckBox *UseGroupNameAsAllPrograms()
|
|---|
| 375 | return gc;
|
|---|
| 376 | }
|
|---|
| 377 |
|
|---|
| 378 | -static HostCheckBox *PBBStartInTitle()
|
|---|
| 379 | +static HostCheckBoxTree *PBBStartInTitle()
|
|---|
| 380 | {
|
|---|
| 381 | - HostCheckBox *gc = new HostCheckBox("PlaybackBoxStartInTitle");
|
|---|
| 382 | + HostCheckBoxTree *gc = new HostCheckBoxTree("PlaybackBoxStartInTitle");
|
|---|
| 383 | gc->setLabel(QObject::tr("Start in group list"));
|
|---|
| 384 | gc->setValue(true);
|
|---|
| 385 | gc->setHelpText(QObject::tr("If enabled, the focus will "
|
|---|
| 386 | @@ -146,9 +406,9 @@ static HostCheckBox *PBBStartInTitle()
|
|---|
| 387 | return gc;
|
|---|
| 388 | }
|
|---|
| 389 |
|
|---|
| 390 | -static HostCheckBox *SmartForward()
|
|---|
| 391 | +static HostCheckBoxTree *SmartForward()
|
|---|
| 392 | {
|
|---|
| 393 | - HostCheckBox *gc = new HostCheckBox("SmartForward");
|
|---|
| 394 | + HostCheckBoxTree *gc = new HostCheckBoxTree("SmartForward");
|
|---|
| 395 | gc->setLabel(QObject::tr("Smart fast forwarding"));
|
|---|
| 396 | gc->setValue(false);
|
|---|
| 397 | gc->setHelpText(QObject::tr("If enabled, then immediately after "
|
|---|
| 398 | @@ -157,9 +417,9 @@ static HostCheckBox *SmartForward()
|
|---|
| 399 | return gc;
|
|---|
| 400 | }
|
|---|
| 401 |
|
|---|
| 402 | -static HostCheckBox *ExactSeeking()
|
|---|
| 403 | +static HostCheckBoxTree *ExactSeeking()
|
|---|
| 404 | {
|
|---|
| 405 | - HostCheckBox *gc = new HostCheckBox("ExactSeeking");
|
|---|
| 406 | + HostCheckBoxTree *gc = new HostCheckBoxTree("ExactSeeking");
|
|---|
| 407 | gc->setLabel(QObject::tr("Seek to exact frame"));
|
|---|
| 408 | gc->setValue(false);
|
|---|
| 409 | gc->setHelpText(QObject::tr("If enabled, seeking is frame exact, but "
|
|---|
| 410 | @@ -167,9 +427,9 @@ static HostCheckBox *ExactSeeking()
|
|---|
| 411 | return gc;
|
|---|
| 412 | }
|
|---|
| 413 |
|
|---|
| 414 | -static GlobalComboBox *CommercialSkipMethod()
|
|---|
| 415 | +static GlobalComboBoxTree *CommercialSkipMethod()
|
|---|
| 416 | {
|
|---|
| 417 | - GlobalComboBox *bc = new GlobalComboBox("CommercialSkipMethod");
|
|---|
| 418 | + GlobalComboBoxTree *bc = new GlobalComboBoxTree("CommercialSkipMethod");
|
|---|
| 419 | bc->setLabel(QObject::tr("Commercial detection method"));
|
|---|
| 420 | bc->setHelpText(QObject::tr(
|
|---|
| 421 | "This determines the method used by MythTV to "
|
|---|
| 422 | @@ -182,9 +442,9 @@ static GlobalComboBox *CommercialSkipMethod()
|
|---|
| 423 | return bc;
|
|---|
| 424 | }
|
|---|
| 425 |
|
|---|
| 426 | -static GlobalCheckBox *CommFlagFast()
|
|---|
| 427 | +static GlobalCheckBoxTree *CommFlagFast()
|
|---|
| 428 | {
|
|---|
| 429 | - GlobalCheckBox *gc = new GlobalCheckBox("CommFlagFast");
|
|---|
| 430 | + GlobalCheckBoxTree *gc = new GlobalCheckBoxTree("CommFlagFast");
|
|---|
| 431 | gc->setLabel(QObject::tr("Enable experimental speedup of commercial detection"));
|
|---|
| 432 | gc->setValue(false);
|
|---|
| 433 | gc->setHelpText(QObject::tr("If enabled, experimental commercial detection "
|
|---|
| 434 | @@ -192,9 +452,9 @@ static GlobalCheckBox *CommFlagFast()
|
|---|
| 435 | return gc;
|
|---|
| 436 | }
|
|---|
| 437 |
|
|---|
| 438 | -static HostComboBox *AutoCommercialSkip()
|
|---|
| 439 | +static HostComboBoxTree *AutoCommercialSkip()
|
|---|
| 440 | {
|
|---|
| 441 | - HostComboBox *gc = new HostComboBox("AutoCommercialSkip");
|
|---|
| 442 | + HostComboBoxTree *gc = new HostComboBoxTree("AutoCommercialSkip");
|
|---|
| 443 | gc->setLabel(QObject::tr("Automatically skip commercials"));
|
|---|
| 444 | gc->addSelection(QObject::tr("Off"), "0");
|
|---|
| 445 | gc->addSelection(QObject::tr("Notify, but do not skip"), "2");
|
|---|
| 446 | @@ -206,9 +466,9 @@ static HostComboBox *AutoCommercialSkip()
|
|---|
| 447 | return gc;
|
|---|
| 448 | }
|
|---|
| 449 |
|
|---|
| 450 | -static GlobalCheckBox *AutoMetadataLookup()
|
|---|
| 451 | +static GlobalCheckBoxTree *AutoMetadataLookup()
|
|---|
| 452 | {
|
|---|
| 453 | - GlobalCheckBox *bc = new GlobalCheckBox("AutoMetadataLookup");
|
|---|
| 454 | + GlobalCheckBoxTree *bc = new GlobalCheckBoxTree("AutoMetadataLookup");
|
|---|
| 455 | bc->setLabel(QObject::tr("Run metadata lookup"));
|
|---|
| 456 | bc->setValue(true);
|
|---|
| 457 | bc->setHelpText(QObject::tr("This is the default value used for the "
|
|---|
| 458 | @@ -217,9 +477,9 @@ static GlobalCheckBox *AutoMetadataLookup()
|
|---|
| 459 | return bc;
|
|---|
| 460 | }
|
|---|
| 461 |
|
|---|
| 462 | -static GlobalCheckBox *AutoCommercialFlag()
|
|---|
| 463 | +static GlobalCheckBoxTree *AutoCommercialFlag()
|
|---|
| 464 | {
|
|---|
| 465 | - GlobalCheckBox *bc = new GlobalCheckBox("AutoCommercialFlag");
|
|---|
| 466 | + GlobalCheckBoxTree *bc = new GlobalCheckBoxTree("AutoCommercialFlag");
|
|---|
| 467 | bc->setLabel(QObject::tr("Run commercial detection"));
|
|---|
| 468 | bc->setValue(true);
|
|---|
| 469 | bc->setHelpText(QObject::tr("This is the default value used for the "
|
|---|
| 470 | @@ -228,9 +488,9 @@ static GlobalCheckBox *AutoCommercialFlag()
|
|---|
| 471 | return bc;
|
|---|
| 472 | }
|
|---|
| 473 |
|
|---|
| 474 | -static GlobalCheckBox *AutoTranscode()
|
|---|
| 475 | +static GlobalCheckBoxTree *AutoTranscode()
|
|---|
| 476 | {
|
|---|
| 477 | - GlobalCheckBox *bc = new GlobalCheckBox("AutoTranscode");
|
|---|
| 478 | + GlobalCheckBoxTree *bc = new GlobalCheckBoxTree("AutoTranscode");
|
|---|
| 479 | bc->setLabel(QObject::tr("Run transcoder"));
|
|---|
| 480 | bc->setValue(false);
|
|---|
| 481 | bc->setHelpText(QObject::tr("This is the default value used for the "
|
|---|
| 482 | @@ -239,21 +499,30 @@ static GlobalCheckBox *AutoTranscode()
|
|---|
| 483 | return bc;
|
|---|
| 484 | }
|
|---|
| 485 |
|
|---|
| 486 | -static GlobalComboBox *DefaultTranscoder()
|
|---|
| 487 | +static GlobalComboBoxTree *DefaultTranscoder()
|
|---|
| 488 | {
|
|---|
| 489 | - GlobalComboBox *bc = new GlobalComboBox("DefaultTranscoder");
|
|---|
| 490 | - bc->setLabel(QObject::tr("Default transcoder"));
|
|---|
| 491 | + GlobalComboBoxTree *ls = new GlobalComboBoxTree("DefaultTranscoder");
|
|---|
| 492 | + ls->setLabel(QObject::tr("Default transcoder"));
|
|---|
| 493 | + //begin hack, I did not want to change any code outside of mythfrontend
|
|---|
| 494 | + GlobalComboBox *bc = new GlobalComboBox("DefaultTranscoder");
|
|---|
| 495 | RecordingProfile::fillSelections(bc, RecordingProfile::TranscoderGroup,
|
|---|
| 496 | - true);
|
|---|
| 497 | - bc->setHelpText(QObject::tr("This is the default value used for the "
|
|---|
| 498 | + true);
|
|---|
| 499 | + uint i;
|
|---|
| 500 | + for (i=0; i< bc->size(); i++)
|
|---|
| 501 | + {
|
|---|
| 502 | + ls->addSelection(bc->GetLabel(i),bc->GetValue(i));
|
|---|
| 503 | + }
|
|---|
| 504 | + delete bc;
|
|---|
| 505 | + //end hack
|
|---|
| 506 | + ls->setHelpText(QObject::tr("This is the default value used for the "
|
|---|
| 507 | "transcoder setting when a new scheduled "
|
|---|
| 508 | "recording is created."));
|
|---|
| 509 | - return bc;
|
|---|
| 510 | + return ls;
|
|---|
| 511 | }
|
|---|
| 512 |
|
|---|
| 513 | -static GlobalSpinBox *DeferAutoTranscodeDays()
|
|---|
| 514 | +static GlobalSpinBoxTree *DeferAutoTranscodeDays()
|
|---|
| 515 | {
|
|---|
| 516 | - GlobalSpinBox *gs = new GlobalSpinBox("DeferAutoTranscodeDays", 0, 365, 1);
|
|---|
| 517 | + GlobalSpinBoxTree *gs = new GlobalSpinBoxTree("DeferAutoTranscodeDays", 0, 365, 1);
|
|---|
| 518 | gs->setLabel(QObject::tr("Deferral days for auto transcode jobs"));
|
|---|
| 519 | gs->setHelpText(QObject::tr("If non-zero, automatic transcode jobs will "
|
|---|
| 520 | "be scheduled to run this many days after a recording "
|
|---|
| 521 | @@ -262,12 +531,12 @@ static GlobalSpinBox *DeferAutoTranscodeDays()
|
|---|
| 522 | return gs;
|
|---|
| 523 | }
|
|---|
| 524 |
|
|---|
| 525 | -static GlobalCheckBox *AutoRunUserJob(uint job_num)
|
|---|
| 526 | +static GlobalCheckBoxTree *AutoRunUserJob(uint job_num)
|
|---|
| 527 | {
|
|---|
| 528 | QString dbStr = QString("AutoRunUserJob%1").arg(job_num);
|
|---|
| 529 | QString label = QObject::tr("Run user job #%1")
|
|---|
| 530 | .arg(job_num);
|
|---|
| 531 | - GlobalCheckBox *bc = new GlobalCheckBox(dbStr);
|
|---|
| 532 | + GlobalCheckBoxTree *bc = new GlobalCheckBoxTree(dbStr);
|
|---|
| 533 | bc->setLabel(label);
|
|---|
| 534 | bc->setValue(false);
|
|---|
| 535 | bc->setHelpText(QObject::tr("This is the default value used for the "
|
|---|
| 536 | @@ -278,9 +547,9 @@ static GlobalCheckBox *AutoRunUserJob(uint job_num)
|
|---|
| 537 | return bc;
|
|---|
| 538 | }
|
|---|
| 539 |
|
|---|
| 540 | -static GlobalCheckBox *AggressiveCommDetect()
|
|---|
| 541 | +static GlobalCheckBoxTree *AggressiveCommDetect()
|
|---|
| 542 | {
|
|---|
| 543 | - GlobalCheckBox *bc = new GlobalCheckBox("AggressiveCommDetect");
|
|---|
| 544 | + GlobalCheckBoxTree *bc = new GlobalCheckBoxTree("AggressiveCommDetect");
|
|---|
| 545 | bc->setLabel(QObject::tr("Strict commercial detection"));
|
|---|
| 546 | bc->setValue(true);
|
|---|
| 547 | bc->setHelpText(QObject::tr("Enable stricter commercial detection code. "
|
|---|
| 548 | @@ -288,9 +557,9 @@ static GlobalCheckBox *AggressiveCommDetect()
|
|---|
| 549 | return bc;
|
|---|
| 550 | }
|
|---|
| 551 |
|
|---|
| 552 | -static HostSpinBox *CommRewindAmount()
|
|---|
| 553 | +static HostSpinBoxTree *CommRewindAmount()
|
|---|
| 554 | {
|
|---|
| 555 | - HostSpinBox *gs = new HostSpinBox("CommRewindAmount", 0, 10, 1);
|
|---|
| 556 | + HostSpinBoxTree *gs = new HostSpinBoxTree("CommRewindAmount", 0, 10, 1);
|
|---|
| 557 | gs->setLabel(QObject::tr("Commercial skip automatic rewind amount (secs)"));
|
|---|
| 558 | gs->setHelpText(QObject::tr("MythTV will automatically rewind "
|
|---|
| 559 | "this many seconds after performing a commercial skip."));
|
|---|
| 560 | @@ -298,9 +567,9 @@ static HostSpinBox *CommRewindAmount()
|
|---|
| 561 | return gs;
|
|---|
| 562 | }
|
|---|
| 563 |
|
|---|
| 564 | -static HostSpinBox *CommNotifyAmount()
|
|---|
| 565 | +static HostSpinBoxTree *CommNotifyAmount()
|
|---|
| 566 | {
|
|---|
| 567 | - HostSpinBox *gs = new HostSpinBox("CommNotifyAmount", 0, 10, 1);
|
|---|
| 568 | + HostSpinBoxTree *gs = new HostSpinBoxTree("CommNotifyAmount", 0, 10, 1);
|
|---|
| 569 | gs->setLabel(QObject::tr("Commercial skip notify amount (secs)"));
|
|---|
| 570 | gs->setHelpText(QObject::tr("MythTV will act like a commercial "
|
|---|
| 571 | "begins this many seconds early. This can be useful "
|
|---|
| 572 | @@ -310,9 +579,9 @@ static HostSpinBox *CommNotifyAmount()
|
|---|
| 573 | return gs;
|
|---|
| 574 | }
|
|---|
| 575 |
|
|---|
| 576 | -static GlobalSpinBox *MaximumCommercialSkip()
|
|---|
| 577 | +static GlobalSpinBoxTree *MaximumCommercialSkip()
|
|---|
| 578 | {
|
|---|
| 579 | - GlobalSpinBox *bs = new GlobalSpinBox("MaximumCommercialSkip", 0, 3600, 10);
|
|---|
| 580 | + GlobalSpinBoxTree *bs = new GlobalSpinBoxTree("MaximumCommercialSkip", 0, 3600, 10);
|
|---|
| 581 | bs->setLabel(QObject::tr("Maximum commercial skip (secs)"));
|
|---|
| 582 | bs->setHelpText(QObject::tr("MythTV will discourage long manual commercial "
|
|---|
| 583 | "skips. Skips which are longer than this will require the "
|
|---|
| 584 | @@ -322,9 +591,9 @@ static GlobalSpinBox *MaximumCommercialSkip()
|
|---|
| 585 | return bs;
|
|---|
| 586 | }
|
|---|
| 587 |
|
|---|
| 588 | -static GlobalSpinBox *MergeShortCommBreaks()
|
|---|
| 589 | +static GlobalSpinBoxTree *MergeShortCommBreaks()
|
|---|
| 590 | {
|
|---|
| 591 | - GlobalSpinBox *bs = new GlobalSpinBox("MergeShortCommBreaks", 0, 3600, 5);
|
|---|
| 592 | + GlobalSpinBoxTree *bs = new GlobalSpinBoxTree("MergeShortCommBreaks", 0, 3600, 5);
|
|---|
| 593 | bs->setLabel(QObject::tr("Merge short commercial breaks (secs)"));
|
|---|
| 594 | bs->setHelpText(QObject::tr("Treat consecutive commercial breaks shorter "
|
|---|
| 595 | "than this as one break when skipping forward. Useful if "
|
|---|
| 596 | @@ -334,9 +603,9 @@ static GlobalSpinBox *MergeShortCommBreaks()
|
|---|
| 597 | return bs;
|
|---|
| 598 | }
|
|---|
| 599 |
|
|---|
| 600 | -static GlobalSpinBox *AutoExpireExtraSpace()
|
|---|
| 601 | +static GlobalSpinBoxTree *AutoExpireExtraSpace()
|
|---|
| 602 | {
|
|---|
| 603 | - GlobalSpinBox *bs = new GlobalSpinBox("AutoExpireExtraSpace", 0, 200, 1);
|
|---|
| 604 | + GlobalSpinBoxTree *bs = new GlobalSpinBoxTree("AutoExpireExtraSpace", 0, 200, 1);
|
|---|
| 605 | bs->setLabel(QObject::tr("Extra disk space (GB)"));
|
|---|
| 606 | bs->setHelpText(QObject::tr("Extra disk space (in gigabytes) beyond what "
|
|---|
| 607 | "MythTV requires that you want to keep free on the "
|
|---|
| 608 | @@ -345,20 +614,9 @@ static GlobalSpinBox *AutoExpireExtraSpace()
|
|---|
| 609 | return bs;
|
|---|
| 610 | };
|
|---|
| 611 |
|
|---|
| 612 | -static GlobalCheckBox *AutoExpireInsteadOfDelete()
|
|---|
| 613 | +static GlobalSpinBoxTree *DeletedMaxAge()
|
|---|
| 614 | {
|
|---|
| 615 | - GlobalCheckBox *cb = new GlobalCheckBox("AutoExpireInsteadOfDelete");
|
|---|
| 616 | - cb->setLabel(QObject::tr("Auto-Expire instead of delete recording"));
|
|---|
| 617 | - cb->setValue(false);
|
|---|
| 618 | - cb->setHelpText(QObject::tr("If enabled, move deleted recordings to the "
|
|---|
| 619 | - "'Deleted' recgroup and turn on autoexpire "
|
|---|
| 620 | - "instead of deleting immediately."));
|
|---|
| 621 | - return cb;
|
|---|
| 622 | -}
|
|---|
| 623 | -
|
|---|
| 624 | -static GlobalSpinBox *DeletedMaxAge()
|
|---|
| 625 | -{
|
|---|
| 626 | - GlobalSpinBox *bs = new GlobalSpinBox("DeletedMaxAge", 0, 365, 1);
|
|---|
| 627 | + GlobalSpinBoxTree *bs = new GlobalSpinBoxTree("DeletedMaxAge", 0, 365, 1);
|
|---|
| 628 | bs->setLabel(QObject::tr("Deleted max age (days)"));
|
|---|
| 629 | bs->setHelpText(QObject::tr("When set to a number greater than zero, "
|
|---|
| 630 | "Auto-Expire will force expiration of Deleted recordings "
|
|---|
| 631 | @@ -367,9 +625,9 @@ static GlobalSpinBox *DeletedMaxAge()
|
|---|
| 632 | return bs;
|
|---|
| 633 | };
|
|---|
| 634 |
|
|---|
| 635 | -static GlobalCheckBox *DeletedFifoOrder()
|
|---|
| 636 | +static GlobalCheckBoxTree *DeletedFifoOrder()
|
|---|
| 637 | {
|
|---|
| 638 | - GlobalCheckBox *cb = new GlobalCheckBox("DeletedFifoOrder");
|
|---|
| 639 | + GlobalCheckBoxTree *cb = new GlobalCheckBoxTree("DeletedFifoOrder");
|
|---|
| 640 | cb->setLabel(QObject::tr("Expire in deleted order"));
|
|---|
| 641 | cb->setValue(false);
|
|---|
| 642 | cb->setHelpText(QObject::tr(
|
|---|
| 643 | @@ -378,31 +636,22 @@ static GlobalCheckBox *DeletedFifoOrder()
|
|---|
| 644 | return cb;
|
|---|
| 645 | };
|
|---|
| 646 |
|
|---|
| 647 | -class DeletedExpireOptions : public TriggeredConfigurationGroup
|
|---|
| 648 | -{
|
|---|
| 649 | - public:
|
|---|
| 650 | - DeletedExpireOptions() :
|
|---|
| 651 | - TriggeredConfigurationGroup(false, false, false, false)
|
|---|
| 652 | - {
|
|---|
| 653 | - setLabel(QObject::tr("DeletedExpireOptions"));
|
|---|
| 654 | - Setting* enabled = AutoExpireInsteadOfDelete();
|
|---|
| 655 | - addChild(enabled);
|
|---|
| 656 | - setTrigger(enabled);
|
|---|
| 657 | -
|
|---|
| 658 | - HorizontalConfigurationGroup* settings =
|
|---|
| 659 | - new HorizontalConfigurationGroup(false);
|
|---|
| 660 | - settings->addChild(DeletedFifoOrder());
|
|---|
| 661 | - settings->addChild(DeletedMaxAge());
|
|---|
| 662 | - addTarget("1", settings);
|
|---|
| 663 | -
|
|---|
| 664 | - // show nothing if fillEnabled is off
|
|---|
| 665 | - addTarget("0", new HorizontalConfigurationGroup(true));
|
|---|
| 666 | - };
|
|---|
| 667 | -};
|
|---|
| 668 | +static GlobalCheckBoxTree *AutoExpireInsteadOfDelete()
|
|---|
| 669 | +{
|
|---|
| 670 | + GlobalCheckBoxTree *cb = new GlobalCheckBoxTree("AutoExpireInsteadOfDelete");
|
|---|
| 671 | + cb->setLabel(QObject::tr("Auto-Expire instead of delete recording"));
|
|---|
| 672 | + cb->setValue(false);
|
|---|
| 673 | + cb->setHelpText(QObject::tr("If enabled, move deleted recordings to the "
|
|---|
| 674 | + "'Deleted' recgroup and turn on autoexpire "
|
|---|
| 675 | + "instead of deleting immediately."));
|
|---|
| 676 | + cb->addChild(true, DeletedFifoOrder());
|
|---|
| 677 | + cb->addChild(true, DeletedMaxAge());
|
|---|
| 678 | + return cb;
|
|---|
| 679 | +}
|
|---|
| 680 |
|
|---|
| 681 | -static GlobalComboBox *AutoExpireMethod()
|
|---|
| 682 | +static GlobalComboBoxTree *AutoExpireMethod()
|
|---|
| 683 | {
|
|---|
| 684 | - GlobalComboBox *bc = new GlobalComboBox("AutoExpireMethod");
|
|---|
| 685 | + GlobalComboBoxTree *bc = new GlobalComboBoxTree("AutoExpireMethod");
|
|---|
| 686 | bc->setLabel(QObject::tr("Auto-Expire method"));
|
|---|
| 687 | bc->addSelection(QObject::tr("Oldest show first"), "1");
|
|---|
| 688 | bc->addSelection(QObject::tr("Lowest priority first"), "2");
|
|---|
| 689 | @@ -414,9 +663,9 @@ static GlobalComboBox *AutoExpireMethod()
|
|---|
| 690 | return bc;
|
|---|
| 691 | }
|
|---|
| 692 |
|
|---|
| 693 | -static GlobalCheckBox *AutoExpireWatchedPriority()
|
|---|
| 694 | +static GlobalCheckBoxTree *AutoExpireWatchedPriority()
|
|---|
| 695 | {
|
|---|
| 696 | - GlobalCheckBox *bc = new GlobalCheckBox("AutoExpireWatchedPriority");
|
|---|
| 697 | + GlobalCheckBoxTree *bc = new GlobalCheckBoxTree("AutoExpireWatchedPriority");
|
|---|
| 698 | bc->setLabel(QObject::tr("Watched before unwatched"));
|
|---|
| 699 | bc->setValue(false);
|
|---|
| 700 | bc->setHelpText(QObject::tr("If enabled, programs that have been marked as "
|
|---|
| 701 | @@ -425,9 +674,9 @@ static GlobalCheckBox *AutoExpireWatchedPriority()
|
|---|
| 702 | return bc;
|
|---|
| 703 | }
|
|---|
| 704 |
|
|---|
| 705 | -static GlobalSpinBox *AutoExpireDayPriority()
|
|---|
| 706 | +static GlobalSpinBoxTree *AutoExpireDayPriority()
|
|---|
| 707 | {
|
|---|
| 708 | - GlobalSpinBox *bs = new GlobalSpinBox("AutoExpireDayPriority", 1, 400, 1);
|
|---|
| 709 | + GlobalSpinBoxTree *bs = new GlobalSpinBoxTree("AutoExpireDayPriority", 1, 400, 1);
|
|---|
| 710 | bs->setLabel(QObject::tr("Priority weight"));
|
|---|
| 711 | bs->setHelpText(QObject::tr("The number of days bonus a program gets for "
|
|---|
| 712 | "each priority point. This is only used when the Weighted "
|
|---|
| 713 | @@ -436,9 +685,9 @@ static GlobalSpinBox *AutoExpireDayPriority()
|
|---|
| 714 | return bs;
|
|---|
| 715 | };
|
|---|
| 716 |
|
|---|
| 717 | -static GlobalCheckBox *AutoExpireDefault()
|
|---|
| 718 | +static GlobalCheckBoxTree *AutoExpireDefault()
|
|---|
| 719 | {
|
|---|
| 720 | - GlobalCheckBox *bc = new GlobalCheckBox("AutoExpireDefault");
|
|---|
| 721 | + GlobalCheckBoxTree *bc = new GlobalCheckBoxTree("AutoExpireDefault");
|
|---|
| 722 | bc->setLabel(QObject::tr("Auto-Expire default"));
|
|---|
| 723 | bc->setValue(true);
|
|---|
| 724 | bc->setHelpText(QObject::tr("If enabled, any new recording schedules "
|
|---|
| 725 | @@ -447,9 +696,9 @@ static GlobalCheckBox *AutoExpireDefault()
|
|---|
| 726 | return bc;
|
|---|
| 727 | }
|
|---|
| 728 |
|
|---|
| 729 | -static GlobalSpinBox *AutoExpireLiveTVMaxAge()
|
|---|
| 730 | +static GlobalSpinBoxTree *AutoExpireLiveTVMaxAge()
|
|---|
| 731 | {
|
|---|
| 732 | - GlobalSpinBox *bs = new GlobalSpinBox("AutoExpireLiveTVMaxAge", 1, 365, 1);
|
|---|
| 733 | + GlobalSpinBoxTree *bs = new GlobalSpinBoxTree("AutoExpireLiveTVMaxAge", 1, 365, 1);
|
|---|
| 734 | bs->setLabel(QObject::tr("Live TV max age (days)"));
|
|---|
| 735 | bs->setHelpText(QObject::tr("Auto-Expire will force expiration of Live "
|
|---|
| 736 | "TV recordings when they are this many days old. Live TV "
|
|---|
| 737 | @@ -474,9 +723,9 @@ static GlobalSpinBox *MinRecordDiskThreshold()
|
|---|
| 738 | }
|
|---|
| 739 | #endif
|
|---|
| 740 |
|
|---|
| 741 | -static GlobalCheckBox *RerecordWatched()
|
|---|
| 742 | +static GlobalCheckBoxTree *RerecordWatched()
|
|---|
| 743 | {
|
|---|
| 744 | - GlobalCheckBox *bc = new GlobalCheckBox("RerecordWatched");
|
|---|
| 745 | + GlobalCheckBoxTree *bc = new GlobalCheckBoxTree("RerecordWatched");
|
|---|
| 746 | bc->setLabel(QObject::tr("Re-record watched"));
|
|---|
| 747 | bc->setValue(false);
|
|---|
| 748 | bc->setHelpText(QObject::tr("If enabled, programs that have been marked as "
|
|---|
| 749 | @@ -485,9 +734,9 @@ static GlobalCheckBox *RerecordWatched()
|
|---|
| 750 | return bc;
|
|---|
| 751 | }
|
|---|
| 752 |
|
|---|
| 753 | -static GlobalSpinBox *RecordPreRoll()
|
|---|
| 754 | +static GlobalSpinBoxTree *RecordPreRoll()
|
|---|
| 755 | {
|
|---|
| 756 | - GlobalSpinBox *bs = new GlobalSpinBox("RecordPreRoll", 0, 600, 60, true);
|
|---|
| 757 | + GlobalSpinBoxTree *bs = new GlobalSpinBoxTree("RecordPreRoll", 0, 600, 60, true);
|
|---|
| 758 | bs->setLabel(QObject::tr("Time to record before start of show "
|
|---|
| 759 | "(secs)"));
|
|---|
| 760 | bs->setHelpText(QObject::tr("This global setting allows the recorder "
|
|---|
| 761 | @@ -498,9 +747,9 @@ static GlobalSpinBox *RecordPreRoll()
|
|---|
| 762 | return bs;
|
|---|
| 763 | }
|
|---|
| 764 |
|
|---|
| 765 | -static GlobalSpinBox *RecordOverTime()
|
|---|
| 766 | +static GlobalSpinBoxTree *RecordOverTime()
|
|---|
| 767 | {
|
|---|
| 768 | - GlobalSpinBox *bs = new GlobalSpinBox("RecordOverTime", 0, 1800, 60, true);
|
|---|
| 769 | + GlobalSpinBoxTree *bs = new GlobalSpinBoxTree("RecordOverTime", 0, 1800, 60, true);
|
|---|
| 770 | bs->setLabel(QObject::tr("Time to record past end of show (secs)"));
|
|---|
| 771 | bs->setValue(0);
|
|---|
| 772 | bs->setHelpText(QObject::tr("This global setting allows the recorder "
|
|---|
| 773 | @@ -510,9 +759,9 @@ static GlobalSpinBox *RecordOverTime()
|
|---|
| 774 | return bs;
|
|---|
| 775 | }
|
|---|
| 776 |
|
|---|
| 777 | -static GlobalComboBox *OverTimeCategory()
|
|---|
| 778 | +static GlobalComboBoxTree *OverTimeCategory()
|
|---|
| 779 | {
|
|---|
| 780 | - GlobalComboBox *gc = new GlobalComboBox("OverTimeCategory");
|
|---|
| 781 | + GlobalComboBoxTree *gc = new GlobalComboBoxTree("OverTimeCategory");
|
|---|
| 782 | gc->setLabel(QObject::tr("Category of shows to be extended"));
|
|---|
| 783 | gc->setHelpText(QObject::tr("For a special category (e.g. "
|
|---|
| 784 | "\"Sports event\"), request that shows be autoextended. "
|
|---|
| 785 | @@ -535,9 +784,9 @@ static GlobalComboBox *OverTimeCategory()
|
|---|
| 786 | return gc;
|
|---|
| 787 | }
|
|---|
| 788 |
|
|---|
| 789 | -static GlobalSpinBox *CategoryOverTime()
|
|---|
| 790 | +static GlobalSpinBoxTree *CategoryOverTime()
|
|---|
| 791 | {
|
|---|
| 792 | - GlobalSpinBox *bs = new GlobalSpinBox("CategoryOverTime",
|
|---|
| 793 | + GlobalSpinBoxTree *bs = new GlobalSpinBoxTree("CategoryOverTime",
|
|---|
| 794 | 0, 180, 60, true);
|
|---|
| 795 | bs->setLabel(QObject::tr("Record past end of show (mins)"));
|
|---|
| 796 | bs->setValue(30);
|
|---|
| 797 | @@ -548,13 +797,12 @@ static GlobalSpinBox *CategoryOverTime()
|
|---|
| 798 | return bs;
|
|---|
| 799 | }
|
|---|
| 800 |
|
|---|
| 801 | -static VerticalConfigurationGroup *CategoryOverTimeSettings()
|
|---|
| 802 | +static GroupSetting *CategoryOverTimeSettings()
|
|---|
| 803 | {
|
|---|
| 804 | - VerticalConfigurationGroup *vcg =
|
|---|
| 805 | - new VerticalConfigurationGroup(false, false);
|
|---|
| 806 | + GroupSetting *vcg =
|
|---|
| 807 | + new GroupSetting();
|
|---|
| 808 |
|
|---|
| 809 | vcg->setLabel(QObject::tr("Category record over-time"));
|
|---|
| 810 | - vcg->setUseLabel(true);
|
|---|
| 811 | vcg->addChild(OverTimeCategory());
|
|---|
| 812 | vcg->addChild(CategoryOverTime());
|
|---|
| 813 | return vcg;
|
|---|
| 814 | @@ -580,53 +828,69 @@ static QString pad(const QString &str, int len)
|
|---|
| 815 | return tmp;
|
|---|
| 816 | }
|
|---|
| 817 |
|
|---|
| 818 | -PlaybackProfileItemConfig::PlaybackProfileItemConfig(ProfileItem &_item) :
|
|---|
| 819 | - item(_item)
|
|---|
| 820 | +PlaybackProfileItemConfig::PlaybackProfileItemConfig(ProfileItem &_item)
|
|---|
| 821 | + :GroupSetting(""),item(_item)
|
|---|
| 822 | {
|
|---|
| 823 | - setLabel(QObject::tr("Profile Item"));
|
|---|
| 824 | + QString andStr = QObject::tr("&", "and");
|
|---|
| 825 | + QString cmp0 = _item.Get("pref_cmp0");
|
|---|
| 826 | + QString cmp1 = _item.Get("pref_cmp1");
|
|---|
| 827 | + QString str = QObject::tr("if rez") + ' ' + cmp0;
|
|---|
| 828 |
|
|---|
| 829 | - HorizontalConfigurationGroup *row[2];
|
|---|
| 830 | + if (!cmp1.isEmpty())
|
|---|
| 831 | + str += " " + andStr + ' ' + cmp1;
|
|---|
| 832 | +
|
|---|
| 833 | + str += " -> ";
|
|---|
| 834 | + str += _item.Get("pref_decoder");
|
|---|
| 835 | + str += " " + andStr + ' ';
|
|---|
| 836 | + str += _item.Get("pref_videorenderer");
|
|---|
| 837 | + str.replace("-blit", "");
|
|---|
| 838 | + str.replace("ivtv " + andStr + " ivtv", "ivtv");
|
|---|
| 839 | + str.replace("xvmc " + andStr + " xvmc", "xvmc");
|
|---|
| 840 | + str.replace("xvmc", "XvMC");
|
|---|
| 841 | + str.replace("xv", "XVideo");
|
|---|
| 842 |
|
|---|
| 843 | - row[0] = new HorizontalConfigurationGroup(false, false, true, true);
|
|---|
| 844 | - cmp[0] = new TransComboBoxSetting();
|
|---|
| 845 | - width[0] = new TransSpinBoxSetting(0, 1920, 64, true);
|
|---|
| 846 | - height[0] = new TransSpinBoxSetting(0, 1088, 64, true);
|
|---|
| 847 | - row[1] = new HorizontalConfigurationGroup(false, false, true, true);
|
|---|
| 848 | - cmp[1] = new TransComboBoxSetting();
|
|---|
| 849 | - width[1] = new TransSpinBoxSetting(0, 1920, 64, true);
|
|---|
| 850 | - height[1] = new TransSpinBoxSetting(0, 1088, 64, true);
|
|---|
| 851 | - decoder = new TransComboBoxSetting();
|
|---|
| 852 | - max_cpus = new TransSpinBoxSetting(1, HAVE_THREADS ? 4 : 1, 1, true);
|
|---|
| 853 | - skiploop = new TransCheckBoxSetting();
|
|---|
| 854 | - vidrend = new TransComboBoxSetting();
|
|---|
| 855 | - osdrend = new TransComboBoxSetting();
|
|---|
| 856 | - osdfade = new TransCheckBoxSetting();
|
|---|
| 857 | - deint0 = new TransComboBoxSetting();
|
|---|
| 858 | - deint1 = new TransComboBoxSetting();
|
|---|
| 859 | - filters = new TransLineEditSetting(true);
|
|---|
| 860 | + setLabel(pad(trunc(str, 48), 48));
|
|---|
| 861 | +
|
|---|
| 862 | +
|
|---|
| 863 | + GroupSetting *row[2];
|
|---|
| 864 | +
|
|---|
| 865 | + row[0] = new GroupSetting();
|
|---|
| 866 | + row[0]->setLabel(tr("First match criterion"));
|
|---|
| 867 | + cmp[0] = new TransComboBoxTree();
|
|---|
| 868 | + width[0] = new TransSpinBoxTree(0, 1920, 64, true);
|
|---|
| 869 | + height[0] = new TransSpinBoxTree(0, 1088, 64, true);
|
|---|
| 870 | + row[1] = new GroupSetting();
|
|---|
| 871 | + row[1]->setLabel(tr("Second match criterion"));
|
|---|
| 872 | + cmp[1] = new TransComboBoxTree();
|
|---|
| 873 | + width[1] = new TransSpinBoxTree(0, 1920, 64, true);
|
|---|
| 874 | + height[1] = new TransSpinBoxTree(0, 1088, 64, true);
|
|---|
| 875 | + decoder = new TransComboBoxTree();
|
|---|
| 876 | + max_cpus = new TransSpinBoxTree(1, HAVE_THREADS ? 4 : 1, 1, true);
|
|---|
| 877 | + skiploop = new TransCheckBoxTree();
|
|---|
| 878 | + vidrend = new TransComboBoxTree();
|
|---|
| 879 | + osdrend = new TransComboBoxTree();
|
|---|
| 880 | + osdfade = new TransCheckBoxTree();
|
|---|
| 881 | + deint0 = new TransComboBoxTree();
|
|---|
| 882 | + deint1 = new TransComboBoxTree();
|
|---|
| 883 | + filters = new TransLineEditTree(true);
|
|---|
| 884 |
|
|---|
| 885 | for (uint i = 0; i < 2; ++i)
|
|---|
| 886 | {
|
|---|
| 887 | const QString kCMP[6] = { "", "<", "<=", "==", ">=", ">" };
|
|---|
| 888 | for (uint j = 0; j < 6; ++j)
|
|---|
| 889 | - cmp[i]->addSelection(kCMP[j]);
|
|---|
| 890 | + cmp[i]->addSelection(kCMP[j],kCMP[j]);
|
|---|
| 891 |
|
|---|
| 892 | cmp[i]->setLabel(tr("Match criteria"));
|
|---|
| 893 | - width[i]->setName(QString("w%1").arg(i));
|
|---|
| 894 | - width[i]->setLabel(tr("W", "Width"));
|
|---|
| 895 | - height[i]->setName(QString("h%1").arg(i));
|
|---|
| 896 | - height[i]->setLabel(tr("H", "Height"));
|
|---|
| 897 | + //TODO width[i]->setName(QString("w%1").arg(i));
|
|---|
| 898 | + width[i]->setLabel(tr("Width"));
|
|---|
| 899 | + //TODO height[i]->setName(QString("h%1").arg(i));
|
|---|
| 900 | + height[i]->setLabel(tr("Height"));
|
|---|
| 901 |
|
|---|
| 902 | row[i]->addChild(cmp[i]);
|
|---|
| 903 | row[i]->addChild(width[i]);
|
|---|
| 904 | row[i]->addChild(height[i]);
|
|---|
| 905 | }
|
|---|
| 906 |
|
|---|
| 907 | - HorizontalConfigurationGroup *vid_row =
|
|---|
| 908 | - new HorizontalConfigurationGroup(false, false, true, true);
|
|---|
| 909 | - HorizontalConfigurationGroup *osd_row =
|
|---|
| 910 | - new HorizontalConfigurationGroup(false, false, true, true);
|
|---|
| 911 | -
|
|---|
| 912 | decoder->setLabel(tr("Decoder"));
|
|---|
| 913 | max_cpus->setLabel(tr("Max CPUs"));
|
|---|
| 914 | skiploop->setLabel(tr("Deblocking filter"));
|
|---|
| 915 | @@ -658,28 +922,18 @@ PlaybackProfileItemConfig::PlaybackProfileItemConfig(ProfileItem &_item) :
|
|---|
| 916 | tr("Uncheck this if the video studders while the OSD is "
|
|---|
| 917 | "fading away."));
|
|---|
| 918 |
|
|---|
| 919 | - vid_row->addChild(decoder);
|
|---|
| 920 | - vid_row->addChild(max_cpus);
|
|---|
| 921 | - vid_row->addChild(skiploop);
|
|---|
| 922 | - osd_row->addChild(vidrend);
|
|---|
| 923 | - osd_row->addChild(osdrend);
|
|---|
| 924 | - osd_row->addChild(osdfade);
|
|---|
| 925 | -
|
|---|
| 926 | - VerticalConfigurationGroup *grp =
|
|---|
| 927 | - new VerticalConfigurationGroup(false, false, true, true);
|
|---|
| 928 | - grp->addChild(row[0]);
|
|---|
| 929 | - grp->addChild(row[1]);
|
|---|
| 930 | - grp->addChild(vid_row);
|
|---|
| 931 | - grp->addChild(osd_row);
|
|---|
| 932 | - addChild(grp);
|
|---|
| 933 | -
|
|---|
| 934 | - VerticalConfigurationGroup *page2 =
|
|---|
| 935 | - new VerticalConfigurationGroup(false, false, true, true);
|
|---|
| 936 | - page2->addChild(deint0);
|
|---|
| 937 | - page2->addChild(deint1);
|
|---|
| 938 | - page2->addChild(filters);
|
|---|
| 939 | - addChild(page2);
|
|---|
| 940 | -
|
|---|
| 941 | + addChild(row[0]);
|
|---|
| 942 | + addChild(row[1]);
|
|---|
| 943 | + addChild(decoder);
|
|---|
| 944 | + addChild(max_cpus);
|
|---|
| 945 | + addChild(skiploop);
|
|---|
| 946 | + addChild(vidrend);
|
|---|
| 947 | + addChild(osdrend);
|
|---|
| 948 | + addChild(osdfade);
|
|---|
| 949 | + addChild(deint0);
|
|---|
| 950 | + addChild(deint1);
|
|---|
| 951 | + addChild(filters);
|
|---|
| 952 | +
|
|---|
| 953 | connect(decoder, SIGNAL(valueChanged(const QString&)),
|
|---|
| 954 | this, SLOT(decoderChanged(const QString&)));\
|
|---|
| 955 | connect(vidrend, SIGNAL(valueChanged(const QString&)),
|
|---|
| 956 | @@ -690,6 +944,7 @@ PlaybackProfileItemConfig::PlaybackProfileItemConfig(ProfileItem &_item) :
|
|---|
| 957 | this, SLOT(deint0Changed(const QString&)));
|
|---|
| 958 | connect(deint1, SIGNAL(valueChanged(const QString&)),
|
|---|
| 959 | this, SLOT(deint1Changed(const QString&)));
|
|---|
| 960 | + Load();
|
|---|
| 961 | }
|
|---|
| 962 |
|
|---|
| 963 | void PlaybackProfileItemConfig::Load(void)
|
|---|
| 964 | @@ -734,7 +989,7 @@ void PlaybackProfileItemConfig::Load(void)
|
|---|
| 965 | }
|
|---|
| 966 | if (!found && !pdecoder.isEmpty())
|
|---|
| 967 | {
|
|---|
| 968 | - decoder->SelectSetting::addSelection(
|
|---|
| 969 | + decoder->addSelection(
|
|---|
| 970 | VideoDisplayProfile::GetDecoderName(pdecoder), pdecoder, true);
|
|---|
| 971 | }
|
|---|
| 972 | decoder->setHelpText(VideoDisplayProfile::GetDecoderHelp(pdecoder));
|
|---|
| 973 | @@ -865,7 +1120,7 @@ void PlaybackProfileItemConfig::deint1Changed(const QString &deint)
|
|---|
| 974 | }
|
|---|
| 975 |
|
|---|
| 976 | PlaybackProfileConfig::PlaybackProfileConfig(const QString &profilename) :
|
|---|
| 977 | - VerticalConfigurationGroup(false, false, true, true),
|
|---|
| 978 | + GroupSetting(profilename),
|
|---|
| 979 | profile_name(profilename), needs_save(false),
|
|---|
| 980 | groupid(0), last_main(NULL)
|
|---|
| 981 | {
|
|---|
| 982 | @@ -874,7 +1129,10 @@ PlaybackProfileConfig::PlaybackProfileConfig(const QString &profilename) :
|
|---|
| 983 |
|
|---|
| 984 | items = VideoDisplayProfile::LoadDB(groupid);
|
|---|
| 985 |
|
|---|
| 986 | - InitUI();
|
|---|
| 987 | + for (uint i = 0; i < items.size(); ++i)
|
|---|
| 988 | + {
|
|---|
| 989 | + addChild(new PlaybackProfileItemConfig(items[i]));
|
|---|
| 990 | + }
|
|---|
| 991 | }
|
|---|
| 992 |
|
|---|
| 993 | PlaybackProfileConfig::~PlaybackProfileConfig()
|
|---|
| 994 | @@ -904,12 +1162,12 @@ void PlaybackProfileConfig::InitLabel(uint i)
|
|---|
| 995 | str.replace("xvmc", "XvMC");
|
|---|
| 996 | str.replace("xv", "XVideo");
|
|---|
| 997 |
|
|---|
| 998 | - labels[i]->setValue(pad(trunc(str, 48), 48));
|
|---|
| 999 | + labels[i]->setLabel(pad(trunc(str, 48), 48));
|
|---|
| 1000 | }
|
|---|
| 1001 |
|
|---|
| 1002 | void PlaybackProfileConfig::InitUI(void)
|
|---|
| 1003 | {
|
|---|
| 1004 | - VerticalConfigurationGroup *main =
|
|---|
| 1005 | + /* VerticalConfigurationGroup *main =
|
|---|
| 1006 | new VerticalConfigurationGroup(false, false, true, true);
|
|---|
| 1007 |
|
|---|
| 1008 | HorizontalConfigurationGroup *rows =
|
|---|
| 1009 | @@ -917,28 +1175,28 @@ void PlaybackProfileConfig::InitUI(void)
|
|---|
| 1010 | VerticalConfigurationGroup *column1 =
|
|---|
| 1011 | new VerticalConfigurationGroup(false, false, true, true);
|
|---|
| 1012 | VerticalConfigurationGroup *column2 =
|
|---|
| 1013 | - new VerticalConfigurationGroup(false, false, true, true);
|
|---|
| 1014 | + new VerticalConfigurationGroup(false, false, true, true);*/
|
|---|
| 1015 |
|
|---|
| 1016 | labels.resize(items.size());
|
|---|
| 1017 |
|
|---|
| 1018 | for (uint i = 0; i < items.size(); ++i)
|
|---|
| 1019 | {
|
|---|
| 1020 | - labels[i] = new TransLabelSetting();
|
|---|
| 1021 | - InitLabel(i);
|
|---|
| 1022 | - column1->addChild(labels[i]);
|
|---|
| 1023 | + addChild(new PlaybackProfileItemConfig(items[i]));
|
|---|
| 1024 | + /*InitLabel(i);
|
|---|
| 1025 | + addChild(labels[i]);*/
|
|---|
| 1026 | }
|
|---|
| 1027 | -
|
|---|
| 1028 | +/*
|
|---|
| 1029 | editProf.resize(items.size());
|
|---|
| 1030 | delProf.resize(items.size());
|
|---|
| 1031 | priority.resize(items.size());
|
|---|
| 1032 |
|
|---|
| 1033 | +
|
|---|
| 1034 | for (uint i = 0; i < items.size(); ++i)
|
|---|
| 1035 | {
|
|---|
| 1036 | - HorizontalConfigurationGroup *grp =
|
|---|
| 1037 | - new HorizontalConfigurationGroup(false, false, true, true);
|
|---|
| 1038 |
|
|---|
| 1039 | - editProf[i] = new TransButtonSetting(QString("edit%1").arg(i));
|
|---|
| 1040 | - delProf[i] = new TransButtonSetting(QString("del%1").arg(i));
|
|---|
| 1041 | +
|
|---|
| 1042 | + editProf[i] = new TransButtonSetting(QString("edit%1").arg(i));
|
|---|
| 1043 | + delProf[i] = new TransButtonSetting(QString("del%1").arg(i));/
|
|---|
| 1044 | priority[i] = new TransSpinBoxSetting(1, items.size(), 1);
|
|---|
| 1045 | priority[i]->setName(QString("pri%1").arg(i));
|
|---|
| 1046 |
|
|---|
| 1047 | @@ -978,7 +1236,7 @@ void PlaybackProfileConfig::InitUI(void)
|
|---|
| 1048 | else
|
|---|
| 1049 | addChild(main);
|
|---|
| 1050 |
|
|---|
| 1051 | - last_main = main;
|
|---|
| 1052 | + last_main = main;*/
|
|---|
| 1053 | }
|
|---|
| 1054 |
|
|---|
| 1055 | void PlaybackProfileConfig::Load(void)
|
|---|
| 1056 | @@ -988,7 +1246,7 @@ void PlaybackProfileConfig::Load(void)
|
|---|
| 1057 |
|
|---|
| 1058 | void PlaybackProfileConfig::Save(void)
|
|---|
| 1059 | {
|
|---|
| 1060 | - if (!needs_save)
|
|---|
| 1061 | + /*if (!needs_save)
|
|---|
| 1062 | return; // nothing to do..
|
|---|
| 1063 |
|
|---|
| 1064 | bool ok = VideoDisplayProfile::DeleteDB(groupid, del_items);
|
|---|
| 1065 | @@ -1005,12 +1263,12 @@ void PlaybackProfileConfig::Save(void)
|
|---|
| 1066 | LOG(VB_GENERAL, LOG_ERR,
|
|---|
| 1067 | "PlaybackProfileConfig::Save() -- failed to save items");
|
|---|
| 1068 | return;
|
|---|
| 1069 | - }
|
|---|
| 1070 | + }*/
|
|---|
| 1071 | }
|
|---|
| 1072 |
|
|---|
| 1073 | void PlaybackProfileConfig::pressed(QString cmd)
|
|---|
| 1074 | {
|
|---|
| 1075 | - if (cmd.left(4) == "edit")
|
|---|
| 1076 | + /* if (cmd.left(4) == "edit")
|
|---|
| 1077 | {
|
|---|
| 1078 | uint i = cmd.mid(4).toUInt();
|
|---|
| 1079 | PlaybackProfileItemConfig itemcfg(items[i]);
|
|---|
| 1080 | @@ -1043,12 +1301,12 @@ void PlaybackProfileConfig::pressed(QString cmd)
|
|---|
| 1081 | needs_save = true;
|
|---|
| 1082 | }
|
|---|
| 1083 |
|
|---|
| 1084 | - repaint();
|
|---|
| 1085 | + repaint();*/
|
|---|
| 1086 | }
|
|---|
| 1087 |
|
|---|
| 1088 | void PlaybackProfileConfig::priorityChanged(const QString &name, int val)
|
|---|
| 1089 | {
|
|---|
| 1090 | - uint i = name.mid(3).toInt();
|
|---|
| 1091 | + /* uint i = name.mid(3).toInt();
|
|---|
| 1092 | uint j = i;
|
|---|
| 1093 |
|
|---|
| 1094 | priority[i]->SetRelayEnabled(false);
|
|---|
| 1095 | @@ -1085,12 +1343,12 @@ void PlaybackProfileConfig::priorityChanged(const QString &name, int val)
|
|---|
| 1096 |
|
|---|
| 1097 | priority[i]->SetRelayEnabled(true);
|
|---|
| 1098 | if (i != j)
|
|---|
| 1099 | - priority[j]->SetRelayEnabled(true);
|
|---|
| 1100 | + priority[j]->SetRelayEnabled(true);*/
|
|---|
| 1101 | }
|
|---|
| 1102 |
|
|---|
| 1103 | void PlaybackProfileConfig::swap(int i, int j)
|
|---|
| 1104 | {
|
|---|
| 1105 | - int pri_i = items[i].GetPriority();
|
|---|
| 1106 | + /* int pri_i = items[i].GetPriority();
|
|---|
| 1107 | int pri_j = items[j].GetPriority();
|
|---|
| 1108 |
|
|---|
| 1109 | ProfileItem item = items[j];
|
|---|
| 1110 | @@ -1106,14 +1364,12 @@ void PlaybackProfileConfig::swap(int i, int j)
|
|---|
| 1111 | const QString label_i = labels[i]->getValue();
|
|---|
| 1112 | const QString label_j = labels[j]->getValue();
|
|---|
| 1113 | labels[i]->setValue(label_j);
|
|---|
| 1114 | - labels[j]->setValue(label_i);
|
|---|
| 1115 | + labels[j]->setValue(label_i);*/
|
|---|
| 1116 | }
|
|---|
| 1117 |
|
|---|
| 1118 | -PlaybackProfileConfigs::PlaybackProfileConfigs(const QString &str) :
|
|---|
| 1119 | - TriggeredConfigurationGroup(false, true, true, true,
|
|---|
| 1120 | - false, false, true, true), grouptrigger(NULL)
|
|---|
| 1121 | +PlaybackProfileConfigs::PlaybackProfileConfigs() :
|
|---|
| 1122 | + HostComboBoxTree("DefaultVideoPlaybackProfile")
|
|---|
| 1123 | {
|
|---|
| 1124 | - setLabel(QObject::tr("Playback Profiles") + str);
|
|---|
| 1125 |
|
|---|
| 1126 | QString host = gCoreContext->GetHostName();
|
|---|
| 1127 | QStringList profiles = VideoDisplayProfile::GetProfiles(host);
|
|---|
| 1128 | @@ -1148,35 +1404,21 @@ PlaybackProfileConfigs::PlaybackProfileConfigs(const QString &str) :
|
|---|
| 1129 | VideoDisplayProfile::SetDefaultProfileName(profile, host);
|
|---|
| 1130 | }
|
|---|
| 1131 |
|
|---|
| 1132 | - grouptrigger = new HostComboBox("DefaultVideoPlaybackProfile");
|
|---|
| 1133 | - grouptrigger->setLabel(QObject::tr("Current Video Playback Profile"));
|
|---|
| 1134 | + setLabel(QObject::tr("Current Video Playback Profile"));
|
|---|
| 1135 | QStringList::const_iterator it;
|
|---|
| 1136 | for (it = profiles.begin(); it != profiles.end(); ++it)
|
|---|
| 1137 | - grouptrigger->addSelection(ProgramInfo::i18n(*it), *it);
|
|---|
| 1138 | + addSelection(ProgramInfo::i18n(*it), *it);
|
|---|
| 1139 |
|
|---|
| 1140 | - HorizontalConfigurationGroup *grp =
|
|---|
| 1141 | - new HorizontalConfigurationGroup(false, false, true, true);
|
|---|
| 1142 | - TransButtonSetting *addProf = new TransButtonSetting("add");
|
|---|
| 1143 | - TransButtonSetting *delProf = new TransButtonSetting("del");
|
|---|
| 1144 | + for (it = profiles.begin(); it != profiles.end(); ++it)
|
|---|
| 1145 | + m_profileTrees[*it]= new PlaybackProfileConfig(*it);
|
|---|
| 1146 |
|
|---|
| 1147 | - addProf->setLabel(QObject::tr("Add New"));
|
|---|
| 1148 | - delProf->setLabel(QObject::tr("Delete"));
|
|---|
| 1149 | + connect(this,SIGNAL(settingValueChanged(const QString &)),
|
|---|
| 1150 | + this, SLOT(changeCurrentProfile(const QString &)));
|
|---|
| 1151 |
|
|---|
| 1152 | - grp->addChild(grouptrigger);
|
|---|
| 1153 | - grp->addChild(addProf);
|
|---|
| 1154 | - grp->addChild(delProf);
|
|---|
| 1155 |
|
|---|
| 1156 | - addChild(grp);
|
|---|
| 1157 | + // setSaveAll(true);
|
|---|
| 1158 |
|
|---|
| 1159 | - setTrigger(grouptrigger);
|
|---|
| 1160 | - for (it = profiles.begin(); it != profiles.end(); ++it)
|
|---|
| 1161 | - addTarget(*it, new PlaybackProfileConfig(*it));
|
|---|
| 1162 | - setSaveAll(true);
|
|---|
| 1163 |
|
|---|
| 1164 | - connect(addProf, SIGNAL(pressed( QString)),
|
|---|
| 1165 | - this, SLOT (btnPress(QString)));
|
|---|
| 1166 | - connect(delProf, SIGNAL(pressed( QString)),
|
|---|
| 1167 | - this, SLOT (btnPress(QString)));
|
|---|
| 1168 | }
|
|---|
| 1169 |
|
|---|
| 1170 | PlaybackProfileConfigs::~PlaybackProfileConfigs()
|
|---|
| 1171 | @@ -1186,70 +1428,706 @@ PlaybackProfileConfigs::~PlaybackProfileConfigs()
|
|---|
| 1172 | #endif
|
|---|
| 1173 | }
|
|---|
| 1174 |
|
|---|
| 1175 | -void PlaybackProfileConfigs::btnPress(QString cmd)
|
|---|
| 1176 | +void PlaybackProfileConfigs::changeCurrentProfile(const QString& newProfileName)
|
|---|
| 1177 | +{
|
|---|
| 1178 | + LOG(VB_GENERAL, LOG_ERR, QString("PlaybackProfileConfigs::changeCurrentProfile(%1)")
|
|---|
| 1179 | + .arg(newProfileName));
|
|---|
| 1180 | +
|
|---|
| 1181 | + QList< MythGenericTree * > *children = getAllChildren ();
|
|---|
| 1182 | + MythGenericTree *child;
|
|---|
| 1183 | + foreach(child, *children)
|
|---|
| 1184 | + {
|
|---|
| 1185 | + this->removeNode(child);
|
|---|
| 1186 | + }
|
|---|
| 1187 | +
|
|---|
| 1188 | + if (m_profileTrees.contains(newProfileName))
|
|---|
| 1189 | + {
|
|---|
| 1190 | + QList< MythGenericTree * > *children = m_profileTrees[newProfileName]->getAllChildren ();
|
|---|
| 1191 | + MythGenericTree *child;
|
|---|
| 1192 | + foreach(child, *children)
|
|---|
| 1193 | + {
|
|---|
| 1194 | + GroupSetting* setting = dynamic_cast<GroupSetting*>(child);
|
|---|
| 1195 | + if (setting)
|
|---|
| 1196 | + this->addChild(setting);
|
|---|
| 1197 | + }
|
|---|
| 1198 | + }
|
|---|
| 1199 | +}
|
|---|
| 1200 | +
|
|---|
| 1201 | +void PlaybackProfileConfigs::customEvent(QEvent *event)
|
|---|
| 1202 | +{
|
|---|
| 1203 | + if (event->type() == DialogCompletionEvent::kEventType)
|
|---|
| 1204 | + {
|
|---|
| 1205 | + DialogCompletionEvent *dce = (DialogCompletionEvent*)(event);
|
|---|
| 1206 | + QString resultid = dce->GetId();
|
|---|
| 1207 | +
|
|---|
| 1208 | + LOG(VB_GENERAL, LOG_ERR, QString("MyComboBoxTree::customEvent: resultId = %1").arg(resultid));
|
|---|
| 1209 | +
|
|---|
| 1210 | + if (resultid == "contextualmenu")
|
|---|
| 1211 | + {
|
|---|
| 1212 | + QString contextualChoice = dce->GetData().toString();
|
|---|
| 1213 | + //else
|
|---|
| 1214 | + LOG(VB_GENERAL, LOG_ERR, QString("MyComboBoxTree::customEvent: result = %1").arg(dce->GetData().toString()));
|
|---|
| 1215 | + if (contextualChoice == "newprofile")
|
|---|
| 1216 | + {
|
|---|
| 1217 | + MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
|
|---|
| 1218 | +
|
|---|
| 1219 | + MythTextInputDialog *settingdialog =
|
|---|
| 1220 | + new MythTextInputDialog(popupStack,
|
|---|
| 1221 | + QObject::tr("New profile name"),FilterNone);
|
|---|
| 1222 | +
|
|---|
| 1223 | + if (settingdialog->Create())
|
|---|
| 1224 | + {
|
|---|
| 1225 | + settingdialog->SetReturnEvent(this, "newprofileresult");
|
|---|
| 1226 | + popupStack->AddScreen(settingdialog);
|
|---|
| 1227 | + }
|
|---|
| 1228 | + }
|
|---|
| 1229 | + else if (contextualChoice == "deleteprofile")
|
|---|
| 1230 | + {
|
|---|
| 1231 | + MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
|
|---|
| 1232 | +
|
|---|
| 1233 | + MythConfirmationDialog *settingdialog =
|
|---|
| 1234 | + new MythConfirmationDialog(popupStack,
|
|---|
| 1235 | + QObject::tr("Remove %1 profile ?").arg(GetText("value")),true);
|
|---|
| 1236 | +
|
|---|
| 1237 | + if (settingdialog->Create())
|
|---|
| 1238 | + {
|
|---|
| 1239 | + settingdialog->SetReturnEvent(this, "deleteprofileresult");
|
|---|
| 1240 | + popupStack->AddScreen(settingdialog);
|
|---|
| 1241 | + }
|
|---|
| 1242 | + }
|
|---|
| 1243 | + else
|
|---|
| 1244 | + HostComboBoxTree::customEvent(event);
|
|---|
| 1245 | +
|
|---|
| 1246 | +
|
|---|
| 1247 | +
|
|---|
| 1248 | + }
|
|---|
| 1249 | + else if (resultid == "newprofileresult")
|
|---|
| 1250 | + {
|
|---|
| 1251 | + newProfile(dce->GetResultText());
|
|---|
| 1252 | + }
|
|---|
| 1253 | + else if (resultid == "deleteprofileresult")
|
|---|
| 1254 | + {
|
|---|
| 1255 | + if (dce->GetResult()==1)
|
|---|
| 1256 | + deleteProfile();
|
|---|
| 1257 | + }
|
|---|
| 1258 | +
|
|---|
| 1259 | + }
|
|---|
| 1260 | +}
|
|---|
| 1261 | +
|
|---|
| 1262 | +/* TODO this is a copy and modified version of ComboBoxTree::edit()
|
|---|
| 1263 | +I need to do it in a more generic way */
|
|---|
| 1264 | +
|
|---|
| 1265 | +void PlaybackProfileConfigs::menu()
|
|---|
| 1266 | +{
|
|---|
| 1267 | + MythScreenStack *popupStack =
|
|---|
| 1268 | + GetMythMainWindow()->GetStack("popup stack");
|
|---|
| 1269 | +
|
|---|
| 1270 | + MythDialogBox * m_menuPopup =
|
|---|
| 1271 | + new MythDialogBox(GetText(), popupStack, "contextualmenu");
|
|---|
| 1272 | +
|
|---|
| 1273 | + if (m_menuPopup->Create())
|
|---|
| 1274 | + popupStack->AddScreen(m_menuPopup);
|
|---|
| 1275 | +
|
|---|
| 1276 | + m_menuPopup->SetReturnEvent(this, "contextualmenu");
|
|---|
| 1277 | +
|
|---|
| 1278 | +//TODO we need to have the menu from the base class too
|
|---|
| 1279 | +
|
|---|
| 1280 | + m_menuPopup->AddButton(QObject::tr("Add New"),QVariant::fromValue(QString("newprofile")));
|
|---|
| 1281 | + m_menuPopup->AddButton(QObject::tr("Delete"),QVariant::fromValue(QString("deleteprofile")));
|
|---|
| 1282 | +
|
|---|
| 1283 | +}
|
|---|
| 1284 | +
|
|---|
| 1285 | +void PlaybackProfileConfigs::newProfile(const QString &name)
|
|---|
| 1286 | +{
|
|---|
| 1287 | + LOG(VB_GENERAL, LOG_ERR, QString("MyComboBoxTree::newProfile(%1) => TODO").arg(name));
|
|---|
| 1288 | + if (name.isEmpty())
|
|---|
| 1289 | + {
|
|---|
| 1290 | + MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
|
|---|
| 1291 | +
|
|---|
| 1292 | + MythConfirmationDialog *settingdialog =
|
|---|
| 1293 | + new MythConfirmationDialog(popupStack,
|
|---|
| 1294 | + QObject::tr("Sorry, playback group\nname cannot be blank."),false);
|
|---|
| 1295 | +
|
|---|
| 1296 | + if (settingdialog->Create())
|
|---|
| 1297 | + {
|
|---|
| 1298 | + popupStack->AddScreen(settingdialog);
|
|---|
| 1299 | + }
|
|---|
| 1300 | + return;
|
|---|
| 1301 | + }
|
|---|
| 1302 | +
|
|---|
| 1303 | +
|
|---|
| 1304 | + QString host = gCoreContext->GetHostName();
|
|---|
| 1305 | + QStringList not_ok_list = VideoDisplayProfile::GetProfiles(host);
|
|---|
| 1306 | +
|
|---|
| 1307 | + if (not_ok_list.contains(name))
|
|---|
| 1308 | + {
|
|---|
| 1309 | +
|
|---|
| 1310 | + MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
|
|---|
| 1311 | +
|
|---|
| 1312 | + MythConfirmationDialog *settingdialog =
|
|---|
| 1313 | + new MythConfirmationDialog(popupStack,
|
|---|
| 1314 | + QObject::tr("Sorry, playback group name\n"
|
|---|
| 1315 | + "'%1' is already being used.").arg(name),false);
|
|---|
| 1316 | +
|
|---|
| 1317 | + if (settingdialog->Create())
|
|---|
| 1318 | + {
|
|---|
| 1319 | + popupStack->AddScreen(settingdialog);
|
|---|
| 1320 | + }
|
|---|
| 1321 | + return;
|
|---|
| 1322 | + }
|
|---|
| 1323 | +
|
|---|
| 1324 | + VideoDisplayProfile::CreateProfileGroup(name, gCoreContext->GetHostName());
|
|---|
| 1325 | + addSelection(name, name, true);
|
|---|
| 1326 | +
|
|---|
| 1327 | +}
|
|---|
| 1328 | +
|
|---|
| 1329 | +
|
|---|
| 1330 | +void PlaybackProfileConfigs::deleteProfile()
|
|---|
| 1331 | +{
|
|---|
| 1332 | + LOG(VB_GENERAL, LOG_ERR, QString("MyComboBoxTree::deleteProfile() => TODO"));
|
|---|
| 1333 | + const QString name = GetText("value");
|
|---|
| 1334 | + if (!name.isEmpty())
|
|---|
| 1335 | + {
|
|---|
| 1336 | + removeSelection(name);
|
|---|
| 1337 | + VideoDisplayProfile::DeleteProfileGroup(
|
|---|
| 1338 | + name, gCoreContext->GetHostName());
|
|---|
| 1339 | + }
|
|---|
| 1340 | +}
|
|---|
| 1341 | +
|
|---|
| 1342 | +
|
|---|
| 1343 | +
|
|---|
| 1344 | +/*
|
|---|
| 1345 | +class PlaybackProfileConfigItemCriteriaTree : public GroupSetting
|
|---|
| 1346 | +{
|
|---|
| 1347 | + public:
|
|---|
| 1348 | + PlaybackProfileConfigItemCriteriaTree();
|
|---|
| 1349 | + virtual ~PlaybackProfileConfigItemCriteriaTree();
|
|---|
| 1350 | + void setValue(const QString &newValue, int i);
|
|---|
| 1351 | + private:
|
|---|
| 1352 | + TransComboBoxTree *m_condition;
|
|---|
| 1353 | + TransSpinBoxTree *m_width;
|
|---|
| 1354 | + TransSpinBoxTree *m_height;
|
|---|
| 1355 | +};*/
|
|---|
| 1356 | +
|
|---|
| 1357 | +/*
|
|---|
| 1358 | +
|
|---|
| 1359 | +void PlaybackProfileConfigItemCriteriaTree::setValue(const QString &newValue, int i)
|
|---|
| 1360 | +{
|
|---|
| 1361 | + QStringList clist = newValue.split(" ");
|
|---|
| 1362 | + if (clist.size() == 0)
|
|---|
| 1363 | + clist<<((i) ? "" : ">");
|
|---|
| 1364 | + if (clist.size() == 1)
|
|---|
| 1365 | + clist<<"0";
|
|---|
| 1366 | + if (clist.size() == 2)
|
|---|
| 1367 | + clist<<"0";
|
|---|
| 1368 | +
|
|---|
| 1369 | + m_condition->setValue(clist[0]);
|
|---|
| 1370 | + m_width->setValue(clist[1].toInt());
|
|---|
| 1371 | + m_height->setValue(clist[2].toInt());
|
|---|
| 1372 | +
|
|---|
| 1373 | + SetText(QString("%1 %2x%3").arg(m_condition->getValue())
|
|---|
| 1374 | + .arg(m_width->getValue()).arg(m_height->getValue()),"value");
|
|---|
| 1375 | +}
|
|---|
| 1376 | +
|
|---|
| 1377 | +PlaybackProfileConfigItemCriteriaTree::PlaybackProfileConfigItemCriteriaTree()
|
|---|
| 1378 | + :GroupSetting()
|
|---|
| 1379 | +{
|
|---|
| 1380 | + m_condition = new TransComboBoxTree();
|
|---|
| 1381 | + m_condition->setLabel(QObject::tr("Condition"));
|
|---|
| 1382 | + const QString kCMP[6] = { "", "<", "<=", "==", ">=", ">" };
|
|---|
| 1383 | + for (uint j = 0; j < 6; ++j)
|
|---|
| 1384 | + m_condition->addSelection(kCMP[j],kCMP[j]);
|
|---|
| 1385 | + addChild(m_condition);
|
|---|
| 1386 | +
|
|---|
| 1387 | + m_width = new TransSpinBoxTree(0,1920,64);
|
|---|
| 1388 | + m_width->setLabel(QObject::tr("Width"));
|
|---|
| 1389 | + addChild(m_width);
|
|---|
| 1390 | +
|
|---|
| 1391 | + m_height = new TransSpinBoxTree(0,1088,64);
|
|---|
| 1392 | + m_height->setLabel(QObject::tr("Height"));
|
|---|
| 1393 | + addChild(m_height);
|
|---|
| 1394 | +}
|
|---|
| 1395 | +
|
|---|
| 1396 | +
|
|---|
| 1397 | +PlaybackProfileConfigItemCriteriaTree::~PlaybackProfileConfigItemCriteriaTree()
|
|---|
| 1398 | +{
|
|---|
| 1399 | +}
|
|---|
| 1400 | +
|
|---|
| 1401 | +
|
|---|
| 1402 | +
|
|---|
| 1403 | +PlaybackProfileConfigItemTree::PlaybackProfileConfigItemTree(ProfileItem &item)
|
|---|
| 1404 | + :GroupSetting(""),
|
|---|
| 1405 | + m_item(item)
|
|---|
| 1406 | +{
|
|---|
| 1407 | + m_criteria1 = new PlaybackProfileConfigItemCriteriaTree();
|
|---|
| 1408 | + m_criteria1->setLabel(tr("First criteria"));
|
|---|
| 1409 | + addChild(m_criteria1);
|
|---|
| 1410 | +
|
|---|
| 1411 | + m_criteria2 = new PlaybackProfileConfigItemCriteriaTree();
|
|---|
| 1412 | + m_criteria2->setLabel(tr("Second criteria"));
|
|---|
| 1413 | + addChild(m_criteria2);
|
|---|
| 1414 | +
|
|---|
| 1415 | + m_decoder = new TransComboBoxTree();
|
|---|
| 1416 | + m_decoder->setLabel(tr("Decoder"));
|
|---|
| 1417 | + addChild(m_decoder);
|
|---|
| 1418 | +
|
|---|
| 1419 | + m_max_cpus = new TransSpinBoxTree(1, HAVE_THREADS ? 4 : 1, 1);
|
|---|
| 1420 | + m_max_cpus->setLabel(tr("Max CPUs"));
|
|---|
| 1421 | + addChild(m_max_cpus);
|
|---|
| 1422 | +
|
|---|
| 1423 | + m_skiploop = new TransCheckBoxTree();
|
|---|
| 1424 | + m_skiploop->setLabel(tr("Deblocking filter"));
|
|---|
| 1425 | + addChild(m_skiploop);
|
|---|
| 1426 | +
|
|---|
| 1427 | + m_vidrend = new TransComboBoxTree();
|
|---|
| 1428 | + m_vidrend->setLabel(tr("Video renderer"));
|
|---|
| 1429 | + addChild(m_vidrend);
|
|---|
| 1430 | +
|
|---|
| 1431 | + m_osdrend = new TransComboBoxTree();
|
|---|
| 1432 | + m_osdrend->setLabel(tr("OSD renderer"));
|
|---|
| 1433 | + addChild(m_osdrend);
|
|---|
| 1434 | +
|
|---|
| 1435 | + m_osdfade = new TransCheckBoxTree();
|
|---|
| 1436 | + m_osdfade->setLabel(tr("OSD fade"));
|
|---|
| 1437 | + addChild(m_osdfade);
|
|---|
| 1438 | +
|
|---|
| 1439 | + m_deint0 = new TransComboBoxTree();
|
|---|
| 1440 | + m_deint0->setLabel(tr("Primary deinterlacer"));
|
|---|
| 1441 | + addChild(m_deint0);
|
|---|
| 1442 | +
|
|---|
| 1443 | + m_deint1 = new TransComboBoxTree();
|
|---|
| 1444 | + m_deint1->setLabel(tr("Fallback deinterlacer"));
|
|---|
| 1445 | + addChild(m_deint1);
|
|---|
| 1446 | +
|
|---|
| 1447 | + m_filters = new TransLineEditTree(true);
|
|---|
| 1448 | + m_filters->setLabel(tr("Custom filters"));
|
|---|
| 1449 | + m_filters->setHelpText(
|
|---|
| 1450 | + QObject::tr("Example custom filter list: 'ivtc,denoise3d'"));
|
|---|
| 1451 | + addChild(m_filters);
|
|---|
| 1452 | +
|
|---|
| 1453 | + connect(m_decoder, SIGNAL(settingValueChanged(const QString&)),
|
|---|
| 1454 | + this, SLOT(decoderChanged(const QString&)));
|
|---|
| 1455 | + connect(m_vidrend, SIGNAL(settingValueChanged(const QString&)),
|
|---|
| 1456 | + this, SLOT(vrenderChanged(const QString&)));
|
|---|
| 1457 | + connect(m_osdrend, SIGNAL(settingValueChanged(const QString&)),
|
|---|
| 1458 | + this, SLOT(orenderChanged(const QString&)));
|
|---|
| 1459 | + connect(m_deint0, SIGNAL(settingValueChanged(const QString&)),
|
|---|
| 1460 | + this, SLOT(deint0Changed(const QString&)));
|
|---|
| 1461 | + connect(m_deint1, SIGNAL(settingValueChanged(const QString&)),
|
|---|
| 1462 | + this, SLOT(deint1Changed(const QString&)));
|
|---|
| 1463 | +}
|
|---|
| 1464 | +
|
|---|
| 1465 | +void PlaybackProfileConfigItemTree::Load(void)
|
|---|
| 1466 | +{
|
|---|
| 1467 | + m_criteria1->setValue(m_item.Get(QString("pref_cmp%1").arg(0)),0);
|
|---|
| 1468 | + m_criteria2->setValue(m_item.Get(QString("pref_cmp%1").arg(1)),1);
|
|---|
| 1469 | +
|
|---|
| 1470 | + QString pdecoder = m_item.Get("pref_decoder");
|
|---|
| 1471 | + QString pmax_cpus = m_item.Get("pref_max_cpus");
|
|---|
| 1472 | + QString pskiploop = m_item.Get("pref_skiploop");
|
|---|
| 1473 | + QString prenderer = m_item.Get("pref_videorenderer");
|
|---|
| 1474 | + QString posd = m_item.Get("pref_osdrenderer");
|
|---|
| 1475 | + QString posdfade = m_item.Get("pref_osdfade");
|
|---|
| 1476 | + QString pdeint0 = m_item.Get("pref_deint0");
|
|---|
| 1477 | + QString pdeint1 = m_item.Get("pref_deint1");
|
|---|
| 1478 | + QString pfilter = m_item.Get("pref_filters");
|
|---|
| 1479 | + bool found = false;
|
|---|
| 1480 | +
|
|---|
| 1481 | + QString dech = VideoDisplayProfile::GetDecoderHelp();
|
|---|
| 1482 | + QStringList decr = VideoDisplayProfile::GetDecoders();
|
|---|
| 1483 | + QStringList decn = VideoDisplayProfile::GetDecoderNames();
|
|---|
| 1484 | + QStringList::const_iterator itr = decr.begin();
|
|---|
| 1485 | + QStringList::const_iterator itn = decn.begin();
|
|---|
| 1486 | + for (; (itr != decr.end()) && (itn != decn.end()); ++itr, ++itn)
|
|---|
| 1487 | + {
|
|---|
| 1488 | + m_decoder->addSelection(*itn, *itr, (*itr == pdecoder));
|
|---|
| 1489 | + found |= (*itr == pdecoder);
|
|---|
| 1490 | + }
|
|---|
| 1491 | + if (!found && !pdecoder.isEmpty())
|
|---|
| 1492 | + {
|
|---|
| 1493 | + m_decoder->addSelection(
|
|---|
| 1494 | + VideoDisplayProfile::GetDecoderName(pdecoder), pdecoder, true);
|
|---|
| 1495 | + }
|
|---|
| 1496 | + m_decoder->setHelpText(VideoDisplayProfile::GetDecoderHelp(pdecoder));
|
|---|
| 1497 | +
|
|---|
| 1498 | + if (!pmax_cpus.isEmpty())
|
|---|
| 1499 | + m_max_cpus->setValue(pmax_cpus.toUInt());
|
|---|
| 1500 | +
|
|---|
| 1501 | + m_skiploop->setValue((!pskiploop.isEmpty()) ? (bool) pskiploop.toInt() : true);
|
|---|
| 1502 | +
|
|---|
| 1503 | + if (!prenderer.isEmpty())
|
|---|
| 1504 | + m_vidrend->setValue(prenderer);
|
|---|
| 1505 | + if (!posd.isEmpty())
|
|---|
| 1506 | + m_osdrend->setValue(posd);
|
|---|
| 1507 | +
|
|---|
| 1508 | + m_osdfade->setValue((!posdfade.isEmpty()) ? (bool) posdfade.toInt() : true);
|
|---|
| 1509 | +
|
|---|
| 1510 | + if (!pdeint0.isEmpty())
|
|---|
| 1511 | + m_deint0->setValue(pdeint0);
|
|---|
| 1512 | + if (!pdeint1.isEmpty())
|
|---|
| 1513 | + m_deint1->setValue(pdeint1);
|
|---|
| 1514 | + if (!pfilter.isEmpty())
|
|---|
| 1515 | + m_filters->setValue(pfilter);
|
|---|
| 1516 | +}
|
|---|
| 1517 | +
|
|---|
| 1518 | +void PlaybackProfileConfigItemTree::decoderChanged(const QString &dec)
|
|---|
| 1519 | +{
|
|---|
| 1520 | + QString vrenderer = m_vidrend->getValue();
|
|---|
| 1521 | + QStringList renderers = VideoDisplayProfile::GetVideoRenderers(dec);
|
|---|
| 1522 | + QStringList::const_iterator it;
|
|---|
| 1523 | +
|
|---|
| 1524 | + QString prenderer;
|
|---|
| 1525 | + for (it = renderers.begin(); it != renderers.end(); ++it)
|
|---|
| 1526 | + prenderer = (*it == vrenderer) ? vrenderer : prenderer;
|
|---|
| 1527 | + if (prenderer.isEmpty())
|
|---|
| 1528 | + prenderer = VideoDisplayProfile::GetPreferredVideoRenderer(dec);
|
|---|
| 1529 | +
|
|---|
| 1530 | + m_vidrend->clearSelections();
|
|---|
| 1531 | + for (it = renderers.begin(); it != renderers.end(); ++it)
|
|---|
| 1532 | + {
|
|---|
| 1533 | + if (*it != "null")
|
|---|
| 1534 | + m_vidrend->addSelection(*it, *it, (*it == prenderer));
|
|---|
| 1535 | + }
|
|---|
| 1536 | +
|
|---|
| 1537 | + m_decoder->setHelpText(VideoDisplayProfile::GetDecoderHelp(dec));
|
|---|
| 1538 | +}
|
|---|
| 1539 | +
|
|---|
| 1540 | +void PlaybackProfileConfigItemTree::vrenderChanged(const QString& renderer)
|
|---|
| 1541 | +{
|
|---|
| 1542 | + LOG(VB_GENERAL, LOG_ERR, QString("PlaybackProfileConfigItemTree::vrenderChanged"));
|
|---|
| 1543 | + QStringList osds = VideoDisplayProfile::GetOSDs(renderer);
|
|---|
| 1544 | + QStringList deints = VideoDisplayProfile::GetDeinterlacers(renderer);
|
|---|
| 1545 | + QString losd = m_osdrend->getValue();
|
|---|
| 1546 | + QString ldeint0 = m_deint0->getValue();
|
|---|
| 1547 | + QString ldeint1 = m_deint1->getValue();
|
|---|
| 1548 | + QStringList::const_iterator it;
|
|---|
| 1549 | +
|
|---|
| 1550 | + m_osdrend->clearSelections();
|
|---|
| 1551 | + for (it = osds.begin(); it != osds.end(); ++it)
|
|---|
| 1552 | + m_osdrend->addSelection(*it, *it, (*it == losd));
|
|---|
| 1553 | +
|
|---|
| 1554 | + m_deint0->clearSelections();
|
|---|
| 1555 | + for (it = deints.begin(); it != deints.end(); ++it)
|
|---|
| 1556 | + {
|
|---|
| 1557 | + m_deint0->addSelection(VideoDisplayProfile::GetDeinterlacerName(*it),
|
|---|
| 1558 | + *it, (*it == ldeint0));
|
|---|
| 1559 | + }
|
|---|
| 1560 | +
|
|---|
| 1561 | + m_deint1->clearSelections();
|
|---|
| 1562 | + for (it = deints.begin(); it != deints.end(); ++it)
|
|---|
| 1563 | + {
|
|---|
| 1564 | + if (!(*it).contains("bobdeint") && !(*it).contains("doublerate") &&
|
|---|
| 1565 | + !(*it).contains("doubleprocess"))
|
|---|
| 1566 | + m_deint1->addSelection(VideoDisplayProfile::GetDeinterlacerName(*it),
|
|---|
| 1567 | + *it, (*it == ldeint1));
|
|---|
| 1568 | + }
|
|---|
| 1569 | +
|
|---|
| 1570 | + //TODO m_filters->setEnabled(VideoDisplayProfile::IsFilterAllowed(renderer));
|
|---|
| 1571 | + m_vidrend->setHelpText(VideoDisplayProfile::GetVideoRendererHelp(renderer));
|
|---|
| 1572 | +}
|
|---|
| 1573 | +
|
|---|
| 1574 | +void PlaybackProfileConfigItemTree::orenderChanged(const QString &renderer)
|
|---|
| 1575 | +{
|
|---|
| 1576 | + m_osdrend->setHelpText(VideoDisplayProfile::GetOSDHelp(renderer));
|
|---|
| 1577 | +}
|
|---|
| 1578 | +
|
|---|
| 1579 | +void PlaybackProfileConfigItemTree::deint0Changed(const QString &deint)
|
|---|
| 1580 | +{
|
|---|
| 1581 | + m_deint0->setHelpText(
|
|---|
| 1582 | + QObject::tr("Main deinterlacing method.") + ' ' +
|
|---|
| 1583 | + VideoDisplayProfile::GetDeinterlacerHelp(deint));
|
|---|
| 1584 | +}
|
|---|
| 1585 | +
|
|---|
| 1586 | +void PlaybackProfileConfigItemTree::deint1Changed(const QString &deint)
|
|---|
| 1587 | {
|
|---|
| 1588 | - if (cmd == "add")
|
|---|
| 1589 | + m_deint1->setHelpText(
|
|---|
| 1590 | + QObject::tr("Fallback deinterlacing method.") + ' ' +
|
|---|
| 1591 | + VideoDisplayProfile::GetDeinterlacerHelp(deint));
|
|---|
| 1592 | +}
|
|---|
| 1593 | +
|
|---|
| 1594 | +class PlaybackProfileConfigTree : public GroupSetting
|
|---|
| 1595 | +{
|
|---|
| 1596 | + public:
|
|---|
| 1597 | + PlaybackProfileConfigTree(QString profileName);
|
|---|
| 1598 | + private:
|
|---|
| 1599 | + item_list_t m_items;
|
|---|
| 1600 | + uint m_groupid;
|
|---|
| 1601 | +};
|
|---|
| 1602 | +
|
|---|
| 1603 | +PlaybackProfileConfigTree::PlaybackProfileConfigTree(QString profileName)
|
|---|
| 1604 | + :GroupSetting(profileName)
|
|---|
| 1605 | +{
|
|---|
| 1606 | + m_groupid = VideoDisplayProfile::GetProfileGroupID(
|
|---|
| 1607 | + profileName, gCoreContext->GetHostName());
|
|---|
| 1608 | +
|
|---|
| 1609 | + LOG(VB_GENERAL, LOG_ERR, QString("PlaybackProfileConfigTree::PlaybackProfileConfigTree() m_groupid=%1 for %")
|
|---|
| 1610 | + .arg(m_groupid).arg(profileName));
|
|---|
| 1611 | +
|
|---|
| 1612 | + m_items = VideoDisplayProfile::LoadDB(m_groupid);
|
|---|
| 1613 | +
|
|---|
| 1614 | + for (uint i = 0; i < m_items.size(); ++i)
|
|---|
| 1615 | {
|
|---|
| 1616 | - QString name;
|
|---|
| 1617 | + QString andStr = QObject::tr("&", "and");
|
|---|
| 1618 | + QString cmp0 = m_items[i].Get("pref_cmp0");
|
|---|
| 1619 | + QString cmp1 = m_items[i].Get("pref_cmp1");
|
|---|
| 1620 | + QString str = QObject::tr("if rez") + ' ' + cmp0;
|
|---|
| 1621 | +
|
|---|
| 1622 | + if (!cmp1.isEmpty())
|
|---|
| 1623 | + str += " " + andStr + ' ' + cmp1;
|
|---|
| 1624 | +
|
|---|
| 1625 | + str += " -> ";
|
|---|
| 1626 | + str += m_items[i].Get("pref_decoder");
|
|---|
| 1627 | + str += " " + andStr + ' ';
|
|---|
| 1628 | + str += m_items[i].Get("pref_videorenderer");
|
|---|
| 1629 | + str.replace("-blit", "");
|
|---|
| 1630 | + str.replace("ivtv " + andStr + " ivtv", "ivtv");
|
|---|
| 1631 | + str.replace("xvmc " + andStr + " xvmc", "xvmc");
|
|---|
| 1632 | + str.replace("xvmc", "XvMC");
|
|---|
| 1633 | + str.replace("xv", "XVideo");
|
|---|
| 1634 | +
|
|---|
| 1635 | + QString groupeName = pad(trunc(str, 48), 48);
|
|---|
| 1636 | + LOG(VB_GENERAL, LOG_ERR, QString("PlaybackProfileConfigTree::PlaybackProfileConfigTree() %1").arg(groupeName));
|
|---|
| 1637 | + addChild(new PlaybackProfileConfigItemTree(m_items[i]));
|
|---|
| 1638 | + }
|
|---|
| 1639 | +};
|
|---|
| 1640 | +
|
|---|
| 1641 | +class PlaybackProfileConfigsTree : public HostComboBoxTree
|
|---|
| 1642 | +{
|
|---|
| 1643 | + public:
|
|---|
| 1644 | + PlaybackProfileConfigsTree()
|
|---|
| 1645 | + : HostComboBoxTree("DefaultVideoPlaybackProfile")
|
|---|
| 1646 | + {
|
|---|
| 1647 | + setLabel(QObject::tr("Current Video Playback Profile"));
|
|---|
| 1648 |
|
|---|
| 1649 | QString host = gCoreContext->GetHostName();
|
|---|
| 1650 | - QStringList not_ok_list = VideoDisplayProfile::GetProfiles(host);
|
|---|
| 1651 | + QStringList profiles = VideoDisplayProfile::GetProfiles(host);
|
|---|
| 1652 | + if (profiles.empty())
|
|---|
| 1653 | + {
|
|---|
| 1654 | + VideoDisplayProfile::CreateProfiles(host);
|
|---|
| 1655 | + profiles = VideoDisplayProfile::GetProfiles(host);
|
|---|
| 1656 | + }
|
|---|
| 1657 | + if (profiles.empty())
|
|---|
| 1658 | + return;
|
|---|
| 1659 | +
|
|---|
| 1660 | + if (!profiles.contains("Normal") &&
|
|---|
| 1661 | + !profiles.contains("High Quality") &&
|
|---|
| 1662 | + !profiles.contains("Slim"))
|
|---|
| 1663 | + {
|
|---|
| 1664 | + VideoDisplayProfile::CreateNewProfiles(host);
|
|---|
| 1665 | + profiles = VideoDisplayProfile::GetProfiles(host);
|
|---|
| 1666 | + }
|
|---|
| 1667 |
|
|---|
| 1668 | - bool ok = true;
|
|---|
| 1669 | - while (ok)
|
|---|
| 1670 | + if (!profiles.contains("VDPAU Normal") &&
|
|---|
| 1671 | + !profiles.contains("VDPAU High Quality") &&
|
|---|
| 1672 | + !profiles.contains("VDPAU Slim"))
|
|---|
| 1673 | {
|
|---|
| 1674 | - QString msg = QObject::tr("Enter Playback Group Name");
|
|---|
| 1675 | + VideoDisplayProfile::CreateVDPAUProfiles(host);
|
|---|
| 1676 | + profiles = VideoDisplayProfile::GetProfiles(host);
|
|---|
| 1677 | + }
|
|---|
| 1678 | +
|
|---|
| 1679 | + QStringList::const_iterator it;
|
|---|
| 1680 | + for (it = profiles.begin(); it != profiles.end(); ++it)
|
|---|
| 1681 | + {
|
|---|
| 1682 | + addSelection(ProgramInfo::i18n(*it), *it);
|
|---|
| 1683 | + GroupSetting * gp = new PlaybackProfileConfigTree(*it);
|
|---|
| 1684 | + //gp->setLabel(*it);
|
|---|
| 1685 | + addChild(gp);
|
|---|
| 1686 | + }
|
|---|
| 1687 | + }
|
|---|
| 1688 | +
|
|---|
| 1689 | + virtual void menu();
|
|---|
| 1690 | + //virtual void resultMenu(DialogCompletionEvent *dce);
|
|---|
| 1691 | + virtual void customEvent(QEvent *event);
|
|---|
| 1692 | + private:
|
|---|
| 1693 | + void newProfile(const QString &name);
|
|---|
| 1694 | + void renameProfile(const QString &newName);
|
|---|
| 1695 | + void deleteProfile();
|
|---|
| 1696 | +};
|
|---|
| 1697 | +
|
|---|
| 1698 | +void PlaybackProfileConfigsTree::customEvent(QEvent *event)
|
|---|
| 1699 | +{
|
|---|
| 1700 | + if (event->type() == DialogCompletionEvent::kEventType)
|
|---|
| 1701 | + {
|
|---|
| 1702 | + DialogCompletionEvent *dce = (DialogCompletionEvent*)(event);
|
|---|
| 1703 | + QString resultid = dce->GetId();
|
|---|
| 1704 |
|
|---|
| 1705 | - ok = MythPopupBox::showGetTextPopup(
|
|---|
| 1706 | - GetMythMainWindow(), msg, msg, name);
|
|---|
| 1707 | + LOG(VB_GENERAL, LOG_ERR, QString("MyComboBoxTree::customEvent: resultId = %1").arg(resultid));
|
|---|
| 1708 |
|
|---|
| 1709 | - if (!ok)
|
|---|
| 1710 | - return;
|
|---|
| 1711 | + if (resultid == "contextualmenu")
|
|---|
| 1712 | + {
|
|---|
| 1713 | + QString contextualChoice = dce->GetData().toString();
|
|---|
| 1714 | + //else
|
|---|
| 1715 | + LOG(VB_GENERAL, LOG_ERR, QString("MyComboBoxTree::customEvent: result = %1").arg(dce->GetData().toString()));
|
|---|
| 1716 | + if (contextualChoice == "newprofile")
|
|---|
| 1717 | + {
|
|---|
| 1718 | + MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
|
|---|
| 1719 | +
|
|---|
| 1720 | + MythTextInputDialog *settingdialog =
|
|---|
| 1721 | + new MythTextInputDialog(popupStack,
|
|---|
| 1722 | + QObject::tr("New profile name"),FilterNone);
|
|---|
| 1723 | +
|
|---|
| 1724 | + if (settingdialog->Create())
|
|---|
| 1725 | + {
|
|---|
| 1726 | + settingdialog->SetReturnEvent(this, "newprofileresult");
|
|---|
| 1727 | + popupStack->AddScreen(settingdialog);
|
|---|
| 1728 | + }
|
|---|
| 1729 | + }
|
|---|
| 1730 | + else if (contextualChoice == "renameprofile")
|
|---|
| 1731 | + {
|
|---|
| 1732 | + MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
|
|---|
| 1733 | +
|
|---|
| 1734 | + MythTextInputDialog *settingdialog =
|
|---|
| 1735 | + new MythTextInputDialog(popupStack,
|
|---|
| 1736 | + QObject::tr("New profile name"),FilterNone, false, GetText("value"));
|
|---|
| 1737 |
|
|---|
| 1738 | - if (not_ok_list.contains(name) || name.isEmpty())
|
|---|
| 1739 | + if (settingdialog->Create())
|
|---|
| 1740 | + {
|
|---|
| 1741 | + settingdialog->SetReturnEvent(this, "renameprofileresult");
|
|---|
| 1742 | + popupStack->AddScreen(settingdialog);
|
|---|
| 1743 | + }
|
|---|
| 1744 | + }
|
|---|
| 1745 | + else if (contextualChoice == "deleteprofile")
|
|---|
| 1746 | {
|
|---|
| 1747 | - msg = (name.isEmpty()) ?
|
|---|
| 1748 | - QObject::tr(
|
|---|
| 1749 | - "Sorry, playback group\nname cannot be blank.") :
|
|---|
| 1750 | - QObject::tr(
|
|---|
| 1751 | - "Sorry, playback group name\n"
|
|---|
| 1752 | - "'%1' is already being used.").arg(name);
|
|---|
| 1753 | + MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
|
|---|
| 1754 |
|
|---|
| 1755 | - MythPopupBox::showOkPopup(
|
|---|
| 1756 | - GetMythMainWindow(), QObject::tr("Error"), msg);
|
|---|
| 1757 | + MythConfirmationDialog *settingdialog =
|
|---|
| 1758 | + new MythConfirmationDialog(popupStack,
|
|---|
| 1759 | + QObject::tr("Remove %1 profile ?").arg(GetText("value")),true);
|
|---|
| 1760 |
|
|---|
| 1761 | - continue;
|
|---|
| 1762 | + if (settingdialog->Create())
|
|---|
| 1763 | + {
|
|---|
| 1764 | + settingdialog->SetReturnEvent(this, "deleteprofileresult");
|
|---|
| 1765 | + popupStack->AddScreen(settingdialog);
|
|---|
| 1766 | + }
|
|---|
| 1767 | }
|
|---|
| 1768 | + else
|
|---|
| 1769 | + HostComboBoxTree::customEvent(event);
|
|---|
| 1770 |
|
|---|
| 1771 | - break;
|
|---|
| 1772 | +
|
|---|
| 1773 | +
|
|---|
| 1774 | + }
|
|---|
| 1775 | + else if (resultid == "newprofileresult")
|
|---|
| 1776 | + {
|
|---|
| 1777 | + newProfile(dce->GetResultText());
|
|---|
| 1778 | + }
|
|---|
| 1779 | + else if (resultid == "renameprofileresult")
|
|---|
| 1780 | + {
|
|---|
| 1781 | + renameProfile(dce->GetResultText());
|
|---|
| 1782 | + }
|
|---|
| 1783 | + else if (resultid == "deleteprofileresult")
|
|---|
| 1784 | + {
|
|---|
| 1785 | + if (dce->GetResult()==1)
|
|---|
| 1786 | + deleteProfile();
|
|---|
| 1787 | }
|
|---|
| 1788 |
|
|---|
| 1789 | - VideoDisplayProfile::CreateProfileGroup(name, gCoreContext->GetHostName());
|
|---|
| 1790 | - addTarget(name, new PlaybackProfileConfig(name));
|
|---|
| 1791 | + }
|
|---|
| 1792 | +}
|
|---|
| 1793 | +
|
|---|
| 1794 | +void PlaybackProfileConfigsTree::newProfile(const QString &name)
|
|---|
| 1795 | +{
|
|---|
| 1796 | + LOG(VB_GENERAL, LOG_ERR, QString("MyComboBoxTree::newProfile(%1) => TODO").arg(name));
|
|---|
| 1797 | + if (name.isEmpty())
|
|---|
| 1798 | + {
|
|---|
| 1799 | + MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
|
|---|
| 1800 |
|
|---|
| 1801 | - if (grouptrigger)
|
|---|
| 1802 | - grouptrigger->addSelection(name, name, true);
|
|---|
| 1803 | + MythConfirmationDialog *settingdialog =
|
|---|
| 1804 | + new MythConfirmationDialog(popupStack,
|
|---|
| 1805 | + QObject::tr("Sorry, playback group\nname cannot be blank."),false);
|
|---|
| 1806 | +
|
|---|
| 1807 | + if (settingdialog->Create())
|
|---|
| 1808 | + {
|
|---|
| 1809 | + popupStack->AddScreen(settingdialog);
|
|---|
| 1810 | + }
|
|---|
| 1811 | + return;
|
|---|
| 1812 | }
|
|---|
| 1813 | - else if ((cmd == "del") && grouptrigger)
|
|---|
| 1814 | +
|
|---|
| 1815 | +
|
|---|
| 1816 | + QString host = gCoreContext->GetHostName();
|
|---|
| 1817 | + QStringList not_ok_list = VideoDisplayProfile::GetProfiles(host);
|
|---|
| 1818 | +
|
|---|
| 1819 | + if (not_ok_list.contains(name))
|
|---|
| 1820 | {
|
|---|
| 1821 | - const QString name = grouptrigger->getSelectionLabel();
|
|---|
| 1822 | - if (!name.isEmpty())
|
|---|
| 1823 | +
|
|---|
| 1824 | + MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
|
|---|
| 1825 | +
|
|---|
| 1826 | + MythConfirmationDialog *settingdialog =
|
|---|
| 1827 | + new MythConfirmationDialog(popupStack,
|
|---|
| 1828 | + QObject::tr("Sorry, playback group name\n"
|
|---|
| 1829 | + "'%1' is already being used.").arg(name),false);
|
|---|
| 1830 | +
|
|---|
| 1831 | + if (settingdialog->Create())
|
|---|
| 1832 | {
|
|---|
| 1833 | - removeTarget(name);
|
|---|
| 1834 | - VideoDisplayProfile::DeleteProfileGroup(
|
|---|
| 1835 | - name, gCoreContext->GetHostName());
|
|---|
| 1836 | + popupStack->AddScreen(settingdialog);
|
|---|
| 1837 | }
|
|---|
| 1838 | + return;
|
|---|
| 1839 | }
|
|---|
| 1840 |
|
|---|
| 1841 | - repaint();
|
|---|
| 1842 | + VideoDisplayProfile::CreateProfileGroup(name, gCoreContext->GetHostName());
|
|---|
| 1843 | + addSelection(name, name, true);
|
|---|
| 1844 | +
|
|---|
| 1845 | +}
|
|---|
| 1846 | +
|
|---|
| 1847 | +void PlaybackProfileConfigsTree::renameProfile(const QString &newName)
|
|---|
| 1848 | +{
|
|---|
| 1849 | + LOG(VB_GENERAL, LOG_ERR, QString("MyComboBoxTree::renameProfile(%1) => TODO").arg(newName));
|
|---|
| 1850 | + if (newName.isEmpty())
|
|---|
| 1851 | + {
|
|---|
| 1852 | + MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
|
|---|
| 1853 | +
|
|---|
| 1854 | + MythConfirmationDialog *settingdialog =
|
|---|
| 1855 | + new MythConfirmationDialog(popupStack,
|
|---|
| 1856 | + QObject::tr("Error: The playback profile's new name is empty"),true);
|
|---|
| 1857 | +
|
|---|
| 1858 | + if (settingdialog->Create())
|
|---|
| 1859 | + {
|
|---|
| 1860 | + popupStack->AddScreen(settingdialog);
|
|---|
| 1861 | + }
|
|---|
| 1862 | + }
|
|---|
| 1863 | }
|
|---|
| 1864 |
|
|---|
| 1865 | -void PlaybackProfileConfigs::triggerChanged(const QString &trig)
|
|---|
| 1866 | +void PlaybackProfileConfigsTree::deleteProfile()
|
|---|
| 1867 | {
|
|---|
| 1868 | - TriggeredConfigurationGroup::triggerChanged(trig);
|
|---|
| 1869 | + LOG(VB_GENERAL, LOG_ERR, QString("MyComboBoxTree::deleteProfile() => TODO"));
|
|---|
| 1870 | + const QString name = GetText("value");
|
|---|
| 1871 | + if (!name.isEmpty())
|
|---|
| 1872 | + {
|
|---|
| 1873 | + removeSelection(name);
|
|---|
| 1874 | + VideoDisplayProfile::DeleteProfileGroup(
|
|---|
| 1875 | + name, gCoreContext->GetHostName());
|
|---|
| 1876 | + }
|
|---|
| 1877 | }
|
|---|
| 1878 | +*/
|
|---|
| 1879 |
|
|---|
| 1880 | -static HostComboBox *PlayBoxOrdering()
|
|---|
| 1881 | +/* TODO this is a copy and modified version of ComboBoxTree::edit()
|
|---|
| 1882 | +I need to do it in a more generic way */
|
|---|
| 1883 | +/*
|
|---|
| 1884 | +void PlaybackProfileConfigsTree::menu()
|
|---|
| 1885 | +{
|
|---|
| 1886 | + if (m_screen==NULL)
|
|---|
| 1887 | + {
|
|---|
| 1888 | + LOG(VB_GENERAL, LOG_ERR, QString("ComboBoxTree::edit: screen is null"));
|
|---|
| 1889 | + return;
|
|---|
| 1890 | + }
|
|---|
| 1891 | + MythScreenStack *popupStack =
|
|---|
| 1892 | + GetMythMainWindow()->GetStack("popup stack");
|
|---|
| 1893 | +
|
|---|
| 1894 | + MythDialogBox * m_menuPopup =
|
|---|
| 1895 | + new MythDialogBox(GetText(), popupStack, "contextualmenu");
|
|---|
| 1896 | +
|
|---|
| 1897 | + if (m_menuPopup->Create())
|
|---|
| 1898 | + popupStack->AddScreen(m_menuPopup);
|
|---|
| 1899 | +
|
|---|
| 1900 | + m_menuPopup->SetReturnEvent(this, "contextualmenu");
|
|---|
| 1901 | +
|
|---|
| 1902 | +//TODO we need to have the menu from the base class too
|
|---|
| 1903 | +
|
|---|
| 1904 | + m_menuPopup->AddButton(QObject::tr("Add New"),QVariant::fromValue(QString("newprofile")));
|
|---|
| 1905 | + //m_menuPopup->AddButton(QObject::tr("Rename"),QVariant::fromValue(QString("renameprofile")));
|
|---|
| 1906 | + m_menuPopup->AddButton(QObject::tr("Delete"),QVariant::fromValue(QString("deleteprofile")));
|
|---|
| 1907 | +
|
|---|
| 1908 | +}*/
|
|---|
| 1909 | +
|
|---|
| 1910 | +static HostComboBoxTree *PlayBoxOrdering()
|
|---|
| 1911 | {
|
|---|
| 1912 | QString str[4] =
|
|---|
| 1913 | {
|
|---|
| 1914 | @@ -1264,7 +2142,7 @@ static HostComboBox *PlayBoxOrdering()
|
|---|
| 1915 | "refers to sections (e.g. \"All Programs\") which list "
|
|---|
| 1916 | "multiple titles. Sections in parentheses are not affected.");
|
|---|
| 1917 |
|
|---|
| 1918 | - HostComboBox *gc = new HostComboBox("PlayBoxOrdering");
|
|---|
| 1919 | + HostComboBoxTree *gc = new HostComboBoxTree("PlayBoxOrdering");
|
|---|
| 1920 | gc->setLabel(QObject::tr("Episode sort orderings"));
|
|---|
| 1921 |
|
|---|
| 1922 | for (int i = 0; i < 4; ++i)
|
|---|
| 1923 | @@ -1276,9 +2154,9 @@ static HostComboBox *PlayBoxOrdering()
|
|---|
| 1924 | return gc;
|
|---|
| 1925 | }
|
|---|
| 1926 |
|
|---|
| 1927 | -static HostComboBox *PlayBoxEpisodeSort()
|
|---|
| 1928 | +static HostComboBoxTree *PlayBoxEpisodeSort()
|
|---|
| 1929 | {
|
|---|
| 1930 | - HostComboBox *gc = new HostComboBox("PlayBoxEpisodeSort");
|
|---|
| 1931 | + HostComboBoxTree *gc = new HostComboBoxTree("PlayBoxEpisodeSort");
|
|---|
| 1932 | gc->setLabel(QObject::tr("Sort episodes"));
|
|---|
| 1933 | gc->addSelection(QObject::tr("Record date"), "Date");
|
|---|
| 1934 | gc->addSelection(QObject::tr("Season/Episode"), "Season");
|
|---|
| 1935 | @@ -1288,9 +2166,9 @@ static HostComboBox *PlayBoxEpisodeSort()
|
|---|
| 1936 | return gc;
|
|---|
| 1937 | }
|
|---|
| 1938 |
|
|---|
| 1939 | -static HostSpinBox *FFRewReposTime()
|
|---|
| 1940 | +static HostSpinBoxTree *FFRewReposTime()
|
|---|
| 1941 | {
|
|---|
| 1942 | - HostSpinBox *gs = new HostSpinBox("FFRewReposTime", 0, 200, 5);
|
|---|
| 1943 | + HostSpinBoxTree *gs = new HostSpinBoxTree("FFRewReposTime", 0, 200, 5);
|
|---|
| 1944 | gs->setLabel(QObject::tr("Fast forward/rewind reposition amount"));
|
|---|
| 1945 | gs->setValue(100);
|
|---|
| 1946 | gs->setHelpText(QObject::tr("When exiting sticky keys fast forward/rewind "
|
|---|
| 1947 | @@ -1301,9 +2179,9 @@ static HostSpinBox *FFRewReposTime()
|
|---|
| 1948 | return gs;
|
|---|
| 1949 | }
|
|---|
| 1950 |
|
|---|
| 1951 | -static HostCheckBox *FFRewReverse()
|
|---|
| 1952 | +static HostCheckBoxTree *FFRewReverse()
|
|---|
| 1953 | {
|
|---|
| 1954 | - HostCheckBox *gc = new HostCheckBox("FFRewReverse");
|
|---|
| 1955 | + HostCheckBoxTree *gc = new HostCheckBoxTree("FFRewReverse");
|
|---|
| 1956 | gc->setLabel(QObject::tr("Reverse direction in fast forward/rewind"));
|
|---|
| 1957 | gc->setValue(true);
|
|---|
| 1958 | gc->setHelpText(QObject::tr("If enabled, pressing the sticky rewind key "
|
|---|
| 1959 | @@ -1314,9 +2192,9 @@ static HostCheckBox *FFRewReverse()
|
|---|
| 1960 | return gc;
|
|---|
| 1961 | }
|
|---|
| 1962 |
|
|---|
| 1963 | -static HostComboBox *MenuTheme()
|
|---|
| 1964 | +static HostComboBoxTree *MenuTheme()
|
|---|
| 1965 | {
|
|---|
| 1966 | - HostComboBox *gc = new HostComboBox("MenuTheme");
|
|---|
| 1967 | + HostComboBoxTree *gc = new HostComboBoxTree("MenuTheme");
|
|---|
| 1968 | gc->setLabel(QObject::tr("Menu theme"));
|
|---|
| 1969 |
|
|---|
| 1970 | QList<ThemeInfo> themelist = GetMythUI()->GetThemes(THEME_MENU);
|
|---|
| 1971 | @@ -1348,9 +2226,9 @@ static HostComboBox MUNUSED *DecodeVBIFormat()
|
|---|
| 1972 | return gc;
|
|---|
| 1973 | }
|
|---|
| 1974 |
|
|---|
| 1975 | -static HostSpinBox *OSDCC708TextZoomPercentage(void)
|
|---|
| 1976 | +static HostSpinBoxTree *OSDCC708TextZoomPercentage(void)
|
|---|
| 1977 | {
|
|---|
| 1978 | - HostSpinBox *gs = new HostSpinBox("OSDCC708TextZoom", 50, 200, 5);
|
|---|
| 1979 | + HostSpinBoxTree *gs = new HostSpinBoxTree("OSDCC708TextZoom", 50, 200, 5);
|
|---|
| 1980 | gs->setLabel(QObject::tr("Subtitle text zoom percentage"));
|
|---|
| 1981 | gs->setValue(100);
|
|---|
| 1982 | gs->setHelpText(QObject::tr("Use this to enlarge or shrink text based subtitles."));
|
|---|
| 1983 | @@ -1358,9 +2236,9 @@ static HostSpinBox *OSDCC708TextZoomPercentage(void)
|
|---|
| 1984 | return gs;
|
|---|
| 1985 | }
|
|---|
| 1986 |
|
|---|
| 1987 | -static HostComboBox *SubtitleFont()
|
|---|
| 1988 | +static HostComboBoxTree *SubtitleFont()
|
|---|
| 1989 | {
|
|---|
| 1990 | - HostComboBox *hcb = new HostComboBox("OSDSubFont");
|
|---|
| 1991 | + HostComboBoxTree *hcb = new HostComboBoxTree("OSDSubFont");
|
|---|
| 1992 | QFontDatabase db;
|
|---|
| 1993 | QStringList fonts = db.families();
|
|---|
| 1994 | QStringList hide = db.families(QFontDatabase::Symbol);
|
|---|
| 1995 | @@ -1375,9 +2253,9 @@ static HostComboBox *SubtitleFont()
|
|---|
| 1996 | return hcb;
|
|---|
| 1997 | }
|
|---|
| 1998 |
|
|---|
| 1999 | -static HostComboBox *SubtitleCodec()
|
|---|
| 2000 | +static HostComboBoxTree *SubtitleCodec()
|
|---|
| 2001 | {
|
|---|
| 2002 | - HostComboBox *gc = new HostComboBox("SubtitleCodec");
|
|---|
| 2003 | + HostComboBoxTree *gc = new HostComboBoxTree("SubtitleCodec");
|
|---|
| 2004 |
|
|---|
| 2005 | gc->setLabel(QObject::tr("Subtitle Codec"));
|
|---|
| 2006 | QList<QByteArray> list = QTextCodec::availableCodecs();
|
|---|
| 2007 | @@ -1390,18 +2268,18 @@ static HostComboBox *SubtitleCodec()
|
|---|
| 2008 | return gc;
|
|---|
| 2009 | }
|
|---|
| 2010 |
|
|---|
| 2011 | -static HostComboBox *ChannelOrdering()
|
|---|
| 2012 | +static HostComboBoxTree *ChannelOrdering()
|
|---|
| 2013 | {
|
|---|
| 2014 | - HostComboBox *gc = new HostComboBox("ChannelOrdering");
|
|---|
| 2015 | + HostComboBoxTree *gc = new HostComboBoxTree("ChannelOrdering");
|
|---|
| 2016 | gc->setLabel(QObject::tr("Channel ordering"));
|
|---|
| 2017 | gc->addSelection(QObject::tr("channel number"), "channum");
|
|---|
| 2018 | gc->addSelection(QObject::tr("callsign"), "callsign");
|
|---|
| 2019 | return gc;
|
|---|
| 2020 | }
|
|---|
| 2021 |
|
|---|
| 2022 | -static HostSpinBox *VertScanPercentage()
|
|---|
| 2023 | +static HostSpinBoxTree *VertScanPercentage()
|
|---|
| 2024 | {
|
|---|
| 2025 | - HostSpinBox *gs = new HostSpinBox("VertScanPercentage", -100, 100, 1);
|
|---|
| 2026 | + HostSpinBoxTree *gs = new HostSpinBoxTree("VertScanPercentage", -100, 100, 1);
|
|---|
| 2027 | gs->setLabel(QObject::tr("Vertical scaling"));
|
|---|
| 2028 | gs->setValue(0);
|
|---|
| 2029 | gs->setHelpText(QObject::tr(
|
|---|
| 2030 | @@ -1410,9 +2288,9 @@ static HostSpinBox *VertScanPercentage()
|
|---|
| 2031 | return gs;
|
|---|
| 2032 | }
|
|---|
| 2033 |
|
|---|
| 2034 | -static HostSpinBox *HorizScanPercentage()
|
|---|
| 2035 | +static HostSpinBoxTree *HorizScanPercentage()
|
|---|
| 2036 | {
|
|---|
| 2037 | - HostSpinBox *gs = new HostSpinBox("HorizScanPercentage", -100, 100, 1);
|
|---|
| 2038 | + HostSpinBoxTree *gs = new HostSpinBoxTree("HorizScanPercentage", -100, 100, 1);
|
|---|
| 2039 | gs->setLabel(QObject::tr("Horizontal scaling"));
|
|---|
| 2040 | gs->setValue(0);
|
|---|
| 2041 | gs->setHelpText(QObject::tr(
|
|---|
| 2042 | @@ -1421,27 +2299,27 @@ static HostSpinBox *HorizScanPercentage()
|
|---|
| 2043 | return gs;
|
|---|
| 2044 | };
|
|---|
| 2045 |
|
|---|
| 2046 | -static HostSpinBox *XScanDisplacement()
|
|---|
| 2047 | +static HostSpinBoxTree *XScanDisplacement()
|
|---|
| 2048 | {
|
|---|
| 2049 | - HostSpinBox *gs = new HostSpinBox("XScanDisplacement", -50, 50, 1);
|
|---|
| 2050 | + HostSpinBoxTree *gs = new HostSpinBoxTree("XScanDisplacement", -50, 50, 1);
|
|---|
| 2051 | gs->setLabel(QObject::tr("Scan displacement (X)"));
|
|---|
| 2052 | gs->setValue(0);
|
|---|
| 2053 | gs->setHelpText(QObject::tr("Adjust this to move the image horizontally."));
|
|---|
| 2054 | return gs;
|
|---|
| 2055 | }
|
|---|
| 2056 |
|
|---|
| 2057 | -static HostSpinBox *YScanDisplacement()
|
|---|
| 2058 | +static HostSpinBoxTree *YScanDisplacement()
|
|---|
| 2059 | {
|
|---|
| 2060 | - HostSpinBox *gs = new HostSpinBox("YScanDisplacement", -50, 50, 1);
|
|---|
| 2061 | + HostSpinBoxTree *gs = new HostSpinBoxTree("YScanDisplacement", -50, 50, 1);
|
|---|
| 2062 | gs->setLabel(QObject::tr("Scan displacement (Y)"));
|
|---|
| 2063 | gs->setValue(0);
|
|---|
| 2064 | gs->setHelpText(QObject::tr("Adjust this to move the image vertically."));
|
|---|
| 2065 | return gs;
|
|---|
| 2066 | };
|
|---|
| 2067 |
|
|---|
| 2068 | -static HostCheckBox *CCBackground()
|
|---|
| 2069 | +static HostCheckBoxTree *CCBackground()
|
|---|
| 2070 | {
|
|---|
| 2071 | - HostCheckBox *gc = new HostCheckBox("CCBackground");
|
|---|
| 2072 | + HostCheckBoxTree *gc = new HostCheckBoxTree("CCBackground");
|
|---|
| 2073 | gc->setLabel(QObject::tr("Black background for closed captioning"));
|
|---|
| 2074 | gc->setValue(false);
|
|---|
| 2075 | gc->setHelpText(QObject::tr(
|
|---|
| 2076 | @@ -1451,9 +2329,9 @@ static HostCheckBox *CCBackground()
|
|---|
| 2077 | return gc;
|
|---|
| 2078 | }
|
|---|
| 2079 |
|
|---|
| 2080 | -static HostCheckBox *DefaultCCMode()
|
|---|
| 2081 | +static HostCheckBoxTree *DefaultCCMode()
|
|---|
| 2082 | {
|
|---|
| 2083 | - HostCheckBox *gc = new HostCheckBox("DefaultCCMode");
|
|---|
| 2084 | + HostCheckBoxTree *gc = new HostCheckBoxTree("DefaultCCMode");
|
|---|
| 2085 | gc->setLabel(QObject::tr("Always display closed captioning or subtitles"));
|
|---|
| 2086 | gc->setValue(false);
|
|---|
| 2087 | gc->setHelpText(QObject::tr(
|
|---|
| 2088 | @@ -1464,9 +2342,9 @@ static HostCheckBox *DefaultCCMode()
|
|---|
| 2089 | return gc;
|
|---|
| 2090 | }
|
|---|
| 2091 |
|
|---|
| 2092 | -static HostCheckBox *PreferCC708()
|
|---|
| 2093 | +static HostCheckBoxTree *PreferCC708()
|
|---|
| 2094 | {
|
|---|
| 2095 | - HostCheckBox *gc = new HostCheckBox("Prefer708Captions");
|
|---|
| 2096 | + HostCheckBoxTree *gc = new HostCheckBoxTree("Prefer708Captions");
|
|---|
| 2097 | gc->setLabel(QObject::tr("Prefer EIA-708 over EIA-608 captions"));
|
|---|
| 2098 | gc->setValue(true);
|
|---|
| 2099 | gc->setHelpText(
|
|---|
| 2100 | @@ -1477,9 +2355,9 @@ static HostCheckBox *PreferCC708()
|
|---|
| 2101 | return gc;
|
|---|
| 2102 | }
|
|---|
| 2103 |
|
|---|
| 2104 | -static HostCheckBox *EnableMHEG()
|
|---|
| 2105 | +static HostCheckBoxTree *EnableMHEG()
|
|---|
| 2106 | {
|
|---|
| 2107 | - HostCheckBox *gc = new HostCheckBox("EnableMHEG");
|
|---|
| 2108 | + HostCheckBoxTree *gc = new HostCheckBoxTree("EnableMHEG");
|
|---|
| 2109 | gc->setLabel(QObject::tr("Enable interactive TV"));
|
|---|
| 2110 | gc->setValue(false);
|
|---|
| 2111 | gc->setHelpText(QObject::tr(
|
|---|
| 2112 | @@ -1489,9 +2367,9 @@ static HostCheckBox *EnableMHEG()
|
|---|
| 2113 | return gc;
|
|---|
| 2114 | }
|
|---|
| 2115 |
|
|---|
| 2116 | -static HostCheckBox *PersistentBrowseMode()
|
|---|
| 2117 | +static HostCheckBoxTree *PersistentBrowseMode()
|
|---|
| 2118 | {
|
|---|
| 2119 | - HostCheckBox *gc = new HostCheckBox("PersistentBrowseMode");
|
|---|
| 2120 | + HostCheckBoxTree *gc = new HostCheckBoxTree("PersistentBrowseMode");
|
|---|
| 2121 | gc->setLabel(QObject::tr("Always use browse mode in Live TV"));
|
|---|
| 2122 | gc->setValue(true);
|
|---|
| 2123 | gc->setHelpText(
|
|---|
| 2124 | @@ -1501,9 +2379,9 @@ static HostCheckBox *PersistentBrowseMode()
|
|---|
| 2125 | return gc;
|
|---|
| 2126 | }
|
|---|
| 2127 |
|
|---|
| 2128 | -static HostCheckBox *BrowseAllTuners()
|
|---|
| 2129 | +static HostCheckBoxTree *BrowseAllTuners()
|
|---|
| 2130 | {
|
|---|
| 2131 | - HostCheckBox *gc = new HostCheckBox("BrowseAllTuners");
|
|---|
| 2132 | + HostCheckBoxTree *gc = new HostCheckBoxTree("BrowseAllTuners");
|
|---|
| 2133 | gc->setLabel(QObject::tr("Browse all channels"));
|
|---|
| 2134 | gc->setValue(false);
|
|---|
| 2135 | gc->setHelpText(
|
|---|
| 2136 | @@ -1514,9 +2392,9 @@ static HostCheckBox *BrowseAllTuners()
|
|---|
| 2137 | return gc;
|
|---|
| 2138 | }
|
|---|
| 2139 |
|
|---|
| 2140 | -static HostCheckBox *ClearSavedPosition()
|
|---|
| 2141 | +static HostCheckBoxTree *ClearSavedPosition()
|
|---|
| 2142 | {
|
|---|
| 2143 | - HostCheckBox *gc = new HostCheckBox("ClearSavedPosition");
|
|---|
| 2144 | + HostCheckBoxTree *gc = new HostCheckBoxTree("ClearSavedPosition");
|
|---|
| 2145 | gc->setLabel(QObject::tr("Clear bookmark on playback"));
|
|---|
| 2146 | gc->setValue(true);
|
|---|
| 2147 | gc->setHelpText(QObject::tr("If enabled, automatically clear the "
|
|---|
| 2148 | @@ -1526,9 +2404,9 @@ static HostCheckBox *ClearSavedPosition()
|
|---|
| 2149 | return gc;
|
|---|
| 2150 | }
|
|---|
| 2151 |
|
|---|
| 2152 | -static HostCheckBox *AltClearSavedPosition()
|
|---|
| 2153 | +static HostCheckBoxTree *AltClearSavedPosition()
|
|---|
| 2154 | {
|
|---|
| 2155 | - HostCheckBox *gc = new HostCheckBox("AltClearSavedPosition");
|
|---|
| 2156 | + HostCheckBoxTree *gc = new HostCheckBoxTree("AltClearSavedPosition");
|
|---|
| 2157 | gc->setLabel(QObject::tr("Alternate clear and save bookmark"));
|
|---|
| 2158 | gc->setValue(true);
|
|---|
| 2159 | gc->setHelpText(QObject::tr("During playback the SELECT key "
|
|---|
| 2160 | @@ -1539,9 +2417,9 @@ static HostCheckBox *AltClearSavedPosition()
|
|---|
| 2161 | return gc;
|
|---|
| 2162 | }
|
|---|
| 2163 |
|
|---|
| 2164 | -static HostComboBox *PlaybackExitPrompt()
|
|---|
| 2165 | +static HostComboBoxTree *PlaybackExitPrompt()
|
|---|
| 2166 | {
|
|---|
| 2167 | - HostComboBox *gc = new HostComboBox("PlaybackExitPrompt");
|
|---|
| 2168 | + HostComboBoxTree *gc = new HostComboBoxTree("PlaybackExitPrompt");
|
|---|
| 2169 | gc->setLabel(QObject::tr("Action on playback exit"));
|
|---|
| 2170 | gc->addSelection(QObject::tr("Just exit"), "0");
|
|---|
| 2171 | gc->addSelection(QObject::tr("Save position and exit"), "2");
|
|---|
| 2172 | @@ -1555,9 +2433,9 @@ static HostComboBox *PlaybackExitPrompt()
|
|---|
| 2173 | return gc;
|
|---|
| 2174 | }
|
|---|
| 2175 |
|
|---|
| 2176 | -static HostCheckBox *EndOfRecordingExitPrompt()
|
|---|
| 2177 | +static HostCheckBoxTree *EndOfRecordingExitPrompt()
|
|---|
| 2178 | {
|
|---|
| 2179 | - HostCheckBox *gc = new HostCheckBox("EndOfRecordingExitPrompt");
|
|---|
| 2180 | + HostCheckBoxTree *gc = new HostCheckBoxTree("EndOfRecordingExitPrompt");
|
|---|
| 2181 | gc->setLabel(QObject::tr("Prompt at end of recording"));
|
|---|
| 2182 | gc->setValue(false);
|
|---|
| 2183 | gc->setHelpText(QObject::tr("If enabled, a menu will be displayed allowing "
|
|---|
| 2184 | @@ -1566,9 +2444,9 @@ static HostCheckBox *EndOfRecordingExitPrompt()
|
|---|
| 2185 | return gc;
|
|---|
| 2186 | }
|
|---|
| 2187 |
|
|---|
| 2188 | -static HostCheckBox *JumpToProgramOSD()
|
|---|
| 2189 | +static HostCheckBoxTree *JumpToProgramOSD()
|
|---|
| 2190 | {
|
|---|
| 2191 | - HostCheckBox *gc = new HostCheckBox("JumpToProgramOSD");
|
|---|
| 2192 | + HostCheckBoxTree *gc = new HostCheckBoxTree("JumpToProgramOSD");
|
|---|
| 2193 | gc->setLabel(QObject::tr("Jump to program OSD"));
|
|---|
| 2194 | gc->setValue(true);
|
|---|
| 2195 | gc->setHelpText(QObject::tr(
|
|---|
| 2196 | @@ -1580,9 +2458,9 @@ static HostCheckBox *JumpToProgramOSD()
|
|---|
| 2197 | return gc;
|
|---|
| 2198 | }
|
|---|
| 2199 |
|
|---|
| 2200 | -static HostCheckBox *ContinueEmbeddedTVPlay()
|
|---|
| 2201 | +static HostCheckBoxTree *ContinueEmbeddedTVPlay()
|
|---|
| 2202 | {
|
|---|
| 2203 | - HostCheckBox *gc = new HostCheckBox("ContinueEmbeddedTVPlay");
|
|---|
| 2204 | + HostCheckBoxTree *gc = new HostCheckBoxTree("ContinueEmbeddedTVPlay");
|
|---|
| 2205 | gc->setLabel(QObject::tr("Continue playback when embedded"));
|
|---|
| 2206 | gc->setValue(false);
|
|---|
| 2207 | gc->setHelpText(QObject::tr(
|
|---|
| 2208 | @@ -1593,9 +2471,9 @@ static HostCheckBox *ContinueEmbeddedTVPlay()
|
|---|
| 2209 | return gc;
|
|---|
| 2210 | }
|
|---|
| 2211 |
|
|---|
| 2212 | -static HostCheckBox *AutomaticSetWatched()
|
|---|
| 2213 | +static HostCheckBoxTree *AutomaticSetWatched()
|
|---|
| 2214 | {
|
|---|
| 2215 | - HostCheckBox *gc = new HostCheckBox("AutomaticSetWatched");
|
|---|
| 2216 | + HostCheckBoxTree *gc = new HostCheckBoxTree("AutomaticSetWatched");
|
|---|
| 2217 | gc->setLabel(QObject::tr("Automatically mark a recording as watched"));
|
|---|
| 2218 | gc->setValue(false);
|
|---|
| 2219 | gc->setHelpText(QObject::tr("If enabled, when you exit near the end of a "
|
|---|
| 2220 | @@ -1606,9 +2484,9 @@ static HostCheckBox *AutomaticSetWatched()
|
|---|
| 2221 | return gc;
|
|---|
| 2222 | }
|
|---|
| 2223 |
|
|---|
| 2224 | -static HostSpinBox *LiveTVIdleTimeout()
|
|---|
| 2225 | +static HostSpinBoxTree *LiveTVIdleTimeout()
|
|---|
| 2226 | {
|
|---|
| 2227 | - HostSpinBox *gs = new HostSpinBox("LiveTVIdleTimeout", 0, 3600, 1);
|
|---|
| 2228 | + HostSpinBoxTree *gs = new HostSpinBoxTree("LiveTVIdleTimeout", 0, 3600, 1);
|
|---|
| 2229 | gs->setLabel(QObject::tr("Live TV idle timeout (mins)"));
|
|---|
| 2230 | gs->setValue(0);
|
|---|
| 2231 | gs->setHelpText(QObject::tr(
|
|---|
| 2232 | @@ -1618,9 +2496,9 @@ static HostSpinBox *LiveTVIdleTimeout()
|
|---|
| 2233 | return gs;
|
|---|
| 2234 | }
|
|---|
| 2235 |
|
|---|
| 2236 | -// static HostCheckBox *PlaybackPreview()
|
|---|
| 2237 | +// static HostCheckBoxTree *PlaybackPreview()
|
|---|
| 2238 | // {
|
|---|
| 2239 | -// HostCheckBox *gc = new HostCheckBox("PlaybackPreview");
|
|---|
| 2240 | +// HostCheckBox *gc = new HostCheckBoxTree("PlaybackPreview");
|
|---|
| 2241 | // gc->setLabel(QObject::tr("Display live preview of recordings"));
|
|---|
| 2242 | // gc->setValue(true);
|
|---|
| 2243 | // gc->setHelpText(QObject::tr("If enabled, a preview of the recording "
|
|---|
| 2244 | @@ -1629,9 +2507,9 @@ static HostSpinBox *LiveTVIdleTimeout()
|
|---|
| 2245 | // return gc;
|
|---|
| 2246 | // }
|
|---|
| 2247 | //
|
|---|
| 2248 | -// static HostCheckBox *HWAccelPlaybackPreview()
|
|---|
| 2249 | +// static HostCheckBoxTree *HWAccelPlaybackPreview()
|
|---|
| 2250 | // {
|
|---|
| 2251 | -// HostCheckBox *gc = new HostCheckBox("HWAccelPlaybackPreview");
|
|---|
| 2252 | +// HostCheckBoxTree *gc = new HostCheckBoxTree("HWAccelPlaybackPreview");
|
|---|
| 2253 | // gc->setLabel(QObject::tr("Use HW Acceleration for live recording preview"));
|
|---|
| 2254 | // gc->setValue(false);
|
|---|
| 2255 | // gc->setHelpText(
|
|---|
| 2256 | @@ -1643,9 +2521,9 @@ static HostSpinBox *LiveTVIdleTimeout()
|
|---|
| 2257 | // return gc;
|
|---|
| 2258 | // }
|
|---|
| 2259 |
|
|---|
| 2260 | -static HostCheckBox *UseVirtualKeyboard()
|
|---|
| 2261 | +static HostCheckBoxTree *UseVirtualKeyboard()
|
|---|
| 2262 | {
|
|---|
| 2263 | - HostCheckBox *gc = new HostCheckBox("UseVirtualKeyboard");
|
|---|
| 2264 | + HostCheckBoxTree *gc = new HostCheckBoxTree("UseVirtualKeyboard");
|
|---|
| 2265 | gc->setLabel(QObject::tr("Use line edit virtual keyboards"));
|
|---|
| 2266 | gc->setValue(true);
|
|---|
| 2267 | gc->setHelpText(QObject::tr("If enabled, you can use a virtual keyboard "
|
|---|
| 2268 | @@ -1654,9 +2532,9 @@ static HostCheckBox *UseVirtualKeyboard()
|
|---|
| 2269 | return gc;
|
|---|
| 2270 | }
|
|---|
| 2271 |
|
|---|
| 2272 | -static HostComboBox *OverrideExitMenu()
|
|---|
| 2273 | +static HostComboBoxTree *OverrideExitMenu()
|
|---|
| 2274 | {
|
|---|
| 2275 | - HostComboBox *gc = new HostComboBox("OverrideExitMenu");
|
|---|
| 2276 | + HostComboBoxTree *gc = new HostComboBoxTree("OverrideExitMenu");
|
|---|
| 2277 | gc->setLabel(QObject::tr("Customize exit menu options"));
|
|---|
| 2278 | gc->addSelection(QObject::tr("Default"), "0");
|
|---|
| 2279 | gc->addSelection(QObject::tr("Show quit"), "1");
|
|---|
| 2280 | @@ -1671,9 +2549,9 @@ static HostComboBox *OverrideExitMenu()
|
|---|
| 2281 | return gc;
|
|---|
| 2282 | }
|
|---|
| 2283 |
|
|---|
| 2284 | -static HostLineEdit *RebootCommand()
|
|---|
| 2285 | +static HostLineEditTree *RebootCommand()
|
|---|
| 2286 | {
|
|---|
| 2287 | - HostLineEdit *ge = new HostLineEdit("RebootCommand");
|
|---|
| 2288 | + HostLineEditTree *ge = new HostLineEditTree("RebootCommand");
|
|---|
| 2289 | ge->setLabel(QObject::tr("Reboot command"));
|
|---|
| 2290 | ge->setValue("");
|
|---|
| 2291 | ge->setHelpText(QObject::tr("Optional. Script to run if you select "
|
|---|
| 2292 | @@ -1683,9 +2561,9 @@ static HostLineEdit *RebootCommand()
|
|---|
| 2293 | return ge;
|
|---|
| 2294 | }
|
|---|
| 2295 |
|
|---|
| 2296 | -static HostLineEdit *HaltCommand()
|
|---|
| 2297 | +static HostLineEditTree *HaltCommand()
|
|---|
| 2298 | {
|
|---|
| 2299 | - HostLineEdit *ge = new HostLineEdit("HaltCommand");
|
|---|
| 2300 | + HostLineEditTree *ge = new HostLineEditTree("HaltCommand");
|
|---|
| 2301 | ge->setLabel(QObject::tr("Halt command"));
|
|---|
| 2302 | ge->setValue("");
|
|---|
| 2303 | ge->setHelpText(QObject::tr("Optional. Script to run if you select "
|
|---|
| 2304 | @@ -1695,9 +2573,9 @@ static HostLineEdit *HaltCommand()
|
|---|
| 2305 | return ge;
|
|---|
| 2306 | }
|
|---|
| 2307 |
|
|---|
| 2308 | -static HostLineEdit *LircDaemonDevice()
|
|---|
| 2309 | +static HostLineEditTree *LircDaemonDevice()
|
|---|
| 2310 | {
|
|---|
| 2311 | - HostLineEdit *ge = new HostLineEdit("LircSocket");
|
|---|
| 2312 | + HostLineEditTree *ge = new HostLineEditTree("LircSocket");
|
|---|
| 2313 | ge->setLabel(QObject::tr("LIRC daemon socket"));
|
|---|
| 2314 |
|
|---|
| 2315 | /* lircd socket moved from /dev/ to /var/run/lirc/ in lirc 0.8.6 */
|
|---|
| 2316 | @@ -1712,18 +2590,18 @@ static HostLineEdit *LircDaemonDevice()
|
|---|
| 2317 | return ge;
|
|---|
| 2318 | }
|
|---|
| 2319 |
|
|---|
| 2320 | -static HostLineEdit *ScreenShotPath()
|
|---|
| 2321 | +static HostLineEditTree *ScreenShotPath()
|
|---|
| 2322 | {
|
|---|
| 2323 | - HostLineEdit *ge = new HostLineEdit("ScreenShotPath");
|
|---|
| 2324 | + HostLineEditTree *ge = new HostLineEditTree("ScreenShotPath");
|
|---|
| 2325 | ge->setLabel(QObject::tr("Screen shot path"));
|
|---|
| 2326 | ge->setValue("/tmp/");
|
|---|
| 2327 | ge->setHelpText(QObject::tr("Path to screenshot storage location. Should be writable by the frontend"));
|
|---|
| 2328 | return ge;
|
|---|
| 2329 | }
|
|---|
| 2330 |
|
|---|
| 2331 | -static HostLineEdit *SetupPinCode()
|
|---|
| 2332 | +static HostLineEditTree *SetupPinCode()
|
|---|
| 2333 | {
|
|---|
| 2334 | - HostLineEdit *ge = new HostLineEdit("SetupPinCode");
|
|---|
| 2335 | + HostLineEditTree *ge = new HostLineEditTree("SetupPinCode");
|
|---|
| 2336 | ge->setLabel(QObject::tr("Setup PIN code"));
|
|---|
| 2337 | ge->setHelpText(QObject::tr("This PIN is used to control access to the "
|
|---|
| 2338 | "setup menus. If you want to use this feature, then "
|
|---|
| 2339 | @@ -1732,9 +2610,9 @@ static HostLineEdit *SetupPinCode()
|
|---|
| 2340 | return ge;
|
|---|
| 2341 | }
|
|---|
| 2342 |
|
|---|
| 2343 | -static HostCheckBox *SetupPinCodeRequired()
|
|---|
| 2344 | +static HostCheckBoxTree *SetupPinCodeRequired()
|
|---|
| 2345 | {
|
|---|
| 2346 | - HostCheckBox *gc = new HostCheckBox("SetupPinCodeRequired");
|
|---|
| 2347 | + HostCheckBoxTree *gc = new HostCheckBoxTree("SetupPinCodeRequired");
|
|---|
| 2348 | gc->setLabel(QObject::tr("Require setup PIN") + " ");
|
|---|
| 2349 | gc->setValue(false);
|
|---|
| 2350 | gc->setHelpText(QObject::tr("If enabled, you will not be able to return "
|
|---|
| 2351 | @@ -1743,9 +2621,9 @@ static HostCheckBox *SetupPinCodeRequired()
|
|---|
| 2352 | return gc;
|
|---|
| 2353 | }
|
|---|
| 2354 |
|
|---|
| 2355 | -static HostComboBox *XineramaScreen()
|
|---|
| 2356 | +static HostComboBoxTree *XineramaScreen()
|
|---|
| 2357 | {
|
|---|
| 2358 | - HostComboBox *gc = new HostComboBox("XineramaScreen", false);
|
|---|
| 2359 | + HostComboBoxTree *gc = new HostComboBoxTree("XineramaScreen", false);
|
|---|
| 2360 | int num = MythDisplay::GetNumberXineramaScreens();
|
|---|
| 2361 | for (int i=0; i<num; ++i)
|
|---|
| 2362 | gc->addSelection(QString::number(i), QString::number(i));
|
|---|
| 2363 | @@ -1758,9 +2636,9 @@ static HostComboBox *XineramaScreen()
|
|---|
| 2364 | }
|
|---|
| 2365 |
|
|---|
| 2366 |
|
|---|
| 2367 | -static HostComboBox *XineramaMonitorAspectRatio()
|
|---|
| 2368 | +static HostComboBoxTree *XineramaMonitorAspectRatio()
|
|---|
| 2369 | {
|
|---|
| 2370 | - HostComboBox *gc = new HostComboBox("XineramaMonitorAspectRatio");
|
|---|
| 2371 | + HostComboBoxTree *gc = new HostComboBoxTree("XineramaMonitorAspectRatio");
|
|---|
| 2372 | gc->setLabel(QObject::tr("Monitor aspect ratio"));
|
|---|
| 2373 | gc->addSelection(QObject::tr("4:3"), "1.3333");
|
|---|
| 2374 | gc->addSelection(QObject::tr("16:9"), "1.7777");
|
|---|
| 2375 | @@ -1771,9 +2649,9 @@ static HostComboBox *XineramaMonitorAspectRatio()
|
|---|
| 2376 | return gc;
|
|---|
| 2377 | }
|
|---|
| 2378 |
|
|---|
| 2379 | -static HostComboBox *LetterboxingColour()
|
|---|
| 2380 | +static HostComboBoxTree *LetterboxingColour()
|
|---|
| 2381 | {
|
|---|
| 2382 | - HostComboBox *gc = new HostComboBox("LetterboxColour");
|
|---|
| 2383 | + HostComboBoxTree *gc = new HostComboBoxTree("LetterboxColour");
|
|---|
| 2384 | gc->setLabel(QObject::tr("Letterboxing color"));
|
|---|
| 2385 | for (int m = kLetterBoxColour_Black; m < kLetterBoxColour_END; ++m)
|
|---|
| 2386 | gc->addSelection(toString((LetterBoxColour)m), QString::number(m));
|
|---|
| 2387 | @@ -1786,9 +2664,9 @@ static HostComboBox *LetterboxingColour()
|
|---|
| 2388 | return gc;
|
|---|
| 2389 | }
|
|---|
| 2390 |
|
|---|
| 2391 | -static HostComboBox *AspectOverride()
|
|---|
| 2392 | +static HostComboBoxTree *AspectOverride()
|
|---|
| 2393 | {
|
|---|
| 2394 | - HostComboBox *gc = new HostComboBox("AspectOverride");
|
|---|
| 2395 | + HostComboBoxTree *gc = new HostComboBoxTree("AspectOverride");
|
|---|
| 2396 | gc->setLabel(QObject::tr("Video aspect override"));
|
|---|
| 2397 | for (int m = kAspect_Off; m < kAspect_END; ++m)
|
|---|
| 2398 | gc->addSelection(toString((AspectOverrideMode)m), QString::number(m));
|
|---|
| 2399 | @@ -1799,9 +2677,9 @@ static HostComboBox *AspectOverride()
|
|---|
| 2400 | return gc;
|
|---|
| 2401 | }
|
|---|
| 2402 |
|
|---|
| 2403 | -static HostComboBox *AdjustFill()
|
|---|
| 2404 | +static HostComboBoxTree *AdjustFill()
|
|---|
| 2405 | {
|
|---|
| 2406 | - HostComboBox *gc = new HostComboBox("AdjustFill");
|
|---|
| 2407 | + HostComboBoxTree *gc = new HostComboBoxTree("AdjustFill");
|
|---|
| 2408 | gc->setLabel(QObject::tr("Zoom"));
|
|---|
| 2409 | for (int m = kAdjustFill_Off; m < kAdjustFill_END; ++m)
|
|---|
| 2410 | gc->addSelection(toString((AdjustFillMode)m), QString::number(m));
|
|---|
| 2411 | @@ -1817,9 +2695,9 @@ static HostComboBox *AdjustFill()
|
|---|
| 2412 |
|
|---|
| 2413 | // Theme settings
|
|---|
| 2414 |
|
|---|
| 2415 | -static HostSpinBox *GuiWidth()
|
|---|
| 2416 | +static HostSpinBoxTree *GuiWidth()
|
|---|
| 2417 | {
|
|---|
| 2418 | - HostSpinBox *gs = new HostSpinBox("GuiWidth", 0, 1920, 8, true);
|
|---|
| 2419 | + HostSpinBoxTree *gs = new HostSpinBoxTree("GuiWidth", 0, 1920, 8, true);
|
|---|
| 2420 | gs->setLabel(QObject::tr("GUI width (pixels)"));
|
|---|
| 2421 | gs->setValue(0);
|
|---|
| 2422 | gs->setHelpText(QObject::tr("The width of the GUI. Do not make the GUI "
|
|---|
| 2423 | @@ -1828,9 +2706,9 @@ static HostSpinBox *GuiWidth()
|
|---|
| 2424 | return gs;
|
|---|
| 2425 | }
|
|---|
| 2426 |
|
|---|
| 2427 | -static HostSpinBox *GuiHeight()
|
|---|
| 2428 | +static HostSpinBoxTree *GuiHeight()
|
|---|
| 2429 | {
|
|---|
| 2430 | - HostSpinBox *gs = new HostSpinBox("GuiHeight", 0, 1600, 8, true);
|
|---|
| 2431 | + HostSpinBoxTree *gs = new HostSpinBoxTree("GuiHeight", 0, 1600, 8, true);
|
|---|
| 2432 | gs->setLabel(QObject::tr("GUI height (pixels)"));
|
|---|
| 2433 | gs->setValue(0);
|
|---|
| 2434 | gs->setHelpText(QObject::tr("The height of the GUI. Do not make the GUI "
|
|---|
| 2435 | @@ -1839,9 +2717,9 @@ static HostSpinBox *GuiHeight()
|
|---|
| 2436 | return gs;
|
|---|
| 2437 | }
|
|---|
| 2438 |
|
|---|
| 2439 | -static HostSpinBox *GuiOffsetX()
|
|---|
| 2440 | +static HostSpinBoxTree *GuiOffsetX()
|
|---|
| 2441 | {
|
|---|
| 2442 | - HostSpinBox *gs = new HostSpinBox("GuiOffsetX", -3840, 3840, 32, true);
|
|---|
| 2443 | + HostSpinBoxTree *gs = new HostSpinBoxTree("GuiOffsetX", -3840, 3840, 32, true);
|
|---|
| 2444 | gs->setLabel(QObject::tr("GUI X offset"));
|
|---|
| 2445 | gs->setValue(0);
|
|---|
| 2446 | gs->setHelpText(QObject::tr("The horizontal offset where the GUI will be "
|
|---|
| 2447 | @@ -1849,9 +2727,9 @@ static HostSpinBox *GuiOffsetX()
|
|---|
| 2448 | return gs;
|
|---|
| 2449 | }
|
|---|
| 2450 |
|
|---|
| 2451 | -static HostSpinBox *GuiOffsetY()
|
|---|
| 2452 | +static HostSpinBoxTree *GuiOffsetY()
|
|---|
| 2453 | {
|
|---|
| 2454 | - HostSpinBox *gs = new HostSpinBox("GuiOffsetY", -1600, 1600, 8, true);
|
|---|
| 2455 | + HostSpinBoxTree *gs = new HostSpinBoxTree("GuiOffsetY", -1600, 1600, 8, true);
|
|---|
| 2456 | gs->setLabel(QObject::tr("GUI Y offset"));
|
|---|
| 2457 | gs->setValue(0);
|
|---|
| 2458 | gs->setHelpText(QObject::tr("The vertical offset where the GUI will be "
|
|---|
| 2459 | @@ -1883,9 +2761,9 @@ static HostSpinBox *DisplaySizeHeight()
|
|---|
| 2460 | }
|
|---|
| 2461 | #endif
|
|---|
| 2462 |
|
|---|
| 2463 | -static HostCheckBox *GuiSizeForTV()
|
|---|
| 2464 | +static HostCheckBoxTree *GuiSizeForTV()
|
|---|
| 2465 | {
|
|---|
| 2466 | - HostCheckBox *gc = new HostCheckBox("GuiSizeForTV");
|
|---|
| 2467 | + HostCheckBoxTree *gc = new HostCheckBoxTree("GuiSizeForTV");
|
|---|
| 2468 | gc->setLabel(QObject::tr("Use GUI size for TV playback"));
|
|---|
| 2469 | gc->setValue(true);
|
|---|
| 2470 | gc->setHelpText(QObject::tr("If enabled, use the above size for TV, "
|
|---|
| 2471 | @@ -1894,45 +2772,34 @@ static HostCheckBox *GuiSizeForTV()
|
|---|
| 2472 | }
|
|---|
| 2473 |
|
|---|
| 2474 | #if defined(USING_XRANDR) || CONFIG_DARWIN
|
|---|
| 2475 | -static HostCheckBox *UseVideoModes()
|
|---|
| 2476 | -{
|
|---|
| 2477 | - HostCheckBox *gc = new HostCheckBox("UseVideoModes");
|
|---|
| 2478 | - gc->setLabel(QObject::tr("Separate video modes for GUI and TV playback"));
|
|---|
| 2479 | - gc->setValue(false);
|
|---|
| 2480 | - gc->setHelpText(QObject::tr("Switch X Window video modes for TV. "
|
|---|
| 2481 | - "Requires \"xrandr\" support."));
|
|---|
| 2482 | - return gc;
|
|---|
| 2483 | -}
|
|---|
| 2484 |
|
|---|
| 2485 | -static HostSpinBox *VidModeWidth(int idx)
|
|---|
| 2486 | +
|
|---|
| 2487 | +static HostSpinBoxTree *VidModeWidth(int idx)
|
|---|
| 2488 | {
|
|---|
| 2489 | - HostSpinBox *gs = new HostSpinBox(QString("VidModeWidth%1").arg(idx),
|
|---|
| 2490 | + HostSpinBoxTree *gs = new HostSpinBoxTree(QString("VidModeWidth%1").arg(idx),
|
|---|
| 2491 | 0, 1920, 16, true);
|
|---|
| 2492 | - gs->setLabel((idx<1) ? QObject::tr("In X"): "");
|
|---|
| 2493 | - gs->setLabelAboveWidget(idx<1);
|
|---|
| 2494 | + gs->setLabel(QObject::tr("In X"));
|
|---|
| 2495 | gs->setValue(0);
|
|---|
| 2496 | gs->setHelpText(QObject::tr("Horizontal resolution of video "
|
|---|
| 2497 | "which needs a special output resolution."));
|
|---|
| 2498 | return gs;
|
|---|
| 2499 | }
|
|---|
| 2500 |
|
|---|
| 2501 | -static HostSpinBox *VidModeHeight(int idx)
|
|---|
| 2502 | +static HostSpinBoxTree *VidModeHeight(int idx)
|
|---|
| 2503 | {
|
|---|
| 2504 | - HostSpinBox *gs = new HostSpinBox(QString("VidModeHeight%1").arg(idx),
|
|---|
| 2505 | + HostSpinBoxTree *gs = new HostSpinBoxTree(QString("VidModeHeight%1").arg(idx),
|
|---|
| 2506 | 0, 1080, 16, true);
|
|---|
| 2507 | - gs->setLabel((idx<1) ? QObject::tr("In Y"): "");
|
|---|
| 2508 | - gs->setLabelAboveWidget(idx<1);
|
|---|
| 2509 | + gs->setLabel(QObject::tr("In Y"));
|
|---|
| 2510 | gs->setValue(0);
|
|---|
| 2511 | gs->setHelpText(QObject::tr("Vertical resolution of video "
|
|---|
| 2512 | "which needs a special output resolution."));
|
|---|
| 2513 | return gs;
|
|---|
| 2514 | }
|
|---|
| 2515 |
|
|---|
| 2516 | -static HostComboBox *GuiVidModeResolution()
|
|---|
| 2517 | +static HostComboBoxTree *GuiVidModeResolution()
|
|---|
| 2518 | {
|
|---|
| 2519 | - HostComboBox *gc = new HostComboBox("GuiVidModeResolution");
|
|---|
| 2520 | + HostComboBoxTree *gc = new HostComboBoxTree("GuiVidModeResolution");
|
|---|
| 2521 | gc->setLabel(QObject::tr("GUI"));
|
|---|
| 2522 | - gc->setLabelAboveWidget(true);
|
|---|
| 2523 | gc->setHelpText(QObject::tr("Resolution of screen "
|
|---|
| 2524 | "when not watching a video."));
|
|---|
| 2525 |
|
|---|
| 2526 | @@ -1961,7 +2828,7 @@ static HostComboBox *GuiVidModeResolution()
|
|---|
| 2527 | return gc;
|
|---|
| 2528 | }
|
|---|
| 2529 |
|
|---|
| 2530 | -static HostComboBox *TVVidModeResolution(int idx=-1)
|
|---|
| 2531 | +static HostComboBoxTree *TVVidModeResolution(int idx=-1)
|
|---|
| 2532 | {
|
|---|
| 2533 | QString dhelp = QObject::tr("Default screen resolution "
|
|---|
| 2534 | "when watching a video.");
|
|---|
| 2535 | @@ -1970,13 +2837,12 @@ static HostComboBox *TVVidModeResolution(int idx=-1)
|
|---|
| 2536 |
|
|---|
| 2537 | QString qstr = (idx<0) ? "TVVidModeResolution" :
|
|---|
| 2538 | QString("TVVidModeResolution%1").arg(idx);
|
|---|
| 2539 | - HostComboBox *gc = new HostComboBox(qstr);
|
|---|
| 2540 | + HostComboBoxTree *gc = new HostComboBoxTree(qstr);
|
|---|
| 2541 | QString lstr = (idx<0) ? QObject::tr("Video output") :
|
|---|
| 2542 | - ((idx<1) ? QObject::tr("Output") : "");
|
|---|
| 2543 | + QObject::tr("Output");
|
|---|
| 2544 | QString hstr = (idx<0) ? dhelp : ohelp;
|
|---|
| 2545 |
|
|---|
| 2546 | gc->setLabel(lstr);
|
|---|
| 2547 | - gc->setLabelAboveWidget(idx<1);
|
|---|
| 2548 | gc->setHelpText(hstr);
|
|---|
| 2549 |
|
|---|
| 2550 | const vector<DisplayResScreen> scr = GetVideoModes();
|
|---|
| 2551 | @@ -1988,7 +2854,7 @@ static HostComboBox *TVVidModeResolution(int idx=-1)
|
|---|
| 2552 | return gc;
|
|---|
| 2553 | }
|
|---|
| 2554 |
|
|---|
| 2555 | -static HostRefreshRateComboBox *TVVidModeRefreshRate(int idx=-1)
|
|---|
| 2556 | +static HostRefreshRateComboBoxTree *TVVidModeRefreshRate(int idx=-1)
|
|---|
| 2557 | {
|
|---|
| 2558 | QString dhelp = QObject::tr("Default refresh rate "
|
|---|
| 2559 | "when watching a video. "
|
|---|
| 2560 | @@ -1998,18 +2864,17 @@ static HostRefreshRateComboBox *TVVidModeRefreshRate(int idx=-1)
|
|---|
| 2561 | "Leave at \"Any\" to automatically use the best available");
|
|---|
| 2562 | QString qstr = (idx<0) ? "TVVidModeRefreshRate" :
|
|---|
| 2563 | QString("TVVidModeRefreshRate%1").arg(idx);
|
|---|
| 2564 | - HostRefreshRateComboBox *gc = new HostRefreshRateComboBox(qstr);
|
|---|
| 2565 | - QString lstr = (idx<1) ? QObject::tr("Rate") : "";
|
|---|
| 2566 | + HostRefreshRateComboBoxTree *gc = new HostRefreshRateComboBoxTree(qstr);
|
|---|
| 2567 | + QString lstr = QObject::tr("Rate");
|
|---|
| 2568 | QString hstr = (idx<0) ? dhelp : ohelp;
|
|---|
| 2569 |
|
|---|
| 2570 | gc->setLabel(lstr);
|
|---|
| 2571 | - gc->setLabelAboveWidget(idx<1);
|
|---|
| 2572 | gc->setHelpText(hstr);
|
|---|
| 2573 | - gc->setEnabled(false);
|
|---|
| 2574 | +//TODO gc->setEnabled(false);
|
|---|
| 2575 | return gc;
|
|---|
| 2576 | }
|
|---|
| 2577 |
|
|---|
| 2578 | -static HostComboBox *TVVidModeForceAspect(int idx=-1)
|
|---|
| 2579 | +static HostComboBoxTree *TVVidModeForceAspect(int idx=-1)
|
|---|
| 2580 | {
|
|---|
| 2581 | QString dhelp = QObject::tr("Aspect ratio when watching a video.");
|
|---|
| 2582 | QString ohelp = QObject::tr("Aspect ratio when watching a "
|
|---|
| 2583 | @@ -2017,9 +2882,8 @@ static HostComboBox *TVVidModeForceAspect(int idx=-1)
|
|---|
| 2584 |
|
|---|
| 2585 | QString qstr = (idx<0) ? "TVVidModeForceAspect" :
|
|---|
| 2586 | QString("TVVidModeForceAspect%1").arg(idx);
|
|---|
| 2587 | - HostComboBox *gc = new HostComboBox(qstr);
|
|---|
| 2588 | - gc->setLabel( (idx<1) ? QObject::tr("Aspect") : "" );
|
|---|
| 2589 | - gc->setLabelAboveWidget(idx<1);
|
|---|
| 2590 | + HostComboBoxTree *gc = new HostComboBoxTree(qstr);
|
|---|
| 2591 | + gc->setLabel(QObject::tr("Aspect"));
|
|---|
| 2592 |
|
|---|
| 2593 | QString hstr = (idx<0) ? dhelp : ohelp;
|
|---|
| 2594 | gc->setHelpText(hstr+" "+
|
|---|
| 2595 | @@ -2032,61 +2896,53 @@ static HostComboBox *TVVidModeForceAspect(int idx=-1)
|
|---|
| 2596 | return gc;
|
|---|
| 2597 | }
|
|---|
| 2598 |
|
|---|
| 2599 | -class VideoModeSettings : public TriggeredConfigurationGroup
|
|---|
| 2600 | +static HostCheckBoxTree *UseVideoModes()
|
|---|
| 2601 | {
|
|---|
| 2602 | - public:
|
|---|
| 2603 | - VideoModeSettings() :
|
|---|
| 2604 | - TriggeredConfigurationGroup(false, true, false, false)
|
|---|
| 2605 | - {
|
|---|
| 2606 | - setLabel(QObject::tr("Video Mode Settings"));
|
|---|
| 2607 | - setUseLabel(false);
|
|---|
| 2608 | -
|
|---|
| 2609 | - Setting *videomode = UseVideoModes();
|
|---|
| 2610 | - addChild(videomode);
|
|---|
| 2611 | - setTrigger(videomode);
|
|---|
| 2612 | -
|
|---|
| 2613 | - ConfigurationGroup* defaultsettings =
|
|---|
| 2614 | - new HorizontalConfigurationGroup(false, false);
|
|---|
| 2615 | -
|
|---|
| 2616 | - HostComboBox *res = TVVidModeResolution();
|
|---|
| 2617 | - HostRefreshRateComboBox *rate = TVVidModeRefreshRate();
|
|---|
| 2618 | - defaultsettings->addChild(GuiVidModeResolution());
|
|---|
| 2619 | - defaultsettings->addChild(res);
|
|---|
| 2620 | - defaultsettings->addChild(rate);
|
|---|
| 2621 | - defaultsettings->addChild(TVVidModeForceAspect());
|
|---|
| 2622 | - connect(res, SIGNAL(valueChanged(const QString&)),
|
|---|
| 2623 | - rate, SLOT(ChangeResolution(const QString&)));
|
|---|
| 2624 | + HostCheckBoxTree *gc = new HostCheckBoxTree("UseVideoModes");
|
|---|
| 2625 | + gc->setLabel(QObject::tr("Separate video modes for GUI and TV playback"));
|
|---|
| 2626 | + gc->setValue(false);
|
|---|
| 2627 | + gc->setHelpText(QObject::tr("Switch X Window video modes for TV. "
|
|---|
| 2628 | + "Requires \"xrandr\" support."));
|
|---|
| 2629 |
|
|---|
| 2630 | - ConfigurationGroup* overrides =
|
|---|
| 2631 | - new GridConfigurationGroup(5, true, true, false, true);
|
|---|
| 2632 | - overrides->setLabel(QObject::tr("Overrides for specific video sizes"));
|
|---|
| 2633 | + GroupSetting* defaultsettings = new GroupSetting();
|
|---|
| 2634 |
|
|---|
| 2635 | - for (int idx = 0; idx < 3; ++idx)
|
|---|
| 2636 | - {
|
|---|
| 2637 | - //input side
|
|---|
| 2638 | - overrides->addChild(VidModeWidth(idx));
|
|---|
| 2639 | - overrides->addChild(VidModeHeight(idx));
|
|---|
| 2640 | - // output side
|
|---|
| 2641 | - overrides->addChild(res = TVVidModeResolution(idx));
|
|---|
| 2642 | - overrides->addChild(rate = TVVidModeRefreshRate(idx));
|
|---|
| 2643 | - overrides->addChild(TVVidModeForceAspect(idx));
|
|---|
| 2644 | - connect(res, SIGNAL(valueChanged(const QString&)),
|
|---|
| 2645 | - rate, SLOT(ChangeResolution(const QString&)));
|
|---|
| 2646 | - }
|
|---|
| 2647 | + defaultsettings->setLabel(QObject::tr("Default video mode") );
|
|---|
| 2648 | +
|
|---|
| 2649 | + HostComboBoxTree *res = TVVidModeResolution();
|
|---|
| 2650 | + HostRefreshRateComboBoxTree *rate = TVVidModeRefreshRate();
|
|---|
| 2651 | + defaultsettings->addChild(GuiVidModeResolution());
|
|---|
| 2652 | + defaultsettings->addChild(res);
|
|---|
| 2653 | + defaultsettings->addChild(rate);
|
|---|
| 2654 | + defaultsettings->addChild(TVVidModeForceAspect());
|
|---|
| 2655 | + QObject::connect(res, SIGNAL(settingValueChanged(const QString&)),
|
|---|
| 2656 | + rate, SLOT(ChangeResolution(const QString&)));
|
|---|
| 2657 |
|
|---|
| 2658 | - ConfigurationGroup* settings = new VerticalConfigurationGroup(false);
|
|---|
| 2659 | - settings->addChild(defaultsettings);
|
|---|
| 2660 | - settings->addChild(overrides);
|
|---|
| 2661 | + gc->addChild(true,defaultsettings);
|
|---|
| 2662 |
|
|---|
| 2663 | - addTarget("1", settings);
|
|---|
| 2664 | - addTarget("0", new VerticalConfigurationGroup(true));
|
|---|
| 2665 | + for (int idx = 0; idx < 3; ++idx)
|
|---|
| 2666 | + {
|
|---|
| 2667 | + GroupSetting * videoOverride = new GroupSetting();
|
|---|
| 2668 | + videoOverride->setLabel(QObject::tr("Video override") + " #"+QString("%1").arg(idx+1));
|
|---|
| 2669 | + //input side
|
|---|
| 2670 | + videoOverride->addChild(VidModeWidth(idx));
|
|---|
| 2671 | + videoOverride->addChild(VidModeHeight(idx));
|
|---|
| 2672 | + // output side
|
|---|
| 2673 | + videoOverride->addChild(res = TVVidModeResolution(idx));
|
|---|
| 2674 | + videoOverride->addChild(rate = TVVidModeRefreshRate(idx));
|
|---|
| 2675 | + videoOverride->addChild(TVVidModeForceAspect(idx));
|
|---|
| 2676 | + QObject::connect(res, SIGNAL(settingValueChanged(const QString&)),
|
|---|
| 2677 | + rate, SLOT(ChangeResolution(const QString&)));
|
|---|
| 2678 | + gc->addChild(true,videoOverride);
|
|---|
| 2679 | }
|
|---|
| 2680 | -};
|
|---|
| 2681 | +
|
|---|
| 2682 | + return gc;
|
|---|
| 2683 | +}
|
|---|
| 2684 | +
|
|---|
| 2685 | #endif
|
|---|
| 2686 |
|
|---|
| 2687 | -static HostCheckBox *HideMouseCursor()
|
|---|
| 2688 | +static HostCheckBoxTree *HideMouseCursor()
|
|---|
| 2689 | {
|
|---|
| 2690 | - HostCheckBox *gc = new HostCheckBox("HideMouseCursor");
|
|---|
| 2691 | + HostCheckBoxTree *gc = new HostCheckBoxTree("HideMouseCursor");
|
|---|
| 2692 | gc->setLabel(QObject::tr("Hide mouse cursor in MythTV"));
|
|---|
| 2693 | gc->setValue(false);
|
|---|
| 2694 | gc->setHelpText(QObject::tr("Toggles mouse cursor visibility for touchscreens. "
|
|---|
| 2695 | @@ -2096,9 +2952,9 @@ static HostCheckBox *HideMouseCursor()
|
|---|
| 2696 | };
|
|---|
| 2697 |
|
|---|
| 2698 |
|
|---|
| 2699 | -static HostCheckBox *RunInWindow()
|
|---|
| 2700 | +static HostCheckBoxTree *RunInWindow()
|
|---|
| 2701 | {
|
|---|
| 2702 | - HostCheckBox *gc = new HostCheckBox("RunFrontendInWindow");
|
|---|
| 2703 | + HostCheckBoxTree *gc = new HostCheckBoxTree("RunFrontendInWindow");
|
|---|
| 2704 | gc->setLabel(QObject::tr("Use window border"));
|
|---|
| 2705 | gc->setValue(false);
|
|---|
| 2706 | gc->setHelpText(QObject::tr("Toggles between windowed and "
|
|---|
| 2707 | @@ -2106,10 +2962,10 @@ static HostCheckBox *RunInWindow()
|
|---|
| 2708 | return gc;
|
|---|
| 2709 | }
|
|---|
| 2710 |
|
|---|
| 2711 | -static HostCheckBox *UseFixedWindowSize()
|
|---|
| 2712 | +static HostCheckBoxTree *UseFixedWindowSize()
|
|---|
| 2713 | {
|
|---|
| 2714 | {
|
|---|
| 2715 | - HostCheckBox *gc = new HostCheckBox("UseFixedWindowSize");
|
|---|
| 2716 | + HostCheckBoxTree *gc = new HostCheckBoxTree("UseFixedWindowSize");
|
|---|
| 2717 | gc->setLabel(QObject::tr("Use fixed window size"));
|
|---|
| 2718 | gc->setValue(true);
|
|---|
| 2719 | gc->setHelpText(QObject::tr(
|
|---|
| 2720 | @@ -2119,9 +2975,9 @@ static HostCheckBox *UseFixedWindowSize()
|
|---|
| 2721 | }
|
|---|
| 2722 | }
|
|---|
| 2723 |
|
|---|
| 2724 | -static HostComboBox *MythDateFormatCB()
|
|---|
| 2725 | +static HostComboBoxTree *MythDateFormatCB()
|
|---|
| 2726 | {
|
|---|
| 2727 | - HostComboBox *gc = new HostComboBox("DateFormat");
|
|---|
| 2728 | + HostComboBoxTree *gc = new HostComboBoxTree("DateFormat");
|
|---|
| 2729 | gc->setLabel(QObject::tr("Date format"));
|
|---|
| 2730 |
|
|---|
| 2731 | QDate sampdate = QDate::currentDate();
|
|---|
| 2732 | @@ -2160,9 +3016,9 @@ static HostComboBox *MythDateFormatCB()
|
|---|
| 2733 | return gc;
|
|---|
| 2734 | }
|
|---|
| 2735 |
|
|---|
| 2736 | -static HostComboBox *MythShortDateFormat()
|
|---|
| 2737 | +static HostComboBoxTree *MythShortDateFormat()
|
|---|
| 2738 | {
|
|---|
| 2739 | - HostComboBox *gc = new HostComboBox("ShortDateFormat");
|
|---|
| 2740 | + HostComboBoxTree *gc = new HostComboBoxTree("ShortDateFormat");
|
|---|
| 2741 | gc->setLabel(QObject::tr("Short date format"));
|
|---|
| 2742 |
|
|---|
| 2743 | QDate sampdate = QDate::currentDate();
|
|---|
| 2744 | @@ -2199,9 +3055,9 @@ static HostComboBox *MythShortDateFormat()
|
|---|
| 2745 | return gc;
|
|---|
| 2746 | }
|
|---|
| 2747 |
|
|---|
| 2748 | -static HostComboBox *MythTimeFormat()
|
|---|
| 2749 | +static HostComboBoxTree *MythTimeFormat()
|
|---|
| 2750 | {
|
|---|
| 2751 | - HostComboBox *gc = new HostComboBox("TimeFormat");
|
|---|
| 2752 | + HostComboBoxTree *gc = new HostComboBoxTree("TimeFormat");
|
|---|
| 2753 | gc->setLabel(QObject::tr("Time format"));
|
|---|
| 2754 |
|
|---|
| 2755 | QTime samptime = QTime::currentTime();
|
|---|
| 2756 | @@ -2219,9 +3075,9 @@ static HostComboBox *MythTimeFormat()
|
|---|
| 2757 | return gc;
|
|---|
| 2758 | }
|
|---|
| 2759 |
|
|---|
| 2760 | -static HostComboBox *ChannelFormat()
|
|---|
| 2761 | +static HostComboBoxTree *ChannelFormat()
|
|---|
| 2762 | {
|
|---|
| 2763 | - HostComboBox *gc = new HostComboBox("ChannelFormat");
|
|---|
| 2764 | + HostComboBoxTree *gc = new HostComboBoxTree("ChannelFormat");
|
|---|
| 2765 | gc->setLabel(QObject::tr("Channel format"));
|
|---|
| 2766 | gc->addSelection(QObject::tr("number"), "<num>");
|
|---|
| 2767 | gc->addSelection(QObject::tr("number callsign"), "<num> <sign>");
|
|---|
| 2768 | @@ -2233,9 +3089,9 @@ static HostComboBox *ChannelFormat()
|
|---|
| 2769 | return gc;
|
|---|
| 2770 | }
|
|---|
| 2771 |
|
|---|
| 2772 | -static HostComboBox *LongChannelFormat()
|
|---|
| 2773 | +static HostComboBoxTree *LongChannelFormat()
|
|---|
| 2774 | {
|
|---|
| 2775 | - HostComboBox *gc = new HostComboBox("LongChannelFormat");
|
|---|
| 2776 | + HostComboBoxTree *gc = new HostComboBoxTree("LongChannelFormat");
|
|---|
| 2777 | gc->setLabel(QObject::tr("Long channel format"));
|
|---|
| 2778 | gc->addSelection(QObject::tr("number"), "<num>");
|
|---|
| 2779 | gc->addSelection(QObject::tr("number callsign"), "<num> <sign>");
|
|---|
| 2780 | @@ -2247,9 +3103,9 @@ static HostComboBox *LongChannelFormat()
|
|---|
| 2781 | return gc;
|
|---|
| 2782 | }
|
|---|
| 2783 |
|
|---|
| 2784 | -static GlobalCheckBox *LastFreeCard()
|
|---|
| 2785 | +static GlobalCheckBoxTree *LastFreeCard()
|
|---|
| 2786 | {
|
|---|
| 2787 | - GlobalCheckBox *bc = new GlobalCheckBox("LastFreeCard");
|
|---|
| 2788 | + GlobalCheckBoxTree *bc = new GlobalCheckBoxTree("LastFreeCard");
|
|---|
| 2789 | bc->setLabel(QObject::tr("Avoid conflicts between Live TV and "
|
|---|
| 2790 | "scheduled shows"));
|
|---|
| 2791 | bc->setValue(false);
|
|---|
| 2792 | @@ -2259,9 +3115,9 @@ static GlobalCheckBox *LastFreeCard()
|
|---|
| 2793 | return bc;
|
|---|
| 2794 | }
|
|---|
| 2795 |
|
|---|
| 2796 | -static GlobalCheckBox *LiveTVPriority()
|
|---|
| 2797 | +static GlobalCheckBoxTree *LiveTVPriority()
|
|---|
| 2798 | {
|
|---|
| 2799 | - GlobalCheckBox *bc = new GlobalCheckBox("LiveTVPriority");
|
|---|
| 2800 | + GlobalCheckBoxTree *bc = new GlobalCheckBoxTree("LiveTVPriority");
|
|---|
| 2801 | bc->setLabel(QObject::tr("Allow Live TV to move scheduled shows"));
|
|---|
| 2802 | bc->setValue(false);
|
|---|
| 2803 | bc->setHelpText(QObject::tr("If enabled, scheduled recordings will "
|
|---|
| 2804 | @@ -2270,20 +3126,9 @@ static GlobalCheckBox *LiveTVPriority()
|
|---|
| 2805 | return bc;
|
|---|
| 2806 | }
|
|---|
| 2807 |
|
|---|
| 2808 | -static HostCheckBox *ChannelGroupRememberLast()
|
|---|
| 2809 | +static HostComboBoxTree *ChannelGroupDefault()
|
|---|
| 2810 | {
|
|---|
| 2811 | - HostCheckBox *gc = new HostCheckBox("ChannelGroupRememberLast");
|
|---|
| 2812 | - gc->setLabel(QObject::tr("Remember last channel group"));
|
|---|
| 2813 | - gc->setHelpText(QObject::tr("If enabled, the EPG will initially display "
|
|---|
| 2814 | - "only the channels from the last channel group selected. Pressing "
|
|---|
| 2815 | - "\"4\" will toggle channel group."));
|
|---|
| 2816 | - gc->setValue(false);
|
|---|
| 2817 | - return gc;
|
|---|
| 2818 | -}
|
|---|
| 2819 | -
|
|---|
| 2820 | -static HostComboBox *ChannelGroupDefault()
|
|---|
| 2821 | -{
|
|---|
| 2822 | - HostComboBox *gc = new HostComboBox("ChannelGroupDefault");
|
|---|
| 2823 | + HostComboBoxTree *gc = new HostComboBoxTree("ChannelGroupDefault");
|
|---|
| 2824 | gc->setLabel(QObject::tr("Default channel group"));
|
|---|
| 2825 |
|
|---|
| 2826 | ChannelGroupList changrplist;
|
|---|
| 2827 | @@ -2303,9 +3148,9 @@ static HostComboBox *ChannelGroupDefault()
|
|---|
| 2828 | return gc;
|
|---|
| 2829 | }
|
|---|
| 2830 |
|
|---|
| 2831 | -static HostCheckBox *BrowseChannelGroup()
|
|---|
| 2832 | +static HostCheckBoxTree *BrowseChannelGroup()
|
|---|
| 2833 | {
|
|---|
| 2834 | - HostCheckBox *gc = new HostCheckBox("BrowseChannelGroup");
|
|---|
| 2835 | + HostCheckBoxTree *gc = new HostCheckBoxTree("BrowseChannelGroup");
|
|---|
| 2836 | gc->setLabel(QObject::tr("Browse/change channels from Channel Group"));
|
|---|
| 2837 | gc->setHelpText(QObject::tr("If enabled, Live TV will browse or change "
|
|---|
| 2838 | "channels from the selected channel group. The \"All "
|
|---|
| 2839 | @@ -2315,33 +3160,25 @@ static HostCheckBox *BrowseChannelGroup()
|
|---|
| 2840 | return gc;
|
|---|
| 2841 | }
|
|---|
| 2842 |
|
|---|
| 2843 | -// Channel Group Settings
|
|---|
| 2844 | -class ChannelGroupSettings : public TriggeredConfigurationGroup
|
|---|
| 2845 | +static HostCheckBoxTree *ChannelGroupRememberLast()
|
|---|
| 2846 | {
|
|---|
| 2847 | - public:
|
|---|
| 2848 | - ChannelGroupSettings() : TriggeredConfigurationGroup(false, true, false, false)
|
|---|
| 2849 | - {
|
|---|
| 2850 | - setLabel(QObject::tr("Remember last channel group"));
|
|---|
| 2851 | - setUseLabel(false);
|
|---|
| 2852 | -
|
|---|
| 2853 | - Setting* RememberChanGrpEnabled = ChannelGroupRememberLast();
|
|---|
| 2854 | - addChild(RememberChanGrpEnabled);
|
|---|
| 2855 | - setTrigger(RememberChanGrpEnabled);
|
|---|
| 2856 | + HostCheckBoxTree *gc = new HostCheckBoxTree("ChannelGroupRememberLast");
|
|---|
| 2857 | + gc->setLabel(QObject::tr("Remember last channel group"));
|
|---|
| 2858 | + gc->setHelpText(QObject::tr("If enabled, the EPG will initially display "
|
|---|
| 2859 | + "only the channels from the last channel group selected. Pressing "
|
|---|
| 2860 | + "\"4\" will toggle channel group."));
|
|---|
| 2861 | + gc->addChild(false, ChannelGroupDefault());
|
|---|
| 2862 |
|
|---|
| 2863 | - ConfigurationGroup* settings = new VerticalConfigurationGroup(false,false);
|
|---|
| 2864 | - settings->addChild(ChannelGroupDefault());
|
|---|
| 2865 | - addTarget("0", settings);
|
|---|
| 2866 | + gc->setValue(false);
|
|---|
| 2867 |
|
|---|
| 2868 | - // show nothing if RememberChanGrpEnabled is on
|
|---|
| 2869 | - addTarget("1", new VerticalConfigurationGroup(true,false));
|
|---|
| 2870 | - };
|
|---|
| 2871 | -};
|
|---|
| 2872 | + return gc;
|
|---|
| 2873 | +}
|
|---|
| 2874 |
|
|---|
| 2875 | // General RecPriorities settings
|
|---|
| 2876 |
|
|---|
| 2877 | -static GlobalCheckBox *GRSchedMoveHigher()
|
|---|
| 2878 | +static GlobalCheckBoxTree *GRSchedMoveHigher()
|
|---|
| 2879 | {
|
|---|
| 2880 | - GlobalCheckBox *bc = new GlobalCheckBox("SchedMoveHigher");
|
|---|
| 2881 | + GlobalCheckBoxTree *bc = new GlobalCheckBoxTree("SchedMoveHigher");
|
|---|
| 2882 | bc->setLabel(QObject::tr("Reschedule higher priorities"));
|
|---|
| 2883 | bc->setHelpText(QObject::tr("Move higher priority programs to other "
|
|---|
| 2884 | "cards and showings when resolving conflicts. This "
|
|---|
| 2885 | @@ -2352,9 +3189,9 @@ static GlobalCheckBox *GRSchedMoveHigher()
|
|---|
| 2886 | return bc;
|
|---|
| 2887 | }
|
|---|
| 2888 |
|
|---|
| 2889 | -static GlobalComboBox *GRSchedOpenEnd()
|
|---|
| 2890 | +static GlobalComboBoxTree *GRSchedOpenEnd()
|
|---|
| 2891 | {
|
|---|
| 2892 | - GlobalComboBox *bc = new GlobalComboBox("SchedOpenEnd");
|
|---|
| 2893 | + GlobalComboBoxTree *bc = new GlobalComboBoxTree("SchedOpenEnd");
|
|---|
| 2894 | bc->setLabel(QObject::tr("Avoid back to back recordings"));
|
|---|
| 2895 | bc->setHelpText(QObject::tr("Selects the situations where the scheduler "
|
|---|
| 2896 | "will avoid assigning shows to the same card if their "
|
|---|
| 2897 | @@ -2367,9 +3204,9 @@ static GlobalComboBox *GRSchedOpenEnd()
|
|---|
| 2898 | return bc;
|
|---|
| 2899 | }
|
|---|
| 2900 |
|
|---|
| 2901 | -static GlobalSpinBox *GRDefaultStartOffset()
|
|---|
| 2902 | +static GlobalSpinBoxTree *GRDefaultStartOffset()
|
|---|
| 2903 | {
|
|---|
| 2904 | - GlobalSpinBox *bs = new GlobalSpinBox("DefaultStartOffset",
|
|---|
| 2905 | + GlobalSpinBoxTree *bs = new GlobalSpinBoxTree("DefaultStartOffset",
|
|---|
| 2906 | -10, 30, 5, true);
|
|---|
| 2907 | bs->setLabel(QObject::tr("Default 'Start Early' minutes for new "
|
|---|
| 2908 | "recording rules"));
|
|---|
| 2909 | @@ -2382,9 +3219,9 @@ static GlobalSpinBox *GRDefaultStartOffset()
|
|---|
| 2910 | return bs;
|
|---|
| 2911 | }
|
|---|
| 2912 |
|
|---|
| 2913 | -static GlobalSpinBox *GRDefaultEndOffset()
|
|---|
| 2914 | +static GlobalSpinBoxTree *GRDefaultEndOffset()
|
|---|
| 2915 | {
|
|---|
| 2916 | - GlobalSpinBox *bs = new GlobalSpinBox("DefaultEndOffset",
|
|---|
| 2917 | + GlobalSpinBoxTree *bs = new GlobalSpinBoxTree("DefaultEndOffset",
|
|---|
| 2918 | -10, 30, 5, true);
|
|---|
| 2919 | bs->setLabel(QObject::tr("Default 'End Late' minutes for new "
|
|---|
| 2920 | "recording rules"));
|
|---|
| 2921 | @@ -2397,9 +3234,9 @@ static GlobalSpinBox *GRDefaultEndOffset()
|
|---|
| 2922 | return bs;
|
|---|
| 2923 | }
|
|---|
| 2924 |
|
|---|
| 2925 | -static GlobalSpinBox *GRPrefInputRecPriority()
|
|---|
| 2926 | +static GlobalSpinBoxTree *GRPrefInputRecPriority()
|
|---|
| 2927 | {
|
|---|
| 2928 | - GlobalSpinBox *bs = new GlobalSpinBox("PrefInputPriority", 1, 99, 1);
|
|---|
| 2929 | + GlobalSpinBoxTree *bs = new GlobalSpinBoxTree("PrefInputPriority", 1, 99, 1);
|
|---|
| 2930 | bs->setLabel(QObject::tr("Preferred input priority"));
|
|---|
| 2931 | bs->setHelpText(QObject::tr("Additional priority when a showing "
|
|---|
| 2932 | "matches the preferred input selected in the 'Scheduling "
|
|---|
| 2933 | @@ -2408,9 +3245,9 @@ static GlobalSpinBox *GRPrefInputRecPriority()
|
|---|
| 2934 | return bs;
|
|---|
| 2935 | }
|
|---|
| 2936 |
|
|---|
| 2937 | -static GlobalSpinBox *GRHDTVRecPriority()
|
|---|
| 2938 | +static GlobalSpinBoxTree *GRHDTVRecPriority()
|
|---|
| 2939 | {
|
|---|
| 2940 | - GlobalSpinBox *bs = new GlobalSpinBox("HDTVRecPriority", -99, 99, 1);
|
|---|
| 2941 | + GlobalSpinBoxTree *bs = new GlobalSpinBoxTree("HDTVRecPriority", -99, 99, 1);
|
|---|
| 2942 | bs->setLabel(QObject::tr("HDTV recording priority"));
|
|---|
| 2943 | bs->setHelpText(QObject::tr("Additional priority when a showing "
|
|---|
| 2944 | "is marked as an HDTV broadcast in the TV listings."));
|
|---|
| 2945 | @@ -2418,9 +3255,9 @@ static GlobalSpinBox *GRHDTVRecPriority()
|
|---|
| 2946 | return bs;
|
|---|
| 2947 | }
|
|---|
| 2948 |
|
|---|
| 2949 | -static GlobalSpinBox *GRWSRecPriority()
|
|---|
| 2950 | +static GlobalSpinBoxTree *GRWSRecPriority()
|
|---|
| 2951 | {
|
|---|
| 2952 | - GlobalSpinBox *bs = new GlobalSpinBox("WSRecPriority", -99, 99, 1);
|
|---|
| 2953 | + GlobalSpinBoxTree *bs = new GlobalSpinBoxTree("WSRecPriority", -99, 99, 1);
|
|---|
| 2954 | bs->setLabel(QObject::tr("Widescreen recording priority"));
|
|---|
| 2955 | bs->setHelpText(QObject::tr("Additional priority when a showing "
|
|---|
| 2956 | "is marked as widescreen in the TV listings."));
|
|---|
| 2957 | @@ -2428,9 +3265,9 @@ static GlobalSpinBox *GRWSRecPriority()
|
|---|
| 2958 | return bs;
|
|---|
| 2959 | }
|
|---|
| 2960 |
|
|---|
| 2961 | -static GlobalSpinBox *GRAutoRecPriority()
|
|---|
| 2962 | +static GlobalSpinBoxTree *GRAutoRecPriority()
|
|---|
| 2963 | {
|
|---|
| 2964 | - GlobalSpinBox *bs = new GlobalSpinBox("AutoRecPriority", -99, 99, 1);
|
|---|
| 2965 | + GlobalSpinBoxTree *bs = new GlobalSpinBoxTree("AutoRecPriority", -99, 99, 1);
|
|---|
| 2966 | bs->setLabel(QObject::tr("Automatic priority range (+/-)"));
|
|---|
| 2967 | bs->setHelpText(QObject::tr("Up to this number of priority points may "
|
|---|
| 2968 | "be added for titles that are usually watched soon after "
|
|---|
| 2969 | @@ -2440,9 +3277,9 @@ static GlobalSpinBox *GRAutoRecPriority()
|
|---|
| 2970 | return bs;
|
|---|
| 2971 | }
|
|---|
| 2972 |
|
|---|
| 2973 | -static GlobalSpinBox *GRSignLangRecPriority()
|
|---|
| 2974 | +static GlobalSpinBoxTree *GRSignLangRecPriority()
|
|---|
| 2975 | {
|
|---|
| 2976 | - GlobalSpinBox *bs = new GlobalSpinBox("SignLangRecPriority",
|
|---|
| 2977 | + GlobalSpinBoxTree *bs = new GlobalSpinBoxTree("SignLangRecPriority",
|
|---|
| 2978 | -99, 99, 1);
|
|---|
| 2979 | bs->setLabel(QObject::tr("Sign language recording priority"));
|
|---|
| 2980 | bs->setHelpText(QObject::tr("Additional priority when a showing "
|
|---|
| 2981 | @@ -2451,9 +3288,9 @@ static GlobalSpinBox *GRSignLangRecPriority()
|
|---|
| 2982 | return bs;
|
|---|
| 2983 | }
|
|---|
| 2984 |
|
|---|
| 2985 | -static GlobalSpinBox *GROnScrSubRecPriority()
|
|---|
| 2986 | +static GlobalSpinBoxTree *GROnScrSubRecPriority()
|
|---|
| 2987 | {
|
|---|
| 2988 | - GlobalSpinBox *bs = new GlobalSpinBox("OnScrSubRecPriority",
|
|---|
| 2989 | + GlobalSpinBoxTree *bs = new GlobalSpinBoxTree("OnScrSubRecPriority",
|
|---|
| 2990 | -99, 99, 1);
|
|---|
| 2991 | bs->setLabel(QObject::tr("In-vision Subtitles Recording Priority"));
|
|---|
| 2992 | bs->setHelpText(QObject::tr("Additional priority when a showing "
|
|---|
| 2993 | @@ -2462,9 +3299,9 @@ static GlobalSpinBox *GROnScrSubRecPriority()
|
|---|
| 2994 | return bs;
|
|---|
| 2995 | }
|
|---|
| 2996 |
|
|---|
| 2997 | -static GlobalSpinBox *GRCCRecPriority()
|
|---|
| 2998 | +static GlobalSpinBoxTree *GRCCRecPriority()
|
|---|
| 2999 | {
|
|---|
| 3000 | - GlobalSpinBox *bs = new GlobalSpinBox("CCRecPriority",
|
|---|
| 3001 | + GlobalSpinBoxTree *bs = new GlobalSpinBoxTree("CCRecPriority",
|
|---|
| 3002 | -99, 99, 1);
|
|---|
| 3003 | bs->setLabel(QObject::tr("Subtitles/CC recording priority"));
|
|---|
| 3004 | bs->setHelpText(QObject::tr("Additional priority when a showing "
|
|---|
| 3005 | @@ -2474,9 +3311,9 @@ static GlobalSpinBox *GRCCRecPriority()
|
|---|
| 3006 | return bs;
|
|---|
| 3007 | }
|
|---|
| 3008 |
|
|---|
| 3009 | -static GlobalSpinBox *GRHardHearRecPriority()
|
|---|
| 3010 | +static GlobalSpinBoxTree *GRHardHearRecPriority()
|
|---|
| 3011 | {
|
|---|
| 3012 | - GlobalSpinBox *bs = new GlobalSpinBox("HardHearRecPriority",
|
|---|
| 3013 | + GlobalSpinBoxTree *bs = new GlobalSpinBoxTree("HardHearRecPriority",
|
|---|
| 3014 | -99, 99, 1);
|
|---|
| 3015 | bs->setLabel(QObject::tr("Hard of hearing priority"));
|
|---|
| 3016 | bs->setHelpText(QObject::tr("Additional priority when a showing "
|
|---|
| 3017 | @@ -2486,9 +3323,9 @@ static GlobalSpinBox *GRHardHearRecPriority()
|
|---|
| 3018 | return bs;
|
|---|
| 3019 | }
|
|---|
| 3020 |
|
|---|
| 3021 | -static GlobalSpinBox *GRAudioDescRecPriority()
|
|---|
| 3022 | +static GlobalSpinBoxTree *GRAudioDescRecPriority()
|
|---|
| 3023 | {
|
|---|
| 3024 | - GlobalSpinBox *bs = new GlobalSpinBox("AudioDescRecPriority",
|
|---|
| 3025 | + GlobalSpinBoxTree *bs = new GlobalSpinBoxTree("AudioDescRecPriority",
|
|---|
| 3026 | -99, 99, 1);
|
|---|
| 3027 | bs->setLabel(QObject::tr("Audio described priority"));
|
|---|
| 3028 | bs->setHelpText(QObject::tr("Additional priority when a showing "
|
|---|
| 3029 | @@ -2497,9 +3334,9 @@ static GlobalSpinBox *GRAudioDescRecPriority()
|
|---|
| 3030 | return bs;
|
|---|
| 3031 | }
|
|---|
| 3032 |
|
|---|
| 3033 | -static GlobalSpinBox *GRSingleRecordRecPriority()
|
|---|
| 3034 | +static GlobalSpinBoxTree *GRSingleRecordRecPriority()
|
|---|
| 3035 | {
|
|---|
| 3036 | - GlobalSpinBox *bs = new GlobalSpinBox("SingleRecordRecPriority",
|
|---|
| 3037 | + GlobalSpinBoxTree *bs = new GlobalSpinBoxTree("SingleRecordRecPriority",
|
|---|
| 3038 | -99, 99, 1);
|
|---|
| 3039 | bs->setLabel(QObject::tr("Single recordings priority"));
|
|---|
| 3040 | bs->setHelpText(QObject::tr("Single recordings will receive this "
|
|---|
| 3041 | @@ -2508,9 +3345,9 @@ static GlobalSpinBox *GRSingleRecordRecPriority()
|
|---|
| 3042 | return bs;
|
|---|
| 3043 | }
|
|---|
| 3044 |
|
|---|
| 3045 | -static GlobalSpinBox *GRWeekslotRecordRecPriority()
|
|---|
| 3046 | +static GlobalSpinBoxTree *GRWeekslotRecordRecPriority()
|
|---|
| 3047 | {
|
|---|
| 3048 | - GlobalSpinBox *bs = new GlobalSpinBox("WeekslotRecordRecPriority",
|
|---|
| 3049 | + GlobalSpinBoxTree *bs = new GlobalSpinBoxTree("WeekslotRecordRecPriority",
|
|---|
| 3050 | -99, 99, 1);
|
|---|
| 3051 | bs->setLabel(QObject::tr("Weekslot recordings priority"));
|
|---|
| 3052 | bs->setHelpText(QObject::tr("Weekslot recordings will receive this "
|
|---|
| 3053 | @@ -2519,9 +3356,9 @@ static GlobalSpinBox *GRWeekslotRecordRecPriority()
|
|---|
| 3054 | return bs;
|
|---|
| 3055 | }
|
|---|
| 3056 |
|
|---|
| 3057 | -static GlobalSpinBox *GRTimeslotRecordRecPriority()
|
|---|
| 3058 | +static GlobalSpinBoxTree *GRTimeslotRecordRecPriority()
|
|---|
| 3059 | {
|
|---|
| 3060 | - GlobalSpinBox *bs = new GlobalSpinBox("TimeslotRecordRecPriority",
|
|---|
| 3061 | + GlobalSpinBoxTree *bs = new GlobalSpinBoxTree("TimeslotRecordRecPriority",
|
|---|
| 3062 | -99, 99, 1);
|
|---|
| 3063 | bs->setLabel(QObject::tr("Timeslot recordings priority"));
|
|---|
| 3064 | bs->setHelpText(QObject::tr("Timeslot recordings will receive this "
|
|---|
| 3065 | @@ -2530,9 +3367,9 @@ static GlobalSpinBox *GRTimeslotRecordRecPriority()
|
|---|
| 3066 | return bs;
|
|---|
| 3067 | }
|
|---|
| 3068 |
|
|---|
| 3069 | -static GlobalSpinBox *GRChannelRecordRecPriority()
|
|---|
| 3070 | +static GlobalSpinBoxTree *GRChannelRecordRecPriority()
|
|---|
| 3071 | {
|
|---|
| 3072 | - GlobalSpinBox *bs = new GlobalSpinBox("ChannelRecordRecPriority",
|
|---|
| 3073 | + GlobalSpinBoxTree *bs = new GlobalSpinBoxTree("ChannelRecordRecPriority",
|
|---|
| 3074 | -99, 99, 1);
|
|---|
| 3075 | bs->setLabel(QObject::tr("Channel recordings priority"));
|
|---|
| 3076 | bs->setHelpText(QObject::tr("Channel recordings will receive this "
|
|---|
| 3077 | @@ -2541,9 +3378,9 @@ static GlobalSpinBox *GRChannelRecordRecPriority()
|
|---|
| 3078 | return bs;
|
|---|
| 3079 | }
|
|---|
| 3080 |
|
|---|
| 3081 | -static GlobalSpinBox *GRAllRecordRecPriority()
|
|---|
| 3082 | +static GlobalSpinBoxTree *GRAllRecordRecPriority()
|
|---|
| 3083 | {
|
|---|
| 3084 | - GlobalSpinBox *bs = new GlobalSpinBox("AllRecordRecPriority",
|
|---|
| 3085 | + GlobalSpinBoxTree *bs = new GlobalSpinBoxTree("AllRecordRecPriority",
|
|---|
| 3086 | -99, 99, 1);
|
|---|
| 3087 | bs->setLabel(QObject::tr("All recordings priority"));
|
|---|
| 3088 | bs->setHelpText(QObject::tr("The 'All' recording type will receive this "
|
|---|
| 3089 | @@ -2552,9 +3389,9 @@ static GlobalSpinBox *GRAllRecordRecPriority()
|
|---|
| 3090 | return bs;
|
|---|
| 3091 | }
|
|---|
| 3092 |
|
|---|
| 3093 | -static GlobalSpinBox *GRFindOneRecordRecPriority()
|
|---|
| 3094 | +static GlobalSpinBoxTree *GRFindOneRecordRecPriority()
|
|---|
| 3095 | {
|
|---|
| 3096 | - GlobalSpinBox *bs = new GlobalSpinBox("FindOneRecordRecPriority",
|
|---|
| 3097 | + GlobalSpinBoxTree *bs = new GlobalSpinBoxTree("FindOneRecordRecPriority",
|
|---|
| 3098 | -99, 99, 1);
|
|---|
| 3099 | bs->setLabel(QObject::tr("Find one recordings priority"));
|
|---|
| 3100 | bs->setHelpText(QObject::tr("Find One, Find Weekly and Find Daily "
|
|---|
| 3101 | @@ -2564,9 +3401,9 @@ static GlobalSpinBox *GRFindOneRecordRecPriority()
|
|---|
| 3102 | return bs;
|
|---|
| 3103 | }
|
|---|
| 3104 |
|
|---|
| 3105 | -static GlobalSpinBox *GROverrideRecordRecPriority()
|
|---|
| 3106 | +static GlobalSpinBoxTree *GROverrideRecordRecPriority()
|
|---|
| 3107 | {
|
|---|
| 3108 | - GlobalSpinBox *bs = new GlobalSpinBox("OverrideRecordRecPriority",
|
|---|
| 3109 | + GlobalSpinBoxTree *bs = new GlobalSpinBoxTree("OverrideRecordRecPriority",
|
|---|
| 3110 | -99, 99, 1);
|
|---|
| 3111 | bs->setLabel(QObject::tr("Override recordings priority"));
|
|---|
| 3112 | bs->setHelpText(QObject::tr("Override recordings will receive this "
|
|---|
| 3113 | @@ -2575,9 +3412,9 @@ static GlobalSpinBox *GROverrideRecordRecPriority()
|
|---|
| 3114 | return bs;
|
|---|
| 3115 | }
|
|---|
| 3116 |
|
|---|
| 3117 | -static HostLineEdit *DefaultTVChannel()
|
|---|
| 3118 | +static HostLineEditTree *DefaultTVChannel()
|
|---|
| 3119 | {
|
|---|
| 3120 | - HostLineEdit *ge = new HostLineEdit("DefaultTVChannel");
|
|---|
| 3121 | + HostLineEditTree *ge = new HostLineEditTree("DefaultTVChannel");
|
|---|
| 3122 | ge->setLabel(QObject::tr("Guide starts at channel"));
|
|---|
| 3123 | ge->setValue("3");
|
|---|
| 3124 | ge->setHelpText(QObject::tr("The program guide starts on this channel if "
|
|---|
| 3125 | @@ -2585,9 +3422,9 @@ static HostLineEdit *DefaultTVChannel()
|
|---|
| 3126 | return ge;
|
|---|
| 3127 | }
|
|---|
| 3128 |
|
|---|
| 3129 | -static HostSpinBox *EPGRecThreshold()
|
|---|
| 3130 | +static HostSpinBoxTree *EPGRecThreshold()
|
|---|
| 3131 | {
|
|---|
| 3132 | - HostSpinBox *gs = new HostSpinBox("SelChangeRecThreshold", 1, 600, 1);
|
|---|
| 3133 | + HostSpinBoxTree *gs = new HostSpinBoxTree("SelChangeRecThreshold", 1, 600, 1);
|
|---|
| 3134 | gs->setLabel(QObject::tr("Record threshold"));
|
|---|
| 3135 | gs->setValue(16);
|
|---|
| 3136 | gs->setHelpText(QObject::tr("Pressing SELECT on a show that is at least "
|
|---|
| 3137 | @@ -2596,9 +3433,9 @@ static HostSpinBox *EPGRecThreshold()
|
|---|
| 3138 | return gs;
|
|---|
| 3139 | }
|
|---|
| 3140 |
|
|---|
| 3141 | -static HostComboBox *MythLanguage()
|
|---|
| 3142 | +static HostComboBoxTree *MythLanguage()
|
|---|
| 3143 | {
|
|---|
| 3144 | - HostComboBox *gc = new HostComboBox("Language");
|
|---|
| 3145 | + HostComboBoxTree *gc = new HostComboBoxTree("Language");
|
|---|
| 3146 | gc->setLabel(QObject::tr("Language"));
|
|---|
| 3147 |
|
|---|
| 3148 | QMap<QString, QString> langMap = MythTranslation::getLanguages();
|
|---|
| 3149 | @@ -2620,9 +3457,9 @@ static HostComboBox *MythLanguage()
|
|---|
| 3150 | return gc;
|
|---|
| 3151 | }
|
|---|
| 3152 |
|
|---|
| 3153 | -static void ISO639_fill_selections(SelectSetting *widget, uint i)
|
|---|
| 3154 | +static void ISO639_fill_selections(ComboBoxTree *listSetting, uint i)
|
|---|
| 3155 | {
|
|---|
| 3156 | - widget->clearSelections();
|
|---|
| 3157 | + listSetting->clearSelections();
|
|---|
| 3158 | QString q = QString("ISO639Language%1").arg(i);
|
|---|
| 3159 | QString lang = gCoreContext->GetSetting(q, "").toLower();
|
|---|
| 3160 |
|
|---|
| 3161 | @@ -2643,13 +3480,13 @@ static void ISO639_fill_selections(SelectSetting *widget, uint i)
|
|---|
| 3162 | desc = desc.left(idx);
|
|---|
| 3163 |
|
|---|
| 3164 | const QString il = iso639_key_to_str3(it.key());
|
|---|
| 3165 | - widget->addSelection(desc, il, il == lang);
|
|---|
| 3166 | + listSetting->addSelection(desc, il, il == lang);
|
|---|
| 3167 | }
|
|---|
| 3168 | }
|
|---|
| 3169 |
|
|---|
| 3170 | -static GlobalComboBox *ISO639PreferredLanguage(uint i)
|
|---|
| 3171 | +static GlobalComboBoxTree *ISO639PreferredLanguage(uint i)
|
|---|
| 3172 | {
|
|---|
| 3173 | - GlobalComboBox *gc = new GlobalComboBox(QString("ISO639Language%1").arg(i));
|
|---|
| 3174 | + GlobalComboBoxTree *gc = new GlobalComboBoxTree(QString("ISO639Language%1").arg(i));
|
|---|
| 3175 | gc->setLabel(QObject::tr("Guide language #%1").arg(i+1));
|
|---|
| 3176 | // We should try to get language from "MythLanguage"
|
|---|
| 3177 | // then use code 2 to code 3 map in iso639.h
|
|---|
| 3178 | @@ -2660,29 +3497,33 @@ static GlobalComboBox *ISO639PreferredLanguage(uint i)
|
|---|
| 3179 | return gc;
|
|---|
| 3180 | }
|
|---|
| 3181 |
|
|---|
| 3182 | -static HostCheckBox *NetworkControlEnabled()
|
|---|
| 3183 | +static HostSpinBoxTree *NetworkControlPort()
|
|---|
| 3184 | +{
|
|---|
| 3185 | + HostSpinBoxTree *gs = new HostSpinBoxTree("NetworkControlPort", 1025, 65535, 1);
|
|---|
| 3186 | + gs->setLabel(QObject::tr("Network Remote Control port"));
|
|---|
| 3187 | + gs->setValue(6546);
|
|---|
| 3188 | + gs->setHelpText(QObject::tr("This specifies what port the network remote "
|
|---|
| 3189 | + "Control interface will listen on for new connections."));
|
|---|
| 3190 | + return gs;
|
|---|
| 3191 | +}
|
|---|
| 3192 | +
|
|---|
| 3193 | +static HostCheckBoxTree *NetworkControlEnabled()
|
|---|
| 3194 | {
|
|---|
| 3195 | - HostCheckBox *gc = new HostCheckBox("NetworkControlEnabled");
|
|---|
| 3196 | + HostCheckBoxTree *gc = new HostCheckBoxTree("NetworkControlEnabled");
|
|---|
| 3197 | gc->setLabel(QObject::tr("Enable Network Remote Control interface"));
|
|---|
| 3198 | gc->setHelpText(QObject::tr("This enables support for controlling "
|
|---|
| 3199 | "mythfrontend over the network."));
|
|---|
| 3200 | gc->setValue(false);
|
|---|
| 3201 | +
|
|---|
| 3202 | + gc->addChild(true, NetworkControlPort());
|
|---|
| 3203 | return gc;
|
|---|
| 3204 | }
|
|---|
| 3205 |
|
|---|
| 3206 | -static HostSpinBox *NetworkControlPort()
|
|---|
| 3207 | -{
|
|---|
| 3208 | - HostSpinBox *gs = new HostSpinBox("NetworkControlPort", 1025, 65535, 1);
|
|---|
| 3209 | - gs->setLabel(QObject::tr("Network Remote Control port"));
|
|---|
| 3210 | - gs->setValue(6546);
|
|---|
| 3211 | - gs->setHelpText(QObject::tr("This specifies what port the network remote "
|
|---|
| 3212 | - "Control interface will listen on for new connections."));
|
|---|
| 3213 | - return gs;
|
|---|
| 3214 | -}
|
|---|
| 3215 |
|
|---|
| 3216 | -static HostLineEdit *UDPNotifyPort()
|
|---|
| 3217 | +
|
|---|
| 3218 | +static HostLineEditTree *UDPNotifyPort()
|
|---|
| 3219 | {
|
|---|
| 3220 | - HostLineEdit *ge = new HostLineEdit("UDPNotifyPort");
|
|---|
| 3221 | + HostLineEditTree *ge = new HostLineEditTree("UDPNotifyPort");
|
|---|
| 3222 | ge->setLabel(QObject::tr("UDP notify port"));
|
|---|
| 3223 | ge->setValue("6948");
|
|---|
| 3224 | ge->setHelpText(QObject::tr("MythTV will listen for "
|
|---|
| 3225 | @@ -2692,9 +3533,9 @@ static HostLineEdit *UDPNotifyPort()
|
|---|
| 3226 | return ge;
|
|---|
| 3227 | }
|
|---|
| 3228 |
|
|---|
| 3229 | -static HostCheckBox *RealtimePriority()
|
|---|
| 3230 | +static HostCheckBoxTree *RealtimePriority()
|
|---|
| 3231 | {
|
|---|
| 3232 | - HostCheckBox *gc = new HostCheckBox("RealtimePriority");
|
|---|
| 3233 | + HostCheckBoxTree *gc = new HostCheckBoxTree("RealtimePriority");
|
|---|
| 3234 | gc->setLabel(QObject::tr("Enable realtime priority threads"));
|
|---|
| 3235 | gc->setHelpText(QObject::tr("When running mythfrontend with root "
|
|---|
| 3236 | "privileges, some threads can be given enhanced priority. "
|
|---|
| 3237 | @@ -2704,21 +3545,9 @@ static HostCheckBox *RealtimePriority()
|
|---|
| 3238 | return gc;
|
|---|
| 3239 | }
|
|---|
| 3240 |
|
|---|
| 3241 | -static HostCheckBox *EnableMediaMon()
|
|---|
| 3242 | -{
|
|---|
| 3243 | - HostCheckBox *gc = new HostCheckBox("MonitorDrives");
|
|---|
| 3244 | - gc->setLabel(QObject::tr("Monitor CD/DVD") +
|
|---|
| 3245 | - QObject::tr(" (and other removable devices)"));
|
|---|
| 3246 | - gc->setHelpText(QObject::tr("This enables support for monitoring "
|
|---|
| 3247 | - "your CD/DVD drives for new disks and launching "
|
|---|
| 3248 | - "the proper plugin to handle them."));
|
|---|
| 3249 | - gc->setValue(false);
|
|---|
| 3250 | - return gc;
|
|---|
| 3251 | -}
|
|---|
| 3252 | -
|
|---|
| 3253 | -static HostLineEdit *IgnoreMedia()
|
|---|
| 3254 | +static HostLineEditTree *IgnoreMedia()
|
|---|
| 3255 | {
|
|---|
| 3256 | - HostLineEdit *ge = new HostLineEdit("IgnoreDevices");
|
|---|
| 3257 | + HostLineEditTree *ge = new HostLineEditTree("IgnoreDevices");
|
|---|
| 3258 | ge->setLabel(QObject::tr("Ignore devices"));
|
|---|
| 3259 | ge->setValue("");
|
|---|
| 3260 | ge->setHelpText(QObject::tr("If there are any devices that you do not want "
|
|---|
| 3261 | @@ -2727,32 +3556,22 @@ static HostLineEdit *IgnoreMedia()
|
|---|
| 3262 | return ge;
|
|---|
| 3263 | }
|
|---|
| 3264 |
|
|---|
| 3265 | -class MythMediaSettings : public TriggeredConfigurationGroup
|
|---|
| 3266 | +static HostCheckBoxTree *EnableMediaMon()
|
|---|
| 3267 | {
|
|---|
| 3268 | - public:
|
|---|
| 3269 | - MythMediaSettings() :
|
|---|
| 3270 | - TriggeredConfigurationGroup(false, false, true, true)
|
|---|
| 3271 | - {
|
|---|
| 3272 | - setLabel(QObject::tr("MythMediaMonitor"));
|
|---|
| 3273 | - setUseLabel(false);
|
|---|
| 3274 | -
|
|---|
| 3275 | - Setting* enabled = EnableMediaMon();
|
|---|
| 3276 | - addChild(enabled);
|
|---|
| 3277 | - setTrigger(enabled);
|
|---|
| 3278 | -
|
|---|
| 3279 | - ConfigurationGroup* settings = new VerticalConfigurationGroup(false);
|
|---|
| 3280 | - settings->addChild(IgnoreMedia());
|
|---|
| 3281 | - addTarget("1", settings);
|
|---|
| 3282 | -
|
|---|
| 3283 | - // show nothing if fillEnabled is off
|
|---|
| 3284 | - addTarget("0", new VerticalConfigurationGroup(true));
|
|---|
| 3285 | - };
|
|---|
| 3286 | -};
|
|---|
| 3287 | -
|
|---|
| 3288 | + HostCheckBoxTree *gc = new HostCheckBoxTree("MonitorDrives");
|
|---|
| 3289 | + gc->setLabel(QObject::tr("Monitor CD/DVD") +
|
|---|
| 3290 | + QObject::tr(" (and other removable devices)"));
|
|---|
| 3291 | + gc->setHelpText(QObject::tr("This enables support for monitoring "
|
|---|
| 3292 | + "your CD/DVD drives for new disks and launching "
|
|---|
| 3293 | + "the proper plugin to handle them."));
|
|---|
| 3294 | + gc->addChild(true,IgnoreMedia());
|
|---|
| 3295 | + gc->setValue(false);
|
|---|
| 3296 | + return gc;
|
|---|
| 3297 | +}
|
|---|
| 3298 |
|
|---|
| 3299 | -static HostComboBox *DisplayGroupTitleSort()
|
|---|
| 3300 | +static HostComboBoxTree *DisplayGroupTitleSort()
|
|---|
| 3301 | {
|
|---|
| 3302 | - HostComboBox *gc = new HostComboBox("DisplayGroupTitleSort");
|
|---|
| 3303 | + HostComboBoxTree *gc = new HostComboBoxTree("DisplayGroupTitleSort");
|
|---|
| 3304 | gc->setLabel(QObject::tr("Sort titles"));
|
|---|
| 3305 | gc->addSelection(QObject::tr("Alphabetically"),
|
|---|
| 3306 | QString::number(PlaybackBox::TitleSortAlphabetical));
|
|---|
| 3307 | @@ -2763,21 +3582,9 @@ static HostComboBox *DisplayGroupTitleSort()
|
|---|
| 3308 | return gc;
|
|---|
| 3309 | }
|
|---|
| 3310 |
|
|---|
| 3311 | -static HostCheckBox *PlaybackWatchList()
|
|---|
| 3312 | -{
|
|---|
| 3313 | - HostCheckBox *gc = new HostCheckBox("PlaybackWatchList");
|
|---|
| 3314 | - gc->setLabel(QObject::tr("Include the 'Watch List' group"));
|
|---|
| 3315 | - gc->setValue(true);
|
|---|
| 3316 | - gc->setHelpText(QObject::tr("The 'Watch List' is an abbreviated list of "
|
|---|
| 3317 | - "recordings sorted to highlight series and "
|
|---|
| 3318 | - "shows that need attention in order to "
|
|---|
| 3319 | - "keep up to date."));
|
|---|
| 3320 | - return gc;
|
|---|
| 3321 | -}
|
|---|
| 3322 | -
|
|---|
| 3323 | -static HostCheckBox *PlaybackWLStart()
|
|---|
| 3324 | +static HostCheckBoxTree *PlaybackWLStart()
|
|---|
| 3325 | {
|
|---|
| 3326 | - HostCheckBox *gc = new HostCheckBox("PlaybackWLStart");
|
|---|
| 3327 | + HostCheckBoxTree *gc = new HostCheckBoxTree("PlaybackWLStart");
|
|---|
| 3328 | gc->setLabel(QObject::tr("Start from the Watch List view"));
|
|---|
| 3329 | gc->setValue(false);
|
|---|
| 3330 | gc->setHelpText(QObject::tr("If enabled, the 'Watch List' will be the "
|
|---|
| 3331 | @@ -2786,9 +3593,9 @@ static HostCheckBox *PlaybackWLStart()
|
|---|
| 3332 | return gc;
|
|---|
| 3333 | }
|
|---|
| 3334 |
|
|---|
| 3335 | -static HostCheckBox *PlaybackWLAutoExpire()
|
|---|
| 3336 | +static HostCheckBoxTree *PlaybackWLAutoExpire()
|
|---|
| 3337 | {
|
|---|
| 3338 | - HostCheckBox *gc = new HostCheckBox("PlaybackWLAutoExpire");
|
|---|
| 3339 | + HostCheckBoxTree *gc = new HostCheckBoxTree("PlaybackWLAutoExpire");
|
|---|
| 3340 | gc->setLabel(QObject::tr("Exclude recordings not set for Auto-Expire"));
|
|---|
| 3341 | gc->setValue(false);
|
|---|
| 3342 | gc->setHelpText(QObject::tr("Set this if you turn off Auto-Expire only "
|
|---|
| 3343 | @@ -2798,9 +3605,9 @@ static HostCheckBox *PlaybackWLAutoExpire()
|
|---|
| 3344 | return gc;
|
|---|
| 3345 | }
|
|---|
| 3346 |
|
|---|
| 3347 | -static HostSpinBox *PlaybackWLMaxAge()
|
|---|
| 3348 | +static HostSpinBoxTree *PlaybackWLMaxAge()
|
|---|
| 3349 | {
|
|---|
| 3350 | - HostSpinBox *gs = new HostSpinBox("PlaybackWLMaxAge", 30, 180, 10);
|
|---|
| 3351 | + HostSpinBoxTree *gs = new HostSpinBoxTree("PlaybackWLMaxAge", 30, 180, 10);
|
|---|
| 3352 | gs->setLabel(QObject::tr("Maximum days counted in the score"));
|
|---|
| 3353 | gs->setValue(60);
|
|---|
| 3354 | gs->setHelpText(QObject::tr("The 'Watch List' scores are based on 1 point "
|
|---|
| 3355 | @@ -2810,9 +3617,9 @@ static HostSpinBox *PlaybackWLMaxAge()
|
|---|
| 3356 | return gs;
|
|---|
| 3357 | }
|
|---|
| 3358 |
|
|---|
| 3359 | -static HostSpinBox *PlaybackWLBlackOut()
|
|---|
| 3360 | +static HostSpinBoxTree *PlaybackWLBlackOut()
|
|---|
| 3361 | {
|
|---|
| 3362 | - HostSpinBox *gs = new HostSpinBox("PlaybackWLBlackOut", 0, 5, 1);
|
|---|
| 3363 | + HostSpinBoxTree *gs = new HostSpinBoxTree("PlaybackWLBlackOut", 0, 5, 1);
|
|---|
| 3364 | gs->setLabel(QObject::tr("Days to exclude weekly episodes after delete"));
|
|---|
| 3365 | gs->setValue(2);
|
|---|
| 3366 | gs->setHelpText(QObject::tr("When an episode is deleted or marked as "
|
|---|
| 3367 | @@ -2823,40 +3630,36 @@ static HostSpinBox *PlaybackWLBlackOut()
|
|---|
| 3368 | return gs;
|
|---|
| 3369 | }
|
|---|
| 3370 |
|
|---|
| 3371 | -class WatchListSettings : public TriggeredConfigurationGroup
|
|---|
| 3372 | +
|
|---|
| 3373 | +static HostCheckBoxTree *PlaybackWatchList()
|
|---|
| 3374 | {
|
|---|
| 3375 | - public:
|
|---|
| 3376 | - WatchListSettings() :
|
|---|
| 3377 | - TriggeredConfigurationGroup(false, false, true, true)
|
|---|
| 3378 | - {
|
|---|
| 3379 | -
|
|---|
| 3380 | - Setting* watchList = PlaybackWatchList();
|
|---|
| 3381 | - addChild(watchList);
|
|---|
| 3382 | - setTrigger(watchList);
|
|---|
| 3383 | -
|
|---|
| 3384 | - ConfigurationGroup* settings = new VerticalConfigurationGroup(false);
|
|---|
| 3385 | - settings->addChild(PlaybackWLStart());
|
|---|
| 3386 | - settings->addChild(PlaybackWLAutoExpire());
|
|---|
| 3387 | - settings->addChild(PlaybackWLMaxAge());
|
|---|
| 3388 | - settings->addChild(PlaybackWLBlackOut());
|
|---|
| 3389 | - addTarget("1", settings);
|
|---|
| 3390 | -
|
|---|
| 3391 | - addTarget("0", new VerticalConfigurationGroup(true));
|
|---|
| 3392 | - };
|
|---|
| 3393 | -};
|
|---|
| 3394 | + HostCheckBoxTree *gc = new HostCheckBoxTree("PlaybackWatchList");
|
|---|
| 3395 | + gc->setLabel(QObject::tr("Include the 'Watch List' group"));
|
|---|
| 3396 | + gc->setValue(true);
|
|---|
| 3397 | + gc->setHelpText(QObject::tr("The 'Watch List' is an abbreviated list of "
|
|---|
| 3398 | + "recordings sorted to highlight series and "
|
|---|
| 3399 | + "shows that need attention in order to "
|
|---|
| 3400 | + "keep up to date."));
|
|---|
| 3401 | +
|
|---|
| 3402 | + gc->addChild(true,PlaybackWLStart());
|
|---|
| 3403 | + gc->addChild(true,PlaybackWLAutoExpire());
|
|---|
| 3404 | + gc->addChild(true,PlaybackWLMaxAge());
|
|---|
| 3405 | + gc->addChild(true,PlaybackWLBlackOut());
|
|---|
| 3406 | + return gc;
|
|---|
| 3407 | +}
|
|---|
| 3408 |
|
|---|
| 3409 | -static HostCheckBox *LCDShowTime()
|
|---|
| 3410 | +static HostCheckBoxTree *LCDShowTime()
|
|---|
| 3411 | {
|
|---|
| 3412 | - HostCheckBox *gc = new HostCheckBox("LCDShowTime");
|
|---|
| 3413 | + HostCheckBoxTree *gc = new HostCheckBoxTree("LCDShowTime");
|
|---|
| 3414 | gc->setLabel(QObject::tr("Display time"));
|
|---|
| 3415 | gc->setHelpText(QObject::tr("Display current time on idle LCD display. "));
|
|---|
| 3416 | gc->setValue(true);
|
|---|
| 3417 | return gc;
|
|---|
| 3418 | }
|
|---|
| 3419 |
|
|---|
| 3420 | -static HostCheckBox *LCDShowRecStatus()
|
|---|
| 3421 | +static HostCheckBoxTree *LCDShowRecStatus()
|
|---|
| 3422 | {
|
|---|
| 3423 | - HostCheckBox *gc = new HostCheckBox("LCDShowRecStatus");
|
|---|
| 3424 | + HostCheckBoxTree *gc = new HostCheckBoxTree("LCDShowRecStatus");
|
|---|
| 3425 | gc->setLabel(QObject::tr("Display recording status"));
|
|---|
| 3426 | gc->setHelpText(QObject::tr("Display current recordings information on "
|
|---|
| 3427 | "LCD display."));
|
|---|
| 3428 | @@ -2864,18 +3667,18 @@ static HostCheckBox *LCDShowRecStatus()
|
|---|
| 3429 | return gc;
|
|---|
| 3430 | }
|
|---|
| 3431 |
|
|---|
| 3432 | -static HostCheckBox *LCDShowMenu()
|
|---|
| 3433 | +static HostCheckBoxTree *LCDShowMenu()
|
|---|
| 3434 | {
|
|---|
| 3435 | - HostCheckBox *gc = new HostCheckBox("LCDShowMenu");
|
|---|
| 3436 | + HostCheckBoxTree *gc = new HostCheckBoxTree("LCDShowMenu");
|
|---|
| 3437 | gc->setLabel(QObject::tr("Display menus"));
|
|---|
| 3438 | gc->setHelpText(QObject::tr("Display selected menu on LCD display. "));
|
|---|
| 3439 | gc->setValue(true);
|
|---|
| 3440 | return gc;
|
|---|
| 3441 | }
|
|---|
| 3442 |
|
|---|
| 3443 | -static HostSpinBox *LCDPopupTime()
|
|---|
| 3444 | +static HostSpinBoxTree *LCDPopupTime()
|
|---|
| 3445 | {
|
|---|
| 3446 | - HostSpinBox *gs = new HostSpinBox("LCDPopupTime", 1, 300, 1, true);
|
|---|
| 3447 | + HostSpinBoxTree *gs = new HostSpinBoxTree("LCDPopupTime", 1, 300, 1, true);
|
|---|
| 3448 | gs->setLabel(QObject::tr("Menu pop-up time"));
|
|---|
| 3449 | gs->setHelpText(QObject::tr("How many seconds the menu will "
|
|---|
| 3450 | "remain visible after navigation."));
|
|---|
| 3451 | @@ -2883,9 +3686,9 @@ static HostSpinBox *LCDPopupTime()
|
|---|
| 3452 | return gs;
|
|---|
| 3453 | }
|
|---|
| 3454 |
|
|---|
| 3455 | -static HostCheckBox *LCDShowMusic()
|
|---|
| 3456 | +static HostCheckBoxTree *LCDShowMusic()
|
|---|
| 3457 | {
|
|---|
| 3458 | - HostCheckBox *gc = new HostCheckBox("LCDShowMusic");
|
|---|
| 3459 | + HostCheckBoxTree *gc = new HostCheckBoxTree("LCDShowMusic");
|
|---|
| 3460 | gc->setLabel(QObject::tr("Display music artist and title"));
|
|---|
| 3461 | gc->setHelpText(QObject::tr("Display playing artist and song title in "
|
|---|
| 3462 | "MythMusic on LCD display."));
|
|---|
| 3463 | @@ -2893,9 +3696,9 @@ static HostCheckBox *LCDShowMusic()
|
|---|
| 3464 | return gc;
|
|---|
| 3465 | }
|
|---|
| 3466 |
|
|---|
| 3467 | -static HostComboBox *LCDShowMusicItems()
|
|---|
| 3468 | +static HostComboBoxTree *LCDShowMusicItems()
|
|---|
| 3469 | {
|
|---|
| 3470 | - HostComboBox *gc = new HostComboBox("LCDShowMusicItems");
|
|---|
| 3471 | + HostComboBoxTree *gc = new HostComboBoxTree("LCDShowMusicItems");
|
|---|
| 3472 | gc->setLabel(QObject::tr("Items"));
|
|---|
| 3473 | gc->addSelection(QObject::tr("Artist - Title"), "ArtistTitle");
|
|---|
| 3474 | gc->addSelection(QObject::tr("Artist [Album] Title"), "ArtistAlbumTitle");
|
|---|
| 3475 | @@ -2903,18 +3706,18 @@ static HostComboBox *LCDShowMusicItems()
|
|---|
| 3476 | return gc;
|
|---|
| 3477 | }
|
|---|
| 3478 |
|
|---|
| 3479 | -static HostCheckBox *LCDShowChannel()
|
|---|
| 3480 | +static HostCheckBoxTree *LCDShowChannel()
|
|---|
| 3481 | {
|
|---|
| 3482 | - HostCheckBox *gc = new HostCheckBox("LCDShowChannel");
|
|---|
| 3483 | + HostCheckBoxTree *gc = new HostCheckBoxTree("LCDShowChannel");
|
|---|
| 3484 | gc->setLabel(QObject::tr("Display channel information"));
|
|---|
| 3485 | gc->setHelpText(QObject::tr("Display tuned channel information on LCD display."));
|
|---|
| 3486 | gc->setValue(true);
|
|---|
| 3487 | return gc;
|
|---|
| 3488 | }
|
|---|
| 3489 |
|
|---|
| 3490 | -static HostCheckBox *LCDShowVolume()
|
|---|
| 3491 | +static HostCheckBoxTree *LCDShowVolume()
|
|---|
| 3492 | {
|
|---|
| 3493 | - HostCheckBox *gc = new HostCheckBox("LCDShowVolume");
|
|---|
| 3494 | + HostCheckBoxTree *gc = new HostCheckBoxTree("LCDShowVolume");
|
|---|
| 3495 | gc->setLabel(QObject::tr("Display volume information"));
|
|---|
| 3496 | gc->setHelpText(QObject::tr("Display volume level information "
|
|---|
| 3497 | "on LCD display."));
|
|---|
| 3498 | @@ -2922,18 +3725,18 @@ static HostCheckBox *LCDShowVolume()
|
|---|
| 3499 | return gc;
|
|---|
| 3500 | }
|
|---|
| 3501 |
|
|---|
| 3502 | -static HostCheckBox *LCDShowGeneric()
|
|---|
| 3503 | +static HostCheckBoxTree *LCDShowGeneric()
|
|---|
| 3504 | {
|
|---|
| 3505 | - HostCheckBox *gc = new HostCheckBox("LCDShowGeneric");
|
|---|
| 3506 | + HostCheckBoxTree *gc = new HostCheckBoxTree("LCDShowGeneric");
|
|---|
| 3507 | gc->setLabel(QObject::tr("Display generic information"));
|
|---|
| 3508 | gc->setHelpText(QObject::tr("Display generic information on LCD display."));
|
|---|
| 3509 | gc->setValue(true);
|
|---|
| 3510 | return gc;
|
|---|
| 3511 | }
|
|---|
| 3512 |
|
|---|
| 3513 | -static HostCheckBox *LCDBacklightOn()
|
|---|
| 3514 | +static HostCheckBoxTree *LCDBacklightOn()
|
|---|
| 3515 | {
|
|---|
| 3516 | - HostCheckBox *gc = new HostCheckBox("LCDBacklightOn");
|
|---|
| 3517 | + HostCheckBoxTree *gc = new HostCheckBoxTree("LCDBacklightOn");
|
|---|
| 3518 | gc->setLabel(QObject::tr("Backlight always on"));
|
|---|
| 3519 | gc->setHelpText(QObject::tr("Turn on the backlight permanently "
|
|---|
| 3520 | "on the LCD display."));
|
|---|
| 3521 | @@ -2941,27 +3744,27 @@ static HostCheckBox *LCDBacklightOn()
|
|---|
| 3522 | return gc;
|
|---|
| 3523 | }
|
|---|
| 3524 |
|
|---|
| 3525 | -static HostCheckBox *LCDHeartBeatOn()
|
|---|
| 3526 | +static HostCheckBoxTree *LCDHeartBeatOn()
|
|---|
| 3527 | {
|
|---|
| 3528 | - HostCheckBox *gc = new HostCheckBox("LCDHeartBeatOn");
|
|---|
| 3529 | + HostCheckBoxTree *gc = new HostCheckBoxTree("LCDHeartBeatOn");
|
|---|
| 3530 | gc->setLabel(QObject::tr("Heartbeat always on"));
|
|---|
| 3531 | gc->setHelpText(QObject::tr("Turn on the LCD heartbeat."));
|
|---|
| 3532 | gc->setValue(false);
|
|---|
| 3533 | return gc;
|
|---|
| 3534 | }
|
|---|
| 3535 |
|
|---|
| 3536 | -static HostCheckBox *LCDBigClock()
|
|---|
| 3537 | +static HostCheckBoxTree *LCDBigClock()
|
|---|
| 3538 | {
|
|---|
| 3539 | - HostCheckBox *gc = new HostCheckBox("LCDBigClock");
|
|---|
| 3540 | + HostCheckBoxTree *gc = new HostCheckBoxTree("LCDBigClock");
|
|---|
| 3541 | gc->setLabel(QObject::tr("Display large clock"));
|
|---|
| 3542 | gc->setHelpText(QObject::tr("On multiline displays try and display the time as large as possible."));
|
|---|
| 3543 | gc->setValue(false);
|
|---|
| 3544 | return gc;
|
|---|
| 3545 | }
|
|---|
| 3546 |
|
|---|
| 3547 | -static HostLineEdit *LCDKeyString()
|
|---|
| 3548 | +static HostLineEditTree *LCDKeyString()
|
|---|
| 3549 | {
|
|---|
| 3550 | - HostLineEdit *ge = new HostLineEdit("LCDKeyString");
|
|---|
| 3551 | + HostLineEditTree *ge = new HostLineEditTree("LCDKeyString");
|
|---|
| 3552 | ge->setLabel(QObject::tr("LCD key order"));
|
|---|
| 3553 | ge->setValue("ABCDEF");
|
|---|
| 3554 | ge->setHelpText(QObject::tr("Enter the 6 Keypad Return Codes for your "
|
|---|
| 3555 | @@ -2972,67 +3775,36 @@ static HostLineEdit *LCDKeyString()
|
|---|
| 3556 | return ge;
|
|---|
| 3557 | }
|
|---|
| 3558 |
|
|---|
| 3559 | -static HostCheckBox *LCDEnable()
|
|---|
| 3560 | +static HostCheckBoxTree *LCDEnable()
|
|---|
| 3561 | {
|
|---|
| 3562 | - HostCheckBox *gc = new HostCheckBox("LCDEnable");
|
|---|
| 3563 | + HostCheckBoxTree *gc = new HostCheckBoxTree("LCDEnable");
|
|---|
| 3564 | gc->setLabel(QObject::tr("Enable LCD device"));
|
|---|
| 3565 | gc->setHelpText(QObject::tr("Use an LCD display to view MythTV status "
|
|---|
| 3566 | "information."));
|
|---|
| 3567 | +
|
|---|
| 3568 | + gc->addChild(true, LCDShowTime());
|
|---|
| 3569 | + gc->addChild(true, LCDShowMenu());
|
|---|
| 3570 | + gc->addChild(true, LCDShowMusic());
|
|---|
| 3571 | + gc->addChild(true, LCDShowMusicItems());
|
|---|
| 3572 | + gc->addChild(true, LCDShowChannel());
|
|---|
| 3573 | + gc->addChild(true, LCDShowRecStatus());
|
|---|
| 3574 | + gc->addChild(true, LCDShowVolume());
|
|---|
| 3575 | + gc->addChild(true, LCDShowGeneric());
|
|---|
| 3576 | + gc->addChild(true, LCDBacklightOn());
|
|---|
| 3577 | + gc->addChild(true, LCDHeartBeatOn());
|
|---|
| 3578 | + gc->addChild(true, LCDBigClock());
|
|---|
| 3579 | + gc->addChild(true, LCDKeyString());;
|
|---|
| 3580 | + gc->addChild(true, LCDPopupTime());
|
|---|
| 3581 | +
|
|---|
| 3582 | gc->setValue(false);
|
|---|
| 3583 | return gc;
|
|---|
| 3584 | }
|
|---|
| 3585 |
|
|---|
| 3586 | -class LcdSettings : public TriggeredConfigurationGroup
|
|---|
| 3587 | -{
|
|---|
| 3588 | - public:
|
|---|
| 3589 | - LcdSettings() : TriggeredConfigurationGroup(false, false, false, false,
|
|---|
| 3590 | - false, false, false, false)
|
|---|
| 3591 | - {
|
|---|
| 3592 | - setLabel(QObject::tr("LCD device display"));
|
|---|
| 3593 | - setUseLabel(false);
|
|---|
| 3594 | -
|
|---|
| 3595 | - Setting* lcd_enable = LCDEnable();
|
|---|
| 3596 | - addChild(lcd_enable);
|
|---|
| 3597 | - setTrigger(lcd_enable);
|
|---|
| 3598 | -
|
|---|
| 3599 | - ConfigurationGroup *settings =
|
|---|
| 3600 | - new VerticalConfigurationGroup(false, true, false, false);
|
|---|
| 3601 | - ConfigurationGroup *setHoriz =
|
|---|
| 3602 | - new HorizontalConfigurationGroup(false, false, false, false);
|
|---|
| 3603 | -
|
|---|
| 3604 | - ConfigurationGroup* setLeft =
|
|---|
| 3605 | - new VerticalConfigurationGroup(false, false, false, false);
|
|---|
| 3606 | - ConfigurationGroup* setRight =
|
|---|
| 3607 | - new VerticalConfigurationGroup(false, false, false, false);
|
|---|
| 3608 | -
|
|---|
| 3609 | - setLeft->addChild(LCDShowTime());
|
|---|
| 3610 | - setLeft->addChild(LCDShowMenu());
|
|---|
| 3611 | - setLeft->addChild(LCDShowMusic());
|
|---|
| 3612 | - setLeft->addChild(LCDShowMusicItems());
|
|---|
| 3613 | - setLeft->addChild(LCDShowChannel());
|
|---|
| 3614 | - setLeft->addChild(LCDShowRecStatus());
|
|---|
| 3615 | - setRight->addChild(LCDShowVolume());
|
|---|
| 3616 | - setRight->addChild(LCDShowGeneric());
|
|---|
| 3617 | - setRight->addChild(LCDBacklightOn());
|
|---|
| 3618 | - setRight->addChild(LCDHeartBeatOn());
|
|---|
| 3619 | - setRight->addChild(LCDBigClock());
|
|---|
| 3620 | - setRight->addChild(LCDKeyString());
|
|---|
| 3621 | - setHoriz->addChild(setLeft);
|
|---|
| 3622 | - setHoriz->addChild(setRight);
|
|---|
| 3623 | - settings->addChild(setHoriz);
|
|---|
| 3624 | - settings->addChild(LCDPopupTime());
|
|---|
| 3625 | -
|
|---|
| 3626 | - addTarget("1", settings);
|
|---|
| 3627 | -
|
|---|
| 3628 | - addTarget("0", new VerticalConfigurationGroup(true));
|
|---|
| 3629 | - };
|
|---|
| 3630 | -};
|
|---|
| 3631 | -
|
|---|
| 3632 |
|
|---|
| 3633 | #if CONFIG_DARWIN
|
|---|
| 3634 | -static HostCheckBox *MacGammaCorrect()
|
|---|
| 3635 | +static HostCheckBoxTree *MacGammaCorrect()
|
|---|
| 3636 | {
|
|---|
| 3637 | - HostCheckBox *gc = new HostCheckBox("MacGammaCorrect");
|
|---|
| 3638 | + HostCheckBoxTree *gc = new HostCheckBoxTree("MacGammaCorrect");
|
|---|
| 3639 | gc->setLabel(QObject::tr("Enable gamma correction for video"));
|
|---|
| 3640 | gc->setValue(false);
|
|---|
| 3641 | gc->setHelpText(QObject::tr("If enabled, QuickTime will correct the gamma "
|
|---|
| 3642 | @@ -3041,9 +3813,9 @@ static HostCheckBox *MacGammaCorrect()
|
|---|
| 3643 | return gc;
|
|---|
| 3644 | }
|
|---|
| 3645 |
|
|---|
| 3646 | -static HostCheckBox *MacScaleUp()
|
|---|
| 3647 | +static HostCheckBoxTree *MacScaleUp()
|
|---|
| 3648 | {
|
|---|
| 3649 | - HostCheckBox *gc = new HostCheckBox("MacScaleUp");
|
|---|
| 3650 | + HostCheckBoxTree *gc = new HostCheckBoxTree("MacScaleUp");
|
|---|
| 3651 | gc->setLabel(QObject::tr("Scale video as necessary"));
|
|---|
| 3652 | gc->setValue(true);
|
|---|
| 3653 | gc->setHelpText(QObject::tr("If enabled, video will be scaled to fit your "
|
|---|
| 3654 | @@ -3052,9 +3824,9 @@ static HostCheckBox *MacScaleUp()
|
|---|
| 3655 | return gc;
|
|---|
| 3656 | }
|
|---|
| 3657 |
|
|---|
| 3658 | -static HostSpinBox *MacFullSkip()
|
|---|
| 3659 | +static HostSpinBoxTree *MacFullSkip()
|
|---|
| 3660 | {
|
|---|
| 3661 | - HostSpinBox *gs = new HostSpinBox("MacFullSkip", 0, 30, 1, true);
|
|---|
| 3662 | + HostSpinBoxTree *gs = new HostSpinBoxTree("MacFullSkip", 0, 30, 1, true);
|
|---|
| 3663 | gs->setLabel(QObject::tr("Frames to skip in fullscreen mode"));
|
|---|
| 3664 | gs->setValue(0);
|
|---|
| 3665 | gs->setHelpText(QObject::tr("Video displayed in fullscreen or non-windowed "
|
|---|
| 3666 | @@ -3065,22 +3837,9 @@ static HostSpinBox *MacFullSkip()
|
|---|
| 3667 | return gs;
|
|---|
| 3668 | }
|
|---|
| 3669 |
|
|---|
| 3670 | -static HostCheckBox *MacMainEnabled()
|
|---|
| 3671 | +static HostSpinBoxTree *MacMainSkip()
|
|---|
| 3672 | {
|
|---|
| 3673 | - HostCheckBox *gc = new HostCheckBox("MacMainEnabled");
|
|---|
| 3674 | - gc->setLabel(QObject::tr("Video in main window"));
|
|---|
| 3675 | - gc->setValue(true);
|
|---|
| 3676 | - gc->setHelpText(QObject::tr("If enabled, video will be displayed in the "
|
|---|
| 3677 | - "main GUI window. Disable this when you only want video "
|
|---|
| 3678 | - "on the desktop or in a floating window. Only valid when "
|
|---|
| 3679 | - "\"Use GUI size for TV playback\" and \"Run the "
|
|---|
| 3680 | - "frontend in a window\" are checked."));
|
|---|
| 3681 | - return gc;
|
|---|
| 3682 | -}
|
|---|
| 3683 | -
|
|---|
| 3684 | -static HostSpinBox *MacMainSkip()
|
|---|
| 3685 | -{
|
|---|
| 3686 | - HostSpinBox *gs = new HostSpinBox("MacMainSkip", 0, 30, 1, true);
|
|---|
| 3687 | + HostSpinBoxTree *gs = new HostSpinBoxTree("MacMainSkip", 0, 30, 1, true);
|
|---|
| 3688 | gs->setLabel(QObject::tr("Frames to skip"));
|
|---|
| 3689 | gs->setValue(0);
|
|---|
| 3690 | gs->setHelpText(QObject::tr("Video in the main window will skip this many "
|
|---|
| 3691 | @@ -3089,9 +3848,9 @@ static HostSpinBox *MacMainSkip()
|
|---|
| 3692 | return gs;
|
|---|
| 3693 | }
|
|---|
| 3694 |
|
|---|
| 3695 | -static HostSpinBox *MacMainOpacity()
|
|---|
| 3696 | +static HostSpinBoxTree *MacMainOpacity()
|
|---|
| 3697 | {
|
|---|
| 3698 | - HostSpinBox *gs = new HostSpinBox("MacMainOpacity", 0, 100, 5, false);
|
|---|
| 3699 | + HostSpinBoxTree *gs = new HostSpinBoxTree("MacMainOpacity", 0, 100, 5, false);
|
|---|
| 3700 | gs->setLabel(QObject::tr("Opacity"));
|
|---|
| 3701 | gs->setValue(100);
|
|---|
| 3702 | gs->setHelpText(QObject::tr("The opacity of the main window. Set to "
|
|---|
| 3703 | @@ -3100,36 +3859,18 @@ static HostSpinBox *MacMainOpacity()
|
|---|
| 3704 | return gs;
|
|---|
| 3705 | }
|
|---|
| 3706 |
|
|---|
| 3707 | -class MacMainSettings : public TriggeredConfigurationGroup
|
|---|
| 3708 | -{
|
|---|
| 3709 | - public:
|
|---|
| 3710 | - MacMainSettings() : TriggeredConfigurationGroup(false)
|
|---|
| 3711 | - {
|
|---|
| 3712 | - setLabel(QObject::tr("Video in main window"));
|
|---|
| 3713 | - setUseLabel(false);
|
|---|
| 3714 | - Setting *gc = MacMainEnabled();
|
|---|
| 3715 | - addChild(gc);
|
|---|
| 3716 | - setTrigger(gc);
|
|---|
| 3717 | -
|
|---|
| 3718 | - VerticalConfigurationGroup *opts =
|
|---|
| 3719 | - new VerticalConfigurationGroup(false, false);
|
|---|
| 3720 | - opts->addChild(MacMainSkip());
|
|---|
| 3721 | - opts->addChild(MacMainOpacity());
|
|---|
| 3722 | -
|
|---|
| 3723 | - addTarget("1", opts);
|
|---|
| 3724 | - addTarget("0", new VerticalConfigurationGroup(false, false));
|
|---|
| 3725 | - }
|
|---|
| 3726 | -};
|
|---|
| 3727 | -
|
|---|
| 3728 | -static HostCheckBox *MacFloatEnabled()
|
|---|
| 3729 | +static HostCheckBoxTree *MacMainEnabled()
|
|---|
| 3730 | {
|
|---|
| 3731 | - HostCheckBox *gc = new HostCheckBox("MacFloatEnabled");
|
|---|
| 3732 | - gc->setLabel(QObject::tr("Video in floating window"));
|
|---|
| 3733 | - gc->setValue(false);
|
|---|
| 3734 | - gc->setHelpText(QObject::tr("If enabled, video will be displayed in a "
|
|---|
| 3735 | - "floating window. Only valid when \"Use GUI size for TV "
|
|---|
| 3736 | - "playback\" and \"Run the frontend in a window\" are "
|
|---|
| 3737 | - "checked."));
|
|---|
| 3738 | + HostCheckBoxTree *gc = new HostCheckBoxTree("MacMainEnabled");
|
|---|
| 3739 | + gc->setLabel(QObject::tr("Video in main window"));
|
|---|
| 3740 | + gc->setValue(true);
|
|---|
| 3741 | + gc->setHelpText(QObject::tr("If enabled, video will be displayed in the "
|
|---|
| 3742 | + "main GUI window. Disable this when you only want video "
|
|---|
| 3743 | + "on the desktop or in a floating window. Only valid when "
|
|---|
| 3744 | + "\"Use GUI size for TV playback\" and \"Run the "
|
|---|
| 3745 | + "frontend in a window\" are checked."));
|
|---|
| 3746 | + gc->addChild(true, MacMainSkip());
|
|---|
| 3747 | + gc->addChild(true, MacMainOpacity());
|
|---|
| 3748 | return gc;
|
|---|
| 3749 | }
|
|---|
| 3750 |
|
|---|
| 3751 | @@ -3155,36 +3896,18 @@ static HostSpinBox *MacFloatOpacity()
|
|---|
| 3752 | return gs;
|
|---|
| 3753 | }
|
|---|
| 3754 |
|
|---|
| 3755 | -class MacFloatSettings : public TriggeredConfigurationGroup
|
|---|
| 3756 | +static HostCheckBox *MacFloatEnabled()
|
|---|
| 3757 | {
|
|---|
| 3758 | - public:
|
|---|
| 3759 | - MacFloatSettings() : TriggeredConfigurationGroup(false)
|
|---|
| 3760 | - {
|
|---|
| 3761 | - setLabel(QObject::tr("Video in floating window"));
|
|---|
| 3762 | - setUseLabel(false);
|
|---|
| 3763 | - Setting *gc = MacFloatEnabled();
|
|---|
| 3764 | - addChild(gc);
|
|---|
| 3765 | - setTrigger(gc);
|
|---|
| 3766 | -
|
|---|
| 3767 | - VerticalConfigurationGroup *opts =
|
|---|
| 3768 | - new VerticalConfigurationGroup(false, false);
|
|---|
| 3769 | - opts->addChild(MacFloatSkip());
|
|---|
| 3770 | - opts->addChild(MacFloatOpacity());
|
|---|
| 3771 | -
|
|---|
| 3772 | - addTarget("1", opts);
|
|---|
| 3773 | - addTarget("0", new VerticalConfigurationGroup(false, false));
|
|---|
| 3774 | - }
|
|---|
| 3775 | -};
|
|---|
| 3776 | + HostCheckBox *gc = new HostCheckBox("MacFloatEnabled");
|
|---|
| 3777 | + gc->setLabel(QObject::tr("Video in floating window"));
|
|---|
| 3778 | + gc->setValue(false);
|
|---|
| 3779 | + gc->setHelpText(QObject::tr("If enabled, video will be displayed in a "
|
|---|
| 3780 | + "floating window. Only valid when \"Use GUI size for TV "
|
|---|
| 3781 | + "playback\" and \"Run the frontend in a window\" are "
|
|---|
| 3782 | + "checked."));
|
|---|
| 3783 |
|
|---|
| 3784 | -static HostCheckBox *MacDockEnabled()
|
|---|
| 3785 | -{
|
|---|
| 3786 | - HostCheckBox *gc = new HostCheckBox("MacDockEnabled");
|
|---|
| 3787 | - gc->setLabel(QObject::tr("Video in the dock"));
|
|---|
| 3788 | - gc->setValue(true);
|
|---|
| 3789 | - gc->setHelpText(QObject::tr("If enabled, video will be displayed in the "
|
|---|
| 3790 | - "application's dock icon. Only valid when \"Use GUI size "
|
|---|
| 3791 | - "for TV playback\" and \"Run the frontend in a window\" "
|
|---|
| 3792 | - "are checked."));
|
|---|
| 3793 | + gc->addChild(true, MacFloatSkip());
|
|---|
| 3794 | + gc->addChild(true, MacFloatOpacity());
|
|---|
| 3795 | return gc;
|
|---|
| 3796 | }
|
|---|
| 3797 |
|
|---|
| 3798 | @@ -3199,32 +3922,17 @@ static HostSpinBox *MacDockSkip()
|
|---|
| 3799 | return gs;
|
|---|
| 3800 | }
|
|---|
| 3801 |
|
|---|
| 3802 | -class MacDockSettings : public TriggeredConfigurationGroup
|
|---|
| 3803 | +static HostCheckBox *MacDockEnabled()
|
|---|
| 3804 | {
|
|---|
| 3805 | - public:
|
|---|
| 3806 | - MacDockSettings() : TriggeredConfigurationGroup(false)
|
|---|
| 3807 | - {
|
|---|
| 3808 | - setLabel(QObject::tr("Video in the dock"));
|
|---|
| 3809 | - setUseLabel(false);
|
|---|
| 3810 | - Setting *gc = MacDockEnabled();
|
|---|
| 3811 | - addChild(gc);
|
|---|
| 3812 | - setTrigger(gc);
|
|---|
| 3813 | -
|
|---|
| 3814 | - Setting *skip = MacDockSkip();
|
|---|
| 3815 | - addTarget("1", skip);
|
|---|
| 3816 | - addTarget("0", new HorizontalConfigurationGroup(false, false));
|
|---|
| 3817 | - }
|
|---|
| 3818 | -};
|
|---|
| 3819 | + HostCheckBox *gc = new HostCheckBox("MacDockEnabled");
|
|---|
| 3820 | + gc->setLabel(QObject::tr("Video in the dock"));
|
|---|
| 3821 | + gc->setValue(true);
|
|---|
| 3822 | + gc->setHelpText(QObject::tr("If enabled, video will be displayed in the "
|
|---|
| 3823 | + "application's dock icon. Only valid when \"Use GUI size "
|
|---|
| 3824 | + "for TV playback\" and \"Run the frontend in a window\" "
|
|---|
| 3825 | + "are checked."));
|
|---|
| 3826 |
|
|---|
| 3827 | -static HostCheckBox *MacDesktopEnabled()
|
|---|
| 3828 | -{
|
|---|
| 3829 | - HostCheckBox *gc = new HostCheckBox("MacDesktopEnabled");
|
|---|
| 3830 | - gc->setLabel(QObject::tr("Video on the desktop"));
|
|---|
| 3831 | - gc->setValue(false);
|
|---|
| 3832 | - gc->setHelpText(QObject::tr("If enabled, video will be displayed on the "
|
|---|
| 3833 | - "desktop, behind the Finder icons. Only valid when \"Use "
|
|---|
| 3834 | - "GUI size for TV playback\" and \"Run the frontend in a "
|
|---|
| 3835 | - "window\" are checked."));
|
|---|
| 3836 | + gc->addChild(true, MacDockSkip());
|
|---|
| 3837 | return gc;
|
|---|
| 3838 | }
|
|---|
| 3839 |
|
|---|
| 3840 | @@ -3239,27 +3947,25 @@ static HostSpinBox *MacDesktopSkip()
|
|---|
| 3841 | return gs;
|
|---|
| 3842 | }
|
|---|
| 3843 |
|
|---|
| 3844 | -class MacDesktopSettings : public TriggeredConfigurationGroup
|
|---|
| 3845 | +static HostCheckBox *MacDesktopEnabled()
|
|---|
| 3846 | {
|
|---|
| 3847 | - public:
|
|---|
| 3848 | - MacDesktopSettings() : TriggeredConfigurationGroup(false)
|
|---|
| 3849 | - {
|
|---|
| 3850 | - setLabel(QObject::tr("Video on the desktop"));
|
|---|
| 3851 | - setUseLabel(false);
|
|---|
| 3852 | - Setting *gc = MacDesktopEnabled();
|
|---|
| 3853 | - addChild(gc);
|
|---|
| 3854 | - setTrigger(gc);
|
|---|
| 3855 | -
|
|---|
| 3856 | - Setting *skip = MacDesktopSkip();
|
|---|
| 3857 | - addTarget("1", skip);
|
|---|
| 3858 | - addTarget("0", new HorizontalConfigurationGroup(false, false));
|
|---|
| 3859 | - }
|
|---|
| 3860 | -};
|
|---|
| 3861 | + HostCheckBox *gc = new HostCheckBox("MacDesktopEnabled");
|
|---|
| 3862 | + gc->setLabel(QObject::tr("Video on the desktop"));
|
|---|
| 3863 | + gc->setValue(false);
|
|---|
| 3864 | + gc->setHelpText(QObject::tr("If enabled, video will be displayed on the "
|
|---|
| 3865 | + "desktop, behind the Finder icons. Only valid when \"Use "
|
|---|
| 3866 | + "GUI size for TV playback\" and \"Run the frontend in a "
|
|---|
| 3867 | + "window\" are checked."));
|
|---|
| 3868 | +
|
|---|
| 3869 | + gc->addChild(true, MacDesktopSkip());
|
|---|
| 3870 | + return gc;
|
|---|
| 3871 | +}
|
|---|
| 3872 | +
|
|---|
| 3873 | #endif
|
|---|
| 3874 |
|
|---|
| 3875 | -static HostCheckBox *WatchTVGuide()
|
|---|
| 3876 | +static HostCheckBoxTree *WatchTVGuide()
|
|---|
| 3877 | {
|
|---|
| 3878 | - HostCheckBox *gc = new HostCheckBox("WatchTVGuide");
|
|---|
| 3879 | + HostCheckBoxTree *gc = new HostCheckBoxTree("WatchTVGuide");
|
|---|
| 3880 | gc->setLabel(QObject::tr("Show the program guide when starting Live TV"));
|
|---|
| 3881 | gc->setHelpText(QObject::tr("This starts the program guide immediately "
|
|---|
| 3882 | "upon starting to watch Live TV."));
|
|---|
| 3883 | @@ -3269,119 +3975,72 @@ static HostCheckBox *WatchTVGuide()
|
|---|
| 3884 |
|
|---|
| 3885 | MainGeneralSettings::MainGeneralSettings()
|
|---|
| 3886 | {
|
|---|
| 3887 | - DatabaseSettings::addDatabaseSettings(this);
|
|---|
| 3888 | + setLabel(QObject::tr("General"));
|
|---|
| 3889 |
|
|---|
| 3890 | - VerticalConfigurationGroup *pin =
|
|---|
| 3891 | - new VerticalConfigurationGroup(false, true, false, false);
|
|---|
| 3892 | + addChild(new MythDbSettings());
|
|---|
| 3893 | +
|
|---|
| 3894 | + GroupSetting *pin = new GroupSetting();
|
|---|
| 3895 | pin->setLabel(QObject::tr("Settings Access"));
|
|---|
| 3896 | pin->addChild(SetupPinCodeRequired());
|
|---|
| 3897 | pin->addChild(SetupPinCode());
|
|---|
| 3898 | addChild(pin);
|
|---|
| 3899 |
|
|---|
| 3900 | - VerticalConfigurationGroup *general =
|
|---|
| 3901 | - new VerticalConfigurationGroup(false, true, false, false);
|
|---|
| 3902 | + GroupSetting *general = new GroupSetting();
|
|---|
| 3903 | general->setLabel(QObject::tr("General"));
|
|---|
| 3904 | general->addChild(UseVirtualKeyboard());
|
|---|
| 3905 | general->addChild(ScreenShotPath());
|
|---|
| 3906 | addChild(general);
|
|---|
| 3907 |
|
|---|
| 3908 | - VerticalConfigurationGroup *media =
|
|---|
| 3909 | - new VerticalConfigurationGroup(false, true, false, false);
|
|---|
| 3910 | - media->setLabel(QObject::tr("Media Monitor"));
|
|---|
| 3911 | - MythMediaSettings *mediaMon = new MythMediaSettings();
|
|---|
| 3912 | - media->addChild(mediaMon);
|
|---|
| 3913 | - addChild(media);
|
|---|
| 3914 | + addChild(EnableMediaMon());
|
|---|
| 3915 |
|
|---|
| 3916 | - VerticalConfigurationGroup *shutdownSettings =
|
|---|
| 3917 | - new VerticalConfigurationGroup(true, true, false, false);
|
|---|
| 3918 | + GroupSetting *shutdownSettings = new GroupSetting();
|
|---|
| 3919 | shutdownSettings->setLabel(QObject::tr("Shutdown/Reboot Settings"));
|
|---|
| 3920 | shutdownSettings->addChild(OverrideExitMenu());
|
|---|
| 3921 | shutdownSettings->addChild(HaltCommand());
|
|---|
| 3922 | shutdownSettings->addChild(RebootCommand());
|
|---|
| 3923 | addChild(shutdownSettings);
|
|---|
| 3924 |
|
|---|
| 3925 | - VerticalConfigurationGroup *remotecontrol =
|
|---|
| 3926 | - new VerticalConfigurationGroup(false, true, false, false);
|
|---|
| 3927 | + GroupSetting *remotecontrol = new GroupSetting();
|
|---|
| 3928 | remotecontrol->setLabel(QObject::tr("Remote Control"));
|
|---|
| 3929 | remotecontrol->addChild(LircDaemonDevice());
|
|---|
| 3930 | remotecontrol->addChild(NetworkControlEnabled());
|
|---|
| 3931 | - remotecontrol->addChild(NetworkControlPort());
|
|---|
| 3932 | remotecontrol->addChild(UDPNotifyPort());
|
|---|
| 3933 | addChild(remotecontrol);
|
|---|
| 3934 | }
|
|---|
| 3935 |
|
|---|
| 3936 | PlaybackSettings::PlaybackSettings()
|
|---|
| 3937 | {
|
|---|
| 3938 | - uint i = 0, total = 8;
|
|---|
| 3939 | -#if CONFIG_DARWIN
|
|---|
| 3940 | - total += 2;
|
|---|
| 3941 | -#endif // USING_DARWIN
|
|---|
| 3942 | -
|
|---|
| 3943 | -
|
|---|
| 3944 | - VerticalConfigurationGroup* general1 =
|
|---|
| 3945 | - new VerticalConfigurationGroup(false);
|
|---|
| 3946 | - general1->setLabel(QObject::tr("General Playback") +
|
|---|
| 3947 | - QString(" (%1/%2)").arg(++i).arg(total));
|
|---|
| 3948 | -
|
|---|
| 3949 | - HorizontalConfigurationGroup *columns =
|
|---|
| 3950 | - new HorizontalConfigurationGroup(false, false, true, true);
|
|---|
| 3951 | -
|
|---|
| 3952 | - VerticalConfigurationGroup *column1 =
|
|---|
| 3953 | - new VerticalConfigurationGroup(false, false, true, true);
|
|---|
| 3954 | - column1->addChild(RealtimePriority());
|
|---|
| 3955 | - column1->addChild(DecodeExtraAudio());
|
|---|
| 3956 | - column1->addChild(JumpToProgramOSD());
|
|---|
| 3957 | - columns->addChild(column1);
|
|---|
| 3958 | -
|
|---|
| 3959 | - VerticalConfigurationGroup *column2 =
|
|---|
| 3960 | - new VerticalConfigurationGroup(false, false, true, true);
|
|---|
| 3961 | - column2->addChild(ClearSavedPosition());
|
|---|
| 3962 | - column2->addChild(AltClearSavedPosition());
|
|---|
| 3963 | - column2->addChild(AutomaticSetWatched());
|
|---|
| 3964 | - column2->addChild(ContinueEmbeddedTVPlay());
|
|---|
| 3965 | - columns->addChild(column2);
|
|---|
| 3966 | -
|
|---|
| 3967 | - general1->addChild(columns);
|
|---|
| 3968 | - general1->addChild(LiveTVIdleTimeout());
|
|---|
| 3969 | - addChild(general1);
|
|---|
| 3970 | -
|
|---|
| 3971 | - VerticalConfigurationGroup* general2 =
|
|---|
| 3972 | - new VerticalConfigurationGroup(false);
|
|---|
| 3973 | - general2->setLabel(QObject::tr("General Playback") +
|
|---|
| 3974 | - QString(" (%1/%2)").arg(++i).arg(total));
|
|---|
| 3975 | -
|
|---|
| 3976 | - HorizontalConfigurationGroup* oscan =
|
|---|
| 3977 | - new HorizontalConfigurationGroup(false, false, true, true);
|
|---|
| 3978 | - VerticalConfigurationGroup *ocol1 =
|
|---|
| 3979 | - new VerticalConfigurationGroup(false, false, true, true);
|
|---|
| 3980 | - VerticalConfigurationGroup *ocol2 =
|
|---|
| 3981 | - new VerticalConfigurationGroup(false, false, true, true);
|
|---|
| 3982 | - ocol1->addChild(VertScanPercentage());
|
|---|
| 3983 | - ocol1->addChild(YScanDisplacement());
|
|---|
| 3984 | - ocol2->addChild(HorizScanPercentage());
|
|---|
| 3985 | - ocol2->addChild(XScanDisplacement());
|
|---|
| 3986 | - oscan->addChild(ocol1);
|
|---|
| 3987 | - oscan->addChild(ocol2);
|
|---|
| 3988 | -
|
|---|
| 3989 | - HorizontalConfigurationGroup* aspect_fill =
|
|---|
| 3990 | - new HorizontalConfigurationGroup(false, false, true, true);
|
|---|
| 3991 | - aspect_fill->addChild(AspectOverride());
|
|---|
| 3992 | - aspect_fill->addChild(AdjustFill());
|
|---|
| 3993 | -
|
|---|
| 3994 | - general2->addChild(oscan);
|
|---|
| 3995 | - general2->addChild(aspect_fill);
|
|---|
| 3996 | - general2->addChild(LetterboxingColour());
|
|---|
| 3997 | - general2->addChild(PIPLocationComboBox());
|
|---|
| 3998 | - general2->addChild(PlaybackExitPrompt());
|
|---|
| 3999 | - general2->addChild(EndOfRecordingExitPrompt());
|
|---|
| 4000 | - addChild(general2);
|
|---|
| 4001 | + setLabel(QObject::tr("Playback"));
|
|---|
| 4002 | + GroupSetting * general = new GroupSetting();
|
|---|
| 4003 | + general->setLabel(QObject::tr("General Playback"));
|
|---|
| 4004 | + general->addChild(RealtimePriority());
|
|---|
| 4005 | + general->addChild(DecodeExtraAudio());
|
|---|
| 4006 | + general->addChild(JumpToProgramOSD());
|
|---|
| 4007 | + general->addChild(ClearSavedPosition());
|
|---|
| 4008 | + general->addChild(AltClearSavedPosition());
|
|---|
| 4009 | + general->addChild(AutomaticSetWatched());
|
|---|
| 4010 | + general->addChild(ContinueEmbeddedTVPlay());
|
|---|
| 4011 | + general->addChild(LiveTVIdleTimeout());
|
|---|
| 4012 | + general->addChild(VertScanPercentage());
|
|---|
| 4013 | + general->addChild(HorizScanPercentage());
|
|---|
| 4014 | + general->addChild(YScanDisplacement());
|
|---|
| 4015 | + general->addChild(XScanDisplacement());
|
|---|
| 4016 | + general->addChild(AspectOverride());
|
|---|
| 4017 | + general->addChild(AdjustFill());
|
|---|
| 4018 | + general->addChild(LetterboxingColour());
|
|---|
| 4019 | + general->addChild(PIPLocationComboBox());
|
|---|
| 4020 | + general->addChild(PlaybackExitPrompt());
|
|---|
| 4021 | + general->addChild(EndOfRecordingExitPrompt());
|
|---|
| 4022 | + addChild(general);
|
|---|
| 4023 |
|
|---|
| 4024 | - QString tmp = QString(" (%1/%2)").arg(++i).arg(total);
|
|---|
| 4025 | - addChild(new PlaybackProfileConfigs(tmp));
|
|---|
| 4026 | + //QString tmp = QString(" (%1/%2)").arg(++i).arg(total);
|
|---|
| 4027 | + //addChild(new GroupSetting("PlaybackProfileConfigs TODO"));
|
|---|
| 4028 | + //TODO addChild(new PlaybackProfileConfigs(tmp));
|
|---|
| 4029 | + addChild(new PlaybackProfileConfigs());
|
|---|
| 4030 | + //addChild(new PlaybackProfileConfigsTree());
|
|---|
| 4031 |
|
|---|
| 4032 | - VerticalConfigurationGroup* pbox = new VerticalConfigurationGroup(false);
|
|---|
| 4033 | - pbox->setLabel(QObject::tr("View Recordings") +
|
|---|
| 4034 | - QString(" (%1/%2)").arg(++i).arg(total));
|
|---|
| 4035 | + GroupSetting* pbox = new GroupSetting();
|
|---|
| 4036 | + pbox->setLabel(QObject::tr("View Recordings"));
|
|---|
| 4037 | pbox->addChild(PlayBoxOrdering());
|
|---|
| 4038 | pbox->addChild(PlayBoxEpisodeSort());
|
|---|
| 4039 | // Disabled until we re-enable live previews
|
|---|
| 4040 | @@ -3390,34 +4049,30 @@ PlaybackSettings::PlaybackSettings()
|
|---|
| 4041 | pbox->addChild(PBBStartInTitle());
|
|---|
| 4042 | addChild(pbox);
|
|---|
| 4043 |
|
|---|
| 4044 | - VerticalConfigurationGroup* pbox2 = new VerticalConfigurationGroup(false);
|
|---|
| 4045 | - pbox2->setLabel(QObject::tr("Recording Groups") +
|
|---|
| 4046 | - QString(" (%1/%2)").arg(++i).arg(total));
|
|---|
| 4047 | + GroupSetting* pbox2 = new GroupSetting();
|
|---|
| 4048 | + pbox2->setLabel(QObject::tr("Recording Groups"));
|
|---|
| 4049 | pbox2->addChild(DisplayRecGroup());
|
|---|
| 4050 | pbox2->addChild(QueryInitialFilter());
|
|---|
| 4051 | pbox2->addChild(RememberRecGroup());
|
|---|
| 4052 | pbox2->addChild(UseGroupNameAsAllPrograms());
|
|---|
| 4053 | addChild(pbox2);
|
|---|
| 4054 |
|
|---|
| 4055 | - VerticalConfigurationGroup* pbox3 = new VerticalConfigurationGroup(false);
|
|---|
| 4056 | - pbox3->setLabel(QObject::tr("View Recordings") +
|
|---|
| 4057 | - QString(" (%1/%2)").arg(++i).arg(total));
|
|---|
| 4058 | + GroupSetting* pbox3 = new GroupSetting();
|
|---|
| 4059 | + pbox3->setLabel(QObject::tr("View Recordings"));
|
|---|
| 4060 | pbox3->addChild(DisplayGroupTitleSort());
|
|---|
| 4061 | - pbox3->addChild(new WatchListSettings());
|
|---|
| 4062 | + addChild(PlaybackWatchList());
|
|---|
| 4063 | addChild(pbox3);
|
|---|
| 4064 |
|
|---|
| 4065 | - VerticalConfigurationGroup* seek = new VerticalConfigurationGroup(false);
|
|---|
| 4066 | - seek->setLabel(QObject::tr("Seeking") +
|
|---|
| 4067 | - QString(" (%1/%2)").arg(++i).arg(total));
|
|---|
| 4068 | + GroupSetting* seek = new GroupSetting();
|
|---|
| 4069 | + seek->setLabel(QObject::tr("Seeking"));
|
|---|
| 4070 | seek->addChild(SmartForward());
|
|---|
| 4071 | seek->addChild(FFRewReposTime());
|
|---|
| 4072 | seek->addChild(FFRewReverse());
|
|---|
| 4073 | seek->addChild(ExactSeeking());
|
|---|
| 4074 | addChild(seek);
|
|---|
| 4075 |
|
|---|
| 4076 | - VerticalConfigurationGroup* comms = new VerticalConfigurationGroup(false);
|
|---|
| 4077 | - comms->setLabel(QObject::tr("Commercial Skip") +
|
|---|
| 4078 | - QString(" (%1/%2)").arg(++i).arg(total));
|
|---|
| 4079 | + GroupSetting* comms = new GroupSetting();
|
|---|
| 4080 | + comms->setLabel(QObject::tr("Commercial Skip"));
|
|---|
| 4081 | comms->addChild(AutoCommercialSkip());
|
|---|
| 4082 | comms->addChild(CommRewindAmount());
|
|---|
| 4083 | comms->addChild(CommNotifyAmount());
|
|---|
| 4084 | @@ -3426,45 +4081,32 @@ PlaybackSettings::PlaybackSettings()
|
|---|
| 4085 | addChild(comms);
|
|---|
| 4086 |
|
|---|
| 4087 | #if CONFIG_DARWIN
|
|---|
| 4088 | - VerticalConfigurationGroup* mac1 = new VerticalConfigurationGroup(false);
|
|---|
| 4089 | - mac1->setLabel(QObject::tr("Mac OS X Video Settings") +
|
|---|
| 4090 | - QString(" (%1/%2)").arg(++i).arg(total));
|
|---|
| 4091 | - mac1->addChild(MacGammaCorrect());
|
|---|
| 4092 | - mac1->addChild(MacScaleUp());
|
|---|
| 4093 | - mac1->addChild(MacFullSkip());
|
|---|
| 4094 | - addChild(mac1);
|
|---|
| 4095 | -
|
|---|
| 4096 | - VerticalConfigurationGroup* mac2 = new VerticalConfigurationGroup(false);
|
|---|
| 4097 | - mac2->setLabel(QObject::tr("Mac OS X Video Settings") +
|
|---|
| 4098 | - QString(" (%1/%2)").arg(++i).arg(total));
|
|---|
| 4099 | - mac2->addChild(new MacMainSettings());
|
|---|
| 4100 | - mac2->addChild(new MacFloatSettings());
|
|---|
| 4101 | -
|
|---|
| 4102 | - HorizontalConfigurationGroup *row =
|
|---|
| 4103 | - new HorizontalConfigurationGroup(false, false, true, true);
|
|---|
| 4104 | - row->addChild(new MacDockSettings());
|
|---|
| 4105 | - row->addChild(new MacDesktopSettings());
|
|---|
| 4106 | - mac2->addChild(row);
|
|---|
| 4107 | -
|
|---|
| 4108 | + GroupSetting* mac = new GroupSetting();
|
|---|
| 4109 | + mac->setLabel(QObject::tr("Mac OS X Video Settings"));
|
|---|
| 4110 | + mac->addChild(MacGammaCorrect());
|
|---|
| 4111 | + mac->addChild(MacScaleUp());
|
|---|
| 4112 | + mac->addChild(MacFullSkip());
|
|---|
| 4113 | + mac->addChild(MacMainEnabled());
|
|---|
| 4114 | + mac->addChild(MacFloatEnabled());
|
|---|
| 4115 | + mac->addChild(MacDockEnabled());
|
|---|
| 4116 | + mac->addChild(MacDesktopSettings());
|
|---|
| 4117 | addChild(mac2);
|
|---|
| 4118 | #endif
|
|---|
| 4119 | }
|
|---|
| 4120 |
|
|---|
| 4121 | OSDSettings::OSDSettings()
|
|---|
| 4122 | {
|
|---|
| 4123 | - VerticalConfigurationGroup* osd = new VerticalConfigurationGroup(false);
|
|---|
| 4124 | - osd->setLabel(QObject::tr("On-screen Display"));
|
|---|
| 4125 | + setLabel(QObject::tr("On-screen Display"));
|
|---|
| 4126 |
|
|---|
| 4127 | - osd->addChild(EnableMHEG());
|
|---|
| 4128 | - osd->addChild(PersistentBrowseMode());
|
|---|
| 4129 | - osd->addChild(BrowseAllTuners());
|
|---|
| 4130 | - osd->addChild(CCBackground());
|
|---|
| 4131 | - osd->addChild(DefaultCCMode());
|
|---|
| 4132 | - osd->addChild(PreferCC708());
|
|---|
| 4133 | - osd->addChild(SubtitleFont());
|
|---|
| 4134 | - osd->addChild(OSDCC708TextZoomPercentage());
|
|---|
| 4135 | - osd->addChild(SubtitleCodec());
|
|---|
| 4136 | - addChild(osd);
|
|---|
| 4137 | + addChild(EnableMHEG());
|
|---|
| 4138 | + addChild(PersistentBrowseMode());
|
|---|
| 4139 | + addChild(BrowseAllTuners());
|
|---|
| 4140 | + addChild(CCBackground());
|
|---|
| 4141 | + addChild(DefaultCCMode());
|
|---|
| 4142 | + addChild(PreferCC708());
|
|---|
| 4143 | + addChild(SubtitleFont());
|
|---|
| 4144 | + addChild(OSDCC708TextZoomPercentage());
|
|---|
| 4145 | + addChild(SubtitleCodec());
|
|---|
| 4146 |
|
|---|
| 4147 | //VerticalConfigurationGroup *cc = new VerticalConfigurationGroup(false);
|
|---|
| 4148 | //cc->setLabel(QObject::tr("Closed Captions"));
|
|---|
| 4149 | @@ -3479,8 +4121,9 @@ OSDSettings::OSDSettings()
|
|---|
| 4150 |
|
|---|
| 4151 | GeneralSettings::GeneralSettings()
|
|---|
| 4152 | {
|
|---|
| 4153 | - VerticalConfigurationGroup* general = new VerticalConfigurationGroup(false);
|
|---|
| 4154 | - general->setLabel(QObject::tr("General (Basic)"));
|
|---|
| 4155 | + setLabel(QObject::tr("General"));
|
|---|
| 4156 | + GroupSetting* general = new GroupSetting();
|
|---|
| 4157 | + general->setLabel(QObject::tr("Basic"));
|
|---|
| 4158 | general->addChild(ChannelOrdering());
|
|---|
| 4159 | general->addChild(ChannelFormat());
|
|---|
| 4160 | general->addChild(LongChannelFormat());
|
|---|
| 4161 | @@ -3488,91 +4131,68 @@ GeneralSettings::GeneralSettings()
|
|---|
| 4162 | general->addChild(LiveTVPriority());
|
|---|
| 4163 | addChild(general);
|
|---|
| 4164 |
|
|---|
| 4165 | - VerticalConfigurationGroup* autoexp = new VerticalConfigurationGroup(false);
|
|---|
| 4166 | - autoexp->setLabel(QObject::tr("General (Auto-Expire)"));
|
|---|
| 4167 | + GroupSetting* autoexp = new GroupSetting();
|
|---|
| 4168 | + autoexp->setLabel(QObject::tr("Auto-Expire"));
|
|---|
| 4169 | autoexp->addChild(AutoExpireMethod());
|
|---|
| 4170 | -
|
|---|
| 4171 | - VerticalConfigurationGroup *expgrp0 =
|
|---|
| 4172 | - new VerticalConfigurationGroup(false, false, true, true);
|
|---|
| 4173 | - expgrp0->addChild(AutoExpireDefault());
|
|---|
| 4174 | - expgrp0->addChild(RerecordWatched());
|
|---|
| 4175 | - expgrp0->addChild(AutoExpireWatchedPriority());
|
|---|
| 4176 | -
|
|---|
| 4177 | - VerticalConfigurationGroup *expgrp1 =
|
|---|
| 4178 | - new VerticalConfigurationGroup(false, false, true, true);
|
|---|
| 4179 | - expgrp1->addChild(AutoExpireLiveTVMaxAge());
|
|---|
| 4180 | - expgrp1->addChild(AutoExpireDayPriority());
|
|---|
| 4181 | - expgrp1->addChild(AutoExpireExtraSpace());
|
|---|
| 4182 | -
|
|---|
| 4183 | - HorizontalConfigurationGroup *expgrp =
|
|---|
| 4184 | - new HorizontalConfigurationGroup(false, false, true, true);
|
|---|
| 4185 | - expgrp->addChild(expgrp0);
|
|---|
| 4186 | - expgrp->addChild(expgrp1);
|
|---|
| 4187 | -
|
|---|
| 4188 | - autoexp->addChild(expgrp);
|
|---|
| 4189 | - autoexp->addChild(new DeletedExpireOptions());
|
|---|
| 4190 | -
|
|---|
| 4191 | + autoexp->addChild(AutoExpireDefault());
|
|---|
| 4192 | + autoexp->addChild(RerecordWatched());
|
|---|
| 4193 | + autoexp->addChild(AutoExpireWatchedPriority());
|
|---|
| 4194 | + autoexp->addChild(AutoExpireLiveTVMaxAge());
|
|---|
| 4195 | + autoexp->addChild(AutoExpireDayPriority());
|
|---|
| 4196 | + autoexp->addChild(AutoExpireExtraSpace());
|
|---|
| 4197 | + autoexp->addChild(AutoExpireInsteadOfDelete());
|
|---|
| 4198 | addChild(autoexp);
|
|---|
| 4199 |
|
|---|
| 4200 | - VerticalConfigurationGroup* jobs = new VerticalConfigurationGroup(false);
|
|---|
| 4201 | - jobs->setLabel(QObject::tr("General (Jobs)"));
|
|---|
| 4202 | + GroupSetting* jobs = new GroupSetting();
|
|---|
| 4203 | + jobs->setLabel(QObject::tr("Jobs"));
|
|---|
| 4204 | jobs->addChild(CommercialSkipMethod());
|
|---|
| 4205 | jobs->addChild(CommFlagFast());
|
|---|
| 4206 | jobs->addChild(AggressiveCommDetect());
|
|---|
| 4207 | jobs->addChild(DefaultTranscoder());
|
|---|
| 4208 | jobs->addChild(DeferAutoTranscodeDays());
|
|---|
| 4209 |
|
|---|
| 4210 | - VerticalConfigurationGroup* autogrp0 =
|
|---|
| 4211 | - new VerticalConfigurationGroup(false, false, true, true);
|
|---|
| 4212 | - autogrp0->addChild(AutoMetadataLookup());
|
|---|
| 4213 | - autogrp0->addChild(AutoCommercialFlag());
|
|---|
| 4214 | - autogrp0->addChild(AutoTranscode());
|
|---|
| 4215 | -
|
|---|
| 4216 | - VerticalConfigurationGroup* autogrp1 =
|
|---|
| 4217 | - new VerticalConfigurationGroup(false, false, true, true);
|
|---|
| 4218 | - autogrp0->addChild(AutoRunUserJob(1));
|
|---|
| 4219 | - autogrp1->addChild(AutoRunUserJob(2));
|
|---|
| 4220 | - autogrp1->addChild(AutoRunUserJob(3));
|
|---|
| 4221 | - autogrp1->addChild(AutoRunUserJob(4));
|
|---|
| 4222 | -
|
|---|
| 4223 | - HorizontalConfigurationGroup *autogrp =
|
|---|
| 4224 | - new HorizontalConfigurationGroup(true, true, false, true);
|
|---|
| 4225 | + GroupSetting* autogrp = new GroupSetting();
|
|---|
| 4226 | autogrp->setLabel(
|
|---|
| 4227 | QObject::tr("Default Job Queue Settings for New Scheduled Recordings"));
|
|---|
| 4228 | - autogrp->addChild(autogrp0);
|
|---|
| 4229 | - autogrp->addChild(autogrp1);
|
|---|
| 4230 | + autogrp->addChild(AutoMetadataLookup());
|
|---|
| 4231 | + autogrp->addChild(AutoCommercialFlag());
|
|---|
| 4232 | + autogrp->addChild(AutoTranscode());
|
|---|
| 4233 | + autogrp->addChild(AutoRunUserJob(1));
|
|---|
| 4234 | + autogrp->addChild(AutoRunUserJob(2));
|
|---|
| 4235 | + autogrp->addChild(AutoRunUserJob(3));
|
|---|
| 4236 | + autogrp->addChild(AutoRunUserJob(4));
|
|---|
| 4237 | +
|
|---|
| 4238 | jobs->addChild(autogrp);
|
|---|
| 4239 |
|
|---|
| 4240 | addChild(jobs);
|
|---|
| 4241 |
|
|---|
| 4242 | - VerticalConfigurationGroup* general2 = new VerticalConfigurationGroup(false);
|
|---|
| 4243 | - general2->setLabel(QObject::tr("General (Advanced)"));
|
|---|
| 4244 | + GroupSetting* general2 = new GroupSetting();
|
|---|
| 4245 | + general2->setLabel(QObject::tr("Advanced"));
|
|---|
| 4246 | general2->addChild(RecordPreRoll());
|
|---|
| 4247 | general2->addChild(RecordOverTime());
|
|---|
| 4248 | general2->addChild(CategoryOverTimeSettings());
|
|---|
| 4249 | addChild(general2);
|
|---|
| 4250 |
|
|---|
| 4251 | - VerticalConfigurationGroup* changrp = new VerticalConfigurationGroup(false);
|
|---|
| 4252 | - changrp->setLabel(QObject::tr("General (Channel Groups)"));
|
|---|
| 4253 | - ChannelGroupSettings *changroupsettings = new ChannelGroupSettings();
|
|---|
| 4254 | - changrp->addChild(changroupsettings);
|
|---|
| 4255 | + GroupSetting* changrp = new GroupSetting();
|
|---|
| 4256 | + changrp->setLabel(QObject::tr("Channel Groups"));
|
|---|
| 4257 | + changrp->addChild(ChannelGroupRememberLast());
|
|---|
| 4258 | changrp->addChild(BrowseChannelGroup());
|
|---|
| 4259 | addChild(changrp);
|
|---|
| 4260 | }
|
|---|
| 4261 |
|
|---|
| 4262 | EPGSettings::EPGSettings()
|
|---|
| 4263 | {
|
|---|
| 4264 | - VerticalConfigurationGroup* epg = new VerticalConfigurationGroup(false);
|
|---|
| 4265 | - epg->setLabel(QObject::tr("Program Guide") + " 1/1");
|
|---|
| 4266 | - epg->addChild(WatchTVGuide());
|
|---|
| 4267 | - epg->addChild(DefaultTVChannel());
|
|---|
| 4268 | - epg->addChild(EPGRecThreshold());
|
|---|
| 4269 | - addChild(epg);
|
|---|
| 4270 | + setLabel(QObject::tr("Program Guide"));
|
|---|
| 4271 | + addChild(WatchTVGuide());
|
|---|
| 4272 | + addChild(DefaultTVChannel());
|
|---|
| 4273 | + addChild(EPGRecThreshold());
|
|---|
| 4274 | }
|
|---|
| 4275 |
|
|---|
| 4276 | GeneralRecPrioritiesSettings::GeneralRecPrioritiesSettings()
|
|---|
| 4277 | {
|
|---|
| 4278 | - VerticalConfigurationGroup* sched = new VerticalConfigurationGroup(false);
|
|---|
| 4279 | + setLabel(QObject::tr("Recording Priorities"));
|
|---|
| 4280 | +
|
|---|
| 4281 | + GroupSetting* sched = new GroupSetting();
|
|---|
| 4282 | sched->setLabel(QObject::tr("Scheduler Options"));
|
|---|
| 4283 |
|
|---|
| 4284 | sched->addChild(GRSchedMoveHigher());
|
|---|
| 4285 | @@ -3585,7 +4205,7 @@ GeneralRecPrioritiesSettings::GeneralRecPrioritiesSettings()
|
|---|
| 4286 | sched->addChild(GRAutoRecPriority());
|
|---|
| 4287 | addChild(sched);
|
|---|
| 4288 |
|
|---|
| 4289 | - VerticalConfigurationGroup* access = new VerticalConfigurationGroup(false);
|
|---|
| 4290 | + GroupSetting* access = new GroupSetting();
|
|---|
| 4291 | access->setLabel(QObject::tr("Accessibility Options"));
|
|---|
| 4292 |
|
|---|
| 4293 | access->addChild(GRSignLangRecPriority());
|
|---|
| 4294 | @@ -3595,7 +4215,7 @@ GeneralRecPrioritiesSettings::GeneralRecPrioritiesSettings()
|
|---|
| 4295 | access->addChild(GRAudioDescRecPriority());
|
|---|
| 4296 | addChild(access);
|
|---|
| 4297 |
|
|---|
| 4298 | - VerticalConfigurationGroup* rtype = new VerticalConfigurationGroup(false);
|
|---|
| 4299 | + GroupSetting* rtype = new GroupSetting();
|
|---|
| 4300 | rtype->setLabel(QObject::tr("Recording Type Priority Settings"));
|
|---|
| 4301 |
|
|---|
| 4302 | rtype->addChild(GRSingleRecordRecPriority());
|
|---|
| 4303 | @@ -3610,7 +4230,9 @@ GeneralRecPrioritiesSettings::GeneralRecPrioritiesSettings()
|
|---|
| 4304 |
|
|---|
| 4305 | AppearanceSettings::AppearanceSettings()
|
|---|
| 4306 | {
|
|---|
| 4307 | - VerticalConfigurationGroup* screen = new VerticalConfigurationGroup(false);
|
|---|
| 4308 | + setLabel(QObject::tr("Appearance"));
|
|---|
| 4309 | +
|
|---|
| 4310 | + GroupSetting* screen = new GroupSetting();
|
|---|
| 4311 | screen->setLabel(QObject::tr("Theme") + " / " + QObject::tr("Screen Settings"));
|
|---|
| 4312 |
|
|---|
| 4313 | screen->addChild(MenuTheme());
|
|---|
| 4314 | @@ -3624,38 +4246,23 @@ AppearanceSettings::AppearanceSettings()
|
|---|
| 4315 | // screen->addChild(DisplaySizeHeight());
|
|---|
| 4316 | // screen->addChild(DisplaySizeWidth());
|
|---|
| 4317 |
|
|---|
| 4318 | - VerticalConfigurationGroup *column1 =
|
|---|
| 4319 | - new VerticalConfigurationGroup(false, false, false, false);
|
|---|
| 4320 | -
|
|---|
| 4321 | - column1->addChild(GuiWidth());
|
|---|
| 4322 | - column1->addChild(GuiHeight());
|
|---|
| 4323 | - column1->addChild(GuiOffsetX());
|
|---|
| 4324 | - column1->addChild(GuiOffsetY());
|
|---|
| 4325 | -
|
|---|
| 4326 | - VerticalConfigurationGroup *column2 =
|
|---|
| 4327 | - new VerticalConfigurationGroup(false, false, false, false);
|
|---|
| 4328 | -
|
|---|
| 4329 | - column2->addChild(GuiSizeForTV());
|
|---|
| 4330 | - column2->addChild(HideMouseCursor());
|
|---|
| 4331 | - column2->addChild(RunInWindow());
|
|---|
| 4332 | - column2->addChild(UseFixedWindowSize());
|
|---|
| 4333 | -
|
|---|
| 4334 | - HorizontalConfigurationGroup *columns =
|
|---|
| 4335 | - new HorizontalConfigurationGroup(false, false, false, false);
|
|---|
| 4336 | -
|
|---|
| 4337 | - columns->addChild(column1);
|
|---|
| 4338 | - columns->addChild(column2);
|
|---|
| 4339 | -
|
|---|
| 4340 | - screen->addChild(columns);
|
|---|
| 4341 | + screen->addChild(GuiWidth());
|
|---|
| 4342 | + screen->addChild(GuiHeight());
|
|---|
| 4343 | + screen->addChild(GuiOffsetX());
|
|---|
| 4344 | + screen->addChild(GuiOffsetY());
|
|---|
| 4345 | + screen->addChild(GuiSizeForTV());
|
|---|
| 4346 | + screen->addChild(HideMouseCursor());
|
|---|
| 4347 | + screen->addChild(RunInWindow());
|
|---|
| 4348 | + screen->addChild(UseFixedWindowSize());
|
|---|
| 4349 |
|
|---|
| 4350 | addChild(screen);
|
|---|
| 4351 |
|
|---|
| 4352 | #if defined(USING_XRANDR) || CONFIG_DARWIN
|
|---|
| 4353 | const vector<DisplayResScreen> scr = GetVideoModes();
|
|---|
| 4354 | if (!scr.empty())
|
|---|
| 4355 | - addChild(new VideoModeSettings());
|
|---|
| 4356 | + addChild(UseVideoModes());
|
|---|
| 4357 | #endif
|
|---|
| 4358 | - VerticalConfigurationGroup* dates = new VerticalConfigurationGroup(false);
|
|---|
| 4359 | + GroupSetting* dates = new GroupSetting();
|
|---|
| 4360 | dates->setLabel(QObject::tr("Localization"));
|
|---|
| 4361 | dates->addChild(MythLanguage());
|
|---|
| 4362 | dates->addChild(ISO639PreferredLanguage(0));
|
|---|
| 4363 | @@ -3665,7 +4272,7 @@ AppearanceSettings::AppearanceSettings()
|
|---|
| 4364 | dates->addChild(MythTimeFormat());
|
|---|
| 4365 | addChild(dates);
|
|---|
| 4366 |
|
|---|
| 4367 | - addChild(new LcdSettings());
|
|---|
| 4368 | + addChild(LCDEnable());
|
|---|
| 4369 | }
|
|---|
| 4370 |
|
|---|
| 4371 | // vim:set sw=4 ts=4 expandtab:
|
|---|
| 4372 | diff --git a/mythtv/programs/mythfrontend/globalsettings.h b/mythtv/programs/mythfrontend/globalsettings.h
|
|---|
| 4373 | index 93e774a..a6a0815 100644
|
|---|
| 4374 | --- a/mythtv/programs/mythfrontend/globalsettings.h
|
|---|
| 4375 | +++ b/mythtv/programs/mythfrontend/globalsettings.h
|
|---|
| 4376 | @@ -7,48 +7,49 @@
|
|---|
| 4377 | #include "settings.h"
|
|---|
| 4378 | #include "mythcontext.h"
|
|---|
| 4379 | #include "videodisplayprofile.h"
|
|---|
| 4380 | +#include "standardsettings.h"
|
|---|
| 4381 |
|
|---|
| 4382 | #include <QMutex>
|
|---|
| 4383 |
|
|---|
| 4384 | class QFileInfo;
|
|---|
| 4385 |
|
|---|
| 4386 | -class PlaybackSettings : public ConfigurationWizard
|
|---|
| 4387 | +class PlaybackSettings : public GroupSetting
|
|---|
| 4388 | {
|
|---|
| 4389 | public:
|
|---|
| 4390 | PlaybackSettings();
|
|---|
| 4391 | };
|
|---|
| 4392 |
|
|---|
| 4393 | -class OSDSettings: virtual public ConfigurationWizard
|
|---|
| 4394 | +class OSDSettings: virtual public GroupSetting
|
|---|
| 4395 | {
|
|---|
| 4396 | public:
|
|---|
| 4397 | OSDSettings();
|
|---|
| 4398 | };
|
|---|
| 4399 |
|
|---|
| 4400 | -class GeneralSettings : public ConfigurationWizard
|
|---|
| 4401 | +class GeneralSettings : public GroupSetting
|
|---|
| 4402 | {
|
|---|
| 4403 | public:
|
|---|
| 4404 | GeneralSettings();
|
|---|
| 4405 | };
|
|---|
| 4406 |
|
|---|
| 4407 | -class EPGSettings : public ConfigurationWizard
|
|---|
| 4408 | +class EPGSettings : public GroupSetting
|
|---|
| 4409 | {
|
|---|
| 4410 | public:
|
|---|
| 4411 | EPGSettings();
|
|---|
| 4412 | };
|
|---|
| 4413 |
|
|---|
| 4414 | -class AppearanceSettings : public ConfigurationWizard
|
|---|
| 4415 | +class AppearanceSettings : public GroupSetting
|
|---|
| 4416 | {
|
|---|
| 4417 | public:
|
|---|
| 4418 | AppearanceSettings();
|
|---|
| 4419 | };
|
|---|
| 4420 |
|
|---|
| 4421 | -class MainGeneralSettings : public ConfigurationWizard
|
|---|
| 4422 | +class MainGeneralSettings : public GroupSetting
|
|---|
| 4423 | {
|
|---|
| 4424 | public:
|
|---|
| 4425 | MainGeneralSettings();
|
|---|
| 4426 | };
|
|---|
| 4427 |
|
|---|
| 4428 | -class GeneralRecPrioritiesSettings : public ConfigurationWizard
|
|---|
| 4429 | +class GeneralRecPrioritiesSettings : public GroupSetting
|
|---|
| 4430 | {
|
|---|
| 4431 | public:
|
|---|
| 4432 | GeneralRecPrioritiesSettings();
|
|---|
| 4433 | @@ -60,7 +61,22 @@ class XboxSettings : public ConfigurationWizard
|
|---|
| 4434 | XboxSettings();
|
|---|
| 4435 | };
|
|---|
| 4436 |
|
|---|
| 4437 | -class PlaybackProfileItemConfig : public QObject, public ConfigurationWizard
|
|---|
| 4438 | +class HostRefreshRateComboBoxTree : public HostComboBoxTree
|
|---|
| 4439 | +{
|
|---|
| 4440 | + Q_OBJECT
|
|---|
| 4441 | + public:
|
|---|
| 4442 | + HostRefreshRateComboBoxTree(const QString &name)
|
|---|
| 4443 | + : HostComboBoxTree(name, ""){ }
|
|---|
| 4444 | + virtual ~HostRefreshRateComboBoxTree() { ; }
|
|---|
| 4445 | +
|
|---|
| 4446 | + public slots:
|
|---|
| 4447 | + virtual void ChangeResolution(const QString& resolution);
|
|---|
| 4448 | +
|
|---|
| 4449 | + private:
|
|---|
| 4450 | + static const vector<double> GetRefreshRates(const QString &resolution);
|
|---|
| 4451 | +};
|
|---|
| 4452 | +
|
|---|
| 4453 | +class PlaybackProfileItemConfig : public GroupSetting
|
|---|
| 4454 | {
|
|---|
| 4455 | Q_OBJECT
|
|---|
| 4456 |
|
|---|
| 4457 | @@ -78,22 +94,22 @@ class PlaybackProfileItemConfig : public QObject, public ConfigurationWizard
|
|---|
| 4458 | void deint1Changed(const QString &deint);
|
|---|
| 4459 |
|
|---|
| 4460 | private:
|
|---|
| 4461 | - ProfileItem &item;
|
|---|
| 4462 | - TransComboBoxSetting *cmp[2];
|
|---|
| 4463 | - TransSpinBoxSetting *width[2];
|
|---|
| 4464 | - TransSpinBoxSetting *height[2];
|
|---|
| 4465 | - TransComboBoxSetting *decoder;
|
|---|
| 4466 | - TransSpinBoxSetting *max_cpus;
|
|---|
| 4467 | - TransCheckBoxSetting *skiploop;
|
|---|
| 4468 | - TransComboBoxSetting *vidrend;
|
|---|
| 4469 | - TransComboBoxSetting *osdrend;
|
|---|
| 4470 | - TransCheckBoxSetting *osdfade;
|
|---|
| 4471 | - TransComboBoxSetting *deint0;
|
|---|
| 4472 | - TransComboBoxSetting *deint1;
|
|---|
| 4473 | - TransLineEditSetting *filters;
|
|---|
| 4474 | + ProfileItem &item;
|
|---|
| 4475 | + TransComboBoxTree *cmp[2];
|
|---|
| 4476 | + TransSpinBoxTree *width[2];
|
|---|
| 4477 | + TransSpinBoxTree *height[2];
|
|---|
| 4478 | + TransComboBoxTree *decoder;
|
|---|
| 4479 | + TransSpinBoxTree *max_cpus;
|
|---|
| 4480 | + TransCheckBoxTree *skiploop;
|
|---|
| 4481 | + TransComboBoxTree *vidrend;
|
|---|
| 4482 | + TransComboBoxTree *osdrend;
|
|---|
| 4483 | + TransCheckBoxTree *osdfade;
|
|---|
| 4484 | + TransComboBoxTree *deint0;
|
|---|
| 4485 | + TransComboBoxTree *deint1;
|
|---|
| 4486 | + TransLineEditTree *filters;
|
|---|
| 4487 | };
|
|---|
| 4488 |
|
|---|
| 4489 | -class PlaybackProfileConfig : public VerticalConfigurationGroup
|
|---|
| 4490 | +class PlaybackProfileConfig : public GroupSetting
|
|---|
| 4491 | {
|
|---|
| 4492 | Q_OBJECT
|
|---|
| 4493 |
|
|---|
| 4494 | @@ -122,30 +138,68 @@ class PlaybackProfileConfig : public VerticalConfigurationGroup
|
|---|
| 4495 | uint groupid;
|
|---|
| 4496 |
|
|---|
| 4497 | VerticalConfigurationGroup *last_main;
|
|---|
| 4498 | - vector<TransLabelSetting*> labels;
|
|---|
| 4499 | + vector<GroupSetting*> labels;
|
|---|
| 4500 | vector<TransButtonSetting*> editProf;
|
|---|
| 4501 | vector<TransButtonSetting*> delProf;
|
|---|
| 4502 | vector<TransSpinBoxSetting*> priority;
|
|---|
| 4503 | };
|
|---|
| 4504 |
|
|---|
| 4505 | -class PlaybackProfileConfigs : public TriggeredConfigurationGroup
|
|---|
| 4506 | +
|
|---|
| 4507 | +
|
|---|
| 4508 | +
|
|---|
| 4509 | +class PlaybackProfileConfigs : public HostComboBoxTree
|
|---|
| 4510 | {
|
|---|
| 4511 | Q_OBJECT
|
|---|
| 4512 |
|
|---|
| 4513 | public:
|
|---|
| 4514 | - PlaybackProfileConfigs(const QString &str);
|
|---|
| 4515 | + PlaybackProfileConfigs();
|
|---|
| 4516 | virtual ~PlaybackProfileConfigs();
|
|---|
| 4517 | + virtual void customEvent(QEvent *event);
|
|---|
| 4518 | + virtual void menu();
|
|---|
| 4519 |
|
|---|
| 4520 | private:
|
|---|
| 4521 | void InitUI(void);
|
|---|
| 4522 |
|
|---|
| 4523 | private slots:
|
|---|
| 4524 | - void btnPress(QString);
|
|---|
| 4525 | - void triggerChanged(const QString&);
|
|---|
| 4526 | + void changeCurrentProfile(const QString&);
|
|---|
| 4527 | + void newProfile(const QString &name);
|
|---|
| 4528 | + void deleteProfile();
|
|---|
| 4529 |
|
|---|
| 4530 | private:
|
|---|
| 4531 | QStringList profiles;
|
|---|
| 4532 | - HostComboBox *grouptrigger;
|
|---|
| 4533 | + QMap<QString, GroupSetting *> m_profileTrees;
|
|---|
| 4534 | +};
|
|---|
| 4535 | +
|
|---|
| 4536 | +/*
|
|---|
| 4537 | +class PlaybackProfileConfigItemCriteriaTree;
|
|---|
| 4538 | +
|
|---|
| 4539 | +class PlaybackProfileConfigItemTree : public GroupSetting
|
|---|
| 4540 | +{
|
|---|
| 4541 | + Q_OBJECT
|
|---|
| 4542 | + public:
|
|---|
| 4543 | + PlaybackProfileConfigItemTree(ProfileItem &item);
|
|---|
| 4544 | + virtual void Load();
|
|---|
| 4545 | + private slots:
|
|---|
| 4546 | + void decoderChanged(const QString&);
|
|---|
| 4547 | + void vrenderChanged(const QString&);
|
|---|
| 4548 | + void orenderChanged(const QString &renderer);
|
|---|
| 4549 | + void deint0Changed(const QString &deint);
|
|---|
| 4550 | + void deint1Changed(const QString &deint);
|
|---|
| 4551 | + private:
|
|---|
| 4552 | + ProfileItem m_item;
|
|---|
| 4553 | + PlaybackProfileConfigItemCriteriaTree * m_criteria1;
|
|---|
| 4554 | + PlaybackProfileConfigItemCriteriaTree * m_criteria2;
|
|---|
| 4555 | + TransComboBoxTree *m_decoder;
|
|---|
| 4556 | + TransSpinBoxTree *m_max_cpus;
|
|---|
| 4557 | + TransCheckBoxTree *m_skiploop;
|
|---|
| 4558 | + TransComboBoxTree *m_vidrend;
|
|---|
| 4559 | + TransComboBoxTree *m_osdrend;
|
|---|
| 4560 | + TransCheckBoxTree *m_osdfade;
|
|---|
| 4561 | + TransComboBoxTree *m_deint0;
|
|---|
| 4562 | + TransComboBoxTree *m_deint1;
|
|---|
| 4563 | + TransLineEditTree *m_filters;
|
|---|
| 4564 | +
|
|---|
| 4565 | };
|
|---|
| 4566 | +*/
|
|---|
| 4567 |
|
|---|
| 4568 | #endif
|
|---|
| 4569 | diff --git a/mythtv/programs/mythfrontend/main.cpp b/mythtv/programs/mythfrontend/main.cpp
|
|---|
| 4570 | index 33a8840..dbd60e0 100644
|
|---|
| 4571 | --- a/mythtv/programs/mythfrontend/main.cpp
|
|---|
| 4572 | +++ b/mythtv/programs/mythfrontend/main.cpp
|
|---|
| 4573 | @@ -829,15 +829,22 @@ static void TVMenuCallback(void *data, QString &selection)
|
|---|
| 4574 | startPrevious();
|
|---|
| 4575 | else if (sel == "settings appearance")
|
|---|
| 4576 | {
|
|---|
| 4577 | - AppearanceSettings *settings = new AppearanceSettings();
|
|---|
| 4578 | - DialogCode res = settings->exec();
|
|---|
| 4579 | - delete settings;
|
|---|
| 4580 | + MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
|
|---|
| 4581 | + StandardSettingDialog *gs = new StandardSettingDialog(mainStack, "maingeeralsettings");
|
|---|
| 4582 |
|
|---|
| 4583 | + if (gs->Create())
|
|---|
| 4584 | + {
|
|---|
| 4585 | + gs->setSettings(new AppearanceSettings());
|
|---|
| 4586 | + mainStack->AddScreen(gs);
|
|---|
| 4587 | + }
|
|---|
| 4588 | + else
|
|---|
| 4589 | + delete gs;
|
|---|
| 4590 | + /* TODO
|
|---|
| 4591 | if (kDialogCodeRejected != res)
|
|---|
| 4592 | {
|
|---|
| 4593 | qApp->processEvents();
|
|---|
| 4594 | GetMythMainWindow()->JumpTo("Reload Theme");
|
|---|
| 4595 | - }
|
|---|
| 4596 | + }*/
|
|---|
| 4597 | }
|
|---|
| 4598 | else if (sel == "settings themechooser")
|
|---|
| 4599 | {
|
|---|
| 4600 | @@ -889,8 +896,16 @@ static void TVMenuCallback(void *data, QString &selection)
|
|---|
| 4601 | }
|
|---|
| 4602 | else if (sel == "settings general")
|
|---|
| 4603 | {
|
|---|
| 4604 | - GeneralSettings settings;
|
|---|
| 4605 | - settings.exec();
|
|---|
| 4606 | + MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
|
|---|
| 4607 | + StandardSettingDialog *gs = new StandardSettingDialog(mainStack, "maingeeralsettings");
|
|---|
| 4608 | +
|
|---|
| 4609 | + if (gs->Create())
|
|---|
| 4610 | + {
|
|---|
| 4611 | + gs->setSettings(new GeneralSettings());
|
|---|
| 4612 | + mainStack->AddScreen(gs);
|
|---|
| 4613 | + }
|
|---|
| 4614 | + else
|
|---|
| 4615 | + delete gs;
|
|---|
| 4616 | }
|
|---|
| 4617 | else if (sel == "settings audiogeneral")
|
|---|
| 4618 | {
|
|---|
| 4619 | @@ -899,25 +914,61 @@ static void TVMenuCallback(void *data, QString &selection)
|
|---|
| 4620 | }
|
|---|
| 4621 | else if (sel == "settings maingeneral")
|
|---|
| 4622 | {
|
|---|
| 4623 | - MainGeneralSettings mainsettings;
|
|---|
| 4624 | - mainsettings.exec();
|
|---|
| 4625 | + MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
|
|---|
| 4626 | + StandardSettingDialog *gs = new StandardSettingDialog(mainStack, "maingeeralsettings");
|
|---|
| 4627 | +
|
|---|
| 4628 | + if (gs->Create())
|
|---|
| 4629 | + {
|
|---|
| 4630 | + gs->setSettings(new MainGeneralSettings());
|
|---|
| 4631 | + mainStack->AddScreen(gs);
|
|---|
| 4632 | + }
|
|---|
| 4633 | + else
|
|---|
| 4634 | + delete gs;
|
|---|
| 4635 | +
|
|---|
| 4636 | + /*TODO need to execute this after
|
|---|
| 4637 | QStringList strlist( QString("REFRESH_BACKEND") );
|
|---|
| 4638 | gCoreContext->SendReceiveStringList(strlist);
|
|---|
| 4639 | + */
|
|---|
| 4640 | +
|
|---|
| 4641 | }
|
|---|
| 4642 | else if (sel == "settings playback")
|
|---|
| 4643 | {
|
|---|
| 4644 | - PlaybackSettings settings;
|
|---|
| 4645 | - settings.exec();
|
|---|
| 4646 | + MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
|
|---|
| 4647 | + StandardSettingDialog *gs = new StandardSettingDialog(mainStack, "maingeeralsettings");
|
|---|
| 4648 | +
|
|---|
| 4649 | + if (gs->Create())
|
|---|
| 4650 | + {
|
|---|
| 4651 | + gs->setSettings(new PlaybackSettings());
|
|---|
| 4652 | + mainStack->AddScreen(gs);
|
|---|
| 4653 | + }
|
|---|
| 4654 | + else
|
|---|
| 4655 | + delete gs;
|
|---|
| 4656 | }
|
|---|
| 4657 | else if (sel == "settings osd")
|
|---|
| 4658 | {
|
|---|
| 4659 | - OSDSettings settings;
|
|---|
| 4660 | - settings.exec();
|
|---|
| 4661 | + MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
|
|---|
| 4662 | + StandardSettingDialog *gs = new StandardSettingDialog(mainStack, "maingeeralsettings");
|
|---|
| 4663 | +
|
|---|
| 4664 | + if (gs->Create())
|
|---|
| 4665 | + {
|
|---|
| 4666 | + gs->setSettings(new OSDSettings());
|
|---|
| 4667 | + mainStack->AddScreen(gs);
|
|---|
| 4668 | + }
|
|---|
| 4669 | + else
|
|---|
| 4670 | + delete gs;
|
|---|
| 4671 | }
|
|---|
| 4672 | else if (sel == "settings epg")
|
|---|
| 4673 | {
|
|---|
| 4674 | - EPGSettings settings;
|
|---|
| 4675 | - settings.exec();
|
|---|
| 4676 | + MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
|
|---|
| 4677 | + StandardSettingDialog *gs = new StandardSettingDialog(mainStack, "maingeeralsettings");
|
|---|
| 4678 | +
|
|---|
| 4679 | + if (gs->Create())
|
|---|
| 4680 | + {
|
|---|
| 4681 | + gs->setSettings(new EPGSettings());
|
|---|
| 4682 | + mainStack->AddScreen(gs);
|
|---|
| 4683 | + }
|
|---|
| 4684 | + else
|
|---|
| 4685 | + delete gs;
|
|---|
| 4686 | }
|
|---|
| 4687 | else if (sel == "settings channelgroups")
|
|---|
| 4688 | {
|
|---|
| 4689 | @@ -926,8 +977,16 @@ static void TVMenuCallback(void *data, QString &selection)
|
|---|
| 4690 | }
|
|---|
| 4691 | else if (sel == "settings generalrecpriorities")
|
|---|
| 4692 | {
|
|---|
| 4693 | - GeneralRecPrioritiesSettings settings;
|
|---|
| 4694 | - settings.exec();
|
|---|
| 4695 | + MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
|
|---|
| 4696 | + StandardSettingDialog *gs = new StandardSettingDialog(mainStack, "maingeeralsettings");
|
|---|
| 4697 | +
|
|---|
| 4698 | + if (gs->Create())
|
|---|
| 4699 | + {
|
|---|
| 4700 | + gs->setSettings(new GeneralRecPrioritiesSettings());
|
|---|
| 4701 | + mainStack->AddScreen(gs);
|
|---|
| 4702 | + }
|
|---|
| 4703 | + else
|
|---|
| 4704 | + delete gs;
|
|---|
| 4705 | }
|
|---|
| 4706 | else if (sel == "settings channelrecpriorities")
|
|---|
| 4707 | {
|
|---|
| 4708 | @@ -1056,6 +1115,7 @@ static bool RunMenu(QString themedir, QString themename)
|
|---|
| 4709 | // the default values
|
|---|
| 4710 | static void WriteDefaults()
|
|---|
| 4711 | {
|
|---|
| 4712 | +/*
|
|---|
| 4713 | PlaybackSettings ps;
|
|---|
| 4714 | ps.Load();
|
|---|
| 4715 | ps.Save();
|
|---|
| 4716 | @@ -1079,7 +1139,7 @@ static void WriteDefaults()
|
|---|
| 4717 | grs.Save();
|
|---|
| 4718 | VideoGeneralSettings vgs;
|
|---|
| 4719 | vgs.Load();
|
|---|
| 4720 | - vgs.Save();
|
|---|
| 4721 | + vgs.Save();*/
|
|---|
| 4722 | }
|
|---|
| 4723 |
|
|---|
| 4724 | static int internal_play_media(const QString &mrl, const QString &plot,
|
|---|
| 4725 | diff --git a/mythtv/programs/mythfrontend/mythfrontend.pro b/mythtv/programs/mythfrontend/mythfrontend.pro
|
|---|
| 4726 | index cf985d6..debf109 100644
|
|---|
| 4727 | --- a/mythtv/programs/mythfrontend/mythfrontend.pro
|
|---|
| 4728 | +++ b/mythtv/programs/mythfrontend/mythfrontend.pro
|
|---|
| 4729 | @@ -39,7 +39,9 @@ HEADERS += videoplayercommand.h videopopups.h
|
|---|
| 4730 | HEADERS += videofilter.h videolist.h
|
|---|
| 4731 | HEADERS += videoplayersettings.h videodlg.h
|
|---|
| 4732 | HEADERS += videoglobalsettings.h upnpscanner.h
|
|---|
| 4733 | -HEADERS += commandlineparser.h
|
|---|
| 4734 | +HEADERS += commandlineparser.h
|
|---|
| 4735 | +HEADERS += standardsettings.h
|
|---|
| 4736 |
|
|---|
| 4737 | SOURCES += main.cpp playbackbox.cpp viewscheduled.cpp audiogeneralsettings.cpp
|
|---|
| 4738 | SOURCES += globalsettings.cpp manualschedule.cpp programrecpriority.cpp
|
|---|
| 4739 | @@ -60,7 +62,9 @@ SOURCES += videoplayercommand.cpp videopopups.cpp
|
|---|
| 4740 | SOURCES += videofilter.cpp videolist.cpp
|
|---|
| 4741 | SOURCES += videoplayersettings.cpp videodlg.cpp
|
|---|
| 4742 | SOURCES += videoglobalsettings.cpp upnpscanner.cpp
|
|---|
| 4743 | -SOURCES += commandlineparser.cpp
|
|---|
| 4744 | +SOURCES += commandlineparser.cpp
|
|---|
| 4745 | +SOURCES += standardsettings.cpp
|
|---|
| 4746 |
|
|---|
| 4747 | macx {
|
|---|
| 4748 | mac_bundle {
|
|---|
| 4749 | diff --git a/mythtv/programs/mythfrontend/standardsettings.cpp b/mythtv/programs/mythfrontend/standardsettings.cpp
|
|---|
| 4750 | index b15ee98..81e3c71 100755
|
|---|
| 4751 | --- a/mythtv/programs/mythfrontend/standardsettings.cpp
|
|---|
| 4752 | +++ b/mythtv/programs/mythfrontend/standardsettings.cpp
|
|---|
| 4753 | @@ -27,19 +27,31 @@ void StandardSetting::SetDBValue(const QString &text){
|
|---|
| 4754 | setSettingValue(text);
|
|---|
| 4755 | };
|
|---|
| 4756 |
|
|---|
| 4757 | -void StandardSetting::setSettingValue(const QString newValue)
|
|---|
| 4758 | +void StandardSetting::customEvent(QEvent *event)
|
|---|
| 4759 | {
|
|---|
| 4760 | - m_settingValue=newValue;
|
|---|
| 4761 | + if (event->type() == DialogCompletionEvent::kEventType)
|
|---|
| 4762 | + {
|
|---|
| 4763 | + DialogCompletionEvent *dce = (DialogCompletionEvent*)(event);
|
|---|
| 4764 | + QString resultid = dce->GetId();
|
|---|
| 4765 | +
|
|---|
| 4766 | + if (resultid == "editsetting")
|
|---|
| 4767 | + this->resultEdit(dce);
|
|---|
| 4768 | + }
|
|---|
| 4769 | }
|
|---|
| 4770 |
|
|---|
| 4771 | -const QString StandardSetting::getHelpText()
|
|---|
| 4772 | +void StandardSetting::setSettingValue(const QString newValue)
|
|---|
| 4773 | {
|
|---|
| 4774 | - return GetText("help");
|
|---|
| 4775 | + if (m_settingValue != newValue)
|
|---|
| 4776 | + {
|
|---|
| 4777 | + m_settingValue=newValue;
|
|---|
| 4778 | + settingValueChanged(m_settingValue);
|
|---|
| 4779 | + emit settingValueChanged(m_settingValue);
|
|---|
| 4780 | + }
|
|---|
| 4781 | }
|
|---|
| 4782 |
|
|---|
| 4783 | -const QString StandardSetting::getTextValue() const
|
|---|
| 4784 | +const QString StandardSetting::getHelpText()
|
|---|
| 4785 | {
|
|---|
| 4786 | - return GetText("value");
|
|---|
| 4787 | + return GetText("help");
|
|---|
| 4788 | }
|
|---|
| 4789 |
|
|---|
| 4790 | bool StandardSetting::haveChanged()
|
|---|
| 4791 | @@ -50,10 +62,25 @@ bool StandardSetting::haveChanged()
|
|---|
| 4792 | }
|
|---|
| 4793 |
|
|---|
| 4794 | GroupSetting::GroupSetting(const QString &text)
|
|---|
| 4795 | - :MythGenericTree (text, 0, true)
|
|---|
| 4796 | + :MythGenericTree (text, 0, true),
|
|---|
| 4797 | + m_item(0)
|
|---|
| 4798 | {
|
|---|
| 4799 | }
|
|---|
| 4800 |
|
|---|
| 4801 | +void GroupSetting::update()
|
|---|
| 4802 | +{
|
|---|
| 4803 | + if (m_item)
|
|---|
| 4804 | + {
|
|---|
| 4805 | + m_item->SetTextFromMap(m_strings);
|
|---|
| 4806 | + QList< MythGenericTree * > *children = getAllChildren ();
|
|---|
| 4807 | + m_item->setDrawArrow(children->size() > 0);
|
|---|
| 4808 | + //force the update
|
|---|
| 4809 | + QString text = m_item->GetText();
|
|---|
| 4810 | + m_item->SetText("");
|
|---|
| 4811 | + m_item->SetText(text);
|
|---|
| 4812 | + }
|
|---|
| 4813 | +}
|
|---|
| 4814 | +
|
|---|
| 4815 | void GroupSetting::setLabel(const QString &label)
|
|---|
| 4816 | {
|
|---|
| 4817 | SetText(label);
|
|---|
| 4818 | @@ -68,16 +95,14 @@ void GroupSetting::setHelpText(const QString &description)
|
|---|
| 4819 | SetText(description,"help");
|
|---|
| 4820 | }
|
|---|
| 4821 |
|
|---|
| 4822 | -//TODO remove the need for this
|
|---|
| 4823 | -void GroupSetting::setScreen(MythScreenType *screen)
|
|---|
| 4824 | +bool GroupSetting::haveChanged()
|
|---|
| 4825 | {
|
|---|
| 4826 | - m_screen = screen;
|
|---|
| 4827 |
|
|---|
| 4828 | QList<MythGenericTree*>::iterator it;
|
|---|
| 4829 | QList<MythGenericTree*> *children = this->getAllChildren();
|
|---|
| 4830 |
|
|---|
| 4831 | if (!children)
|
|---|
| 4832 | - return;
|
|---|
| 4833 | + return false;
|
|---|
| 4834 |
|
|---|
| 4835 | MythGenericTree *child = NULL;
|
|---|
| 4836 |
|
|---|
| 4837 | @@ -87,34 +112,43 @@ void GroupSetting::setScreen(MythScreenType *screen)
|
|---|
| 4838 | if (!child)
|
|---|
| 4839 | continue;
|
|---|
| 4840 | GroupSetting * setting = dynamic_cast<GroupSetting*>(child);
|
|---|
| 4841 | - if (setting)
|
|---|
| 4842 | - setting->setScreen(screen);
|
|---|
| 4843 | + if (setting && setting->haveChanged())
|
|---|
| 4844 | + return true;
|
|---|
| 4845 | }
|
|---|
| 4846 | + return false;
|
|---|
| 4847 | }
|
|---|
| 4848 |
|
|---|
| 4849 | -bool GroupSetting::haveChanged()
|
|---|
| 4850 | +class MyItem : public MythUIButtonListItem
|
|---|
| 4851 | {
|
|---|
| 4852 | + public:
|
|---|
| 4853 | + MyItem(MythUIButtonList *list, const QString &text, GroupSetting * setting)
|
|---|
| 4854 | + :MythUIButtonListItem(list, text),
|
|---|
| 4855 | + m_setting(setting){
|
|---|
| 4856 | + m_setting->setItem(this);
|
|---|
| 4857 | + }
|
|---|
| 4858 | + virtual ~MyItem()
|
|---|
| 4859 | + {
|
|---|
| 4860 | + m_setting->setItem(NULL);
|
|---|
| 4861 | + }
|
|---|
| 4862 | + GroupSetting *m_setting;
|
|---|
| 4863 | +};
|
|---|
| 4864 |
|
|---|
| 4865 | - QList<MythGenericTree*>::iterator it;
|
|---|
| 4866 | - QList<MythGenericTree*> *children = this->getAllChildren();
|
|---|
| 4867 |
|
|---|
| 4868 | - if (!children)
|
|---|
| 4869 | - return false;
|
|---|
| 4870 |
|
|---|
| 4871 | - MythGenericTree *child = NULL;
|
|---|
| 4872 | +MythUIButtonListItem *GroupSetting::CreateListButton(MythUIButtonList *list)
|
|---|
| 4873 | +{
|
|---|
| 4874 | + MythUIButtonListItem *item = new MyItem(list, getString(),this);
|
|---|
| 4875 | + item->SetData(qVariantFromValue((MythGenericTree*)this));
|
|---|
| 4876 | + item->SetTextFromMap(m_strings);
|
|---|
| 4877 | + item->SetImageFromMap(m_imageFilenames);
|
|---|
| 4878 |
|
|---|
| 4879 | - for (it = children->begin(); it != children->end(); ++it)
|
|---|
| 4880 | - {
|
|---|
| 4881 | - child = *it;
|
|---|
| 4882 | - if (!child)
|
|---|
| 4883 | - continue;
|
|---|
| 4884 | - GroupSetting * setting = dynamic_cast<GroupSetting*>(child);
|
|---|
| 4885 | - if (setting && setting->haveChanged())
|
|---|
| 4886 | - return true;
|
|---|
| 4887 | - }
|
|---|
| 4888 | - return false;
|
|---|
| 4889 | + if (visibleChildCount() > 0)
|
|---|
| 4890 | + item->setDrawArrow(true);
|
|---|
| 4891 | +
|
|---|
| 4892 | + return item;
|
|---|
| 4893 | }
|
|---|
| 4894 |
|
|---|
| 4895 | +
|
|---|
| 4896 | void GroupSetting::Save()
|
|---|
| 4897 | {
|
|---|
| 4898 | QList<MythGenericTree*>::iterator it;
|
|---|
| 4899 | @@ -136,6 +170,17 @@ void GroupSetting::Save()
|
|---|
| 4900 | }
|
|---|
| 4901 | }
|
|---|
| 4902 |
|
|---|
| 4903 | +void GroupSetting::setItem(MythUIButtonListItem * item)
|
|---|
| 4904 | +{
|
|---|
| 4905 | + m_item = item;
|
|---|
| 4906 | +};
|
|---|
| 4907 | +
|
|---|
| 4908 | +void GroupSetting::setEnabled(bool enabled)
|
|---|
| 4909 | +{
|
|---|
| 4910 | + LOG(VB_GENERAL, LOG_ERR, QString("GroupSetting::setEnabled(%1) for %2")
|
|---|
| 4911 | + .arg(enabled).arg(getLabel()));
|
|---|
| 4912 | +};
|
|---|
| 4913 | +
|
|---|
| 4914 | void GroupSetting::Load()
|
|---|
| 4915 | {
|
|---|
| 4916 | QList<MythGenericTree*>::iterator it;
|
|---|
| 4917 | @@ -161,21 +206,61 @@ void GroupSetting::edit()
|
|---|
| 4918 | {
|
|---|
| 4919 | DialogCompletionEvent *dce =
|
|---|
| 4920 | new DialogCompletionEvent("editsetting", 0, "", "");
|
|---|
| 4921 | - QCoreApplication::postEvent(m_screen, dce);
|
|---|
| 4922 | + QCoreApplication::postEvent(this, dce);
|
|---|
| 4923 | }
|
|---|
| 4924 |
|
|---|
| 4925 | -TextualSetting::TextualSetting(const QString &settingName, const QString &text, bool password)
|
|---|
| 4926 | +void GroupSetting::menu()
|
|---|
| 4927 | +{
|
|---|
| 4928 | + MythScreenStack *popupStack =
|
|---|
| 4929 | + GetMythMainWindow()->GetStack("popup stack");
|
|---|
| 4930 | +
|
|---|
| 4931 | + MythDialogBox * m_menuPopup =
|
|---|
| 4932 | + new MythDialogBox(GetText(), popupStack, "optionmenu");
|
|---|
| 4933 | +
|
|---|
| 4934 | + if (m_menuPopup->Create())
|
|---|
| 4935 | + popupStack->AddScreen(m_menuPopup);
|
|---|
| 4936 | +
|
|---|
| 4937 | + m_menuPopup->SetReturnEvent(this, "menusetting");
|
|---|
| 4938 | +
|
|---|
| 4939 | + m_menuPopup->AddButton(QObject::tr("Reset to default"),"reset");
|
|---|
| 4940 | + m_menuPopup->AddButton(QObject::tr("Reload"),"reload");
|
|---|
| 4941 | + m_menuPopup->AddButton(QObject::tr("Save"),"save");
|
|---|
| 4942 | +
|
|---|
| 4943 | +}
|
|---|
| 4944 | +
|
|---|
| 4945 | +void GroupSetting::resultMenu(DialogCompletionEvent *dce)
|
|---|
| 4946 | +{
|
|---|
| 4947 | + LOG(VB_GENERAL, LOG_ERR, QString("GroupSetting::resultMenu"));
|
|---|
| 4948 | + if (dce->GetResult()!=-1)
|
|---|
| 4949 | + {
|
|---|
| 4950 | + QString choice = dce->GetData().toString();
|
|---|
| 4951 | + if (choice=="reset")
|
|---|
| 4952 | + {
|
|---|
| 4953 | + //TODO reset to default
|
|---|
| 4954 | + }
|
|---|
| 4955 | + else if (choice=="save")
|
|---|
| 4956 | + {
|
|---|
| 4957 | + //TODO save
|
|---|
| 4958 | + }
|
|---|
| 4959 | + else if (choice=="load")
|
|---|
| 4960 | + {
|
|---|
| 4961 | + //TODO load
|
|---|
| 4962 | + }
|
|---|
| 4963 | + }
|
|---|
| 4964 | +}
|
|---|
| 4965 | +
|
|---|
| 4966 | +LineEditTree::LineEditTree(const QString &settingName, const QString &text, bool password)
|
|---|
| 4967 | : StandardSetting(settingName, text),
|
|---|
| 4968 | m_password(password)
|
|---|
| 4969 | {
|
|---|
| 4970 | }
|
|---|
| 4971 |
|
|---|
| 4972 | -void TextualSetting::setValue(const QString &newValue)
|
|---|
| 4973 | +void LineEditTree::setValue(const QString &newValue)
|
|---|
| 4974 | {
|
|---|
| 4975 | setSettingValue(newValue);
|
|---|
| 4976 | }
|
|---|
| 4977 |
|
|---|
| 4978 | -void TextualSetting::edit()
|
|---|
| 4979 | +void LineEditTree::edit()
|
|---|
| 4980 | {
|
|---|
| 4981 | MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
|
|---|
| 4982 |
|
|---|
| 4983 | @@ -185,23 +270,25 @@ void TextualSetting::edit()
|
|---|
| 4984 |
|
|---|
| 4985 | if (settingdialog->Create())
|
|---|
| 4986 | {
|
|---|
| 4987 | - settingdialog->SetReturnEvent(m_screen, "editsetting");
|
|---|
| 4988 | + settingdialog->SetReturnEvent(this, "editsetting");
|
|---|
| 4989 | popupStack->AddScreen(settingdialog);
|
|---|
| 4990 | }
|
|---|
| 4991 | }
|
|---|
| 4992 |
|
|---|
| 4993 | -void TextualSetting::resultEdit(DialogCompletionEvent *dce)
|
|---|
| 4994 | +void LineEditTree::resultEdit(DialogCompletionEvent *dce)
|
|---|
| 4995 | {
|
|---|
| 4996 | if (m_settingValue!=dce->GetResultText())
|
|---|
| 4997 | {
|
|---|
| 4998 | m_haveChanged=true;
|
|---|
| 4999 | setSettingValue(dce->GetResultText());
|
|---|
| 5000 | + LOG(VB_GENERAL, LOG_ERR, QString("LineEditTree::resultEdit"));
|
|---|
| 5001 | + update();
|
|---|
| 5002 | }
|
|---|
| 5003 | }
|
|---|
| 5004 |
|
|---|
| 5005 | -void TextualSetting::setSettingValue(const QString newValue)
|
|---|
| 5006 | +void LineEditTree::setSettingValue(const QString newValue)
|
|---|
| 5007 | {
|
|---|
| 5008 | - m_settingValue = newValue;
|
|---|
| 5009 | + StandardSetting::setSettingValue(newValue);
|
|---|
| 5010 |
|
|---|
| 5011 | if (m_password)
|
|---|
| 5012 | if (m_settingValue.isEmpty())
|
|---|
| 5013 | @@ -212,46 +299,45 @@ void TextualSetting::setSettingValue(const QString newValue)
|
|---|
| 5014 | SetText(m_settingValue,"value");
|
|---|
| 5015 | }
|
|---|
| 5016 |
|
|---|
| 5017 | -BoolSetting::BoolSetting(const QString &settingName, const QString &text)
|
|---|
| 5018 | +CheckBoxTree::CheckBoxTree(const QString &settingName, const QString &text)
|
|---|
| 5019 | : StandardSetting(settingName, text)
|
|---|
| 5020 | {
|
|---|
| 5021 | }
|
|---|
| 5022 |
|
|---|
| 5023 | -void BoolSetting::edit()
|
|---|
| 5024 | +void CheckBoxTree::edit()
|
|---|
| 5025 | {
|
|---|
| 5026 | - //LOG(VB_GENERAL, LOG_ERR, "BoolSetting::edit()");
|
|---|
| 5027 | - DialogCompletionEvent *dce =
|
|---|
| 5028 | - new DialogCompletionEvent("editsetting", 0, "", QVariant::fromValue((MythGenericTree*)this));
|
|---|
| 5029 | - QCoreApplication::postEvent(m_screen, dce);
|
|---|
| 5030 | + LOG(VB_GENERAL, LOG_ERR, QString("CheckBoxTree::edit()"));
|
|---|
| 5031 | + if (m_settingValue=="1")
|
|---|
| 5032 | + setSettingValue(m_settingValue="0");
|
|---|
| 5033 | + else
|
|---|
| 5034 | + setSettingValue(m_settingValue="1");
|
|---|
| 5035 | + m_haveChanged=true;
|
|---|
| 5036 | + update();
|
|---|
| 5037 | }
|
|---|
| 5038 |
|
|---|
| 5039 | -void BoolSetting::addChild (bool value, GroupSetting *child)
|
|---|
| 5040 | +void CheckBoxTree::addChild (bool value, GroupSetting *child)
|
|---|
| 5041 | {
|
|---|
| 5042 | if (value)
|
|---|
| 5043 | - m_OnChildren.append(child);
|
|---|
| 5044 | + m_OnChildren.addChild(child);
|
|---|
| 5045 | else
|
|---|
| 5046 | - m_OffChildren.append(child);
|
|---|
| 5047 | -/*
|
|---|
| 5048 | - child = StandardSetting::addNode(child);
|
|---|
| 5049 | - child->SetVisible(m_settingValue=="1");
|
|---|
| 5050 | - return child;*/
|
|---|
| 5051 | + m_OffChildren.addChild(child);
|
|---|
| 5052 | }
|
|---|
| 5053 |
|
|---|
| 5054 | -void BoolSetting::setSettingValue(const QString newValue)
|
|---|
| 5055 | +void CheckBoxTree::setSettingValue(const QString newValue)
|
|---|
| 5056 | {
|
|---|
| 5057 | - m_settingValue = newValue;
|
|---|
| 5058 | + StandardSetting::setSettingValue(newValue);
|
|---|
| 5059 |
|
|---|
| 5060 | - QList< GroupSetting * > *nodes = NULL;
|
|---|
| 5061 | + QList< MythGenericTree * > *newChildren;
|
|---|
| 5062 |
|
|---|
| 5063 | - if (m_settingValue=="1")
|
|---|
| 5064 | + if (newValue=="1")
|
|---|
| 5065 | {
|
|---|
| 5066 | SetText(QObject::tr("On"),"value");
|
|---|
| 5067 | - nodes=&m_OnChildren;
|
|---|
| 5068 | + newChildren=m_OnChildren.getAllChildren ();
|
|---|
| 5069 | }
|
|---|
| 5070 | else
|
|---|
| 5071 | {
|
|---|
| 5072 | SetText(QObject::tr("Off"),"value");
|
|---|
| 5073 | - nodes=&m_OffChildren;
|
|---|
| 5074 | + newChildren=m_OffChildren.getAllChildren ();
|
|---|
| 5075 | }
|
|---|
| 5076 |
|
|---|
| 5077 | QList< MythGenericTree * > *children = getAllChildren ();
|
|---|
| 5078 | @@ -261,15 +347,19 @@ void BoolSetting::setSettingValue(const QString newValue)
|
|---|
| 5079 | this->removeNode(child);
|
|---|
| 5080 | }
|
|---|
| 5081 |
|
|---|
| 5082 | -
|
|---|
| 5083 | - GroupSetting *node;
|
|---|
| 5084 | - foreach(node, *nodes)
|
|---|
| 5085 | + foreach(child, *newChildren)
|
|---|
| 5086 | {
|
|---|
| 5087 | - this->addNode(node);
|
|---|
| 5088 | + GroupSetting * setting = dynamic_cast<GroupSetting*>(child);
|
|---|
| 5089 | + if (!setting)continue;
|
|---|
| 5090 | + this->addNode(child);
|
|---|
| 5091 | + setting->Load();
|
|---|
| 5092 | }
|
|---|
| 5093 | + update();
|
|---|
| 5094 | +
|
|---|
| 5095 | +
|
|---|
| 5096 | }
|
|---|
| 5097 |
|
|---|
| 5098 | -void BoolSetting::setValue(bool newValue)
|
|---|
| 5099 | +void CheckBoxTree::setValue(bool newValue)
|
|---|
| 5100 | {
|
|---|
| 5101 | if (newValue)
|
|---|
| 5102 | setSettingValue("1");
|
|---|
| 5103 | @@ -277,8 +367,9 @@ void BoolSetting::setValue(bool newValue)
|
|---|
| 5104 | setSettingValue("0");
|
|---|
| 5105 | }
|
|---|
| 5106 |
|
|---|
| 5107 | -void BoolSetting::resultEdit(DialogCompletionEvent *dce)
|
|---|
| 5108 | +void CheckBoxTree::resultEdit(DialogCompletionEvent *dce)
|
|---|
| 5109 | {
|
|---|
| 5110 | + LOG(VB_GENERAL, LOG_ERR, QString(" CheckBoxTree::resultEdit %1").arg(GetText()));
|
|---|
| 5111 | if (m_settingValue=="1")
|
|---|
| 5112 | setSettingValue(m_settingValue="0");
|
|---|
| 5113 | else
|
|---|
| 5114 | @@ -286,45 +377,55 @@ void BoolSetting::resultEdit(DialogCompletionEvent *dce)
|
|---|
| 5115 | m_haveChanged=true;
|
|---|
| 5116 | }
|
|---|
| 5117 |
|
|---|
| 5118 | -RangeSetting::RangeSetting(const QString &settingName, int min, int max, int step, bool allow_single_step)
|
|---|
| 5119 | +SpinBoxTree::SpinBoxTree(const QString &settingName, int min, int max, int step, bool allow_single_step)
|
|---|
| 5120 | : StandardSetting(settingName)
|
|---|
| 5121 | {
|
|---|
| 5122 | m_min = min;
|
|---|
| 5123 | m_max = max;
|
|---|
| 5124 | }
|
|---|
| 5125 |
|
|---|
| 5126 | -void RangeSetting::setValue(int newValue)
|
|---|
| 5127 | +void SpinBoxTree::setValue(int newValue)
|
|---|
| 5128 | +{
|
|---|
| 5129 | + setSettingValue(QString("%1").arg(newValue));
|
|---|
| 5130 | +}
|
|---|
| 5131 | +
|
|---|
| 5132 | +void SpinBoxTree::setSettingValue(const QString &newValue)
|
|---|
| 5133 | {
|
|---|
| 5134 | - m_settingValue=QString("%1").arg(newValue);
|
|---|
| 5135 | + StandardSetting::setSettingValue(newValue);
|
|---|
| 5136 | + SetText(newValue,"value");
|
|---|
| 5137 | update();
|
|---|
| 5138 | }
|
|---|
| 5139 |
|
|---|
| 5140 | -void RangeSetting::edit()
|
|---|
| 5141 | +void SpinBoxTree::edit()
|
|---|
| 5142 | {
|
|---|
| 5143 | MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
|
|---|
| 5144 |
|
|---|
| 5145 |
|
|---|
| 5146 | MythTextInputDialog *settingdialog =
|
|---|
| 5147 | - new MythTextInputDialog(popupStack,
|
|---|
| 5148 | - "Range: " +this->GetText(),(InputFilter)(FilterAlpha | FilterSymbols | FilterPunct) ,false, m_settingValue);
|
|---|
| 5149 | + new MythTextInputDialog(popupStack,
|
|---|
| 5150 | + "Range: " +this->GetText(),
|
|---|
| 5151 | + (InputFilter)(FilterAlpha | FilterSymbols | FilterPunct) ,
|
|---|
| 5152 | + false, m_settingValue);
|
|---|
| 5153 | +
|
|---|
| 5154 | if (settingdialog->Create())
|
|---|
| 5155 | {
|
|---|
| 5156 | - settingdialog->SetReturnEvent(m_screen, "editsetting");
|
|---|
| 5157 | + settingdialog->SetReturnEvent(this, "editsetting");
|
|---|
| 5158 | popupStack->AddScreen(settingdialog);
|
|---|
| 5159 | }
|
|---|
| 5160 | }
|
|---|
| 5161 |
|
|---|
| 5162 | -void RangeSetting::resultEdit(DialogCompletionEvent *dce)
|
|---|
| 5163 | +void SpinBoxTree::resultEdit(DialogCompletionEvent *dce)
|
|---|
| 5164 | {
|
|---|
| 5165 | if (m_settingValue!=dce->GetResultText())
|
|---|
| 5166 | {
|
|---|
| 5167 | int newValue=dce->GetResultText().toInt();
|
|---|
| 5168 | if (newValue< m_min || newValue > m_max)
|
|---|
| 5169 | {
|
|---|
| 5170 | - //TODO display out of bound message;
|
|---|
| 5171 | - MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
|
|---|
| 5172 | - MythConfirmationDialog * errorDialog = new MythConfirmationDialog(popupStack,
|
|---|
| 5173 | - QObject::tr("out of bound, the value should be between %1 and %2")
|
|---|
| 5174 | + MythScreenStack *popupStack =
|
|---|
| 5175 | + GetMythMainWindow()->GetStack("popup stack");
|
|---|
| 5176 | + MythConfirmationDialog * errorDialog =
|
|---|
| 5177 | + new MythConfirmationDialog(popupStack,
|
|---|
| 5178 | + QObject::tr("Out of bound, the value should be between %1 and %2")
|
|---|
| 5179 | .arg(m_min).arg(m_max),false);
|
|---|
| 5180 | if (errorDialog->Create())
|
|---|
| 5181 | popupStack->AddScreen(errorDialog);
|
|---|
| 5182 | @@ -333,24 +434,17 @@ void RangeSetting::resultEdit(DialogCompletionEvent *dce)
|
|---|
| 5183 | {
|
|---|
| 5184 | m_haveChanged=true;
|
|---|
| 5185 | setSettingValue(dce->GetResultText());
|
|---|
| 5186 | -
|
|---|
| 5187 | }
|
|---|
| 5188 | - update();
|
|---|
| 5189 | }
|
|---|
| 5190 | }
|
|---|
| 5191 |
|
|---|
| 5192 | -void RangeSetting::update()
|
|---|
| 5193 | -{
|
|---|
| 5194 | - SetText(m_settingValue,"value");
|
|---|
| 5195 | -}
|
|---|
| 5196 | -
|
|---|
| 5197 | -ListSetting::ListSetting(const QString &settingName, const QString &text)
|
|---|
| 5198 | +ComboBoxTree::ComboBoxTree(const QString &settingName, const QString &text)
|
|---|
| 5199 | :StandardSetting(settingName, text)
|
|---|
| 5200 | {
|
|---|
| 5201 | Load();
|
|---|
| 5202 | }
|
|---|
| 5203 |
|
|---|
| 5204 | -void ListSetting::setValue(int newValue)
|
|---|
| 5205 | +void ComboBoxTree::setValue(int newValue)
|
|---|
| 5206 | {
|
|---|
| 5207 | QMapIterator<QString, QString> i(m_options);
|
|---|
| 5208 | while (i.hasNext())
|
|---|
| 5209 | @@ -365,42 +459,49 @@ void ListSetting::setValue(int newValue)
|
|---|
| 5210 | }
|
|---|
| 5211 | }
|
|---|
| 5212 |
|
|---|
| 5213 | -void ListSetting::setSettingValue(const QString newValue)
|
|---|
| 5214 | +void ComboBoxTree::setValue(const QString & newValue)
|
|---|
| 5215 | {
|
|---|
| 5216 | - LOG(VB_GENERAL, LOG_ERR, QString("ListSetting::setSettingValue(%1) for %2")
|
|---|
| 5217 | - .arg(newValue).arg(m_settingName));
|
|---|
| 5218 | - m_settingValue=newValue;
|
|---|
| 5219 | + setSettingValue(newValue);
|
|---|
| 5220 | +}
|
|---|
| 5221 | +
|
|---|
| 5222 | +void ComboBoxTree::setSettingValue(const QString newValue)
|
|---|
| 5223 | +{
|
|---|
| 5224 | + StandardSetting::setSettingValue(newValue);
|
|---|
| 5225 | if (m_options.contains(m_settingValue))
|
|---|
| 5226 | {
|
|---|
| 5227 | - LOG(VB_GENERAL, LOG_ERR, QString("ListSetting::setSettingValue(%1) for %2 => %3")
|
|---|
| 5228 | - .arg(newValue).arg(m_settingName).arg(m_options[m_settingValue]));
|
|---|
| 5229 | SetText(m_options[m_settingValue],"value");
|
|---|
| 5230 | }
|
|---|
| 5231 | else
|
|---|
| 5232 | {
|
|---|
| 5233 | - LOG(VB_GENERAL, LOG_ERR, QString("*ListSetting::setSettingValue(%1) for %2")
|
|---|
| 5234 | - .arg(newValue).arg(m_settingName));
|
|---|
| 5235 | + //TODO wha should I do here
|
|---|
| 5236 | SetText(newValue+"*","value");
|
|---|
| 5237 | }
|
|---|
| 5238 | }
|
|---|
| 5239 |
|
|---|
| 5240 |
|
|---|
| 5241 | -void ListSetting::addSelection(QString label, QString value, bool select)
|
|---|
| 5242 | +void ComboBoxTree::addSelection(QString label, QString value, bool select)
|
|---|
| 5243 | {
|
|---|
| 5244 | m_options[value]=label;
|
|---|
| 5245 | //TODO do something with select
|
|---|
| 5246 | - LOG(VB_GENERAL, LOG_ERR, QString("%1 => %2 =? %3")
|
|---|
| 5247 | - .arg(m_settingName).arg(value).arg(m_settingValue));
|
|---|
| 5248 | + if (select)
|
|---|
| 5249 | + LOG(VB_GENERAL, LOG_ERR, QString("ComboBoxTree::addSelection %1").arg(GetText()));
|
|---|
| 5250 | if (value == m_settingValue && m_options.contains(m_settingValue))
|
|---|
| 5251 | SetText(m_options[m_settingValue],"value");
|
|---|
| 5252 | }
|
|---|
| 5253 |
|
|---|
| 5254 | -void ListSetting::clearSelections()
|
|---|
| 5255 | +void ComboBoxTree::removeSelection(QString value)
|
|---|
| 5256 | +{
|
|---|
| 5257 | + m_options.remove(value);
|
|---|
| 5258 | + //TODO update "value"
|
|---|
| 5259 | +}
|
|---|
| 5260 | +
|
|---|
| 5261 | +void ComboBoxTree::clearSelections()
|
|---|
| 5262 | {
|
|---|
| 5263 | m_options.clear();
|
|---|
| 5264 | + //TODO update "value"
|
|---|
| 5265 | }
|
|---|
| 5266 |
|
|---|
| 5267 | -void ListSetting::edit()
|
|---|
| 5268 | +void ComboBoxTree::edit()
|
|---|
| 5269 | {
|
|---|
| 5270 | MythScreenStack *popupStack =
|
|---|
| 5271 | GetMythMainWindow()->GetStack("popup stack");
|
|---|
| 5272 | @@ -411,7 +512,7 @@ void ListSetting::edit()
|
|---|
| 5273 | if (m_menuPopup->Create())
|
|---|
| 5274 | popupStack->AddScreen(m_menuPopup);
|
|---|
| 5275 |
|
|---|
| 5276 | - m_menuPopup->SetReturnEvent(m_screen, "editsetting");
|
|---|
| 5277 | + m_menuPopup->SetReturnEvent(this, "editsetting");
|
|---|
| 5278 |
|
|---|
| 5279 | //populate the list of choice
|
|---|
| 5280 | QMapIterator<QString, QString> i(m_options);
|
|---|
| 5281 | @@ -425,92 +526,20 @@ void ListSetting::edit()
|
|---|
| 5282 | }
|
|---|
| 5283 | }
|
|---|
| 5284 |
|
|---|
| 5285 | -void ListSetting::resultEdit(DialogCompletionEvent *dce)
|
|---|
| 5286 | +void ComboBoxTree::resultEdit(DialogCompletionEvent *dce)
|
|---|
| 5287 | {
|
|---|
| 5288 | if (dce->GetResult()!=-1 && m_settingValue!=dce->GetData().toString())
|
|---|
| 5289 | {
|
|---|
| 5290 | m_haveChanged=true;
|
|---|
| 5291 | setSettingValue(dce->GetData().toString());
|
|---|
| 5292 | + update();
|
|---|
| 5293 | }
|
|---|
| 5294 | }
|
|---|
| 5295 |
|
|---|
| 5296 | -MythSpinBoxDialog::MythSpinBoxDialog(MythScreenStack *parent,
|
|---|
| 5297 | - const QString &message,
|
|---|
| 5298 | - const QString &defaultValue)
|
|---|
| 5299 | - : MythScreenType(parent, "mythspinboxpopup")
|
|---|
| 5300 | -{
|
|---|
| 5301 | - m_message = message;
|
|---|
| 5302 | - m_defaultValue = defaultValue;
|
|---|
| 5303 | - m_spinBox = NULL;
|
|---|
| 5304 | -
|
|---|
| 5305 | - m_id = "";
|
|---|
| 5306 | - m_retObject = NULL;
|
|---|
| 5307 | -}
|
|---|
| 5308 | -
|
|---|
| 5309 | -bool MythSpinBoxDialog::Create(void)
|
|---|
| 5310 | -{
|
|---|
| 5311 | - if (!LoadWindowFromXML("standardsetting-ui.xml", "MythSpinBoxDialog", this))
|
|---|
| 5312 | - return false;
|
|---|
| 5313 | -
|
|---|
| 5314 | - MythUIText *messageText = NULL;
|
|---|
| 5315 | - MythUIButton *okButton = NULL;
|
|---|
| 5316 | - MythUIButton *cancelButton = NULL;
|
|---|
| 5317 | -
|
|---|
| 5318 | - bool err = false;
|
|---|
| 5319 | - UIUtilE::Assign(this, m_spinBox, "input", &err);
|
|---|
| 5320 | - UIUtilE::Assign(this, messageText, "message", &err);
|
|---|
| 5321 | - UIUtilE::Assign(this, okButton, "ok", &err);
|
|---|
| 5322 | - UIUtilW::Assign(this, cancelButton, "cancel");
|
|---|
| 5323 | - if (!m_spinBox)LOG(VB_GENERAL, LOG_ERR, "spinBox");
|
|---|
| 5324 | - if (!messageText)LOG(VB_GENERAL, LOG_ERR, "messageText");
|
|---|
| 5325 | - if (!okButton)LOG(VB_GENERAL, LOG_ERR, "okButton");
|
|---|
| 5326 | -
|
|---|
| 5327 | - if (err)
|
|---|
| 5328 | - {
|
|---|
| 5329 | - LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'MythSpinBoxDialog'");
|
|---|
| 5330 | - return false;
|
|---|
| 5331 | - }
|
|---|
| 5332 | -
|
|---|
| 5333 | - if (cancelButton)
|
|---|
| 5334 | - connect(cancelButton, SIGNAL(Clicked()), SLOT(Close()));
|
|---|
| 5335 | - connect(okButton, SIGNAL(Clicked()), SLOT(sendResult()));
|
|---|
| 5336 | -
|
|---|
| 5337 | - m_spinBox->SetValue(m_defaultValue);
|
|---|
| 5338 | -
|
|---|
| 5339 | - messageText->SetText(m_message);
|
|---|
| 5340 | -
|
|---|
| 5341 | - BuildFocusList();
|
|---|
| 5342 | -
|
|---|
| 5343 | - return true;
|
|---|
| 5344 | -}
|
|---|
| 5345 | -
|
|---|
| 5346 | -void MythSpinBoxDialog::SetReturnEvent(QObject *retobject,
|
|---|
| 5347 | - const QString &resultid)
|
|---|
| 5348 | -{
|
|---|
| 5349 | - m_retObject = retobject;
|
|---|
| 5350 | - m_id = resultid;
|
|---|
| 5351 | -}
|
|---|
| 5352 | -
|
|---|
| 5353 | -void MythSpinBoxDialog::sendResult()
|
|---|
| 5354 | -{
|
|---|
| 5355 | - QString inputString = m_spinBox->GetValue();
|
|---|
| 5356 | - emit haveResult(inputString);
|
|---|
| 5357 | -
|
|---|
| 5358 | - if (m_retObject)
|
|---|
| 5359 | - {
|
|---|
| 5360 | - DialogCompletionEvent *dce = new DialogCompletionEvent(m_id, 0,
|
|---|
| 5361 | - inputString, "");
|
|---|
| 5362 | - QCoreApplication::postEvent(m_retObject, dce);
|
|---|
| 5363 | - }
|
|---|
| 5364 | -
|
|---|
| 5365 | - Close();
|
|---|
| 5366 | -}
|
|---|
| 5367 | -
|
|---|
| 5368 | -void MythSpinBoxDialog::SetRange(int low, int high, int step, uint pageMultiple)
|
|---|
| 5369 | +HostComboBoxTree::HostComboBoxTree(const QString &settingName, const QString &text)
|
|---|
| 5370 | + :ComboBoxTree(settingName, text), HostDBStorage (this, settingName)
|
|---|
| 5371 | {
|
|---|
| 5372 | - if (m_spinBox)
|
|---|
| 5373 | - m_spinBox->SetRange(low, high, step, pageMultiple);
|
|---|
| 5374 | -}
|
|---|
| 5375 | +};
|
|---|
| 5376 |
|
|---|
| 5377 | StandardSettingDialog::StandardSettingDialog(MythScreenStack *parent, const char *name) :
|
|---|
| 5378 | MythScreenType(parent, name),
|
|---|
| 5379 | @@ -521,14 +550,11 @@ StandardSettingDialog::StandardSettingDialog(MythScreenStack *parent, const char
|
|---|
| 5380 | m_selectedSettingLabel(0),
|
|---|
| 5381 | m_selectedSettingValue(0),
|
|---|
| 5382 | m_selectedSettingHelp(0),
|
|---|
| 5383 | - m_cancelButton(0),
|
|---|
| 5384 | - m_saveButton(0),
|
|---|
| 5385 | - m_menuPopup(0),
|
|---|
| 5386 | m_loaded(false),
|
|---|
| 5387 | - m_editedSetting(0)
|
|---|
| 5388 | + m_justChangeSelected(false),
|
|---|
| 5389 | + m_parentSelected(0)
|
|---|
| 5390 | {
|
|---|
| 5391 | m_settingsTree=new GroupSetting(name);
|
|---|
| 5392 | - m_settingsTree->setScreen(this);
|
|---|
| 5393 | }
|
|---|
| 5394 |
|
|---|
| 5395 | StandardSettingDialog::~StandardSettingDialog()
|
|---|
| 5396 | @@ -537,7 +563,6 @@ StandardSettingDialog::~StandardSettingDialog()
|
|---|
| 5397 |
|
|---|
| 5398 | bool StandardSettingDialog::Create(void)
|
|---|
| 5399 | {
|
|---|
| 5400 | - LOG(VB_GENERAL, LOG_ERR, "StandardSettingDialog::Create");
|
|---|
| 5401 | if (!LoadWindowFromXML("standardsetting-ui.xml", "settingssetup", this))
|
|---|
| 5402 | return false;
|
|---|
| 5403 |
|
|---|
| 5404 | @@ -550,8 +575,10 @@ bool StandardSettingDialog::Create(void)
|
|---|
| 5405 | UIUtilW::Assign(this, m_selectedSettingValue, "selectedsettingvalue");
|
|---|
| 5406 | UIUtilW::Assign(this, m_selectedSettingHelp, "selectedsettinghelp");
|
|---|
| 5407 |
|
|---|
| 5408 | - connect(m_buttonTree,SIGNAL(itemSelected(MythUIButtonListItem*)), this,SLOT(settingSelected(MythUIButtonListItem*)));
|
|---|
| 5409 | connect(m_buttonTree,SIGNAL(itemClicked(MythUIButtonListItem*)), this,SLOT(settingClicked(MythUIButtonListItem*)));
|
|---|
| 5410 | + connect(m_buttonTree,SIGNAL(itemSelected(MythUIButtonListItem*)), this,SLOT(settingSelected(MythUIButtonListItem*)));
|
|---|
| 5411 | + //nodeChanged is send only when the node change not when it is initialize so I use itemSelected instead
|
|---|
| 5412 | + //connect(m_buttonTree,SIGNAL(nodeChanged(MythGenericTree*)), this,SLOT(groupSettingChanged(MythGenericTree*)));
|
|---|
| 5413 |
|
|---|
| 5414 | if (error)
|
|---|
| 5415 | {
|
|---|
| 5416 | @@ -562,51 +589,52 @@ bool StandardSettingDialog::Create(void)
|
|---|
| 5417 | return true;
|
|---|
| 5418 | }
|
|---|
| 5419 |
|
|---|
| 5420 | -void StandardSettingDialog::settingSelected(MythUIButtonListItem *item)
|
|---|
| 5421 | +void StandardSettingDialog::groupSettingChanged(MythGenericTree *node)
|
|---|
| 5422 | {
|
|---|
| 5423 | - MythGenericTree * node = qVariantValue<MythGenericTree*>(item->GetData());
|
|---|
| 5424 | - if (m_title)
|
|---|
| 5425 | + QString title;
|
|---|
| 5426 | + QString groupHelp;
|
|---|
| 5427 | + QString settingLabel;
|
|---|
| 5428 | + QString settingValue;
|
|---|
| 5429 | + QString settingHelp;
|
|---|
| 5430 | +
|
|---|
| 5431 | + if (node)
|
|---|
| 5432 | {
|
|---|
| 5433 | + settingLabel = node->GetText();
|
|---|
| 5434 | + settingValue = node->GetText("value");
|
|---|
| 5435 | + settingHelp = node->GetText("help");
|
|---|
| 5436 | +
|
|---|
| 5437 | + /* This is not exactly what I am looking for,
|
|---|
| 5438 | + I am trying to get the current root (i.e. from where the tree is displayed)
|
|---|
| 5439 | + So the following code does not work for more than on list
|
|---|
| 5440 | + I need to create a signal in MythUIButtonTree to give me that node */
|
|---|
| 5441 | + /*node = node->getParent();
|
|---|
| 5442 | if (node)
|
|---|
| 5443 | {
|
|---|
| 5444 | - /*QString newTitle;
|
|---|
| 5445 | - MythGenericTree * parentNode;
|
|---|
| 5446 | - while (parentNode = node->getParent())
|
|---|
| 5447 | - {
|
|---|
| 5448 | - newTitle=QString("%1 > %2").arg(parentNode->GetText()).arg(newTitle);
|
|---|
| 5449 | - node = parentNode;
|
|---|
| 5450 | - }
|
|---|
| 5451 | - m_title->SetText(newTitle);*/
|
|---|
| 5452 | - m_title->SetText(node->getParent()->GetText());
|
|---|
| 5453 | - }
|
|---|
| 5454 | + title = node->GetText();
|
|---|
| 5455 | + groupHelp = node->GetText("help");
|
|---|
| 5456 | + }*/
|
|---|
| 5457 | }
|
|---|
| 5458 |
|
|---|
| 5459 | + if (m_title)
|
|---|
| 5460 | + m_title->SetText(title);
|
|---|
| 5461 | if (m_grouphelp)
|
|---|
| 5462 | - {
|
|---|
| 5463 | - m_grouphelp->SetText(node->getParent()->GetText("help"));
|
|---|
| 5464 | - }
|
|---|
| 5465 | - else
|
|---|
| 5466 | - LOG(VB_GENERAL, LOG_ERR, "StandardSettingDialog::settingSelected()");
|
|---|
| 5467 | -
|
|---|
| 5468 | + m_grouphelp->SetText(groupHelp);
|
|---|
| 5469 | if (m_selectedSettingLabel)
|
|---|
| 5470 | - m_selectedSettingLabel->SetText(item->GetText());
|
|---|
| 5471 | + m_selectedSettingLabel->SetText(settingLabel);
|
|---|
| 5472 | if (m_selectedSettingValue)
|
|---|
| 5473 | - m_selectedSettingValue->SetText(item->GetText("value"));
|
|---|
| 5474 | + m_selectedSettingValue->SetText(settingValue);
|
|---|
| 5475 | if (m_selectedSettingHelp)
|
|---|
| 5476 | - m_selectedSettingHelp->SetText(item->GetText("help"));
|
|---|
| 5477 | -
|
|---|
| 5478 | -
|
|---|
| 5479 | + m_selectedSettingHelp->SetText(settingHelp);
|
|---|
| 5480 | }
|
|---|
| 5481 |
|
|---|
| 5482 | void StandardSettingDialog::settingClicked(MythUIButtonListItem *item)
|
|---|
| 5483 | {
|
|---|
| 5484 | + LOG(VB_GENERAL, LOG_ERR, QString("StandardSettingDialog::settingClicked"));
|
|---|
| 5485 | MythGenericTree* tree = item->GetData().value<MythGenericTree*>();
|
|---|
| 5486 | + if (!tree)return;
|
|---|
| 5487 | StandardSetting *ss = dynamic_cast<StandardSetting*>(tree);
|
|---|
| 5488 | if (ss)
|
|---|
| 5489 | - {
|
|---|
| 5490 | - m_editedSetting=ss;
|
|---|
| 5491 | ss->edit();
|
|---|
| 5492 | - }
|
|---|
| 5493 | else
|
|---|
| 5494 | {
|
|---|
| 5495 | GroupSetting *gs = dynamic_cast<GroupSetting*>(tree);
|
|---|
| 5496 | @@ -614,11 +642,21 @@ void StandardSettingDialog::settingClicked(MythUIButtonListItem *item)
|
|---|
| 5497 | {
|
|---|
| 5498 | MythGenericTree *child = gs->getVisibleChildAt(0);
|
|---|
| 5499 | if (child)
|
|---|
| 5500 | - m_buttonTree->SetCurrentNode(child);
|
|---|
| 5501 | + m_buttonTree->SetCurrentNode(child);
|
|---|
| 5502 | }
|
|---|
| 5503 | }
|
|---|
| 5504 | }
|
|---|
| 5505 |
|
|---|
| 5506 | +void StandardSettingDialog::settingSelected(MythUIButtonListItem *item)
|
|---|
| 5507 | +{
|
|---|
| 5508 | + LOG(VB_GENERAL, LOG_ERR, QString("StandardSettingDialog::settingSelected %1").arg(item->GetText()));
|
|---|
| 5509 | + m_justChangeSelected=true;
|
|---|
| 5510 | + MythGenericTree* tree = item->GetData().value<MythGenericTree*>();
|
|---|
| 5511 | + if (tree)
|
|---|
| 5512 | + groupSettingChanged(tree);
|
|---|
| 5513 | +}
|
|---|
| 5514 | +
|
|---|
| 5515 | +
|
|---|
| 5516 | void StandardSettingDialog::customEvent(QEvent *event)
|
|---|
| 5517 | {
|
|---|
| 5518 | if (event->type() == DialogCompletionEvent::kEventType)
|
|---|
| 5519 | @@ -626,18 +664,7 @@ void StandardSettingDialog::customEvent(QEvent *event)
|
|---|
| 5520 | DialogCompletionEvent *dce = (DialogCompletionEvent*)(event);
|
|---|
| 5521 | QString resultid = dce->GetId();
|
|---|
| 5522 |
|
|---|
| 5523 | - if (resultid == "editsetting")
|
|---|
| 5524 | - {
|
|---|
| 5525 | - if (!m_editedSetting) return;
|
|---|
| 5526 | - m_editedSetting->resultEdit(dce);
|
|---|
| 5527 | - m_editedSetting=NULL;
|
|---|
| 5528 | -
|
|---|
| 5529 | - //Force to refresh the button tree. not very elegant but no choice at the moment
|
|---|
| 5530 | - MythGenericTree *currentNode = m_buttonTree->GetCurrentNode();
|
|---|
| 5531 | - m_buttonTree->AssignTree(m_settingsTree);
|
|---|
| 5532 | - m_buttonTree->SetCurrentNode(currentNode);
|
|---|
| 5533 | - }
|
|---|
| 5534 | - else if (resultid == "exit")
|
|---|
| 5535 | + if (resultid == "exit")
|
|---|
| 5536 | {
|
|---|
| 5537 | int buttonnum = dce->GetResult();
|
|---|
| 5538 | if (buttonnum == 0)
|
|---|
| 5539 | @@ -648,16 +675,18 @@ void StandardSettingDialog::customEvent(QEvent *event)
|
|---|
| 5540 | else if (buttonnum == 1)
|
|---|
| 5541 | MythScreenType::Close();
|
|---|
| 5542 | }
|
|---|
| 5543 | +
|
|---|
| 5544 | }
|
|---|
| 5545 | }
|
|---|
| 5546 |
|
|---|
| 5547 | +
|
|---|
| 5548 | void StandardSettingDialog::setSettings(GroupSetting * groupSettings)
|
|---|
| 5549 | {
|
|---|
| 5550 | m_settingsTree=groupSettings;
|
|---|
| 5551 | - m_settingsTree->setScreen(this);
|
|---|
| 5552 | m_settingsTree->Load();
|
|---|
| 5553 | m_buttonTree->AssignTree(m_settingsTree);
|
|---|
| 5554 | - BuildFocusList();
|
|---|
| 5555 | + groupSettingChanged(m_settingsTree);
|
|---|
| 5556 | + BuildFocusList();
|
|---|
| 5557 | }
|
|---|
| 5558 |
|
|---|
| 5559 | void StandardSettingDialog::Save()
|
|---|
| 5560 | @@ -670,25 +699,58 @@ void StandardSettingDialog::Close(void)
|
|---|
| 5561 | {
|
|---|
| 5562 | if (m_settingsTree->haveChanged())
|
|---|
| 5563 | {
|
|---|
| 5564 | - QString label = tr("Exit ?");
|
|---|
| 5565 | + ShowMenu();
|
|---|
| 5566 | + }
|
|---|
| 5567 | + else
|
|---|
| 5568 | + MythScreenType::Close();
|
|---|
| 5569 | +}
|
|---|
| 5570 |
|
|---|
| 5571 | - MythScreenStack *popupStack =
|
|---|
| 5572 | - GetMythMainWindow()->GetStack("popup stack");
|
|---|
| 5573 | +void StandardSettingDialog::ShowMenu (void)
|
|---|
| 5574 | +{
|
|---|
| 5575 | + QString label = tr("Exit ?");
|
|---|
| 5576 |
|
|---|
| 5577 | - MythDialogBox * m_menuPopup =
|
|---|
| 5578 | - new MythDialogBox(label, popupStack, "exitmenu");
|
|---|
| 5579 | + MythScreenStack *popupStack =
|
|---|
| 5580 | + GetMythMainWindow()->GetStack("popup stack");
|
|---|
| 5581 |
|
|---|
| 5582 | - if (m_menuPopup->Create())
|
|---|
| 5583 | - popupStack->AddScreen(m_menuPopup);
|
|---|
| 5584 | + MythDialogBox * m_menuPopup =
|
|---|
| 5585 | + new MythDialogBox(label, popupStack, "exitmenu");
|
|---|
| 5586 |
|
|---|
| 5587 | - m_menuPopup->SetReturnEvent(this, "exit");
|
|---|
| 5588 | + if (m_menuPopup->Create())
|
|---|
| 5589 | + popupStack->AddScreen(m_menuPopup);
|
|---|
| 5590 |
|
|---|
| 5591 | - m_menuPopup->AddButton(tr("Save then Exit"));
|
|---|
| 5592 | - m_menuPopup->AddButton(tr("Exit without saving changes"));
|
|---|
| 5593 | - m_menuPopup->AddButton(tr("Cancel"));
|
|---|
| 5594 | - }
|
|---|
| 5595 | - else
|
|---|
| 5596 | - MythScreenType::Close();
|
|---|
| 5597 | + m_menuPopup->SetReturnEvent(this, "exit");
|
|---|
| 5598 | +
|
|---|
| 5599 | + m_menuPopup->AddButton(tr("Save then Exit"));
|
|---|
| 5600 | + m_menuPopup->AddButton(tr("Exit without saving changes"));
|
|---|
| 5601 | + m_menuPopup->AddButton(tr("Cancel"));
|
|---|
| 5602 | +}
|
|---|
| 5603 | +
|
|---|
| 5604 | +bool StandardSettingDialog::keyPressEvent (QKeyEvent * event)
|
|---|
| 5605 | +{
|
|---|
| 5606 | + if (MythScreenType::keyPressEvent (event))
|
|---|
| 5607 | + return true;
|
|---|
| 5608 | +
|
|---|
| 5609 | + QStringList actions;
|
|---|
| 5610 | + bool handled = GetMythMainWindow()->TranslateKeyPress("Global", event, actions);
|
|---|
| 5611 | +
|
|---|
| 5612 | + for (int i = 0; i < actions.size() && !handled; i++)
|
|---|
| 5613 | + {
|
|---|
| 5614 | + QString action = actions[i];
|
|---|
| 5615 | + handled = true;
|
|---|
| 5616 | +
|
|---|
| 5617 | + if (action == "INFO") //should it be MENU?
|
|---|
| 5618 | + {
|
|---|
| 5619 | + GroupSetting *gs = dynamic_cast<GroupSetting*>(m_buttonTree->GetCurrentNode());
|
|---|
| 5620 | + if (gs)
|
|---|
| 5621 | + {
|
|---|
| 5622 | + gs->menu();
|
|---|
| 5623 | + }
|
|---|
| 5624 | + }
|
|---|
| 5625 | + else
|
|---|
| 5626 | + handled = false;
|
|---|
| 5627 | + }
|
|---|
| 5628 | +
|
|---|
| 5629 | + return handled;
|
|---|
| 5630 | }
|
|---|
| 5631 |
|
|---|
| 5632 |
|
|---|
| 5633 | @@ -696,3 +758,4 @@ void StandardSettingDialog::Close(void)
|
|---|
| 5634 |
|
|---|
| 5635 |
|
|---|
| 5636 |
|
|---|
| 5637 | +
|
|---|
| 5638 | diff --git a/mythtv/programs/mythfrontend/standardsettings.h b/mythtv/programs/mythfrontend/standardsettings.h
|
|---|
| 5639 | index 095057d..a01e99f 100755
|
|---|
| 5640 | --- a/mythtv/programs/mythfrontend/standardsettings.h
|
|---|
| 5641 | +++ b/mythtv/programs/mythfrontend/standardsettings.h
|
|---|
| 5642 | @@ -5,17 +5,18 @@
|
|---|
| 5643 | #include <mythdialogbox.h>
|
|---|
| 5644 | #include <mythuibuttontree.h>
|
|---|
| 5645 | #include <mythgenerictree.h>
|
|---|
| 5646 | +#include <mythuibuttonlist.h>
|
|---|
| 5647 | #include <QMap>
|
|---|
| 5648 |
|
|---|
| 5649 | /** TODO LIST
|
|---|
| 5650 | - ListSetting is not properly initialize, it should show the label not the value
|
|---|
| 5651 | + ComboBoxTree is not properly initialize, it should show the label not the value
|
|---|
| 5652 | Implement Save method
|
|---|
| 5653 | */
|
|---|
| 5654 |
|
|---|
| 5655 | /*
|
|---|
| 5656 | MythUIButtonListItem Type
|
|---|
| 5657 |
|
|---|
| 5658 | -*TextualSetting
|
|---|
| 5659 | +*LineEditTree
|
|---|
| 5660 | PasswordSetting
|
|---|
| 5661 | DirectorySetting
|
|---|
| 5662 | FileSetting
|
|---|
| 5663 | @@ -23,10 +24,10 @@ FileSetting
|
|---|
| 5664 | SpinSetting
|
|---|
| 5665 | GroupSetting
|
|---|
| 5666 | GroupBooleanSetting
|
|---|
| 5667 | -GroupListSetting
|
|---|
| 5668 | -ListSetting
|
|---|
| 5669 | -ListSetting+refresh
|
|---|
| 5670 | -FreeListSetting
|
|---|
| 5671 | +GroupComboBoxTree
|
|---|
| 5672 | +ComboBoxTree
|
|---|
| 5673 | +ComboBoxTree+refresh
|
|---|
| 5674 | +FreeComboBoxTree
|
|---|
| 5675 | Button for testing
|
|---|
| 5676 | */
|
|---|
| 5677 | /*
|
|---|
| 5678 | @@ -57,8 +58,9 @@ class GlobalDBSetting : public DBSetting
|
|---|
| 5679 | /**
|
|---|
| 5680 | * Group Setting together
|
|---|
| 5681 | */
|
|---|
| 5682 | -class GroupSetting : public MythGenericTree, public Storage
|
|---|
| 5683 | +class GroupSetting : public QObject, public MythGenericTree, public Storage
|
|---|
| 5684 | {
|
|---|
| 5685 | + Q_OBJECT
|
|---|
| 5686 | public:
|
|---|
| 5687 | GroupSetting(const QString &text = "");
|
|---|
| 5688 | virtual ~GroupSetting(){};
|
|---|
| 5689 | @@ -68,62 +70,62 @@ class GroupSetting : public MythGenericTree, public Storage
|
|---|
| 5690 | void addChild(GroupSetting *groupSetting);
|
|---|
| 5691 | void setHelpText(const QString &description);
|
|---|
| 5692 | QString getHelpText(){return GetText("help");};
|
|---|
| 5693 | -
|
|---|
| 5694 | - void setScreen(MythScreenType *screen);
|
|---|
| 5695 | + void setEnabled(bool enabled);
|
|---|
| 5696 |
|
|---|
| 5697 | void Save();
|
|---|
| 5698 | void Load();
|
|---|
| 5699 | virtual void edit();
|
|---|
| 5700 | - //virtual void resultEdit(DialogCompletionEvent *dce);
|
|---|
| 5701 | + virtual void menu();
|
|---|
| 5702 | + virtual void resultMenu(DialogCompletionEvent *dce);
|
|---|
| 5703 | virtual bool haveChanged();
|
|---|
| 5704 | +
|
|---|
| 5705 | + /*Hack to be able to update*/
|
|---|
| 5706 | + MythUIButtonListItem *CreateListButton(MythUIButtonList *list);
|
|---|
| 5707 | + void setItem(MythUIButtonListItem * item);
|
|---|
| 5708 | + virtual void update();
|
|---|
| 5709 | protected:
|
|---|
| 5710 | const QString getSettingName(){return "";};
|
|---|
| 5711 | void setSettingValue(const QString newValue){};
|
|---|
| 5712 | - MythScreenType *m_screen;
|
|---|
| 5713 | -
|
|---|
| 5714 | + MythUIButtonListItem *m_item;
|
|---|
| 5715 | };
|
|---|
| 5716 |
|
|---|
| 5717 |
|
|---|
| 5718 | // allow to set a textual setting
|
|---|
| 5719 | class StandardSetting : public GroupSetting, public StorageUser
|
|---|
| 5720 | {
|
|---|
| 5721 | + Q_OBJECT
|
|---|
| 5722 | public:
|
|---|
| 5723 | StandardSetting(const QString &settingName, const QString &text = "");
|
|---|
| 5724 | virtual ~StandardSetting();
|
|---|
| 5725 |
|
|---|
| 5726 | const QString getHelpText();
|
|---|
| 5727 | -
|
|---|
| 5728 | -
|
|---|
| 5729 | - const QString getTextValue() const;
|
|---|
| 5730 | + //const QString getTextValue() const;
|
|---|
| 5731 | const QString getValue() const{return GetText("value");};
|
|---|
| 5732 | + virtual void customEvent(QEvent *event);
|
|---|
| 5733 | virtual void resultEdit(DialogCompletionEvent *dce)=0;
|
|---|
| 5734 | bool haveChanged();
|
|---|
| 5735 |
|
|---|
| 5736 | void SetDBValue(const QString &text);
|
|---|
| 5737 | QString GetDBValue(void) const { return m_settingValue ;};
|
|---|
| 5738 | + signals:
|
|---|
| 5739 | + void settingValueChanged(const QString & newValue);
|
|---|
| 5740 |
|
|---|
| 5741 | protected:
|
|---|
| 5742 | - //void SaveChildren();
|
|---|
| 5743 | - //void LoadChildren();
|
|---|
| 5744 | - //const QString settingName();//{return m_settingName;};
|
|---|
| 5745 | - virtual void setSettingValue(const QString newValue);//{m_settingValue=newValue;};
|
|---|
| 5746 | + virtual void setSettingValue(const QString newValue);
|
|---|
| 5747 | QString m_settingName;
|
|---|
| 5748 | QString m_settingValue;
|
|---|
| 5749 | -
|
|---|
| 5750 | -
|
|---|
| 5751 | bool m_haveChanged;
|
|---|
| 5752 | - //DBSetting * m_DBSetting;
|
|---|
| 5753 | };
|
|---|
| 5754 |
|
|---|
| 5755 |
|
|---|
| 5756 | /**
|
|---|
| 5757 | * Display and edit a textual value
|
|---|
| 5758 | */
|
|---|
| 5759 | -class TextualSetting : public StandardSetting
|
|---|
| 5760 | +class LineEditTree : public StandardSetting
|
|---|
| 5761 | {
|
|---|
| 5762 | public:
|
|---|
| 5763 | - TextualSetting(const QString &settingName, const QString &text = "", bool password=false);
|
|---|
| 5764 | - virtual ~TextualSetting(){};
|
|---|
| 5765 | + LineEditTree(const QString &settingName, const QString &text = "", bool password=false);
|
|---|
| 5766 | + virtual ~LineEditTree(){};
|
|---|
| 5767 | void setValue(const QString &newValue);
|
|---|
| 5768 | void setSettingValue(const QString newValue);
|
|---|
| 5769 | void edit();
|
|---|
| 5770 | @@ -133,53 +135,50 @@ class TextualSetting : public StandardSetting
|
|---|
| 5771 | bool m_password;
|
|---|
| 5772 | };
|
|---|
| 5773 |
|
|---|
| 5774 | -class GlobalTextualSetting : public TextualSetting, public GlobalDBStorage
|
|---|
| 5775 | +class GlobalLineEditTree : public LineEditTree, public GlobalDBStorage
|
|---|
| 5776 | {
|
|---|
| 5777 | public:
|
|---|
| 5778 | - GlobalTextualSetting(const QString &settingName, const QString &text = "", bool password=false)
|
|---|
| 5779 | - :TextualSetting(settingName, text, password), GlobalDBStorage (this, settingName)
|
|---|
| 5780 | + GlobalLineEditTree(const QString &settingName, const QString &text = "", bool password=false)
|
|---|
| 5781 | + :LineEditTree(settingName, text, password), GlobalDBStorage (this, settingName)
|
|---|
| 5782 | {
|
|---|
| 5783 | };
|
|---|
| 5784 | void Load()
|
|---|
| 5785 | {
|
|---|
| 5786 | - TextualSetting::Load();
|
|---|
| 5787 | + LineEditTree::Load();
|
|---|
| 5788 | GlobalDBStorage::Load();
|
|---|
| 5789 | }
|
|---|
| 5790 | void Save()
|
|---|
| 5791 | {
|
|---|
| 5792 | - TextualSetting::Save();
|
|---|
| 5793 | + LineEditTree::Save();
|
|---|
| 5794 | GlobalDBStorage::Save();
|
|---|
| 5795 | }
|
|---|
| 5796 | -
|
|---|
| 5797 | -
|
|---|
| 5798 | -
|
|---|
| 5799 | };
|
|---|
| 5800 |
|
|---|
| 5801 | -class HostTextualSetting : public TextualSetting, public HostDBStorage
|
|---|
| 5802 | +class HostLineEditTree : public LineEditTree, public HostDBStorage
|
|---|
| 5803 | {
|
|---|
| 5804 | public:
|
|---|
| 5805 | - HostTextualSetting(const QString &settingName, const QString &text = "", bool password=false)
|
|---|
| 5806 | - :TextualSetting(settingName, text, password), HostDBStorage (this, settingName)
|
|---|
| 5807 | + HostLineEditTree(const QString &settingName, const QString &text = "", bool password=false)
|
|---|
| 5808 | + :LineEditTree(settingName, text, password), HostDBStorage (this, settingName)
|
|---|
| 5809 | {
|
|---|
| 5810 | };
|
|---|
| 5811 | void Load()
|
|---|
| 5812 | {
|
|---|
| 5813 | - TextualSetting::Load();
|
|---|
| 5814 | + LineEditTree::Load();
|
|---|
| 5815 | HostDBStorage::Load();
|
|---|
| 5816 | }
|
|---|
| 5817 |
|
|---|
| 5818 | void Save()
|
|---|
| 5819 | {
|
|---|
| 5820 | - TextualSetting::Save();
|
|---|
| 5821 | + LineEditTree::Save();
|
|---|
| 5822 | HostDBStorage::Save();
|
|---|
| 5823 | }
|
|---|
| 5824 | };
|
|---|
| 5825 |
|
|---|
| 5826 | -class TransTextualSetting : public TextualSetting, public TransientStorage
|
|---|
| 5827 | +class TransLineEditTree : public LineEditTree, public TransientStorage
|
|---|
| 5828 | {
|
|---|
| 5829 | public:
|
|---|
| 5830 | - TransTextualSetting(bool password=false)
|
|---|
| 5831 | - :TextualSetting("", "", password), TransientStorage()
|
|---|
| 5832 | + TransLineEditTree(bool password=false)
|
|---|
| 5833 | + :LineEditTree("", "", password), TransientStorage()
|
|---|
| 5834 | {
|
|---|
| 5835 | };
|
|---|
| 5836 | };
|
|---|
| 5837 | @@ -189,64 +188,63 @@ class TransTextualSetting : public TextualSetting, public TransientStorage
|
|---|
| 5838 | * Display and edit a textual value
|
|---|
| 5839 | */
|
|---|
| 5840 |
|
|---|
| 5841 | -class ListSetting : public StandardSetting
|
|---|
| 5842 | +class ComboBoxTree : public StandardSetting
|
|---|
| 5843 | {
|
|---|
| 5844 | public:
|
|---|
| 5845 | - ListSetting(const QString &settingName, const QString &text = "");
|
|---|
| 5846 | - virtual ~ListSetting(){};
|
|---|
| 5847 | + ComboBoxTree(const QString &settingName, const QString &text = "");
|
|---|
| 5848 | + virtual ~ComboBoxTree(){};
|
|---|
| 5849 | void setValue(int newValue);
|
|---|
| 5850 | + void setValue(const QString & newValue);
|
|---|
| 5851 | void setSettingValue(const QString newValue);
|
|---|
| 5852 | void addSelection(QString label, QString value, bool select = false);
|
|---|
| 5853 | + void removeSelection(QString value);
|
|---|
| 5854 | void clearSelections();
|
|---|
| 5855 | virtual void edit();
|
|---|
| 5856 | virtual void resultEdit(DialogCompletionEvent *dce);
|
|---|
| 5857 | - private:
|
|---|
| 5858 | + protected:
|
|---|
| 5859 | QMap<QString, QString> m_options;
|
|---|
| 5860 | };
|
|---|
| 5861 |
|
|---|
| 5862 | -class GlobalListSetting : public ListSetting, public GlobalDBStorage
|
|---|
| 5863 | +class GlobalComboBoxTree : public ComboBoxTree, public GlobalDBStorage
|
|---|
| 5864 | {
|
|---|
| 5865 | public:
|
|---|
| 5866 | - GlobalListSetting(const QString &settingName, const QString &text = "")
|
|---|
| 5867 | - :ListSetting(settingName, text), GlobalDBStorage (this, settingName)
|
|---|
| 5868 | + GlobalComboBoxTree(const QString &settingName, const QString &text = "")
|
|---|
| 5869 | + :ComboBoxTree(settingName, text), GlobalDBStorage (this, settingName)
|
|---|
| 5870 | {
|
|---|
| 5871 | };
|
|---|
| 5872 | void Load()
|
|---|
| 5873 | {
|
|---|
| 5874 | - ListSetting::Load();
|
|---|
| 5875 | + ComboBoxTree::Load();
|
|---|
| 5876 | GlobalDBStorage::Load();
|
|---|
| 5877 | }
|
|---|
| 5878 | void Save()
|
|---|
| 5879 | {
|
|---|
| 5880 | - ListSetting::Save();
|
|---|
| 5881 | + ComboBoxTree::Save();
|
|---|
| 5882 | GlobalDBStorage::Save();
|
|---|
| 5883 | }
|
|---|
| 5884 | };
|
|---|
| 5885 |
|
|---|
| 5886 | -class HostListSetting : public ListSetting, public HostDBStorage
|
|---|
| 5887 | +class HostComboBoxTree : public ComboBoxTree, public HostDBStorage
|
|---|
| 5888 | {
|
|---|
| 5889 | public:
|
|---|
| 5890 | - HostListSetting(const QString &settingName, const QString &text = "")
|
|---|
| 5891 | - :ListSetting(settingName, text), HostDBStorage (this, settingName)
|
|---|
| 5892 | - {
|
|---|
| 5893 | - };
|
|---|
| 5894 | + HostComboBoxTree(const QString &settingName, const QString &text = "");
|
|---|
| 5895 | void Load()
|
|---|
| 5896 | {
|
|---|
| 5897 | - ListSetting::Load();
|
|---|
| 5898 | + ComboBoxTree::Load();
|
|---|
| 5899 | HostDBStorage::Load();
|
|---|
| 5900 | }
|
|---|
| 5901 | void Save()
|
|---|
| 5902 | {
|
|---|
| 5903 | - ListSetting::Save();
|
|---|
| 5904 | + ComboBoxTree::Save();
|
|---|
| 5905 | HostDBStorage::Save();
|
|---|
| 5906 | }
|
|---|
| 5907 | };
|
|---|
| 5908 |
|
|---|
| 5909 | -class TransListSetting : public ListSetting, public TransientStorage
|
|---|
| 5910 | +class TransComboBoxTree : public ComboBoxTree, public TransientStorage
|
|---|
| 5911 | {
|
|---|
| 5912 | public:
|
|---|
| 5913 | - TransListSetting()
|
|---|
| 5914 | - :ListSetting("", ""), TransientStorage()
|
|---|
| 5915 | + TransComboBoxTree()
|
|---|
| 5916 | + :ComboBoxTree("", ""), TransientStorage()
|
|---|
| 5917 | {
|
|---|
| 5918 | };
|
|---|
| 5919 | };
|
|---|
| 5920 | @@ -255,133 +253,143 @@ class TransListSetting : public ListSetting, public TransientStorage
|
|---|
| 5921 | * Display and edit a textual value
|
|---|
| 5922 | */
|
|---|
| 5923 |
|
|---|
| 5924 | -class BoolSetting : public StandardSetting
|
|---|
| 5925 | +class CheckBoxTree : public StandardSetting
|
|---|
| 5926 | {
|
|---|
| 5927 | public:
|
|---|
| 5928 | - BoolSetting(const QString &settingName, const QString &text = "");
|
|---|
| 5929 | - virtual ~BoolSetting(){};
|
|---|
| 5930 | + CheckBoxTree(const QString &settingName, const QString &text = "");
|
|---|
| 5931 | + virtual ~CheckBoxTree(){};
|
|---|
| 5932 | void setValue(bool newValue);
|
|---|
| 5933 | bool boolValue() const{return GetText("value")=="1";};
|
|---|
| 5934 | void edit();
|
|---|
| 5935 | void resultEdit(DialogCompletionEvent *dce);
|
|---|
| 5936 | + /**
|
|---|
| 5937 | + * Add child for a specific state only
|
|---|
| 5938 | + * TODO override addChild() to add to m_children
|
|---|
| 5939 | +
|
|---|
| 5940 | + */
|
|---|
| 5941 | void addChild (bool value, GroupSetting *child);
|
|---|
| 5942 | + //TODO override Load/Save so m_OffChildren and m_OnChildren Loaded/Saved too
|
|---|
| 5943 | + //void setScreen(MythScreenType *screen);
|
|---|
| 5944 |
|
|---|
| 5945 | protected:
|
|---|
| 5946 | virtual void setSettingValue(const QString newValue);
|
|---|
| 5947 | private:
|
|---|
| 5948 | - QList<GroupSetting *> m_OnChildren;
|
|---|
| 5949 | - QList<GroupSetting *> m_OffChildren;
|
|---|
| 5950 | + GroupSetting m_OnChildren;
|
|---|
| 5951 | + GroupSetting m_OffChildren;
|
|---|
| 5952 | + QList<GroupSetting *> m_children;//both on and off
|
|---|
| 5953 | };
|
|---|
| 5954 |
|
|---|
| 5955 | -class GlobalBoolSetting : public BoolSetting, public GlobalDBStorage
|
|---|
| 5956 | +class GlobalCheckBoxTree : public CheckBoxTree, public GlobalDBStorage
|
|---|
| 5957 | {
|
|---|
| 5958 | public:
|
|---|
| 5959 | - GlobalBoolSetting(const QString &settingName, const QString &text = "")
|
|---|
| 5960 | - : BoolSetting(settingName, text), GlobalDBStorage (this, settingName)
|
|---|
| 5961 | + GlobalCheckBoxTree(const QString &settingName, const QString &text = "")
|
|---|
| 5962 | + : CheckBoxTree(settingName, text), GlobalDBStorage (this, settingName)
|
|---|
| 5963 | {
|
|---|
| 5964 | };
|
|---|
| 5965 | void Load()
|
|---|
| 5966 | {
|
|---|
| 5967 | - BoolSetting::Load();
|
|---|
| 5968 | + CheckBoxTree::Load();
|
|---|
| 5969 | GlobalDBStorage::Load();
|
|---|
| 5970 | }
|
|---|
| 5971 | void Save()
|
|---|
| 5972 | {
|
|---|
| 5973 | - BoolSetting::Save();
|
|---|
| 5974 | + CheckBoxTree::Save();
|
|---|
| 5975 | GlobalDBStorage::Save();
|
|---|
| 5976 | }
|
|---|
| 5977 | };
|
|---|
| 5978 |
|
|---|
| 5979 | -class HostBoolSetting : public BoolSetting, public HostDBStorage
|
|---|
| 5980 | +class HostCheckBoxTree : public CheckBoxTree, public HostDBStorage
|
|---|
| 5981 | {
|
|---|
| 5982 | public:
|
|---|
| 5983 | - HostBoolSetting(const QString &settingName, const QString &text = "")
|
|---|
| 5984 | - : BoolSetting(settingName, text), HostDBStorage (this, settingName)
|
|---|
| 5985 | + HostCheckBoxTree(const QString &settingName, const QString &text = "")
|
|---|
| 5986 | + : CheckBoxTree(settingName, text), HostDBStorage (this, settingName)
|
|---|
| 5987 | {
|
|---|
| 5988 | };
|
|---|
| 5989 | void Load()
|
|---|
| 5990 | {
|
|---|
| 5991 | - BoolSetting::Load();
|
|---|
| 5992 | + CheckBoxTree::Load();
|
|---|
| 5993 | HostDBStorage::Load();
|
|---|
| 5994 | }
|
|---|
| 5995 | void Save()
|
|---|
| 5996 | {
|
|---|
| 5997 | - BoolSetting::Save();
|
|---|
| 5998 | + CheckBoxTree::Save();
|
|---|
| 5999 | HostDBStorage::Save();
|
|---|
| 6000 | }
|
|---|
| 6001 | };
|
|---|
| 6002 |
|
|---|
| 6003 | -class TransBoolSetting : public BoolSetting, public TransientStorage
|
|---|
| 6004 | +class TransCheckBoxTree : public CheckBoxTree, public TransientStorage
|
|---|
| 6005 | {
|
|---|
| 6006 | public:
|
|---|
| 6007 | - TransBoolSetting()
|
|---|
| 6008 | - : BoolSetting(""), TransientStorage()
|
|---|
| 6009 | + TransCheckBoxTree()
|
|---|
| 6010 | + : CheckBoxTree(""), TransientStorage()
|
|---|
| 6011 | {
|
|---|
| 6012 | };
|
|---|
| 6013 | };
|
|---|
| 6014 |
|
|---|
| 6015 |
|
|---|
| 6016 |
|
|---|
| 6017 | -class RangeSetting : public StandardSetting
|
|---|
| 6018 | +class SpinBoxTree : public StandardSetting
|
|---|
| 6019 | {
|
|---|
| 6020 | public:
|
|---|
| 6021 | - RangeSetting(const QString &settingName, int min, int max, int step, bool allow_single_step = false);
|
|---|
| 6022 | - virtual ~RangeSetting(){};
|
|---|
| 6023 | + SpinBoxTree(const QString &settingName, int min, int max, int step, bool allow_single_step = false);
|
|---|
| 6024 | + virtual ~SpinBoxTree(){};
|
|---|
| 6025 | virtual void edit();
|
|---|
| 6026 | virtual void resultEdit(DialogCompletionEvent *dce);
|
|---|
| 6027 | - // void SetRange(int min, int max);
|
|---|
| 6028 | void setValue(int newValue);
|
|---|
| 6029 | + void setValue(const QString &newValue);
|
|---|
| 6030 | int intValue() const{return GetText("value").toInt();};
|
|---|
| 6031 | + void setSettingValue(const QString &newValue);
|
|---|
| 6032 | +
|
|---|
| 6033 | protected:
|
|---|
| 6034 | - void update();
|
|---|
| 6035 | + //void update();
|
|---|
| 6036 | private:
|
|---|
| 6037 | int m_min;
|
|---|
| 6038 | int m_max;
|
|---|
| 6039 | };
|
|---|
| 6040 |
|
|---|
| 6041 | -class GlobalRangeSetting: public RangeSetting, public GlobalDBStorage
|
|---|
| 6042 | +class GlobalSpinBoxTree: public SpinBoxTree, public GlobalDBStorage
|
|---|
| 6043 | {
|
|---|
| 6044 | public:
|
|---|
| 6045 | - GlobalRangeSetting(const QString &settingName, int min, int max, int step, bool allow_single_step = false)
|
|---|
| 6046 | - :RangeSetting(settingName, min, max, step, allow_single_step), GlobalDBStorage (this, settingName)
|
|---|
| 6047 | + GlobalSpinBoxTree(const QString &settingName, int min, int max, int step, bool allow_single_step = false)
|
|---|
| 6048 | + :SpinBoxTree(settingName, min, max, step, allow_single_step), GlobalDBStorage (this, settingName)
|
|---|
| 6049 | {
|
|---|
| 6050 | };
|
|---|
| 6051 | void Load()
|
|---|
| 6052 | {
|
|---|
| 6053 | - RangeSetting::Load();
|
|---|
| 6054 | + SpinBoxTree::Load();
|
|---|
| 6055 | GlobalDBStorage::Load();
|
|---|
| 6056 | }
|
|---|
| 6057 | void Save()
|
|---|
| 6058 | {
|
|---|
| 6059 | - RangeSetting::Save();
|
|---|
| 6060 | + SpinBoxTree::Save();
|
|---|
| 6061 | GlobalDBStorage::Save();
|
|---|
| 6062 | }
|
|---|
| 6063 | };
|
|---|
| 6064 |
|
|---|
| 6065 | -class HostRangeSetting: public RangeSetting, public HostDBStorage
|
|---|
| 6066 | +class HostSpinBoxTree: public SpinBoxTree, public HostDBStorage
|
|---|
| 6067 | {
|
|---|
| 6068 | public:
|
|---|
| 6069 | - HostRangeSetting(const QString &settingName, int min, int max, int step, bool allow_single_step = false)
|
|---|
| 6070 | - :RangeSetting(settingName, min, max, step, allow_single_step), HostDBStorage (this, settingName)
|
|---|
| 6071 | + HostSpinBoxTree(const QString &settingName, int min, int max, int step, bool allow_single_step = false)
|
|---|
| 6072 | + :SpinBoxTree(settingName, min, max, step, allow_single_step), HostDBStorage (this, settingName)
|
|---|
| 6073 | {
|
|---|
| 6074 | };
|
|---|
| 6075 | void Load()
|
|---|
| 6076 | {
|
|---|
| 6077 | - RangeSetting::Load();
|
|---|
| 6078 | + SpinBoxTree::Load();
|
|---|
| 6079 | HostDBStorage::Load();
|
|---|
| 6080 | }
|
|---|
| 6081 | void Save()
|
|---|
| 6082 | {
|
|---|
| 6083 | - RangeSetting::Save();
|
|---|
| 6084 | + SpinBoxTree::Save();
|
|---|
| 6085 | HostDBStorage::Save();
|
|---|
| 6086 | }
|
|---|
| 6087 | };
|
|---|
| 6088 |
|
|---|
| 6089 | -class TransRangeSetting: public RangeSetting, public TransientStorage
|
|---|
| 6090 | +class TransSpinBoxTree: public SpinBoxTree, public TransientStorage
|
|---|
| 6091 | {
|
|---|
| 6092 | public:
|
|---|
| 6093 | - TransRangeSetting(int min, int max, int step, bool allow_single_step = false)
|
|---|
| 6094 | - :RangeSetting("", min, max, step, allow_single_step), TransientStorage()
|
|---|
| 6095 | + TransSpinBoxTree(int min, int max, int step, bool allow_single_step = false)
|
|---|
| 6096 | + :SpinBoxTree("", min, max, step, allow_single_step), TransientStorage()
|
|---|
| 6097 | {
|
|---|
| 6098 | };
|
|---|
| 6099 | };
|
|---|
| 6100 | @@ -389,38 +397,6 @@ class TransRangeSetting: public RangeSetting, public TransientStorage
|
|---|
| 6101 |
|
|---|
| 6102 |
|
|---|
| 6103 |
|
|---|
| 6104 | -
|
|---|
| 6105 | -class /*MUI_PUBLIC*/ MythSpinBoxDialog : public MythScreenType
|
|---|
| 6106 | -{
|
|---|
| 6107 | - Q_OBJECT
|
|---|
| 6108 | -
|
|---|
| 6109 | - public:
|
|---|
| 6110 | - MythSpinBoxDialog(MythScreenStack *parent, const QString &message,
|
|---|
| 6111 | - const QString &defaultValue = "");
|
|---|
| 6112 | -
|
|---|
| 6113 | - bool Create(void);
|
|---|
| 6114 | -
|
|---|
| 6115 | - void SetRange(int low, int high, int step, uint pageMultiple = 5);
|
|---|
| 6116 | -
|
|---|
| 6117 | - void SetReturnEvent(QObject *retobject, const QString &resultid);
|
|---|
| 6118 | -
|
|---|
| 6119 | - signals:
|
|---|
| 6120 | - void haveResult(QString);
|
|---|
| 6121 | -
|
|---|
| 6122 | - protected:
|
|---|
| 6123 | - MythUISpinBox *m_spinBox;
|
|---|
| 6124 | - QString m_message;
|
|---|
| 6125 | - QString m_defaultValue;
|
|---|
| 6126 | - QObject *m_retObject;
|
|---|
| 6127 | - QString m_id;
|
|---|
| 6128 | -
|
|---|
| 6129 | - protected slots:
|
|---|
| 6130 | - void sendResult();
|
|---|
| 6131 | -};
|
|---|
| 6132 | -
|
|---|
| 6133 | -
|
|---|
| 6134 | -
|
|---|
| 6135 | -
|
|---|
| 6136 | class StandardSettingDialog : public MythScreenType
|
|---|
| 6137 | {
|
|---|
| 6138 | Q_OBJECT
|
|---|
| 6139 | @@ -432,27 +408,29 @@ class StandardSettingDialog : public MythScreenType
|
|---|
| 6140 | bool Create(void);
|
|---|
| 6141 | virtual void customEvent(QEvent *event);
|
|---|
| 6142 | void setSettings(GroupSetting * groupSettings);
|
|---|
| 6143 | + virtual bool keyPressEvent (QKeyEvent *);
|
|---|
| 6144 | + virtual void ShowMenu (void);
|
|---|
| 6145 | public slots:
|
|---|
| 6146 | void Close(void);
|
|---|
| 6147 | protected:
|
|---|
| 6148 | GroupSetting *m_settingsTree;
|
|---|
| 6149 | MythUIButtonTree *m_buttonTree;
|
|---|
| 6150 | private slots:
|
|---|
| 6151 | - void settingSelected(MythUIButtonListItem *item);
|
|---|
| 6152 | void settingClicked(MythUIButtonListItem *item);
|
|---|
| 6153 | + void settingSelected(MythUIButtonListItem *item);
|
|---|
| 6154 | + void groupSettingChanged(MythGenericTree *item);
|
|---|
| 6155 | private:
|
|---|
| 6156 | void Save();
|
|---|
| 6157 | - MythUIText *m_title;
|
|---|
| 6158 | - MythUIText *m_grouphelp;
|
|---|
| 6159 | + MythUIText *m_title;
|
|---|
| 6160 | + MythUIText *m_grouphelp;
|
|---|
| 6161 | MythUIButtonList *m_titleList;
|
|---|
| 6162 | - MythUIText *m_selectedSettingLabel;
|
|---|
| 6163 | - MythUIText *m_selectedSettingValue;
|
|---|
| 6164 | - MythUIText *m_selectedSettingHelp;
|
|---|
| 6165 | - MythUIButton *m_cancelButton;
|
|---|
| 6166 | - MythUIButton *m_saveButton;
|
|---|
| 6167 | - MythDialogBox *m_menuPopup;
|
|---|
| 6168 | + MythUIText *m_selectedSettingLabel;
|
|---|
| 6169 | + MythUIText *m_selectedSettingValue;
|
|---|
| 6170 | + MythUIText *m_selectedSettingHelp;
|
|---|
| 6171 | bool m_loaded;
|
|---|
| 6172 | - StandardSetting * m_editedSetting;
|
|---|
| 6173 | + bool m_justChangeSelected;
|
|---|
| 6174 | + MythGenericTree *m_parentSelected;
|
|---|
| 6175 | +
|
|---|
| 6176 | };
|
|---|
| 6177 |
|
|---|
| 6178 |
|
|---|