Ticket #10092: mythfrontendsetup.diff
| File mythfrontendsetup.diff, 153.7 KB (added by , 15 years ago) |
|---|
-
mythtv/programs/mythfrontend/globalsettings.cpp
diff --git a/mythtv/programs/mythfrontend/globalsettings.cpp b/mythtv/programs/mythfrontend/globalsettings.cpp index a379b8f..883e894 100644
a b 24 24 #include "mythcorecontext.h" 25 25 #include "mythdbcon.h" 26 26 #include "mythlogging.h" 27 #include "dbsettings.h"27 //#include "dbsettings.h" 28 28 #include "mythtranslation.h" 29 29 #include "iso639.h" 30 30 #include "playbackbox.h" … … 39 39 #include "mythdirs.h" 40 40 #include "mythuihelper.h" 41 41 42 static HostCheckBox *DecodeExtraAudio() 42 /* This class have been copied from settingdb.h/.cpp and modified 43 I believe this is also used by mythtv-setup so 44 I did not want to break it by modifying the original*/ 45 class MythDbSettings: public GroupSetting { 46 public: 47 MythDbSettings(); 48 49 void Load(void); 50 void Save(void); 51 52 protected: 53 TransTextualSetting *dbHostName; 54 TransBoolSetting *dbHostPing; 55 TransTextualSetting *dbPort; 56 TransTextualSetting *dbName; 57 TransTextualSetting *dbUserName; 58 TransTextualSetting *dbPassword; 59 TransBoolSetting *localEnabled; 60 TransTextualSetting *localHostName; 61 TransBoolSetting *wolEnabled; 62 TransRangeSetting *wolReconnect; 63 TransRangeSetting *wolRetry; 64 TransTextualSetting *wolCommand; 65 }; 66 67 68 69 MythDbSettings::MythDbSettings() : 70 GroupSetting() 43 71 { 44 HostCheckBox *gc = new HostCheckBox("DecodeExtraAudio"); 72 73 setLabel(QObject::tr("Database Configuration")); 74 75 MSqlQuery query(MSqlQuery::InitCon()); 76 if (query.isConnected()) 77 setHelpText(QObject::tr("All database settings take effect when " 78 "you restart this program.")); 79 else 80 setHelpText(QObject::tr("MythTV could not connect to the database. " 81 "Please verify your database settings " 82 "below.")); 83 84 GroupSetting* dbServer = new GroupSetting(); 85 dbServer->setLabel(QObject::tr("Database Server Settings")); 86 dbHostName = new TransTextualSetting(); 87 dbHostName->setLabel(QObject::tr("Hostname")); 88 dbHostName->setHelpText(QObject::tr("The host name or IP address of " 89 "the machine hosting the database. " 90 "This information is required.")); 91 dbServer->addChild(dbHostName); 92 93 94 dbHostPing = new TransBoolSetting(); 95 dbHostPing->setLabel(QObject::tr("Ping test server?")); 96 dbHostPing->setHelpText(QObject::tr("Test basic host connectivity using " 97 "the ping command. Turn off if your " 98 "host or network don't support ping " 99 "(ICMP ECHO) packets")); 100 dbServer->addChild(dbHostPing); 101 102 103 dbPort = new TransTextualSetting(); 104 dbPort->setLabel(QObject::tr("Port")); 105 dbPort->setHelpText(QObject::tr("The port number the database is running " 106 "on. Leave blank if using the default " 107 "port (3306).")); 108 dbServer->addChild(dbPort); 109 110 dbName = new TransTextualSetting(); 111 dbName->setLabel(QObject::tr("Database name")); 112 dbName->setHelpText(QObject::tr("The name of the database. " 113 "This information is required.")); 114 dbServer->addChild(dbName); 115 116 dbUserName = new TransTextualSetting(); 117 dbUserName->setLabel(QObject::tr("User")); 118 dbUserName->setHelpText(QObject::tr("The user name to use while " 119 "connecting to the database. " 120 "This information is required.")); 121 dbServer->addChild(dbUserName); 122 123 dbPassword = new TransTextualSetting(); 124 dbPassword->setLabel(QObject::tr("Password")); 125 dbPassword->setHelpText(QObject::tr("The password to use while " 126 "connecting to the database. " 127 "This information is required.")); 128 dbServer->addChild(dbPassword); 129 130 addChild(dbServer); 131 132 localEnabled = new TransBoolSetting(); 133 localEnabled->setLabel(QObject::tr("Use custom identifier for frontend " 134 "preferences")); 135 localEnabled->setHelpText(QObject::tr("If this frontend's host name " 136 "changes often, check this box " 137 "and provide a network-unique " 138 "name to identify it. " 139 "If unchecked, the frontend " 140 "machine's local host name will " 141 "be used to save preferences in " 142 "the database.")); 143 144 localHostName = new TransTextualSetting(true); 145 localHostName->setLabel(QObject::tr("Custom identifier")); 146 localHostName->setHelpText(QObject::tr("An identifier to use while " 147 "saving the settings for this " 148 "frontend.")); 149 localEnabled->addChild(true, localHostName); 150 151 wolEnabled = new TransBoolSetting(); 152 wolEnabled->setLabel(QObject::tr("Enable database server wakeup")); 153 wolEnabled->setHelpText(QObject::tr("If enabled, the frontend will use " 154 "database wakeup parameters to " 155 "reconnect to the database server.")); 156 157 wolReconnect = new TransRangeSetting(0, 60, 1, true); 158 wolReconnect->setLabel(QObject::tr("Reconnect time")); 159 wolReconnect->setHelpText(QObject::tr("The time in seconds to wait for " 160 "the server to wake up.")); 161 162 wolEnabled->addChild(true, wolReconnect); 163 164 wolRetry = new TransRangeSetting(1, 10, 1, true); 165 wolRetry->setLabel(QObject::tr("Retry attempts")); 166 wolRetry->setHelpText(QObject::tr("The number of retries to wake the " 167 "server before the frontend gives " 168 "up.")); 169 170 wolEnabled->addChild(true, wolReconnect); 171 172 wolCommand = new TransTextualSetting(true); 173 wolCommand->setLabel(QObject::tr("Wake command")); 174 wolCommand->setHelpText(QObject::tr("The command executed on this " 175 "frontend to wake up the database " 176 "server (eg. sudo /etc/init.d/mysql " 177 "restart).")); 178 179 wolEnabled->addChild(true, wolCommand); 180 181 addChild(wolEnabled); 182 } 183 184 void MythDbSettings::Load(void) 185 { 186 DatabaseParams params = gContext->GetDatabaseParams(); 187 188 if (params.dbHostName.isEmpty() || 189 params.dbUserName.isEmpty() || 190 params.dbPassword.isEmpty() || 191 params.dbName.isEmpty()) 192 setHelpText(getHelpText() + "\n" + 193 QObject::tr("Required fields are" 194 " marked with an asterisk (*).")); 195 196 if (params.dbHostName.isEmpty()) 197 { 198 dbHostName->setLabel("* " + dbHostName->getLabel()); 199 //TODO? dbHostName->setValue(m_DBhostOverride); 200 } 201 else 202 dbHostName->setValue(params.dbHostName); 203 204 dbHostPing->setValue(params.dbHostPing); 205 206 if (params.dbPort) 207 dbPort->setValue(QString::number(params.dbPort)); 208 209 dbUserName->setValue(params.dbUserName); 210 if (params.dbUserName.isEmpty()) 211 dbUserName->setLabel("* " + dbUserName->getLabel()); 212 dbPassword->setValue(params.dbPassword); 213 if (params.dbPassword.isEmpty()) 214 dbPassword->setLabel("* " + dbPassword->getLabel()); 215 dbName->setValue(params.dbName); 216 if (params.dbName.isEmpty()) 217 dbName->setLabel("* " + dbName->getLabel()); 218 219 localEnabled->setValue(params.localEnabled); 220 localHostName->setValue(params.localHostName); 221 222 wolEnabled->setValue(params.wolEnabled); 223 wolReconnect->setValue(params.wolReconnect); 224 wolRetry->setValue(params.wolRetry); 225 wolCommand->setValue(params.wolCommand); 226 } 227 228 void MythDbSettings::Save(void) 229 { 230 DatabaseParams params = gContext->GetDatabaseParams(); 231 232 params.dbHostName = dbHostName->getValue(); 233 params.dbHostPing = dbHostPing->boolValue(); 234 params.dbPort = dbPort->getValue().toInt(); 235 params.dbUserName = dbUserName->getValue(); 236 params.dbPassword = dbPassword->getValue(); 237 params.dbName = dbName->getValue(); 238 params.dbType = "QMYSQL"; 239 params.localEnabled = localEnabled->boolValue(); 240 params.localHostName = localHostName->getValue(); 241 params.wolEnabled = wolEnabled->boolValue(); 242 params.wolReconnect = wolReconnect->intValue(); 243 params.wolRetry = wolRetry->intValue(); 244 params.wolCommand = wolCommand->getValue(); 245 246 gContext->SaveDatabaseParams(params); 247 } 248 249 static HostBoolSetting *DecodeExtraAudio() 250 { 251 HostBoolSetting *gc = new HostBoolSetting("DecodeExtraAudio"); 45 252 gc->setLabel(QObject::tr("Extra audio buffering")); 46 253 gc->setValue(true); 47 254 gc->setHelpText(QObject::tr("Enable this setting if MythTV is playing " … … static HostCheckBox *DecodeExtraAudio() 53 260 return gc; 54 261 } 55 262 56 static Host ComboBox*PIPLocationComboBox()263 static HostListSetting *PIPLocationComboBox() 57 264 { 58 Host ComboBox *gc = new HostComboBox("PIPLocation");265 HostListSetting *gc = new HostListSetting("PIPLocation"); 59 266 gc->setLabel(QObject::tr("PIP video location")); 60 267 for (uint loc = 0; loc < kPIP_END; ++loc) 61 268 gc->addSelection(toString((PIPLocation) loc), QString::number(loc)); … … static HostComboBox *PIPLocationComboBox() 63 270 return gc; 64 271 } 65 272 66 static Host ComboBox*DisplayRecGroup()273 static HostListSetting *DisplayRecGroup() 67 274 { 68 Host ComboBox *gc = new HostComboBox("DisplayRecGroup");275 HostListSetting *gc = new HostListSetting("DisplayRecGroup"); 69 276 gc->setLabel(QObject::tr("Default group filter to apply")); 70 277 71 278 gc->addSelection(QObject::tr("All Programs"), QString("All Programs")); … … static HostComboBox *DisplayRecGroup() 102 309 return gc; 103 310 } 104 311 105 static Host CheckBox*QueryInitialFilter()312 static HostBoolSetting *QueryInitialFilter() 106 313 { 107 Host CheckBox *gc = new HostCheckBox("QueryInitialFilter");314 HostBoolSetting *gc = new HostBoolSetting("QueryInitialFilter"); 108 315 gc->setLabel(QObject::tr("Always prompt for initial group filter")); 109 316 gc->setValue(false); 110 317 gc->setHelpText(QObject::tr("If enabled, always prompt the user for the " … … static HostCheckBox *QueryInitialFilter() 113 320 return gc; 114 321 } 115 322 116 static Host CheckBox*RememberRecGroup()323 static HostBoolSetting *RememberRecGroup() 117 324 { 118 Host CheckBox *gc = new HostCheckBox("RememberRecGroup");325 HostBoolSetting *gc = new HostBoolSetting("RememberRecGroup"); 119 326 gc->setLabel(QObject::tr("Save current group filter when changed")); 120 327 gc->setValue(true); 121 328 gc->setHelpText(QObject::tr("If enabled, remember the last selected filter " … … static HostCheckBox *RememberRecGroup() 124 331 return gc; 125 332 } 126 333 127 static Host CheckBox*UseGroupNameAsAllPrograms()334 static HostBoolSetting *UseGroupNameAsAllPrograms() 128 335 { 129 Host CheckBox *gc = new HostCheckBox("DispRecGroupAsAllProg");336 HostBoolSetting *gc = new HostBoolSetting("DispRecGroupAsAllProg"); 130 337 gc->setLabel(QObject::tr("Show filter name instead of \"All Programs\"")); 131 338 gc->setValue(false); 132 339 gc->setHelpText(QObject::tr("If enabled, use the name of the display " … … static HostCheckBox *UseGroupNameAsAllPrograms() 135 342 return gc; 136 343 } 137 344 138 static Host CheckBox*PBBStartInTitle()345 static HostBoolSetting *PBBStartInTitle() 139 346 { 140 Host CheckBox *gc = new HostCheckBox("PlaybackBoxStartInTitle");347 HostBoolSetting *gc = new HostBoolSetting("PlaybackBoxStartInTitle"); 141 348 gc->setLabel(QObject::tr("Start in group list")); 142 349 gc->setValue(true); 143 350 gc->setHelpText(QObject::tr("If enabled, the focus will " … … static HostCheckBox *PBBStartInTitle() 146 353 return gc; 147 354 } 148 355 149 static Host CheckBox*SmartForward()356 static HostBoolSetting *SmartForward() 150 357 { 151 Host CheckBox *gc = new HostCheckBox("SmartForward");358 HostBoolSetting *gc = new HostBoolSetting("SmartForward"); 152 359 gc->setLabel(QObject::tr("Smart fast forwarding")); 153 360 gc->setValue(false); 154 361 gc->setHelpText(QObject::tr("If enabled, then immediately after " … … static HostCheckBox *SmartForward() 157 364 return gc; 158 365 } 159 366 160 static Host CheckBox*ExactSeeking()367 static HostBoolSetting *ExactSeeking() 161 368 { 162 Host CheckBox *gc = new HostCheckBox("ExactSeeking");369 HostBoolSetting *gc = new HostBoolSetting("ExactSeeking"); 163 370 gc->setLabel(QObject::tr("Seek to exact frame")); 164 371 gc->setValue(false); 165 372 gc->setHelpText(QObject::tr("If enabled, seeking is frame exact, but " … … static HostCheckBox *ExactSeeking() 167 374 return gc; 168 375 } 169 376 170 static Global ComboBox*CommercialSkipMethod()377 static GlobalListSetting *CommercialSkipMethod() 171 378 { 172 Global ComboBox *bc = new GlobalComboBox("CommercialSkipMethod");379 GlobalListSetting *bc = new GlobalListSetting("CommercialSkipMethod"); 173 380 bc->setLabel(QObject::tr("Commercial detection method")); 174 381 bc->setHelpText(QObject::tr( 175 382 "This determines the method used by MythTV to " … … static GlobalComboBox *CommercialSkipMethod() 182 389 return bc; 183 390 } 184 391 185 static Global CheckBox*CommFlagFast()392 static GlobalBoolSetting *CommFlagFast() 186 393 { 187 Global CheckBox *gc = new GlobalCheckBox("CommFlagFast");394 GlobalBoolSetting *gc = new GlobalBoolSetting("CommFlagFast"); 188 395 gc->setLabel(QObject::tr("Enable experimental speedup of commercial detection")); 189 396 gc->setValue(false); 190 397 gc->setHelpText(QObject::tr("If enabled, experimental commercial detection " … … static GlobalCheckBox *CommFlagFast() 192 399 return gc; 193 400 } 194 401 195 static Host ComboBox*AutoCommercialSkip()402 static HostListSetting *AutoCommercialSkip() 196 403 { 197 Host ComboBox *gc = new HostComboBox("AutoCommercialSkip");404 HostListSetting *gc = new HostListSetting("AutoCommercialSkip"); 198 405 gc->setLabel(QObject::tr("Automatically skip commercials")); 199 406 gc->addSelection(QObject::tr("Off"), "0"); 200 407 gc->addSelection(QObject::tr("Notify, but do not skip"), "2"); … … static HostComboBox *AutoCommercialSkip() 206 413 return gc; 207 414 } 208 415 209 static Global CheckBox*AutoMetadataLookup()416 static GlobalBoolSetting *AutoMetadataLookup() 210 417 { 211 Global CheckBox *bc = new GlobalCheckBox("AutoMetadataLookup");418 GlobalBoolSetting *bc = new GlobalBoolSetting("AutoMetadataLookup"); 212 419 bc->setLabel(QObject::tr("Run metadata lookup")); 213 420 bc->setValue(true); 214 421 bc->setHelpText(QObject::tr("This is the default value used for the " … … static GlobalCheckBox *AutoMetadataLookup() 217 424 return bc; 218 425 } 219 426 220 static Global CheckBox*AutoCommercialFlag()427 static GlobalBoolSetting *AutoCommercialFlag() 221 428 { 222 Global CheckBox *bc = new GlobalCheckBox("AutoCommercialFlag");429 GlobalBoolSetting *bc = new GlobalBoolSetting("AutoCommercialFlag"); 223 430 bc->setLabel(QObject::tr("Run commercial detection")); 224 431 bc->setValue(true); 225 432 bc->setHelpText(QObject::tr("This is the default value used for the " … … static GlobalCheckBox *AutoCommercialFlag() 228 435 return bc; 229 436 } 230 437 231 static Global CheckBox*AutoTranscode()438 static GlobalBoolSetting *AutoTranscode() 232 439 { 233 Global CheckBox *bc = new GlobalCheckBox("AutoTranscode");440 GlobalBoolSetting *bc = new GlobalBoolSetting("AutoTranscode"); 234 441 bc->setLabel(QObject::tr("Run transcoder")); 235 442 bc->setValue(false); 236 443 bc->setHelpText(QObject::tr("This is the default value used for the " … … static GlobalCheckBox *AutoTranscode() 239 446 return bc; 240 447 } 241 448 242 static Global ComboBox*DefaultTranscoder()449 static GlobalListSetting *DefaultTranscoder() 243 450 { 244 GlobalComboBox *bc = new GlobalComboBox("DefaultTranscoder"); 245 bc->setLabel(QObject::tr("Default transcoder")); 451 GlobalListSetting *ls = new GlobalListSetting("DefaultTranscoder"); 452 ls->setLabel(QObject::tr("Default transcoder")); 453 //begin hack, I did not want to change any code outside of mythfrontend 454 GlobalComboBox *bc = new GlobalComboBox("DefaultTranscoder"); 246 455 RecordingProfile::fillSelections(bc, RecordingProfile::TranscoderGroup, 247 true); 248 bc->setHelpText(QObject::tr("This is the default value used for the " 456 true); 457 uint i; 458 for (i=0; i< bc->size(); i++) 459 { 460 ls->addSelection(bc->GetLabel(i),bc->GetValue(i)); 461 } 462 delete bc; 463 //end hack 464 ls->setHelpText(QObject::tr("This is the default value used for the " 249 465 "transcoder setting when a new scheduled " 250 466 "recording is created.")); 251 return bc;467 return ls; 252 468 } 253 469 254 static Global SpinBox*DeferAutoTranscodeDays()470 static GlobalRangeSetting *DeferAutoTranscodeDays() 255 471 { 256 Global SpinBox *gs = new GlobalSpinBox("DeferAutoTranscodeDays", 0, 365, 1);472 GlobalRangeSetting *gs = new GlobalRangeSetting("DeferAutoTranscodeDays", 0, 365, 1); 257 473 gs->setLabel(QObject::tr("Deferral days for auto transcode jobs")); 258 474 gs->setHelpText(QObject::tr("If non-zero, automatic transcode jobs will " 259 475 "be scheduled to run this many days after a recording " … … static GlobalSpinBox *DeferAutoTranscodeDays() 262 478 return gs; 263 479 } 264 480 265 static Global CheckBox*AutoRunUserJob(uint job_num)481 static GlobalBoolSetting *AutoRunUserJob(uint job_num) 266 482 { 267 483 QString dbStr = QString("AutoRunUserJob%1").arg(job_num); 268 484 QString label = QObject::tr("Run user job #%1") 269 485 .arg(job_num); 270 Global CheckBox *bc = new GlobalCheckBox(dbStr);486 GlobalBoolSetting *bc = new GlobalBoolSetting(dbStr); 271 487 bc->setLabel(label); 272 488 bc->setValue(false); 273 489 bc->setHelpText(QObject::tr("This is the default value used for the " … … static GlobalCheckBox *AutoRunUserJob(uint job_num) 278 494 return bc; 279 495 } 280 496 281 static Global CheckBox*AggressiveCommDetect()497 static GlobalBoolSetting *AggressiveCommDetect() 282 498 { 283 Global CheckBox *bc = new GlobalCheckBox("AggressiveCommDetect");499 GlobalBoolSetting *bc = new GlobalBoolSetting("AggressiveCommDetect"); 284 500 bc->setLabel(QObject::tr("Strict commercial detection")); 285 501 bc->setValue(true); 286 502 bc->setHelpText(QObject::tr("Enable stricter commercial detection code. " … … static GlobalCheckBox *AggressiveCommDetect() 288 504 return bc; 289 505 } 290 506 291 static Host SpinBox*CommRewindAmount()507 static HostRangeSetting *CommRewindAmount() 292 508 { 293 Host SpinBox *gs = new HostSpinBox("CommRewindAmount", 0, 10, 1);509 HostRangeSetting *gs = new HostRangeSetting("CommRewindAmount", 0, 10, 1); 294 510 gs->setLabel(QObject::tr("Commercial skip automatic rewind amount (secs)")); 295 511 gs->setHelpText(QObject::tr("MythTV will automatically rewind " 296 512 "this many seconds after performing a commercial skip.")); … … static HostSpinBox *CommRewindAmount() 298 514 return gs; 299 515 } 300 516 301 static Host SpinBox*CommNotifyAmount()517 static HostRangeSetting *CommNotifyAmount() 302 518 { 303 Host SpinBox *gs = new HostSpinBox("CommNotifyAmount", 0, 10, 1);519 HostRangeSetting *gs = new HostRangeSetting("CommNotifyAmount", 0, 10, 1); 304 520 gs->setLabel(QObject::tr("Commercial skip notify amount (secs)")); 305 521 gs->setHelpText(QObject::tr("MythTV will act like a commercial " 306 522 "begins this many seconds early. This can be useful " … … static HostSpinBox *CommNotifyAmount() 310 526 return gs; 311 527 } 312 528 313 static Global SpinBox*MaximumCommercialSkip()529 static GlobalRangeSetting *MaximumCommercialSkip() 314 530 { 315 Global SpinBox *bs = new GlobalSpinBox("MaximumCommercialSkip", 0, 3600, 10);531 GlobalRangeSetting *bs = new GlobalRangeSetting("MaximumCommercialSkip", 0, 3600, 10); 316 532 bs->setLabel(QObject::tr("Maximum commercial skip (secs)")); 317 533 bs->setHelpText(QObject::tr("MythTV will discourage long manual commercial " 318 534 "skips. Skips which are longer than this will require the " … … static GlobalSpinBox *MaximumCommercialSkip() 322 538 return bs; 323 539 } 324 540 325 static Global SpinBox*MergeShortCommBreaks()541 static GlobalRangeSetting *MergeShortCommBreaks() 326 542 { 327 Global SpinBox *bs = new GlobalSpinBox("MergeShortCommBreaks", 0, 3600, 5);543 GlobalRangeSetting *bs = new GlobalRangeSetting("MergeShortCommBreaks", 0, 3600, 5); 328 544 bs->setLabel(QObject::tr("Merge short commercial breaks (secs)")); 329 545 bs->setHelpText(QObject::tr("Treat consecutive commercial breaks shorter " 330 546 "than this as one break when skipping forward. Useful if " … … static GlobalSpinBox *MergeShortCommBreaks() 334 550 return bs; 335 551 } 336 552 337 static Global SpinBox*AutoExpireExtraSpace()553 static GlobalRangeSetting *AutoExpireExtraSpace() 338 554 { 339 Global SpinBox *bs = new GlobalSpinBox("AutoExpireExtraSpace", 0, 200, 1);555 GlobalRangeSetting *bs = new GlobalRangeSetting("AutoExpireExtraSpace", 0, 200, 1); 340 556 bs->setLabel(QObject::tr("Extra disk space (GB)")); 341 557 bs->setHelpText(QObject::tr("Extra disk space (in gigabytes) beyond what " 342 558 "MythTV requires that you want to keep free on the " … … static GlobalSpinBox *AutoExpireExtraSpace() 345 561 return bs; 346 562 }; 347 563 348 static GlobalCheckBox *AutoExpireInsteadOfDelete() 349 { 350 GlobalCheckBox *cb = new GlobalCheckBox("AutoExpireInsteadOfDelete"); 351 cb->setLabel(QObject::tr("Auto-Expire instead of delete recording")); 352 cb->setValue(false); 353 cb->setHelpText(QObject::tr("If enabled, move deleted recordings to the " 354 "'Deleted' recgroup and turn on autoexpire " 355 "instead of deleting immediately.")); 356 return cb; 357 } 358 359 static GlobalSpinBox *DeletedMaxAge() 564 static GlobalRangeSetting *DeletedMaxAge() 360 565 { 361 Global SpinBox *bs = new GlobalSpinBox("DeletedMaxAge", 0, 365, 1);566 GlobalRangeSetting *bs = new GlobalRangeSetting("DeletedMaxAge", 0, 365, 1); 362 567 bs->setLabel(QObject::tr("Deleted max age (days)")); 363 568 bs->setHelpText(QObject::tr("When set to a number greater than zero, " 364 569 "Auto-Expire will force expiration of Deleted recordings " … … static GlobalSpinBox *DeletedMaxAge() 367 572 return bs; 368 573 }; 369 574 370 static Global CheckBox*DeletedFifoOrder()575 static GlobalBoolSetting *DeletedFifoOrder() 371 576 { 372 Global CheckBox *cb = new GlobalCheckBox("DeletedFifoOrder");577 GlobalBoolSetting *cb = new GlobalBoolSetting("DeletedFifoOrder"); 373 578 cb->setLabel(QObject::tr("Expire in deleted order")); 374 579 cb->setValue(false); 375 580 cb->setHelpText(QObject::tr( … … static GlobalCheckBox *DeletedFifoOrder() 378 583 return cb; 379 584 }; 380 585 381 class DeletedExpireOptions : public TriggeredConfigurationGroup 382 { 383 public: 384 DeletedExpireOptions() : 385 TriggeredConfigurationGroup(false, false, false, false) 386 { 387 setLabel(QObject::tr("DeletedExpireOptions")); 388 Setting* enabled = AutoExpireInsteadOfDelete(); 389 addChild(enabled); 390 setTrigger(enabled); 391 392 HorizontalConfigurationGroup* settings = 393 new HorizontalConfigurationGroup(false); 394 settings->addChild(DeletedFifoOrder()); 395 settings->addChild(DeletedMaxAge()); 396 addTarget("1", settings); 397 398 // show nothing if fillEnabled is off 399 addTarget("0", new HorizontalConfigurationGroup(true)); 400 }; 401 }; 586 static GlobalBoolSetting *AutoExpireInsteadOfDelete() 587 { 588 GlobalBoolSetting *cb = new GlobalBoolSetting("AutoExpireInsteadOfDelete"); 589 cb->setLabel(QObject::tr("Auto-Expire instead of delete recording")); 590 cb->setValue(false); 591 cb->setHelpText(QObject::tr("If enabled, move deleted recordings to the " 592 "'Deleted' recgroup and turn on autoexpire " 593 "instead of deleting immediately.")); 594 cb->addChild(true, DeletedFifoOrder()); 595 cb->addChild(true, DeletedMaxAge()); 596 return cb; 597 } 402 598 403 static Global ComboBox*AutoExpireMethod()599 static GlobalListSetting *AutoExpireMethod() 404 600 { 405 Global ComboBox *bc = new GlobalComboBox("AutoExpireMethod");601 GlobalListSetting *bc = new GlobalListSetting("AutoExpireMethod"); 406 602 bc->setLabel(QObject::tr("Auto-Expire method")); 407 603 bc->addSelection(QObject::tr("Oldest show first"), "1"); 408 604 bc->addSelection(QObject::tr("Lowest priority first"), "2"); … … static GlobalComboBox *AutoExpireMethod() 414 610 return bc; 415 611 } 416 612 417 static Global CheckBox*AutoExpireWatchedPriority()613 static GlobalBoolSetting *AutoExpireWatchedPriority() 418 614 { 419 Global CheckBox *bc = new GlobalCheckBox("AutoExpireWatchedPriority");615 GlobalBoolSetting *bc = new GlobalBoolSetting("AutoExpireWatchedPriority"); 420 616 bc->setLabel(QObject::tr("Watched before unwatched")); 421 617 bc->setValue(false); 422 618 bc->setHelpText(QObject::tr("If enabled, programs that have been marked as " … … static GlobalCheckBox *AutoExpireWatchedPriority() 425 621 return bc; 426 622 } 427 623 428 static Global SpinBox*AutoExpireDayPriority()624 static GlobalRangeSetting *AutoExpireDayPriority() 429 625 { 430 Global SpinBox *bs = new GlobalSpinBox("AutoExpireDayPriority", 1, 400, 1);626 GlobalRangeSetting *bs = new GlobalRangeSetting("AutoExpireDayPriority", 1, 400, 1); 431 627 bs->setLabel(QObject::tr("Priority weight")); 432 628 bs->setHelpText(QObject::tr("The number of days bonus a program gets for " 433 629 "each priority point. This is only used when the Weighted " … … static GlobalSpinBox *AutoExpireDayPriority() 436 632 return bs; 437 633 }; 438 634 439 static Global CheckBox*AutoExpireDefault()635 static GlobalBoolSetting *AutoExpireDefault() 440 636 { 441 Global CheckBox *bc = new GlobalCheckBox("AutoExpireDefault");637 GlobalBoolSetting *bc = new GlobalBoolSetting("AutoExpireDefault"); 442 638 bc->setLabel(QObject::tr("Auto-Expire default")); 443 639 bc->setValue(true); 444 640 bc->setHelpText(QObject::tr("If enabled, any new recording schedules " … … static GlobalCheckBox *AutoExpireDefault() 447 643 return bc; 448 644 } 449 645 450 static Global SpinBox*AutoExpireLiveTVMaxAge()646 static GlobalRangeSetting *AutoExpireLiveTVMaxAge() 451 647 { 452 Global SpinBox *bs = new GlobalSpinBox("AutoExpireLiveTVMaxAge", 1, 365, 1);648 GlobalRangeSetting *bs = new GlobalRangeSetting("AutoExpireLiveTVMaxAge", 1, 365, 1); 453 649 bs->setLabel(QObject::tr("Live TV max age (days)")); 454 650 bs->setHelpText(QObject::tr("Auto-Expire will force expiration of Live " 455 651 "TV recordings when they are this many days old. Live TV " … … static GlobalSpinBox *MinRecordDiskThreshold() 474 670 } 475 671 #endif 476 672 477 static Global CheckBox*RerecordWatched()673 static GlobalBoolSetting *RerecordWatched() 478 674 { 479 Global CheckBox *bc = new GlobalCheckBox("RerecordWatched");675 GlobalBoolSetting *bc = new GlobalBoolSetting("RerecordWatched"); 480 676 bc->setLabel(QObject::tr("Re-record watched")); 481 677 bc->setValue(false); 482 678 bc->setHelpText(QObject::tr("If enabled, programs that have been marked as " … … static GlobalCheckBox *RerecordWatched() 485 681 return bc; 486 682 } 487 683 488 static Global SpinBox*RecordPreRoll()684 static GlobalRangeSetting *RecordPreRoll() 489 685 { 490 Global SpinBox *bs = new GlobalSpinBox("RecordPreRoll", 0, 600, 60, true);686 GlobalRangeSetting *bs = new GlobalRangeSetting("RecordPreRoll", 0, 600, 60, true); 491 687 bs->setLabel(QObject::tr("Time to record before start of show " 492 688 "(secs)")); 493 689 bs->setHelpText(QObject::tr("This global setting allows the recorder " … … static GlobalSpinBox *RecordPreRoll() 498 694 return bs; 499 695 } 500 696 501 static Global SpinBox*RecordOverTime()697 static GlobalRangeSetting *RecordOverTime() 502 698 { 503 Global SpinBox *bs = new GlobalSpinBox("RecordOverTime", 0, 1800, 60, true);699 GlobalRangeSetting *bs = new GlobalRangeSetting("RecordOverTime", 0, 1800, 60, true); 504 700 bs->setLabel(QObject::tr("Time to record past end of show (secs)")); 505 701 bs->setValue(0); 506 702 bs->setHelpText(QObject::tr("This global setting allows the recorder " … … static GlobalSpinBox *RecordOverTime() 510 706 return bs; 511 707 } 512 708 513 static Global ComboBox*OverTimeCategory()709 static GlobalListSetting *OverTimeCategory() 514 710 { 515 Global ComboBox *gc = new GlobalComboBox("OverTimeCategory");711 GlobalListSetting *gc = new GlobalListSetting("OverTimeCategory"); 516 712 gc->setLabel(QObject::tr("Category of shows to be extended")); 517 713 gc->setHelpText(QObject::tr("For a special category (e.g. " 518 714 "\"Sports event\"), request that shows be autoextended. " … … static GlobalComboBox *OverTimeCategory() 535 731 return gc; 536 732 } 537 733 538 static Global SpinBox*CategoryOverTime()734 static GlobalRangeSetting *CategoryOverTime() 539 735 { 540 Global SpinBox *bs = new GlobalSpinBox("CategoryOverTime",736 GlobalRangeSetting *bs = new GlobalRangeSetting("CategoryOverTime", 541 737 0, 180, 60, true); 542 738 bs->setLabel(QObject::tr("Record past end of show (mins)")); 543 739 bs->setValue(30); … … static GlobalSpinBox *CategoryOverTime() 548 744 return bs; 549 745 } 550 746 551 static VerticalConfigurationGroup*CategoryOverTimeSettings()747 static GroupSetting *CategoryOverTimeSettings() 552 748 { 553 VerticalConfigurationGroup*vcg =554 new VerticalConfigurationGroup(false, false);749 GroupSetting *vcg = 750 new GroupSetting(); 555 751 556 752 vcg->setLabel(QObject::tr("Category record over-time")); 557 vcg->setUseLabel(true);558 753 vcg->addChild(OverTimeCategory()); 559 754 vcg->addChild(CategoryOverTime()); 560 755 return vcg; … … void PlaybackProfileConfigs::triggerChanged(const QString &trig) 1249 1444 TriggeredConfigurationGroup::triggerChanged(trig); 1250 1445 } 1251 1446 1252 static Host ComboBox*PlayBoxOrdering()1447 static HostListSetting *PlayBoxOrdering() 1253 1448 { 1254 1449 QString str[4] = 1255 1450 { … … static HostComboBox *PlayBoxOrdering() 1264 1459 "refers to sections (e.g. \"All Programs\") which list " 1265 1460 "multiple titles. Sections in parentheses are not affected."); 1266 1461 1267 Host ComboBox *gc = new HostComboBox("PlayBoxOrdering");1462 HostListSetting *gc = new HostListSetting("PlayBoxOrdering"); 1268 1463 gc->setLabel(QObject::tr("Episode sort orderings")); 1269 1464 1270 1465 for (int i = 0; i < 4; ++i) … … static HostComboBox *PlayBoxOrdering() 1276 1471 return gc; 1277 1472 } 1278 1473 1279 static Host ComboBox*PlayBoxEpisodeSort()1474 static HostListSetting *PlayBoxEpisodeSort() 1280 1475 { 1281 Host ComboBox *gc = new HostComboBox("PlayBoxEpisodeSort");1476 HostListSetting *gc = new HostListSetting("PlayBoxEpisodeSort"); 1282 1477 gc->setLabel(QObject::tr("Sort episodes")); 1283 1478 gc->addSelection(QObject::tr("Record date"), "Date"); 1284 1479 gc->addSelection(QObject::tr("Season/Episode"), "Season"); … … static HostComboBox *PlayBoxEpisodeSort() 1288 1483 return gc; 1289 1484 } 1290 1485 1291 static Host SpinBox*FFRewReposTime()1486 static HostRangeSetting *FFRewReposTime() 1292 1487 { 1293 Host SpinBox *gs = new HostSpinBox("FFRewReposTime", 0, 200, 5);1488 HostRangeSetting *gs = new HostRangeSetting("FFRewReposTime", 0, 200, 5); 1294 1489 gs->setLabel(QObject::tr("Fast forward/rewind reposition amount")); 1295 1490 gs->setValue(100); 1296 1491 gs->setHelpText(QObject::tr("When exiting sticky keys fast forward/rewind " … … static HostSpinBox *FFRewReposTime() 1301 1496 return gs; 1302 1497 } 1303 1498 1304 static Host CheckBox*FFRewReverse()1499 static HostBoolSetting *FFRewReverse() 1305 1500 { 1306 Host CheckBox *gc = new HostCheckBox("FFRewReverse");1501 HostBoolSetting *gc = new HostBoolSetting("FFRewReverse"); 1307 1502 gc->setLabel(QObject::tr("Reverse direction in fast forward/rewind")); 1308 1503 gc->setValue(true); 1309 1504 gc->setHelpText(QObject::tr("If enabled, pressing the sticky rewind key " … … static HostCheckBox *FFRewReverse() 1314 1509 return gc; 1315 1510 } 1316 1511 1317 static Host ComboBox*MenuTheme()1512 static HostListSetting *MenuTheme() 1318 1513 { 1319 Host ComboBox *gc = new HostComboBox("MenuTheme");1514 HostListSetting *gc = new HostListSetting("MenuTheme"); 1320 1515 gc->setLabel(QObject::tr("Menu theme")); 1321 1516 1322 1517 QList<ThemeInfo> themelist = GetMythUI()->GetThemes(THEME_MENU); … … static HostComboBox MUNUSED *DecodeVBIFormat() 1348 1543 return gc; 1349 1544 } 1350 1545 1351 static Host SpinBox*OSDCC708TextZoomPercentage(void)1546 static HostRangeSetting *OSDCC708TextZoomPercentage(void) 1352 1547 { 1353 Host SpinBox *gs = new HostSpinBox("OSDCC708TextZoom", 50, 200, 5);1548 HostRangeSetting *gs = new HostRangeSetting("OSDCC708TextZoom", 50, 200, 5); 1354 1549 gs->setLabel(QObject::tr("Subtitle text zoom percentage")); 1355 1550 gs->setValue(100); 1356 1551 gs->setHelpText(QObject::tr("Use this to enlarge or shrink text based subtitles.")); … … static HostSpinBox *OSDCC708TextZoomPercentage(void) 1358 1553 return gs; 1359 1554 } 1360 1555 1361 static Host ComboBox*SubtitleFont()1556 static HostListSetting *SubtitleFont() 1362 1557 { 1363 Host ComboBox *hcb = new HostComboBox("OSDSubFont");1558 HostListSetting *hcb = new HostListSetting("OSDSubFont"); 1364 1559 QFontDatabase db; 1365 1560 QStringList fonts = db.families(); 1366 1561 QStringList hide = db.families(QFontDatabase::Symbol); … … static HostComboBox *SubtitleFont() 1375 1570 return hcb; 1376 1571 } 1377 1572 1378 static Host ComboBox*SubtitleCodec()1573 static HostListSetting *SubtitleCodec() 1379 1574 { 1380 Host ComboBox *gc = new HostComboBox("SubtitleCodec");1575 HostListSetting *gc = new HostListSetting("SubtitleCodec"); 1381 1576 1382 1577 gc->setLabel(QObject::tr("Subtitle Codec")); 1383 1578 QList<QByteArray> list = QTextCodec::availableCodecs(); … … static HostComboBox *SubtitleCodec() 1390 1585 return gc; 1391 1586 } 1392 1587 1393 static Host ComboBox*ChannelOrdering()1588 static HostListSetting *ChannelOrdering() 1394 1589 { 1395 Host ComboBox *gc = new HostComboBox("ChannelOrdering");1590 HostListSetting *gc = new HostListSetting("ChannelOrdering"); 1396 1591 gc->setLabel(QObject::tr("Channel ordering")); 1397 1592 gc->addSelection(QObject::tr("channel number"), "channum"); 1398 1593 gc->addSelection(QObject::tr("callsign"), "callsign"); 1399 1594 return gc; 1400 1595 } 1401 1596 1402 static Host SpinBox*VertScanPercentage()1597 static HostRangeSetting *VertScanPercentage() 1403 1598 { 1404 Host SpinBox *gs = new HostSpinBox("VertScanPercentage", -100, 100, 1);1599 HostRangeSetting *gs = new HostRangeSetting("VertScanPercentage", -100, 100, 1); 1405 1600 gs->setLabel(QObject::tr("Vertical scaling")); 1406 1601 gs->setValue(0); 1407 1602 gs->setHelpText(QObject::tr( … … static HostSpinBox *VertScanPercentage() 1410 1605 return gs; 1411 1606 } 1412 1607 1413 static Host SpinBox*HorizScanPercentage()1608 static HostRangeSetting *HorizScanPercentage() 1414 1609 { 1415 Host SpinBox *gs = new HostSpinBox("HorizScanPercentage", -100, 100, 1);1610 HostRangeSetting *gs = new HostRangeSetting("HorizScanPercentage", -100, 100, 1); 1416 1611 gs->setLabel(QObject::tr("Horizontal scaling")); 1417 1612 gs->setValue(0); 1418 1613 gs->setHelpText(QObject::tr( … … static HostSpinBox *HorizScanPercentage() 1421 1616 return gs; 1422 1617 }; 1423 1618 1424 static Host SpinBox*XScanDisplacement()1619 static HostRangeSetting *XScanDisplacement() 1425 1620 { 1426 Host SpinBox *gs = new HostSpinBox("XScanDisplacement", -50, 50, 1);1621 HostRangeSetting *gs = new HostRangeSetting("XScanDisplacement", -50, 50, 1); 1427 1622 gs->setLabel(QObject::tr("Scan displacement (X)")); 1428 1623 gs->setValue(0); 1429 1624 gs->setHelpText(QObject::tr("Adjust this to move the image horizontally.")); 1430 1625 return gs; 1431 1626 } 1432 1627 1433 static Host SpinBox*YScanDisplacement()1628 static HostRangeSetting *YScanDisplacement() 1434 1629 { 1435 Host SpinBox *gs = new HostSpinBox("YScanDisplacement", -50, 50, 1);1630 HostRangeSetting *gs = new HostRangeSetting("YScanDisplacement", -50, 50, 1); 1436 1631 gs->setLabel(QObject::tr("Scan displacement (Y)")); 1437 1632 gs->setValue(0); 1438 1633 gs->setHelpText(QObject::tr("Adjust this to move the image vertically.")); 1439 1634 return gs; 1440 1635 }; 1441 1636 1442 static Host CheckBox*CCBackground()1637 static HostBoolSetting *CCBackground() 1443 1638 { 1444 Host CheckBox *gc = new HostCheckBox("CCBackground");1639 HostBoolSetting *gc = new HostBoolSetting("CCBackground"); 1445 1640 gc->setLabel(QObject::tr("Black background for closed captioning")); 1446 1641 gc->setValue(false); 1447 1642 gc->setHelpText(QObject::tr( … … static HostCheckBox *CCBackground() 1451 1646 return gc; 1452 1647 } 1453 1648 1454 static Host CheckBox*DefaultCCMode()1649 static HostBoolSetting *DefaultCCMode() 1455 1650 { 1456 Host CheckBox *gc = new HostCheckBox("DefaultCCMode");1651 HostBoolSetting *gc = new HostBoolSetting("DefaultCCMode"); 1457 1652 gc->setLabel(QObject::tr("Always display closed captioning or subtitles")); 1458 1653 gc->setValue(false); 1459 1654 gc->setHelpText(QObject::tr( … … static HostCheckBox *DefaultCCMode() 1464 1659 return gc; 1465 1660 } 1466 1661 1467 static Host CheckBox*PreferCC708()1662 static HostBoolSetting *PreferCC708() 1468 1663 { 1469 Host CheckBox *gc = new HostCheckBox("Prefer708Captions");1664 HostBoolSetting *gc = new HostBoolSetting("Prefer708Captions"); 1470 1665 gc->setLabel(QObject::tr("Prefer EIA-708 over EIA-608 captions")); 1471 1666 gc->setValue(true); 1472 1667 gc->setHelpText( … … static HostCheckBox *PreferCC708() 1477 1672 return gc; 1478 1673 } 1479 1674 1480 static Host CheckBox*EnableMHEG()1675 static HostBoolSetting *EnableMHEG() 1481 1676 { 1482 Host CheckBox *gc = new HostCheckBox("EnableMHEG");1677 HostBoolSetting *gc = new HostBoolSetting("EnableMHEG"); 1483 1678 gc->setLabel(QObject::tr("Enable interactive TV")); 1484 1679 gc->setValue(false); 1485 1680 gc->setHelpText(QObject::tr( … … static HostCheckBox *EnableMHEG() 1489 1684 return gc; 1490 1685 } 1491 1686 1492 static Host CheckBox*PersistentBrowseMode()1687 static HostBoolSetting *PersistentBrowseMode() 1493 1688 { 1494 Host CheckBox *gc = new HostCheckBox("PersistentBrowseMode");1689 HostBoolSetting *gc = new HostBoolSetting("PersistentBrowseMode"); 1495 1690 gc->setLabel(QObject::tr("Always use browse mode in Live TV")); 1496 1691 gc->setValue(true); 1497 1692 gc->setHelpText( … … static HostCheckBox *PersistentBrowseMode() 1501 1696 return gc; 1502 1697 } 1503 1698 1504 static Host CheckBox*BrowseAllTuners()1699 static HostBoolSetting *BrowseAllTuners() 1505 1700 { 1506 Host CheckBox *gc = new HostCheckBox("BrowseAllTuners");1701 HostBoolSetting *gc = new HostBoolSetting("BrowseAllTuners"); 1507 1702 gc->setLabel(QObject::tr("Browse all channels")); 1508 1703 gc->setValue(false); 1509 1704 gc->setHelpText( … … static HostCheckBox *BrowseAllTuners() 1514 1709 return gc; 1515 1710 } 1516 1711 1517 static Host CheckBox*ClearSavedPosition()1712 static HostBoolSetting *ClearSavedPosition() 1518 1713 { 1519 Host CheckBox *gc = new HostCheckBox("ClearSavedPosition");1714 HostBoolSetting *gc = new HostBoolSetting("ClearSavedPosition"); 1520 1715 gc->setLabel(QObject::tr("Clear bookmark on playback")); 1521 1716 gc->setValue(true); 1522 1717 gc->setHelpText(QObject::tr("If enabled, automatically clear the " … … static HostCheckBox *ClearSavedPosition() 1526 1721 return gc; 1527 1722 } 1528 1723 1529 static Host CheckBox*AltClearSavedPosition()1724 static HostBoolSetting *AltClearSavedPosition() 1530 1725 { 1531 Host CheckBox *gc = new HostCheckBox("AltClearSavedPosition");1726 HostBoolSetting *gc = new HostBoolSetting("AltClearSavedPosition"); 1532 1727 gc->setLabel(QObject::tr("Alternate clear and save bookmark")); 1533 1728 gc->setValue(true); 1534 1729 gc->setHelpText(QObject::tr("During playback the SELECT key " … … static HostCheckBox *AltClearSavedPosition() 1539 1734 return gc; 1540 1735 } 1541 1736 1542 static Host ComboBox*PlaybackExitPrompt()1737 static HostListSetting *PlaybackExitPrompt() 1543 1738 { 1544 Host ComboBox *gc = new HostComboBox("PlaybackExitPrompt");1739 HostListSetting *gc = new HostListSetting("PlaybackExitPrompt"); 1545 1740 gc->setLabel(QObject::tr("Action on playback exit")); 1546 1741 gc->addSelection(QObject::tr("Just exit"), "0"); 1547 1742 gc->addSelection(QObject::tr("Save position and exit"), "2"); … … static HostComboBox *PlaybackExitPrompt() 1555 1750 return gc; 1556 1751 } 1557 1752 1558 static Host CheckBox*EndOfRecordingExitPrompt()1753 static HostBoolSetting *EndOfRecordingExitPrompt() 1559 1754 { 1560 Host CheckBox *gc = new HostCheckBox("EndOfRecordingExitPrompt");1755 HostBoolSetting *gc = new HostBoolSetting("EndOfRecordingExitPrompt"); 1561 1756 gc->setLabel(QObject::tr("Prompt at end of recording")); 1562 1757 gc->setValue(false); 1563 1758 gc->setHelpText(QObject::tr("If enabled, a menu will be displayed allowing " … … static HostCheckBox *EndOfRecordingExitPrompt() 1566 1761 return gc; 1567 1762 } 1568 1763 1569 static Host CheckBox*JumpToProgramOSD()1764 static HostBoolSetting *JumpToProgramOSD() 1570 1765 { 1571 Host CheckBox *gc = new HostCheckBox("JumpToProgramOSD");1766 HostBoolSetting *gc = new HostBoolSetting("JumpToProgramOSD"); 1572 1767 gc->setLabel(QObject::tr("Jump to program OSD")); 1573 1768 gc->setValue(true); 1574 1769 gc->setHelpText(QObject::tr( … … static HostCheckBox *JumpToProgramOSD() 1580 1775 return gc; 1581 1776 } 1582 1777 1583 static Host CheckBox*ContinueEmbeddedTVPlay()1778 static HostBoolSetting *ContinueEmbeddedTVPlay() 1584 1779 { 1585 Host CheckBox *gc = new HostCheckBox("ContinueEmbeddedTVPlay");1780 HostBoolSetting *gc = new HostBoolSetting("ContinueEmbeddedTVPlay"); 1586 1781 gc->setLabel(QObject::tr("Continue playback when embedded")); 1587 1782 gc->setValue(false); 1588 1783 gc->setHelpText(QObject::tr( … … static HostCheckBox *ContinueEmbeddedTVPlay() 1593 1788 return gc; 1594 1789 } 1595 1790 1596 static Host CheckBox*AutomaticSetWatched()1791 static HostBoolSetting *AutomaticSetWatched() 1597 1792 { 1598 Host CheckBox *gc = new HostCheckBox("AutomaticSetWatched");1793 HostBoolSetting *gc = new HostBoolSetting("AutomaticSetWatched"); 1599 1794 gc->setLabel(QObject::tr("Automatically mark a recording as watched")); 1600 1795 gc->setValue(false); 1601 1796 gc->setHelpText(QObject::tr("If enabled, when you exit near the end of a " … … static HostCheckBox *AutomaticSetWatched() 1606 1801 return gc; 1607 1802 } 1608 1803 1609 static Host SpinBox*LiveTVIdleTimeout()1804 static HostRangeSetting *LiveTVIdleTimeout() 1610 1805 { 1611 Host SpinBox *gs = new HostSpinBox("LiveTVIdleTimeout", 0, 3600, 1);1806 HostRangeSetting *gs = new HostRangeSetting("LiveTVIdleTimeout", 0, 3600, 1); 1612 1807 gs->setLabel(QObject::tr("Live TV idle timeout (mins)")); 1613 1808 gs->setValue(0); 1614 1809 gs->setHelpText(QObject::tr( … … static HostSpinBox *LiveTVIdleTimeout() 1618 1813 return gs; 1619 1814 } 1620 1815 1621 // static Host CheckBox*PlaybackPreview()1816 // static HostBoolSetting *PlaybackPreview() 1622 1817 // { 1623 // HostCheckBox *gc = new Host CheckBox("PlaybackPreview");1818 // HostCheckBox *gc = new HostBoolSetting("PlaybackPreview"); 1624 1819 // gc->setLabel(QObject::tr("Display live preview of recordings")); 1625 1820 // gc->setValue(true); 1626 1821 // gc->setHelpText(QObject::tr("If enabled, a preview of the recording " … … static HostSpinBox *LiveTVIdleTimeout() 1629 1824 // return gc; 1630 1825 // } 1631 1826 // 1632 // static Host CheckBox*HWAccelPlaybackPreview()1827 // static HostBoolSetting *HWAccelPlaybackPreview() 1633 1828 // { 1634 // Host CheckBox *gc = new HostCheckBox("HWAccelPlaybackPreview");1829 // HostBoolSetting *gc = new HostBoolSetting("HWAccelPlaybackPreview"); 1635 1830 // gc->setLabel(QObject::tr("Use HW Acceleration for live recording preview")); 1636 1831 // gc->setValue(false); 1637 1832 // gc->setHelpText( … … static HostSpinBox *LiveTVIdleTimeout() 1643 1838 // return gc; 1644 1839 // } 1645 1840 1646 static Host CheckBox*UseVirtualKeyboard()1841 static HostBoolSetting *UseVirtualKeyboard() 1647 1842 { 1648 Host CheckBox *gc = new HostCheckBox("UseVirtualKeyboard");1843 HostBoolSetting *gc = new HostBoolSetting("UseVirtualKeyboard"); 1649 1844 gc->setLabel(QObject::tr("Use line edit virtual keyboards")); 1650 1845 gc->setValue(true); 1651 1846 gc->setHelpText(QObject::tr("If enabled, you can use a virtual keyboard " … … static HostCheckBox *UseVirtualKeyboard() 1654 1849 return gc; 1655 1850 } 1656 1851 1657 static Host ComboBox*OverrideExitMenu()1852 static HostListSetting *OverrideExitMenu() 1658 1853 { 1659 Host ComboBox *gc = new HostComboBox("OverrideExitMenu");1854 HostListSetting *gc = new HostListSetting("OverrideExitMenu"); 1660 1855 gc->setLabel(QObject::tr("Customize exit menu options")); 1661 1856 gc->addSelection(QObject::tr("Default"), "0"); 1662 1857 gc->addSelection(QObject::tr("Show quit"), "1"); … … static HostComboBox *OverrideExitMenu() 1671 1866 return gc; 1672 1867 } 1673 1868 1674 static Host LineEdit*RebootCommand()1869 static HostTextualSetting *RebootCommand() 1675 1870 { 1676 Host LineEdit *ge = new HostLineEdit("RebootCommand");1871 HostTextualSetting *ge = new HostTextualSetting("RebootCommand"); 1677 1872 ge->setLabel(QObject::tr("Reboot command")); 1678 1873 ge->setValue(""); 1679 1874 ge->setHelpText(QObject::tr("Optional. Script to run if you select " … … static HostLineEdit *RebootCommand() 1683 1878 return ge; 1684 1879 } 1685 1880 1686 static Host LineEdit*HaltCommand()1881 static HostTextualSetting *HaltCommand() 1687 1882 { 1688 Host LineEdit *ge = new HostLineEdit("HaltCommand");1883 HostTextualSetting *ge = new HostTextualSetting("HaltCommand"); 1689 1884 ge->setLabel(QObject::tr("Halt command")); 1690 1885 ge->setValue(""); 1691 1886 ge->setHelpText(QObject::tr("Optional. Script to run if you select " … … static HostLineEdit *HaltCommand() 1695 1890 return ge; 1696 1891 } 1697 1892 1698 static Host LineEdit*LircDaemonDevice()1893 static HostTextualSetting *LircDaemonDevice() 1699 1894 { 1700 Host LineEdit *ge = new HostLineEdit("LircSocket");1895 HostTextualSetting *ge = new HostTextualSetting("LircSocket"); 1701 1896 ge->setLabel(QObject::tr("LIRC daemon socket")); 1702 1897 1703 1898 /* lircd socket moved from /dev/ to /var/run/lirc/ in lirc 0.8.6 */ … … static HostLineEdit *LircDaemonDevice() 1712 1907 return ge; 1713 1908 } 1714 1909 1715 static Host LineEdit*ScreenShotPath()1910 static HostTextualSetting *ScreenShotPath() 1716 1911 { 1717 Host LineEdit *ge = new HostLineEdit("ScreenShotPath");1912 HostTextualSetting *ge = new HostTextualSetting("ScreenShotPath"); 1718 1913 ge->setLabel(QObject::tr("Screen shot path")); 1719 1914 ge->setValue("/tmp/"); 1720 1915 ge->setHelpText(QObject::tr("Path to screenshot storage location. Should be writable by the frontend")); 1721 1916 return ge; 1722 1917 } 1723 1918 1724 static Host LineEdit*SetupPinCode()1919 static HostTextualSetting *SetupPinCode() 1725 1920 { 1726 Host LineEdit *ge = new HostLineEdit("SetupPinCode");1921 HostTextualSetting *ge = new HostTextualSetting("SetupPinCode"); 1727 1922 ge->setLabel(QObject::tr("Setup PIN code")); 1728 1923 ge->setHelpText(QObject::tr("This PIN is used to control access to the " 1729 1924 "setup menus. If you want to use this feature, then " … … static HostLineEdit *SetupPinCode() 1732 1927 return ge; 1733 1928 } 1734 1929 1735 static Host CheckBox*SetupPinCodeRequired()1930 static HostBoolSetting *SetupPinCodeRequired() 1736 1931 { 1737 Host CheckBox *gc = new HostCheckBox("SetupPinCodeRequired");1932 HostBoolSetting *gc = new HostBoolSetting("SetupPinCodeRequired"); 1738 1933 gc->setLabel(QObject::tr("Require setup PIN") + " "); 1739 1934 gc->setValue(false); 1740 1935 gc->setHelpText(QObject::tr("If enabled, you will not be able to return " … … static HostCheckBox *SetupPinCodeRequired() 1743 1938 return gc; 1744 1939 } 1745 1940 1746 static Host ComboBox*XineramaScreen()1941 static HostListSetting *XineramaScreen() 1747 1942 { 1748 Host ComboBox *gc = new HostComboBox("XineramaScreen", false);1943 HostListSetting *gc = new HostListSetting("XineramaScreen", false); 1749 1944 int num = MythDisplay::GetNumberXineramaScreens(); 1750 1945 for (int i=0; i<num; ++i) 1751 1946 gc->addSelection(QString::number(i), QString::number(i)); … … static HostComboBox *XineramaScreen() 1758 1953 } 1759 1954 1760 1955 1761 static Host ComboBox*XineramaMonitorAspectRatio()1956 static HostListSetting *XineramaMonitorAspectRatio() 1762 1957 { 1763 Host ComboBox *gc = new HostComboBox("XineramaMonitorAspectRatio");1958 HostListSetting *gc = new HostListSetting("XineramaMonitorAspectRatio"); 1764 1959 gc->setLabel(QObject::tr("Monitor aspect ratio")); 1765 1960 gc->addSelection(QObject::tr("4:3"), "1.3333"); 1766 1961 gc->addSelection(QObject::tr("16:9"), "1.7777"); … … static HostComboBox *XineramaMonitorAspectRatio() 1771 1966 return gc; 1772 1967 } 1773 1968 1774 static Host ComboBox*LetterboxingColour()1969 static HostListSetting *LetterboxingColour() 1775 1970 { 1776 Host ComboBox *gc = new HostComboBox("LetterboxColour");1971 HostListSetting *gc = new HostListSetting("LetterboxColour"); 1777 1972 gc->setLabel(QObject::tr("Letterboxing color")); 1778 1973 for (int m = kLetterBoxColour_Black; m < kLetterBoxColour_END; ++m) 1779 1974 gc->addSelection(toString((LetterBoxColour)m), QString::number(m)); … … static HostComboBox *LetterboxingColour() 1786 1981 return gc; 1787 1982 } 1788 1983 1789 static Host ComboBox*AspectOverride()1984 static HostListSetting *AspectOverride() 1790 1985 { 1791 Host ComboBox *gc = new HostComboBox("AspectOverride");1986 HostListSetting *gc = new HostListSetting("AspectOverride"); 1792 1987 gc->setLabel(QObject::tr("Video aspect override")); 1793 1988 for (int m = kAspect_Off; m < kAspect_END; ++m) 1794 1989 gc->addSelection(toString((AspectOverrideMode)m), QString::number(m)); … … static HostComboBox *AspectOverride() 1799 1994 return gc; 1800 1995 } 1801 1996 1802 static Host ComboBox*AdjustFill()1997 static HostListSetting *AdjustFill() 1803 1998 { 1804 Host ComboBox *gc = new HostComboBox("AdjustFill");1999 HostListSetting *gc = new HostListSetting("AdjustFill"); 1805 2000 gc->setLabel(QObject::tr("Zoom")); 1806 2001 for (int m = kAdjustFill_Off; m < kAdjustFill_END; ++m) 1807 2002 gc->addSelection(toString((AdjustFillMode)m), QString::number(m)); … … static HostComboBox *AdjustFill() 1817 2012 1818 2013 // Theme settings 1819 2014 1820 static Host SpinBox*GuiWidth()2015 static HostRangeSetting *GuiWidth() 1821 2016 { 1822 Host SpinBox *gs = new HostSpinBox("GuiWidth", 0, 1920, 8, true);2017 HostRangeSetting *gs = new HostRangeSetting("GuiWidth", 0, 1920, 8, true); 1823 2018 gs->setLabel(QObject::tr("GUI width (pixels)")); 1824 2019 gs->setValue(0); 1825 2020 gs->setHelpText(QObject::tr("The width of the GUI. Do not make the GUI " … … static HostSpinBox *GuiWidth() 1828 2023 return gs; 1829 2024 } 1830 2025 1831 static Host SpinBox*GuiHeight()2026 static HostRangeSetting *GuiHeight() 1832 2027 { 1833 Host SpinBox *gs = new HostSpinBox("GuiHeight", 0, 1600, 8, true);2028 HostRangeSetting *gs = new HostRangeSetting("GuiHeight", 0, 1600, 8, true); 1834 2029 gs->setLabel(QObject::tr("GUI height (pixels)")); 1835 2030 gs->setValue(0); 1836 2031 gs->setHelpText(QObject::tr("The height of the GUI. Do not make the GUI " … … static HostSpinBox *GuiHeight() 1839 2034 return gs; 1840 2035 } 1841 2036 1842 static Host SpinBox*GuiOffsetX()2037 static HostRangeSetting *GuiOffsetX() 1843 2038 { 1844 Host SpinBox *gs = new HostSpinBox("GuiOffsetX", -3840, 3840, 32, true);2039 HostRangeSetting *gs = new HostRangeSetting("GuiOffsetX", -3840, 3840, 32, true); 1845 2040 gs->setLabel(QObject::tr("GUI X offset")); 1846 2041 gs->setValue(0); 1847 2042 gs->setHelpText(QObject::tr("The horizontal offset where the GUI will be " … … static HostSpinBox *GuiOffsetX() 1849 2044 return gs; 1850 2045 } 1851 2046 1852 static Host SpinBox*GuiOffsetY()2047 static HostRangeSetting *GuiOffsetY() 1853 2048 { 1854 Host SpinBox *gs = new HostSpinBox("GuiOffsetY", -1600, 1600, 8, true);2049 HostRangeSetting *gs = new HostRangeSetting("GuiOffsetY", -1600, 1600, 8, true); 1855 2050 gs->setLabel(QObject::tr("GUI Y offset")); 1856 2051 gs->setValue(0); 1857 2052 gs->setHelpText(QObject::tr("The vertical offset where the GUI will be " … … static HostSpinBox *DisplaySizeHeight() 1883 2078 } 1884 2079 #endif 1885 2080 1886 static Host CheckBox*GuiSizeForTV()2081 static HostBoolSetting *GuiSizeForTV() 1887 2082 { 1888 Host CheckBox *gc = new HostCheckBox("GuiSizeForTV");2083 HostBoolSetting *gc = new HostBoolSetting("GuiSizeForTV"); 1889 2084 gc->setLabel(QObject::tr("Use GUI size for TV playback")); 1890 2085 gc->setValue(true); 1891 2086 gc->setHelpText(QObject::tr("If enabled, use the above size for TV, " … … static HostCheckBox *GuiSizeForTV() 1894 2089 } 1895 2090 1896 2091 #if defined(USING_XRANDR) || CONFIG_DARWIN 1897 static HostCheckBox *UseVideoModes() 1898 { 1899 HostCheckBox *gc = new HostCheckBox("UseVideoModes"); 1900 gc->setLabel(QObject::tr("Separate video modes for GUI and TV playback")); 1901 gc->setValue(false); 1902 gc->setHelpText(QObject::tr("Switch X Window video modes for TV. " 1903 "Requires \"xrandr\" support.")); 1904 return gc; 1905 } 2092 1906 2093 1907 2094 static HostSpinBox *VidModeWidth(int idx) 1908 2095 { … … static HostComboBox *TVVidModeForceAspect(int idx=-1) 2032 2219 return gc; 2033 2220 } 2034 2221 2222 static HostCheckBox *UseVideoModes() 2223 { 2224 HostCheckBox *gc = new HostCheckBox("UseVideoModes"); 2225 gc->setLabel(QObject::tr("Separate video modes for GUI and TV playback")); 2226 gc->setValue(false); 2227 gc->setHelpText(QObject::tr("Switch X Window video modes for TV. " 2228 "Requires \"xrandr\" support.")); 2229 2230 return gc; 2231 } 2232 2035 2233 class VideoModeSettings : public TriggeredConfigurationGroup 2036 2234 { 2037 2235 public: … … class VideoModeSettings : public TriggeredConfigurationGroup 2084 2282 }; 2085 2283 #endif 2086 2284 2087 static Host CheckBox*HideMouseCursor()2285 static HostBoolSetting *HideMouseCursor() 2088 2286 { 2089 Host CheckBox *gc = new HostCheckBox("HideMouseCursor");2287 HostBoolSetting *gc = new HostBoolSetting("HideMouseCursor"); 2090 2288 gc->setLabel(QObject::tr("Hide mouse cursor in MythTV")); 2091 2289 gc->setValue(false); 2092 2290 gc->setHelpText(QObject::tr("Toggles mouse cursor visibility for touchscreens. " … … static HostCheckBox *HideMouseCursor() 2096 2294 }; 2097 2295 2098 2296 2099 static Host CheckBox*RunInWindow()2297 static HostBoolSetting *RunInWindow() 2100 2298 { 2101 Host CheckBox *gc = new HostCheckBox("RunFrontendInWindow");2299 HostBoolSetting *gc = new HostBoolSetting("RunFrontendInWindow"); 2102 2300 gc->setLabel(QObject::tr("Use window border")); 2103 2301 gc->setValue(false); 2104 2302 gc->setHelpText(QObject::tr("Toggles between windowed and " … … static HostCheckBox *RunInWindow() 2106 2304 return gc; 2107 2305 } 2108 2306 2109 static Host CheckBox*UseFixedWindowSize()2307 static HostBoolSetting *UseFixedWindowSize() 2110 2308 { 2111 2309 { 2112 Host CheckBox *gc = new HostCheckBox("UseFixedWindowSize");2310 HostBoolSetting *gc = new HostBoolSetting("UseFixedWindowSize"); 2113 2311 gc->setLabel(QObject::tr("Use fixed window size")); 2114 2312 gc->setValue(true); 2115 2313 gc->setHelpText(QObject::tr( … … static HostCheckBox *UseFixedWindowSize() 2119 2317 } 2120 2318 } 2121 2319 2122 static Host ComboBox*MythDateFormatCB()2320 static HostListSetting *MythDateFormatCB() 2123 2321 { 2124 Host ComboBox *gc = new HostComboBox("DateFormat");2322 HostListSetting *gc = new HostListSetting("DateFormat"); 2125 2323 gc->setLabel(QObject::tr("Date format")); 2126 2324 2127 2325 QDate sampdate = QDate::currentDate(); … … static HostComboBox *MythDateFormatCB() 2160 2358 return gc; 2161 2359 } 2162 2360 2163 static Host ComboBox*MythShortDateFormat()2361 static HostListSetting *MythShortDateFormat() 2164 2362 { 2165 Host ComboBox *gc = new HostComboBox("ShortDateFormat");2363 HostListSetting *gc = new HostListSetting("ShortDateFormat"); 2166 2364 gc->setLabel(QObject::tr("Short date format")); 2167 2365 2168 2366 QDate sampdate = QDate::currentDate(); … … static HostComboBox *MythShortDateFormat() 2199 2397 return gc; 2200 2398 } 2201 2399 2202 static Host ComboBox*MythTimeFormat()2400 static HostListSetting *MythTimeFormat() 2203 2401 { 2204 Host ComboBox *gc = new HostComboBox("TimeFormat");2402 HostListSetting *gc = new HostListSetting("TimeFormat"); 2205 2403 gc->setLabel(QObject::tr("Time format")); 2206 2404 2207 2405 QTime samptime = QTime::currentTime(); … … static HostComboBox *MythTimeFormat() 2219 2417 return gc; 2220 2418 } 2221 2419 2222 static Host ComboBox*ChannelFormat()2420 static HostListSetting *ChannelFormat() 2223 2421 { 2224 Host ComboBox *gc = new HostComboBox("ChannelFormat");2422 HostListSetting *gc = new HostListSetting("ChannelFormat"); 2225 2423 gc->setLabel(QObject::tr("Channel format")); 2226 2424 gc->addSelection(QObject::tr("number"), "<num>"); 2227 2425 gc->addSelection(QObject::tr("number callsign"), "<num> <sign>"); … … static HostComboBox *ChannelFormat() 2233 2431 return gc; 2234 2432 } 2235 2433 2236 static Host ComboBox*LongChannelFormat()2434 static HostListSetting *LongChannelFormat() 2237 2435 { 2238 Host ComboBox *gc = new HostComboBox("LongChannelFormat");2436 HostListSetting *gc = new HostListSetting("LongChannelFormat"); 2239 2437 gc->setLabel(QObject::tr("Long channel format")); 2240 2438 gc->addSelection(QObject::tr("number"), "<num>"); 2241 2439 gc->addSelection(QObject::tr("number callsign"), "<num> <sign>"); … … static HostComboBox *LongChannelFormat() 2247 2445 return gc; 2248 2446 } 2249 2447 2250 static Global CheckBox*LastFreeCard()2448 static GlobalBoolSetting *LastFreeCard() 2251 2449 { 2252 Global CheckBox *bc = new GlobalCheckBox("LastFreeCard");2450 GlobalBoolSetting *bc = new GlobalBoolSetting("LastFreeCard"); 2253 2451 bc->setLabel(QObject::tr("Avoid conflicts between Live TV and " 2254 2452 "scheduled shows")); 2255 2453 bc->setValue(false); … … static GlobalCheckBox *LastFreeCard() 2259 2457 return bc; 2260 2458 } 2261 2459 2262 static Global CheckBox*LiveTVPriority()2460 static GlobalBoolSetting *LiveTVPriority() 2263 2461 { 2264 Global CheckBox *bc = new GlobalCheckBox("LiveTVPriority");2462 GlobalBoolSetting *bc = new GlobalBoolSetting("LiveTVPriority"); 2265 2463 bc->setLabel(QObject::tr("Allow Live TV to move scheduled shows")); 2266 2464 bc->setValue(false); 2267 2465 bc->setHelpText(QObject::tr("If enabled, scheduled recordings will " … … static GlobalCheckBox *LiveTVPriority() 2270 2468 return bc; 2271 2469 } 2272 2470 2273 static HostCheckBox *ChannelGroupRememberLast() 2274 { 2275 HostCheckBox *gc = new HostCheckBox("ChannelGroupRememberLast"); 2276 gc->setLabel(QObject::tr("Remember last channel group")); 2277 gc->setHelpText(QObject::tr("If enabled, the EPG will initially display " 2278 "only the channels from the last channel group selected. Pressing " 2279 "\"4\" will toggle channel group.")); 2280 gc->setValue(false); 2281 return gc; 2282 } 2283 2284 static HostComboBox *ChannelGroupDefault() 2471 static HostListSetting *ChannelGroupDefault() 2285 2472 { 2286 Host ComboBox *gc = new HostComboBox("ChannelGroupDefault");2473 HostListSetting *gc = new HostListSetting("ChannelGroupDefault"); 2287 2474 gc->setLabel(QObject::tr("Default channel group")); 2288 2475 2289 2476 ChannelGroupList changrplist; … … static HostComboBox *ChannelGroupDefault() 2303 2490 return gc; 2304 2491 } 2305 2492 2306 static Host CheckBox*BrowseChannelGroup()2493 static HostBoolSetting *BrowseChannelGroup() 2307 2494 { 2308 Host CheckBox *gc = new HostCheckBox("BrowseChannelGroup");2495 HostBoolSetting *gc = new HostBoolSetting("BrowseChannelGroup"); 2309 2496 gc->setLabel(QObject::tr("Browse/change channels from Channel Group")); 2310 2497 gc->setHelpText(QObject::tr("If enabled, Live TV will browse or change " 2311 2498 "channels from the selected channel group. The \"All " … … static HostCheckBox *BrowseChannelGroup() 2315 2502 return gc; 2316 2503 } 2317 2504 2318 // Channel Group Settings 2319 class ChannelGroupSettings : public TriggeredConfigurationGroup 2505 static HostBoolSetting *ChannelGroupRememberLast() 2320 2506 { 2321 public: 2322 ChannelGroupSettings() : TriggeredConfigurationGroup(false, true, false, false) 2323 { 2324 setLabel(QObject::tr("Remember last channel group")); 2325 setUseLabel(false); 2326 2327 Setting* RememberChanGrpEnabled = ChannelGroupRememberLast(); 2328 addChild(RememberChanGrpEnabled); 2329 setTrigger(RememberChanGrpEnabled); 2507 HostBoolSetting *gc = new HostBoolSetting("ChannelGroupRememberLast"); 2508 gc->setLabel(QObject::tr("Remember last channel group")); 2509 gc->setHelpText(QObject::tr("If enabled, the EPG will initially display " 2510 "only the channels from the last channel group selected. Pressing " 2511 "\"4\" will toggle channel group.")); 2512 gc->addChild(false, ChannelGroupDefault()); 2330 2513 2331 ConfigurationGroup* settings = new VerticalConfigurationGroup(false,false); 2332 settings->addChild(ChannelGroupDefault()); 2333 addTarget("0", settings); 2514 gc->setValue(false); 2334 2515 2335 // show nothing if RememberChanGrpEnabled is on 2336 addTarget("1", new VerticalConfigurationGroup(true,false)); 2337 }; 2338 }; 2516 return gc; 2517 } 2339 2518 2340 2519 // General RecPriorities settings 2341 2520 2342 static Global CheckBox*GRSchedMoveHigher()2521 static GlobalBoolSetting *GRSchedMoveHigher() 2343 2522 { 2344 Global CheckBox *bc = new GlobalCheckBox("SchedMoveHigher");2523 GlobalBoolSetting *bc = new GlobalBoolSetting("SchedMoveHigher"); 2345 2524 bc->setLabel(QObject::tr("Reschedule higher priorities")); 2346 2525 bc->setHelpText(QObject::tr("Move higher priority programs to other " 2347 2526 "cards and showings when resolving conflicts. This " … … static GlobalCheckBox *GRSchedMoveHigher() 2352 2531 return bc; 2353 2532 } 2354 2533 2355 static Global ComboBox*GRSchedOpenEnd()2534 static GlobalListSetting *GRSchedOpenEnd() 2356 2535 { 2357 Global ComboBox *bc = new GlobalComboBox("SchedOpenEnd");2536 GlobalListSetting *bc = new GlobalListSetting("SchedOpenEnd"); 2358 2537 bc->setLabel(QObject::tr("Avoid back to back recordings")); 2359 2538 bc->setHelpText(QObject::tr("Selects the situations where the scheduler " 2360 2539 "will avoid assigning shows to the same card if their " … … static GlobalComboBox *GRSchedOpenEnd() 2367 2546 return bc; 2368 2547 } 2369 2548 2370 static Global SpinBox*GRDefaultStartOffset()2549 static GlobalRangeSetting *GRDefaultStartOffset() 2371 2550 { 2372 Global SpinBox *bs = new GlobalSpinBox("DefaultStartOffset",2551 GlobalRangeSetting *bs = new GlobalRangeSetting("DefaultStartOffset", 2373 2552 -10, 30, 5, true); 2374 2553 bs->setLabel(QObject::tr("Default 'Start Early' minutes for new " 2375 2554 "recording rules")); … … static GlobalSpinBox *GRDefaultStartOffset() 2382 2561 return bs; 2383 2562 } 2384 2563 2385 static Global SpinBox*GRDefaultEndOffset()2564 static GlobalRangeSetting *GRDefaultEndOffset() 2386 2565 { 2387 Global SpinBox *bs = new GlobalSpinBox("DefaultEndOffset",2566 GlobalRangeSetting *bs = new GlobalRangeSetting("DefaultEndOffset", 2388 2567 -10, 30, 5, true); 2389 2568 bs->setLabel(QObject::tr("Default 'End Late' minutes for new " 2390 2569 "recording rules")); … … static GlobalSpinBox *GRDefaultEndOffset() 2397 2576 return bs; 2398 2577 } 2399 2578 2400 static Global SpinBox*GRPrefInputRecPriority()2579 static GlobalRangeSetting *GRPrefInputRecPriority() 2401 2580 { 2402 Global SpinBox *bs = new GlobalSpinBox("PrefInputPriority", 1, 99, 1);2581 GlobalRangeSetting *bs = new GlobalRangeSetting("PrefInputPriority", 1, 99, 1); 2403 2582 bs->setLabel(QObject::tr("Preferred input priority")); 2404 2583 bs->setHelpText(QObject::tr("Additional priority when a showing " 2405 2584 "matches the preferred input selected in the 'Scheduling " … … static GlobalSpinBox *GRPrefInputRecPriority() 2408 2587 return bs; 2409 2588 } 2410 2589 2411 static Global SpinBox*GRHDTVRecPriority()2590 static GlobalRangeSetting *GRHDTVRecPriority() 2412 2591 { 2413 Global SpinBox *bs = new GlobalSpinBox("HDTVRecPriority", -99, 99, 1);2592 GlobalRangeSetting *bs = new GlobalRangeSetting("HDTVRecPriority", -99, 99, 1); 2414 2593 bs->setLabel(QObject::tr("HDTV recording priority")); 2415 2594 bs->setHelpText(QObject::tr("Additional priority when a showing " 2416 2595 "is marked as an HDTV broadcast in the TV listings.")); … … static GlobalSpinBox *GRHDTVRecPriority() 2418 2597 return bs; 2419 2598 } 2420 2599 2421 static Global SpinBox*GRWSRecPriority()2600 static GlobalRangeSetting *GRWSRecPriority() 2422 2601 { 2423 Global SpinBox *bs = new GlobalSpinBox("WSRecPriority", -99, 99, 1);2602 GlobalRangeSetting *bs = new GlobalRangeSetting("WSRecPriority", -99, 99, 1); 2424 2603 bs->setLabel(QObject::tr("Widescreen recording priority")); 2425 2604 bs->setHelpText(QObject::tr("Additional priority when a showing " 2426 2605 "is marked as widescreen in the TV listings.")); … … static GlobalSpinBox *GRWSRecPriority() 2428 2607 return bs; 2429 2608 } 2430 2609 2431 static Global SpinBox*GRAutoRecPriority()2610 static GlobalRangeSetting *GRAutoRecPriority() 2432 2611 { 2433 Global SpinBox *bs = new GlobalSpinBox("AutoRecPriority", -99, 99, 1);2612 GlobalRangeSetting *bs = new GlobalRangeSetting("AutoRecPriority", -99, 99, 1); 2434 2613 bs->setLabel(QObject::tr("Automatic priority range (+/-)")); 2435 2614 bs->setHelpText(QObject::tr("Up to this number of priority points may " 2436 2615 "be added for titles that are usually watched soon after " … … static GlobalSpinBox *GRAutoRecPriority() 2440 2619 return bs; 2441 2620 } 2442 2621 2443 static Global SpinBox*GRSignLangRecPriority()2622 static GlobalRangeSetting *GRSignLangRecPriority() 2444 2623 { 2445 Global SpinBox *bs = new GlobalSpinBox("SignLangRecPriority",2624 GlobalRangeSetting *bs = new GlobalRangeSetting("SignLangRecPriority", 2446 2625 -99, 99, 1); 2447 2626 bs->setLabel(QObject::tr("Sign language recording priority")); 2448 2627 bs->setHelpText(QObject::tr("Additional priority when a showing " … … static GlobalSpinBox *GRSignLangRecPriority() 2451 2630 return bs; 2452 2631 } 2453 2632 2454 static Global SpinBox*GROnScrSubRecPriority()2633 static GlobalRangeSetting *GROnScrSubRecPriority() 2455 2634 { 2456 Global SpinBox *bs = new GlobalSpinBox("OnScrSubRecPriority",2635 GlobalRangeSetting *bs = new GlobalRangeSetting("OnScrSubRecPriority", 2457 2636 -99, 99, 1); 2458 2637 bs->setLabel(QObject::tr("In-vision Subtitles Recording Priority")); 2459 2638 bs->setHelpText(QObject::tr("Additional priority when a showing " … … static GlobalSpinBox *GROnScrSubRecPriority() 2462 2641 return bs; 2463 2642 } 2464 2643 2465 static Global SpinBox*GRCCRecPriority()2644 static GlobalRangeSetting *GRCCRecPriority() 2466 2645 { 2467 Global SpinBox *bs = new GlobalSpinBox("CCRecPriority",2646 GlobalRangeSetting *bs = new GlobalRangeSetting("CCRecPriority", 2468 2647 -99, 99, 1); 2469 2648 bs->setLabel(QObject::tr("Subtitles/CC recording priority")); 2470 2649 bs->setHelpText(QObject::tr("Additional priority when a showing " … … static GlobalSpinBox *GRCCRecPriority() 2474 2653 return bs; 2475 2654 } 2476 2655 2477 static Global SpinBox*GRHardHearRecPriority()2656 static GlobalRangeSetting *GRHardHearRecPriority() 2478 2657 { 2479 Global SpinBox *bs = new GlobalSpinBox("HardHearRecPriority",2658 GlobalRangeSetting *bs = new GlobalRangeSetting("HardHearRecPriority", 2480 2659 -99, 99, 1); 2481 2660 bs->setLabel(QObject::tr("Hard of hearing priority")); 2482 2661 bs->setHelpText(QObject::tr("Additional priority when a showing " … … static GlobalSpinBox *GRHardHearRecPriority() 2486 2665 return bs; 2487 2666 } 2488 2667 2489 static Global SpinBox*GRAudioDescRecPriority()2668 static GlobalRangeSetting *GRAudioDescRecPriority() 2490 2669 { 2491 Global SpinBox *bs = new GlobalSpinBox("AudioDescRecPriority",2670 GlobalRangeSetting *bs = new GlobalRangeSetting("AudioDescRecPriority", 2492 2671 -99, 99, 1); 2493 2672 bs->setLabel(QObject::tr("Audio described priority")); 2494 2673 bs->setHelpText(QObject::tr("Additional priority when a showing " … … static GlobalSpinBox *GRAudioDescRecPriority() 2497 2676 return bs; 2498 2677 } 2499 2678 2500 static Global SpinBox*GRSingleRecordRecPriority()2679 static GlobalRangeSetting *GRSingleRecordRecPriority() 2501 2680 { 2502 Global SpinBox *bs = new GlobalSpinBox("SingleRecordRecPriority",2681 GlobalRangeSetting *bs = new GlobalRangeSetting("SingleRecordRecPriority", 2503 2682 -99, 99, 1); 2504 2683 bs->setLabel(QObject::tr("Single recordings priority")); 2505 2684 bs->setHelpText(QObject::tr("Single recordings will receive this " … … static GlobalSpinBox *GRSingleRecordRecPriority() 2508 2687 return bs; 2509 2688 } 2510 2689 2511 static Global SpinBox*GRWeekslotRecordRecPriority()2690 static GlobalRangeSetting *GRWeekslotRecordRecPriority() 2512 2691 { 2513 Global SpinBox *bs = new GlobalSpinBox("WeekslotRecordRecPriority",2692 GlobalRangeSetting *bs = new GlobalRangeSetting("WeekslotRecordRecPriority", 2514 2693 -99, 99, 1); 2515 2694 bs->setLabel(QObject::tr("Weekslot recordings priority")); 2516 2695 bs->setHelpText(QObject::tr("Weekslot recordings will receive this " … … static GlobalSpinBox *GRWeekslotRecordRecPriority() 2519 2698 return bs; 2520 2699 } 2521 2700 2522 static Global SpinBox*GRTimeslotRecordRecPriority()2701 static GlobalRangeSetting *GRTimeslotRecordRecPriority() 2523 2702 { 2524 Global SpinBox *bs = new GlobalSpinBox("TimeslotRecordRecPriority",2703 GlobalRangeSetting *bs = new GlobalRangeSetting("TimeslotRecordRecPriority", 2525 2704 -99, 99, 1); 2526 2705 bs->setLabel(QObject::tr("Timeslot recordings priority")); 2527 2706 bs->setHelpText(QObject::tr("Timeslot recordings will receive this " … … static GlobalSpinBox *GRTimeslotRecordRecPriority() 2530 2709 return bs; 2531 2710 } 2532 2711 2533 static Global SpinBox*GRChannelRecordRecPriority()2712 static GlobalRangeSetting *GRChannelRecordRecPriority() 2534 2713 { 2535 Global SpinBox *bs = new GlobalSpinBox("ChannelRecordRecPriority",2714 GlobalRangeSetting *bs = new GlobalRangeSetting("ChannelRecordRecPriority", 2536 2715 -99, 99, 1); 2537 2716 bs->setLabel(QObject::tr("Channel recordings priority")); 2538 2717 bs->setHelpText(QObject::tr("Channel recordings will receive this " … … static GlobalSpinBox *GRChannelRecordRecPriority() 2541 2720 return bs; 2542 2721 } 2543 2722 2544 static Global SpinBox*GRAllRecordRecPriority()2723 static GlobalRangeSetting *GRAllRecordRecPriority() 2545 2724 { 2546 Global SpinBox *bs = new GlobalSpinBox("AllRecordRecPriority",2725 GlobalRangeSetting *bs = new GlobalRangeSetting("AllRecordRecPriority", 2547 2726 -99, 99, 1); 2548 2727 bs->setLabel(QObject::tr("All recordings priority")); 2549 2728 bs->setHelpText(QObject::tr("The 'All' recording type will receive this " … … static GlobalSpinBox *GRAllRecordRecPriority() 2552 2731 return bs; 2553 2732 } 2554 2733 2555 static Global SpinBox*GRFindOneRecordRecPriority()2734 static GlobalRangeSetting *GRFindOneRecordRecPriority() 2556 2735 { 2557 Global SpinBox *bs = new GlobalSpinBox("FindOneRecordRecPriority",2736 GlobalRangeSetting *bs = new GlobalRangeSetting("FindOneRecordRecPriority", 2558 2737 -99, 99, 1); 2559 2738 bs->setLabel(QObject::tr("Find one recordings priority")); 2560 2739 bs->setHelpText(QObject::tr("Find One, Find Weekly and Find Daily " … … static GlobalSpinBox *GRFindOneRecordRecPriority() 2564 2743 return bs; 2565 2744 } 2566 2745 2567 static Global SpinBox*GROverrideRecordRecPriority()2746 static GlobalRangeSetting *GROverrideRecordRecPriority() 2568 2747 { 2569 Global SpinBox *bs = new GlobalSpinBox("OverrideRecordRecPriority",2748 GlobalRangeSetting *bs = new GlobalRangeSetting("OverrideRecordRecPriority", 2570 2749 -99, 99, 1); 2571 2750 bs->setLabel(QObject::tr("Override recordings priority")); 2572 2751 bs->setHelpText(QObject::tr("Override recordings will receive this " … … static GlobalSpinBox *GROverrideRecordRecPriority() 2575 2754 return bs; 2576 2755 } 2577 2756 2578 static Host LineEdit*DefaultTVChannel()2757 static HostTextualSetting *DefaultTVChannel() 2579 2758 { 2580 Host LineEdit *ge = new HostLineEdit("DefaultTVChannel");2759 HostTextualSetting *ge = new HostTextualSetting("DefaultTVChannel"); 2581 2760 ge->setLabel(QObject::tr("Guide starts at channel")); 2582 2761 ge->setValue("3"); 2583 2762 ge->setHelpText(QObject::tr("The program guide starts on this channel if " … … static HostLineEdit *DefaultTVChannel() 2585 2764 return ge; 2586 2765 } 2587 2766 2588 static Host SpinBox*EPGRecThreshold()2767 static HostRangeSetting *EPGRecThreshold() 2589 2768 { 2590 Host SpinBox *gs = new HostSpinBox("SelChangeRecThreshold", 1, 600, 1);2769 HostRangeSetting *gs = new HostRangeSetting("SelChangeRecThreshold", 1, 600, 1); 2591 2770 gs->setLabel(QObject::tr("Record threshold")); 2592 2771 gs->setValue(16); 2593 2772 gs->setHelpText(QObject::tr("Pressing SELECT on a show that is at least " … … static HostSpinBox *EPGRecThreshold() 2596 2775 return gs; 2597 2776 } 2598 2777 2599 static Host ComboBox*MythLanguage()2778 static HostListSetting *MythLanguage() 2600 2779 { 2601 Host ComboBox *gc = new HostComboBox("Language");2780 HostListSetting *gc = new HostListSetting("Language"); 2602 2781 gc->setLabel(QObject::tr("Language")); 2603 2782 2604 2783 QMap<QString, QString> langMap = MythTranslation::getLanguages(); … … static HostComboBox *MythLanguage() 2620 2799 return gc; 2621 2800 } 2622 2801 2623 static void ISO639_fill_selections( SelectSetting *widget, uint i)2802 static void ISO639_fill_selections(ListSetting *listSetting, uint i) 2624 2803 { 2625 widget->clearSelections();2804 listSetting->clearSelections(); 2626 2805 QString q = QString("ISO639Language%1").arg(i); 2627 2806 QString lang = gCoreContext->GetSetting(q, "").toLower(); 2628 2807 … … static void ISO639_fill_selections(SelectSetting *widget, uint i) 2643 2822 desc = desc.left(idx); 2644 2823 2645 2824 const QString il = iso639_key_to_str3(it.key()); 2646 widget->addSelection(desc, il, il == lang);2825 listSetting->addSelection(desc, il, il == lang); 2647 2826 } 2648 2827 } 2649 2828 2650 static Global ComboBox*ISO639PreferredLanguage(uint i)2829 static GlobalListSetting *ISO639PreferredLanguage(uint i) 2651 2830 { 2652 Global ComboBox *gc = new GlobalComboBox(QString("ISO639Language%1").arg(i));2831 GlobalListSetting *gc = new GlobalListSetting(QString("ISO639Language%1").arg(i)); 2653 2832 gc->setLabel(QObject::tr("Guide language #%1").arg(i+1)); 2654 2833 // We should try to get language from "MythLanguage" 2655 2834 // then use code 2 to code 3 map in iso639.h … … static GlobalComboBox *ISO639PreferredLanguage(uint i) 2660 2839 return gc; 2661 2840 } 2662 2841 2663 static Host CheckBox *NetworkControlEnabled()2842 static HostRangeSetting *NetworkControlPort() 2664 2843 { 2665 HostCheckBox *gc = new HostCheckBox("NetworkControlEnabled"); 2844 HostRangeSetting *gs = new HostRangeSetting("NetworkControlPort", 1025, 65535, 1); 2845 gs->setLabel(QObject::tr("Network Remote Control port")); 2846 gs->setValue(6546); 2847 gs->setHelpText(QObject::tr("This specifies what port the network remote " 2848 "Control interface will listen on for new connections.")); 2849 return gs; 2850 } 2851 2852 static HostBoolSetting *NetworkControlEnabled() 2853 { 2854 HostBoolSetting *gc = new HostBoolSetting("NetworkControlEnabled"); 2666 2855 gc->setLabel(QObject::tr("Enable Network Remote Control interface")); 2667 2856 gc->setHelpText(QObject::tr("This enables support for controlling " 2668 2857 "mythfrontend over the network.")); 2669 2858 gc->setValue(false); 2859 2860 gc->addChild(true, NetworkControlPort()); 2670 2861 return gc; 2671 2862 } 2672 2863 2673 static HostSpinBox *NetworkControlPort()2674 {2675 HostSpinBox *gs = new HostSpinBox("NetworkControlPort", 1025, 65535, 1);2676 gs->setLabel(QObject::tr("Network Remote Control port"));2677 gs->setValue(6546);2678 gs->setHelpText(QObject::tr("This specifies what port the network remote "2679 "Control interface will listen on for new connections."));2680 return gs;2681 }2682 2864 2683 static HostLineEdit *UDPNotifyPort() 2865 2866 static HostTextualSetting *UDPNotifyPort() 2684 2867 { 2685 Host LineEdit *ge = new HostLineEdit("UDPNotifyPort");2868 HostTextualSetting *ge = new HostTextualSetting("UDPNotifyPort"); 2686 2869 ge->setLabel(QObject::tr("UDP notify port")); 2687 2870 ge->setValue("6948"); 2688 2871 ge->setHelpText(QObject::tr("MythTV will listen for " … … static HostLineEdit *UDPNotifyPort() 2692 2875 return ge; 2693 2876 } 2694 2877 2695 static Host CheckBox*RealtimePriority()2878 static HostBoolSetting *RealtimePriority() 2696 2879 { 2697 Host CheckBox *gc = new HostCheckBox("RealtimePriority");2880 HostBoolSetting *gc = new HostBoolSetting("RealtimePriority"); 2698 2881 gc->setLabel(QObject::tr("Enable realtime priority threads")); 2699 2882 gc->setHelpText(QObject::tr("When running mythfrontend with root " 2700 2883 "privileges, some threads can be given enhanced priority. " … … static HostCheckBox *RealtimePriority() 2704 2887 return gc; 2705 2888 } 2706 2889 2707 static HostCheckBox *EnableMediaMon() 2708 { 2709 HostCheckBox *gc = new HostCheckBox("MonitorDrives"); 2710 gc->setLabel(QObject::tr("Monitor CD/DVD") + 2711 QObject::tr(" (and other removable devices)")); 2712 gc->setHelpText(QObject::tr("This enables support for monitoring " 2713 "your CD/DVD drives for new disks and launching " 2714 "the proper plugin to handle them.")); 2715 gc->setValue(false); 2716 return gc; 2717 } 2718 2719 static HostLineEdit *IgnoreMedia() 2890 static HostTextualSetting *IgnoreMedia() 2720 2891 { 2721 Host LineEdit *ge = new HostLineEdit("IgnoreDevices");2892 HostTextualSetting *ge = new HostTextualSetting("IgnoreDevices"); 2722 2893 ge->setLabel(QObject::tr("Ignore devices")); 2723 2894 ge->setValue(""); 2724 2895 ge->setHelpText(QObject::tr("If there are any devices that you do not want " … … static HostLineEdit *IgnoreMedia() 2727 2898 return ge; 2728 2899 } 2729 2900 2730 class MythMediaSettings : public TriggeredConfigurationGroup 2901 static HostBoolSetting *EnableMediaMon() 2731 2902 { 2732 public: 2733 MythMediaSettings() : 2734 TriggeredConfigurationGroup(false, false, true, true) 2735 { 2736 setLabel(QObject::tr("MythMediaMonitor")); 2737 setUseLabel(false); 2738 2739 Setting* enabled = EnableMediaMon(); 2740 addChild(enabled); 2741 setTrigger(enabled); 2742 2743 ConfigurationGroup* settings = new VerticalConfigurationGroup(false); 2744 settings->addChild(IgnoreMedia()); 2745 addTarget("1", settings); 2746 2747 // show nothing if fillEnabled is off 2748 addTarget("0", new VerticalConfigurationGroup(true)); 2749 }; 2750 }; 2751 2903 HostBoolSetting *gc = new HostBoolSetting("MonitorDrives"); 2904 gc->setLabel(QObject::tr("Monitor CD/DVD") + 2905 QObject::tr(" (and other removable devices)")); 2906 gc->setHelpText(QObject::tr("This enables support for monitoring " 2907 "your CD/DVD drives for new disks and launching " 2908 "the proper plugin to handle them.")); 2909 gc->addChild(true,IgnoreMedia()); 2910 gc->setValue(false); 2911 return gc; 2912 } 2752 2913 2753 static Host ComboBox*DisplayGroupTitleSort()2914 static HostListSetting *DisplayGroupTitleSort() 2754 2915 { 2755 Host ComboBox *gc = new HostComboBox("DisplayGroupTitleSort");2916 HostListSetting *gc = new HostListSetting("DisplayGroupTitleSort"); 2756 2917 gc->setLabel(QObject::tr("Sort titles")); 2757 2918 gc->addSelection(QObject::tr("Alphabetically"), 2758 2919 QString::number(PlaybackBox::TitleSortAlphabetical)); … … static HostComboBox *DisplayGroupTitleSort() 2763 2924 return gc; 2764 2925 } 2765 2926 2766 static Host CheckBox *PlaybackWatchList()2927 static HostBoolSetting *PlaybackWLStart() 2767 2928 { 2768 HostCheckBox *gc = new HostCheckBox("PlaybackWatchList"); 2769 gc->setLabel(QObject::tr("Include the 'Watch List' group")); 2770 gc->setValue(true); 2771 gc->setHelpText(QObject::tr("The 'Watch List' is an abbreviated list of " 2772 "recordings sorted to highlight series and " 2773 "shows that need attention in order to " 2774 "keep up to date.")); 2775 return gc; 2776 } 2777 2778 static HostCheckBox *PlaybackWLStart() 2779 { 2780 HostCheckBox *gc = new HostCheckBox("PlaybackWLStart"); 2929 HostBoolSetting *gc = new HostBoolSetting("PlaybackWLStart"); 2781 2930 gc->setLabel(QObject::tr("Start from the Watch List view")); 2782 2931 gc->setValue(false); 2783 2932 gc->setHelpText(QObject::tr("If enabled, the 'Watch List' will be the " … … static HostCheckBox *PlaybackWLStart() 2786 2935 return gc; 2787 2936 } 2788 2937 2789 static Host CheckBox*PlaybackWLAutoExpire()2938 static HostBoolSetting *PlaybackWLAutoExpire() 2790 2939 { 2791 Host CheckBox *gc = new HostCheckBox("PlaybackWLAutoExpire");2940 HostBoolSetting *gc = new HostBoolSetting("PlaybackWLAutoExpire"); 2792 2941 gc->setLabel(QObject::tr("Exclude recordings not set for Auto-Expire")); 2793 2942 gc->setValue(false); 2794 2943 gc->setHelpText(QObject::tr("Set this if you turn off Auto-Expire only " … … static HostCheckBox *PlaybackWLAutoExpire() 2798 2947 return gc; 2799 2948 } 2800 2949 2801 static Host SpinBox*PlaybackWLMaxAge()2950 static HostRangeSetting *PlaybackWLMaxAge() 2802 2951 { 2803 Host SpinBox *gs = new HostSpinBox("PlaybackWLMaxAge", 30, 180, 10);2952 HostRangeSetting *gs = new HostRangeSetting("PlaybackWLMaxAge", 30, 180, 10); 2804 2953 gs->setLabel(QObject::tr("Maximum days counted in the score")); 2805 2954 gs->setValue(60); 2806 2955 gs->setHelpText(QObject::tr("The 'Watch List' scores are based on 1 point " … … static HostSpinBox *PlaybackWLMaxAge() 2810 2959 return gs; 2811 2960 } 2812 2961 2813 static Host SpinBox*PlaybackWLBlackOut()2962 static HostRangeSetting *PlaybackWLBlackOut() 2814 2963 { 2815 Host SpinBox *gs = new HostSpinBox("PlaybackWLBlackOut", 0, 5, 1);2964 HostRangeSetting *gs = new HostRangeSetting("PlaybackWLBlackOut", 0, 5, 1); 2816 2965 gs->setLabel(QObject::tr("Days to exclude weekly episodes after delete")); 2817 2966 gs->setValue(2); 2818 2967 gs->setHelpText(QObject::tr("When an episode is deleted or marked as " … … static HostSpinBox *PlaybackWLBlackOut() 2823 2972 return gs; 2824 2973 } 2825 2974 2826 class WatchListSettings : public TriggeredConfigurationGroup 2975 2976 static HostBoolSetting *PlaybackWatchList() 2827 2977 { 2828 public: 2829 WatchListSettings() : 2830 TriggeredConfigurationGroup(false, false, true, true) 2831 { 2832 2833 Setting* watchList = PlaybackWatchList(); 2834 addChild(watchList); 2835 setTrigger(watchList); 2836 2837 ConfigurationGroup* settings = new VerticalConfigurationGroup(false); 2838 settings->addChild(PlaybackWLStart()); 2839 settings->addChild(PlaybackWLAutoExpire()); 2840 settings->addChild(PlaybackWLMaxAge()); 2841 settings->addChild(PlaybackWLBlackOut()); 2842 addTarget("1", settings); 2843 2844 addTarget("0", new VerticalConfigurationGroup(true)); 2845 }; 2846 }; 2978 HostBoolSetting *gc = new HostBoolSetting("PlaybackWatchList"); 2979 gc->setLabel(QObject::tr("Include the 'Watch List' group")); 2980 gc->setValue(true); 2981 gc->setHelpText(QObject::tr("The 'Watch List' is an abbreviated list of " 2982 "recordings sorted to highlight series and " 2983 "shows that need attention in order to " 2984 "keep up to date.")); 2847 2985 2848 static HostCheckBox *LCDShowTime() 2986 gc->addChild(true,PlaybackWLStart()); 2987 gc->addChild(true,PlaybackWLAutoExpire()); 2988 gc->addChild(true,PlaybackWLMaxAge()); 2989 gc->addChild(true,PlaybackWLBlackOut()); 2990 return gc; 2991 } 2992 2993 static HostBoolSetting *LCDShowTime() 2849 2994 { 2850 Host CheckBox *gc = new HostCheckBox("LCDShowTime");2995 HostBoolSetting *gc = new HostBoolSetting("LCDShowTime"); 2851 2996 gc->setLabel(QObject::tr("Display time")); 2852 2997 gc->setHelpText(QObject::tr("Display current time on idle LCD display. ")); 2853 2998 gc->setValue(true); 2854 2999 return gc; 2855 3000 } 2856 3001 2857 static Host CheckBox*LCDShowRecStatus()3002 static HostBoolSetting *LCDShowRecStatus() 2858 3003 { 2859 Host CheckBox *gc = new HostCheckBox("LCDShowRecStatus");3004 HostBoolSetting *gc = new HostBoolSetting("LCDShowRecStatus"); 2860 3005 gc->setLabel(QObject::tr("Display recording status")); 2861 3006 gc->setHelpText(QObject::tr("Display current recordings information on " 2862 3007 "LCD display.")); … … static HostCheckBox *LCDShowRecStatus() 2864 3009 return gc; 2865 3010 } 2866 3011 2867 static Host CheckBox*LCDShowMenu()3012 static HostBoolSetting *LCDShowMenu() 2868 3013 { 2869 Host CheckBox *gc = new HostCheckBox("LCDShowMenu");3014 HostBoolSetting *gc = new HostBoolSetting("LCDShowMenu"); 2870 3015 gc->setLabel(QObject::tr("Display menus")); 2871 3016 gc->setHelpText(QObject::tr("Display selected menu on LCD display. ")); 2872 3017 gc->setValue(true); 2873 3018 return gc; 2874 3019 } 2875 3020 2876 static Host SpinBox*LCDPopupTime()3021 static HostRangeSetting *LCDPopupTime() 2877 3022 { 2878 Host SpinBox *gs = new HostSpinBox("LCDPopupTime", 1, 300, 1, true);3023 HostRangeSetting *gs = new HostRangeSetting("LCDPopupTime", 1, 300, 1, true); 2879 3024 gs->setLabel(QObject::tr("Menu pop-up time")); 2880 3025 gs->setHelpText(QObject::tr("How many seconds the menu will " 2881 3026 "remain visible after navigation.")); … … static HostSpinBox *LCDPopupTime() 2883 3028 return gs; 2884 3029 } 2885 3030 2886 static Host CheckBox*LCDShowMusic()3031 static HostBoolSetting *LCDShowMusic() 2887 3032 { 2888 Host CheckBox *gc = new HostCheckBox("LCDShowMusic");3033 HostBoolSetting *gc = new HostBoolSetting("LCDShowMusic"); 2889 3034 gc->setLabel(QObject::tr("Display music artist and title")); 2890 3035 gc->setHelpText(QObject::tr("Display playing artist and song title in " 2891 3036 "MythMusic on LCD display.")); … … static HostCheckBox *LCDShowMusic() 2893 3038 return gc; 2894 3039 } 2895 3040 2896 static Host ComboBox*LCDShowMusicItems()3041 static HostListSetting *LCDShowMusicItems() 2897 3042 { 2898 Host ComboBox *gc = new HostComboBox("LCDShowMusicItems");3043 HostListSetting *gc = new HostListSetting("LCDShowMusicItems"); 2899 3044 gc->setLabel(QObject::tr("Items")); 2900 3045 gc->addSelection(QObject::tr("Artist - Title"), "ArtistTitle"); 2901 3046 gc->addSelection(QObject::tr("Artist [Album] Title"), "ArtistAlbumTitle"); … … static HostComboBox *LCDShowMusicItems() 2903 3048 return gc; 2904 3049 } 2905 3050 2906 static Host CheckBox*LCDShowChannel()3051 static HostBoolSetting *LCDShowChannel() 2907 3052 { 2908 Host CheckBox *gc = new HostCheckBox("LCDShowChannel");3053 HostBoolSetting *gc = new HostBoolSetting("LCDShowChannel"); 2909 3054 gc->setLabel(QObject::tr("Display channel information")); 2910 3055 gc->setHelpText(QObject::tr("Display tuned channel information on LCD display.")); 2911 3056 gc->setValue(true); 2912 3057 return gc; 2913 3058 } 2914 3059 2915 static Host CheckBox*LCDShowVolume()3060 static HostBoolSetting *LCDShowVolume() 2916 3061 { 2917 Host CheckBox *gc = new HostCheckBox("LCDShowVolume");3062 HostBoolSetting *gc = new HostBoolSetting("LCDShowVolume"); 2918 3063 gc->setLabel(QObject::tr("Display volume information")); 2919 3064 gc->setHelpText(QObject::tr("Display volume level information " 2920 3065 "on LCD display.")); … … static HostCheckBox *LCDShowVolume() 2922 3067 return gc; 2923 3068 } 2924 3069 2925 static Host CheckBox*LCDShowGeneric()3070 static HostBoolSetting *LCDShowGeneric() 2926 3071 { 2927 Host CheckBox *gc = new HostCheckBox("LCDShowGeneric");3072 HostBoolSetting *gc = new HostBoolSetting("LCDShowGeneric"); 2928 3073 gc->setLabel(QObject::tr("Display generic information")); 2929 3074 gc->setHelpText(QObject::tr("Display generic information on LCD display.")); 2930 3075 gc->setValue(true); 2931 3076 return gc; 2932 3077 } 2933 3078 2934 static Host CheckBox*LCDBacklightOn()3079 static HostBoolSetting *LCDBacklightOn() 2935 3080 { 2936 Host CheckBox *gc = new HostCheckBox("LCDBacklightOn");3081 HostBoolSetting *gc = new HostBoolSetting("LCDBacklightOn"); 2937 3082 gc->setLabel(QObject::tr("Backlight always on")); 2938 3083 gc->setHelpText(QObject::tr("Turn on the backlight permanently " 2939 3084 "on the LCD display.")); … … static HostCheckBox *LCDBacklightOn() 2941 3086 return gc; 2942 3087 } 2943 3088 2944 static Host CheckBox*LCDHeartBeatOn()3089 static HostBoolSetting *LCDHeartBeatOn() 2945 3090 { 2946 Host CheckBox *gc = new HostCheckBox("LCDHeartBeatOn");3091 HostBoolSetting *gc = new HostBoolSetting("LCDHeartBeatOn"); 2947 3092 gc->setLabel(QObject::tr("Heartbeat always on")); 2948 3093 gc->setHelpText(QObject::tr("Turn on the LCD heartbeat.")); 2949 3094 gc->setValue(false); 2950 3095 return gc; 2951 3096 } 2952 3097 2953 static Host CheckBox*LCDBigClock()3098 static HostBoolSetting *LCDBigClock() 2954 3099 { 2955 Host CheckBox *gc = new HostCheckBox("LCDBigClock");3100 HostBoolSetting *gc = new HostBoolSetting("LCDBigClock"); 2956 3101 gc->setLabel(QObject::tr("Display large clock")); 2957 3102 gc->setHelpText(QObject::tr("On multiline displays try and display the time as large as possible.")); 2958 3103 gc->setValue(false); 2959 3104 return gc; 2960 3105 } 2961 3106 2962 static Host LineEdit*LCDKeyString()3107 static HostTextualSetting *LCDKeyString() 2963 3108 { 2964 Host LineEdit *ge = new HostLineEdit("LCDKeyString");3109 HostTextualSetting *ge = new HostTextualSetting("LCDKeyString"); 2965 3110 ge->setLabel(QObject::tr("LCD key order")); 2966 3111 ge->setValue("ABCDEF"); 2967 3112 ge->setHelpText(QObject::tr("Enter the 6 Keypad Return Codes for your " … … static HostLineEdit *LCDKeyString() 2972 3117 return ge; 2973 3118 } 2974 3119 2975 static Host CheckBox*LCDEnable()3120 static HostBoolSetting *LCDEnable() 2976 3121 { 2977 Host CheckBox *gc = new HostCheckBox("LCDEnable");3122 HostBoolSetting *gc = new HostBoolSetting("LCDEnable"); 2978 3123 gc->setLabel(QObject::tr("Enable LCD device")); 2979 3124 gc->setHelpText(QObject::tr("Use an LCD display to view MythTV status " 2980 3125 "information.")); 3126 3127 gc->addChild(true, LCDShowTime()); 3128 gc->addChild(true, LCDShowMenu()); 3129 gc->addChild(true, LCDShowMusic()); 3130 gc->addChild(true, LCDShowMusicItems()); 3131 gc->addChild(true, LCDShowChannel()); 3132 gc->addChild(true, LCDShowRecStatus()); 3133 gc->addChild(true, LCDShowVolume()); 3134 gc->addChild(true, LCDShowGeneric()); 3135 gc->addChild(true, LCDBacklightOn()); 3136 gc->addChild(true, LCDHeartBeatOn()); 3137 gc->addChild(true, LCDBigClock()); 3138 gc->addChild(true, LCDKeyString());; 3139 gc->addChild(true, LCDPopupTime()); 3140 2981 3141 gc->setValue(false); 2982 3142 return gc; 2983 3143 } 2984 3144 2985 class LcdSettings : public TriggeredConfigurationGroup2986 {2987 public:2988 LcdSettings() : TriggeredConfigurationGroup(false, false, false, false,2989 false, false, false, false)2990 {2991 setLabel(QObject::tr("LCD device display"));2992 setUseLabel(false);2993 2994 Setting* lcd_enable = LCDEnable();2995 addChild(lcd_enable);2996 setTrigger(lcd_enable);2997 2998 ConfigurationGroup *settings =2999 new VerticalConfigurationGroup(false, true, false, false);3000 ConfigurationGroup *setHoriz =3001 new HorizontalConfigurationGroup(false, false, false, false);3002 3003 ConfigurationGroup* setLeft =3004 new VerticalConfigurationGroup(false, false, false, false);3005 ConfigurationGroup* setRight =3006 new VerticalConfigurationGroup(false, false, false, false);3007 3008 setLeft->addChild(LCDShowTime());3009 setLeft->addChild(LCDShowMenu());3010 setLeft->addChild(LCDShowMusic());3011 setLeft->addChild(LCDShowMusicItems());3012 setLeft->addChild(LCDShowChannel());3013 setLeft->addChild(LCDShowRecStatus());3014 setRight->addChild(LCDShowVolume());3015 setRight->addChild(LCDShowGeneric());3016 setRight->addChild(LCDBacklightOn());3017 setRight->addChild(LCDHeartBeatOn());3018 setRight->addChild(LCDBigClock());3019 setRight->addChild(LCDKeyString());3020 setHoriz->addChild(setLeft);3021 setHoriz->addChild(setRight);3022 settings->addChild(setHoriz);3023 settings->addChild(LCDPopupTime());3024 3025 addTarget("1", settings);3026 3027 addTarget("0", new VerticalConfigurationGroup(true));3028 };3029 };3030 3031 3145 3032 3146 #if CONFIG_DARWIN 3033 static Host CheckBox*MacGammaCorrect()3147 static HostBoolSetting *MacGammaCorrect() 3034 3148 { 3035 Host CheckBox *gc = new HostCheckBox("MacGammaCorrect");3149 HostBoolSetting *gc = new HostBoolSetting("MacGammaCorrect"); 3036 3150 gc->setLabel(QObject::tr("Enable gamma correction for video")); 3037 3151 gc->setValue(false); 3038 3152 gc->setHelpText(QObject::tr("If enabled, QuickTime will correct the gamma " … … static HostCheckBox *MacGammaCorrect() 3041 3155 return gc; 3042 3156 } 3043 3157 3044 static Host CheckBox*MacScaleUp()3158 static HostBoolSetting *MacScaleUp() 3045 3159 { 3046 Host CheckBox *gc = new HostCheckBox("MacScaleUp");3160 HostBoolSetting *gc = new HostBoolSetting("MacScaleUp"); 3047 3161 gc->setLabel(QObject::tr("Scale video as necessary")); 3048 3162 gc->setValue(true); 3049 3163 gc->setHelpText(QObject::tr("If enabled, video will be scaled to fit your " … … static HostCheckBox *MacScaleUp() 3052 3166 return gc; 3053 3167 } 3054 3168 3055 static Host SpinBox*MacFullSkip()3169 static HostRangeSetting *MacFullSkip() 3056 3170 { 3057 Host SpinBox *gs = new HostSpinBox("MacFullSkip", 0, 30, 1, true);3171 HostRangeSetting *gs = new HostRangeSetting("MacFullSkip", 0, 30, 1, true); 3058 3172 gs->setLabel(QObject::tr("Frames to skip in fullscreen mode")); 3059 3173 gs->setValue(0); 3060 3174 gs->setHelpText(QObject::tr("Video displayed in fullscreen or non-windowed " … … static HostSpinBox *MacFullSkip() 3065 3179 return gs; 3066 3180 } 3067 3181 3068 static Host CheckBox *MacMainEnabled()3182 static HostRangeSetting *MacMainSkip() 3069 3183 { 3070 HostCheckBox *gc = new HostCheckBox("MacMainEnabled"); 3071 gc->setLabel(QObject::tr("Video in main window")); 3072 gc->setValue(true); 3073 gc->setHelpText(QObject::tr("If enabled, video will be displayed in the " 3074 "main GUI window. Disable this when you only want video " 3075 "on the desktop or in a floating window. Only valid when " 3076 "\"Use GUI size for TV playback\" and \"Run the " 3077 "frontend in a window\" are checked.")); 3078 return gc; 3079 } 3080 3081 static HostSpinBox *MacMainSkip() 3082 { 3083 HostSpinBox *gs = new HostSpinBox("MacMainSkip", 0, 30, 1, true); 3184 HostRangeSetting *gs = new HostRangeSetting("MacMainSkip", 0, 30, 1, true); 3084 3185 gs->setLabel(QObject::tr("Frames to skip")); 3085 3186 gs->setValue(0); 3086 3187 gs->setHelpText(QObject::tr("Video in the main window will skip this many " … … static HostSpinBox *MacMainSkip() 3089 3190 return gs; 3090 3191 } 3091 3192 3092 static Host SpinBox*MacMainOpacity()3193 static HostRangeSetting *MacMainOpacity() 3093 3194 { 3094 Host SpinBox *gs = new HostSpinBox("MacMainOpacity", 0, 100, 5, false);3195 HostRangeSetting *gs = new HostRangeSetting("MacMainOpacity", 0, 100, 5, false); 3095 3196 gs->setLabel(QObject::tr("Opacity")); 3096 3197 gs->setValue(100); 3097 3198 gs->setHelpText(QObject::tr("The opacity of the main window. Set to " … … static HostSpinBox *MacMainOpacity() 3100 3201 return gs; 3101 3202 } 3102 3203 3103 class MacMainSettings : public TriggeredConfigurationGroup 3104 { 3105 public: 3106 MacMainSettings() : TriggeredConfigurationGroup(false) 3107 { 3108 setLabel(QObject::tr("Video in main window")); 3109 setUseLabel(false); 3110 Setting *gc = MacMainEnabled(); 3111 addChild(gc); 3112 setTrigger(gc); 3113 3114 VerticalConfigurationGroup *opts = 3115 new VerticalConfigurationGroup(false, false); 3116 opts->addChild(MacMainSkip()); 3117 opts->addChild(MacMainOpacity()); 3118 3119 addTarget("1", opts); 3120 addTarget("0", new VerticalConfigurationGroup(false, false)); 3121 } 3122 }; 3123 3124 static HostCheckBox *MacFloatEnabled() 3204 static HostBoolSetting *MacMainEnabled() 3125 3205 { 3126 HostCheckBox *gc = new HostCheckBox("MacFloatEnabled"); 3127 gc->setLabel(QObject::tr("Video in floating window")); 3128 gc->setValue(false); 3129 gc->setHelpText(QObject::tr("If enabled, video will be displayed in a " 3130 "floating window. Only valid when \"Use GUI size for TV " 3131 "playback\" and \"Run the frontend in a window\" are " 3132 "checked.")); 3206 HostBoolSetting *gc = new HostBoolSetting("MacMainEnabled"); 3207 gc->setLabel(QObject::tr("Video in main window")); 3208 gc->setValue(true); 3209 gc->setHelpText(QObject::tr("If enabled, video will be displayed in the " 3210 "main GUI window. Disable this when you only want video " 3211 "on the desktop or in a floating window. Only valid when " 3212 "\"Use GUI size for TV playback\" and \"Run the " 3213 "frontend in a window\" are checked.")); 3214 gc->addChild(true, MacMainSkip()); 3215 gc->addChild(true, MacMainOpacity()); 3133 3216 return gc; 3134 3217 } 3135 3218 … … static HostSpinBox *MacFloatOpacity() 3155 3238 return gs; 3156 3239 } 3157 3240 3158 class MacFloatSettings : public TriggeredConfigurationGroup 3241 static HostCheckBox *MacFloatEnabled() 3159 3242 { 3160 public: 3161 MacFloatSettings() : TriggeredConfigurationGroup(false) 3162 { 3163 setLabel(QObject::tr("Video in floating window")); 3164 setUseLabel(false); 3165 Setting *gc = MacFloatEnabled(); 3166 addChild(gc); 3167 setTrigger(gc); 3243 HostCheckBox *gc = new HostCheckBox("MacFloatEnabled"); 3244 gc->setLabel(QObject::tr("Video in floating window")); 3245 gc->setValue(false); 3246 gc->setHelpText(QObject::tr("If enabled, video will be displayed in a " 3247 "floating window. Only valid when \"Use GUI size for TV " 3248 "playback\" and \"Run the frontend in a window\" are " 3249 "checked.")); 3168 3250 3169 VerticalConfigurationGroup *opts =3170 new VerticalConfigurationGroup(false, false);3171 opts->addChild(MacFloatSkip());3172 opts->addChild(MacFloatOpacity()); 3251 gc->addChild(true, MacFloatSkip()); 3252 gc->addChild(true, MacFloatOpacity()); 3253 return gc; 3254 } 3173 3255 3174 addTarget("1", opts); 3175 addTarget("0", new VerticalConfigurationGroup(false, false)); 3176 } 3177 }; 3256 static HostSpinBox *MacDockSkip() 3257 { 3258 HostSpinBox *gs = new HostSpinBox("MacDockSkip", 0, 30, 1, true); 3259 gs->setLabel(QObject::tr("Frames to skip")); 3260 gs->setValue(3); 3261 gs->setHelpText(QObject::tr("Video in the dock icon will skip this many " 3262 "frames for each frame drawn. Set to 0 to show " 3263 "every frame.")); 3264 return gs; 3265 } 3178 3266 3179 3267 static HostCheckBox *MacDockEnabled() 3180 3268 { … … static HostCheckBox *MacDockEnabled() 3185 3273 "application's dock icon. Only valid when \"Use GUI size " 3186 3274 "for TV playback\" and \"Run the frontend in a window\" " 3187 3275 "are checked.")); 3276 3277 gc->addChild(true, MacDockSkip()); 3188 3278 return gc; 3189 3279 } 3190 3280 3191 static HostSpinBox *MacD ockSkip()3281 static HostSpinBox *MacDesktopSkip() 3192 3282 { 3193 HostSpinBox *gs = new HostSpinBox("MacD ockSkip", 0, 30, 1, true);3283 HostSpinBox *gs = new HostSpinBox("MacDesktopSkip", 0, 30, 1, true); 3194 3284 gs->setLabel(QObject::tr("Frames to skip")); 3195 gs->setValue( 3);3196 gs->setHelpText(QObject::tr("Video in the dock iconwill skip this many "3285 gs->setValue(0); 3286 gs->setHelpText(QObject::tr("Video on the desktop will skip this many " 3197 3287 "frames for each frame drawn. Set to 0 to show " 3198 3288 "every frame.")); 3199 3289 return gs; 3200 3290 } 3201 3291 3202 class MacDockSettings : public TriggeredConfigurationGroup3203 {3204 public:3205 MacDockSettings() : TriggeredConfigurationGroup(false)3206 {3207 setLabel(QObject::tr("Video in the dock"));3208 setUseLabel(false);3209 Setting *gc = MacDockEnabled();3210 addChild(gc);3211 setTrigger(gc);3212 3213 Setting *skip = MacDockSkip();3214 addTarget("1", skip);3215 addTarget("0", new HorizontalConfigurationGroup(false, false));3216 }3217 };3218 3219 3292 static HostCheckBox *MacDesktopEnabled() 3220 3293 { 3221 3294 HostCheckBox *gc = new HostCheckBox("MacDesktopEnabled"); … … static HostCheckBox *MacDesktopEnabled() 3225 3298 "desktop, behind the Finder icons. Only valid when \"Use " 3226 3299 "GUI size for TV playback\" and \"Run the frontend in a " 3227 3300 "window\" are checked.")); 3228 return gc;3229 }3230 3301 3231 static HostSpinBox *MacDesktopSkip() 3232 { 3233 HostSpinBox *gs = new HostSpinBox("MacDesktopSkip", 0, 30, 1, true); 3234 gs->setLabel(QObject::tr("Frames to skip")); 3235 gs->setValue(0); 3236 gs->setHelpText(QObject::tr("Video on the desktop will skip this many " 3237 "frames for each frame drawn. Set to 0 to show " 3238 "every frame.")); 3239 return gs; 3302 gc->addChild(true, MacDesktopSkip()); 3303 return gc; 3240 3304 } 3241 3305 3242 class MacDesktopSettings : public TriggeredConfigurationGroup3243 {3244 public:3245 MacDesktopSettings() : TriggeredConfigurationGroup(false)3246 {3247 setLabel(QObject::tr("Video on the desktop"));3248 setUseLabel(false);3249 Setting *gc = MacDesktopEnabled();3250 addChild(gc);3251 setTrigger(gc);3252 3253 Setting *skip = MacDesktopSkip();3254 addTarget("1", skip);3255 addTarget("0", new HorizontalConfigurationGroup(false, false));3256 }3257 };3258 3306 #endif 3259 3307 3260 static Host CheckBox*WatchTVGuide()3308 static HostBoolSetting *WatchTVGuide() 3261 3309 { 3262 Host CheckBox *gc = new HostCheckBox("WatchTVGuide");3310 HostBoolSetting *gc = new HostBoolSetting("WatchTVGuide"); 3263 3311 gc->setLabel(QObject::tr("Show the program guide when starting Live TV")); 3264 3312 gc->setHelpText(QObject::tr("This starts the program guide immediately " 3265 3313 "upon starting to watch Live TV.")); … … static HostCheckBox *WatchTVGuide() 3269 3317 3270 3318 MainGeneralSettings::MainGeneralSettings() 3271 3319 { 3272 DatabaseSettings::addDatabaseSettings(this);3320 setLabel(QObject::tr("General")); 3273 3321 3274 VerticalConfigurationGroup *pin = 3275 new VerticalConfigurationGroup(false, true, false, false); 3322 addChild(new MythDbSettings()); 3323 3324 GroupSetting *pin = new GroupSetting(); 3276 3325 pin->setLabel(QObject::tr("Settings Access")); 3277 3326 pin->addChild(SetupPinCodeRequired()); 3278 3327 pin->addChild(SetupPinCode()); 3279 3328 addChild(pin); 3280 3329 3281 VerticalConfigurationGroup *general = 3282 new VerticalConfigurationGroup(false, true, false, false); 3330 GroupSetting *general = new GroupSetting(); 3283 3331 general->setLabel(QObject::tr("General")); 3284 3332 general->addChild(UseVirtualKeyboard()); 3285 3333 general->addChild(ScreenShotPath()); 3286 3334 addChild(general); 3287 3335 3288 VerticalConfigurationGroup *media = 3289 new VerticalConfigurationGroup(false, true, false, false); 3290 media->setLabel(QObject::tr("Media Monitor")); 3291 MythMediaSettings *mediaMon = new MythMediaSettings(); 3292 media->addChild(mediaMon); 3293 addChild(media); 3336 addChild(EnableMediaMon()); 3294 3337 3295 VerticalConfigurationGroup *shutdownSettings = 3296 new VerticalConfigurationGroup(true, true, false, false); 3338 GroupSetting *shutdownSettings = new GroupSetting(); 3297 3339 shutdownSettings->setLabel(QObject::tr("Shutdown/Reboot Settings")); 3298 3340 shutdownSettings->addChild(OverrideExitMenu()); 3299 3341 shutdownSettings->addChild(HaltCommand()); 3300 3342 shutdownSettings->addChild(RebootCommand()); 3301 3343 addChild(shutdownSettings); 3302 3344 3303 VerticalConfigurationGroup *remotecontrol = 3304 new VerticalConfigurationGroup(false, true, false, false); 3345 GroupSetting *remotecontrol = new GroupSetting(); 3305 3346 remotecontrol->setLabel(QObject::tr("Remote Control")); 3306 3347 remotecontrol->addChild(LircDaemonDevice()); 3307 3348 remotecontrol->addChild(NetworkControlEnabled()); 3308 remotecontrol->addChild(NetworkControlPort());3309 3349 remotecontrol->addChild(UDPNotifyPort()); 3310 3350 addChild(remotecontrol); 3311 3351 } 3312 3352 3313 3353 PlaybackSettings::PlaybackSettings() 3314 3354 { 3315 uint i = 0, total = 8; 3316 #if CONFIG_DARWIN 3317 total += 2; 3318 #endif // USING_DARWIN 3319 3320 3321 VerticalConfigurationGroup* general1 = 3322 new VerticalConfigurationGroup(false); 3323 general1->setLabel(QObject::tr("General Playback") + 3324 QString(" (%1/%2)").arg(++i).arg(total)); 3325 3326 HorizontalConfigurationGroup *columns = 3327 new HorizontalConfigurationGroup(false, false, true, true); 3328 3329 VerticalConfigurationGroup *column1 = 3330 new VerticalConfigurationGroup(false, false, true, true); 3331 column1->addChild(RealtimePriority()); 3332 column1->addChild(DecodeExtraAudio()); 3333 column1->addChild(JumpToProgramOSD()); 3334 columns->addChild(column1); 3335 3336 VerticalConfigurationGroup *column2 = 3337 new VerticalConfigurationGroup(false, false, true, true); 3338 column2->addChild(ClearSavedPosition()); 3339 column2->addChild(AltClearSavedPosition()); 3340 column2->addChild(AutomaticSetWatched()); 3341 column2->addChild(ContinueEmbeddedTVPlay()); 3342 columns->addChild(column2); 3343 3344 general1->addChild(columns); 3345 general1->addChild(LiveTVIdleTimeout()); 3346 addChild(general1); 3347 3348 VerticalConfigurationGroup* general2 = 3349 new VerticalConfigurationGroup(false); 3350 general2->setLabel(QObject::tr("General Playback") + 3351 QString(" (%1/%2)").arg(++i).arg(total)); 3352 3353 HorizontalConfigurationGroup* oscan = 3354 new HorizontalConfigurationGroup(false, false, true, true); 3355 VerticalConfigurationGroup *ocol1 = 3356 new VerticalConfigurationGroup(false, false, true, true); 3357 VerticalConfigurationGroup *ocol2 = 3358 new VerticalConfigurationGroup(false, false, true, true); 3359 ocol1->addChild(VertScanPercentage()); 3360 ocol1->addChild(YScanDisplacement()); 3361 ocol2->addChild(HorizScanPercentage()); 3362 ocol2->addChild(XScanDisplacement()); 3363 oscan->addChild(ocol1); 3364 oscan->addChild(ocol2); 3365 3366 HorizontalConfigurationGroup* aspect_fill = 3367 new HorizontalConfigurationGroup(false, false, true, true); 3368 aspect_fill->addChild(AspectOverride()); 3369 aspect_fill->addChild(AdjustFill()); 3370 3371 general2->addChild(oscan); 3372 general2->addChild(aspect_fill); 3373 general2->addChild(LetterboxingColour()); 3374 general2->addChild(PIPLocationComboBox()); 3375 general2->addChild(PlaybackExitPrompt()); 3376 general2->addChild(EndOfRecordingExitPrompt()); 3377 addChild(general2); 3355 setLabel(QObject::tr("Playback")); 3356 GroupSetting * general = new GroupSetting(); 3357 general->setLabel(QObject::tr("General Playback")); 3358 general->addChild(RealtimePriority()); 3359 general->addChild(DecodeExtraAudio()); 3360 general->addChild(JumpToProgramOSD()); 3361 general->addChild(ClearSavedPosition()); 3362 general->addChild(AltClearSavedPosition()); 3363 general->addChild(AutomaticSetWatched()); 3364 general->addChild(ContinueEmbeddedTVPlay()); 3365 general->addChild(LiveTVIdleTimeout()); 3366 general->addChild(VertScanPercentage()); 3367 general->addChild(HorizScanPercentage()); 3368 general->addChild(YScanDisplacement()); 3369 general->addChild(XScanDisplacement()); 3370 general->addChild(AspectOverride()); 3371 general->addChild(AdjustFill()); 3372 general->addChild(LetterboxingColour()); 3373 general->addChild(PIPLocationComboBox()); 3374 general->addChild(PlaybackExitPrompt()); 3375 general->addChild(EndOfRecordingExitPrompt()); 3376 addChild(general); 3378 3377 3379 QString tmp = QString(" (%1/%2)").arg(++i).arg(total); 3380 addChild(new PlaybackProfileConfigs(tmp)); 3378 //QString tmp = QString(" (%1/%2)").arg(++i).arg(total); 3379 addChild(new GroupSetting("PlaybackProfileConfigs TODO")); 3380 //TODO addChild(new PlaybackProfileConfigs(tmp)); 3381 3381 3382 VerticalConfigurationGroup* pbox = new VerticalConfigurationGroup(false); 3383 pbox->setLabel(QObject::tr("View Recordings") + 3384 QString(" (%1/%2)").arg(++i).arg(total)); 3382 GroupSetting* pbox = new GroupSetting(); 3383 pbox->setLabel(QObject::tr("View Recordings")); 3385 3384 pbox->addChild(PlayBoxOrdering()); 3386 3385 pbox->addChild(PlayBoxEpisodeSort()); 3387 3386 // Disabled until we re-enable live previews … … PlaybackSettings::PlaybackSettings() 3390 3389 pbox->addChild(PBBStartInTitle()); 3391 3390 addChild(pbox); 3392 3391 3393 VerticalConfigurationGroup* pbox2 = new VerticalConfigurationGroup(false); 3394 pbox2->setLabel(QObject::tr("Recording Groups") + 3395 QString(" (%1/%2)").arg(++i).arg(total)); 3392 GroupSetting* pbox2 = new GroupSetting(); 3393 pbox2->setLabel(QObject::tr("Recording Groups")); 3396 3394 pbox2->addChild(DisplayRecGroup()); 3397 3395 pbox2->addChild(QueryInitialFilter()); 3398 3396 pbox2->addChild(RememberRecGroup()); 3399 3397 pbox2->addChild(UseGroupNameAsAllPrograms()); 3400 3398 addChild(pbox2); 3401 3399 3402 VerticalConfigurationGroup* pbox3 = new VerticalConfigurationGroup(false); 3403 pbox3->setLabel(QObject::tr("View Recordings") + 3404 QString(" (%1/%2)").arg(++i).arg(total)); 3400 GroupSetting* pbox3 = new GroupSetting(); 3401 pbox3->setLabel(QObject::tr("View Recordings")); 3405 3402 pbox3->addChild(DisplayGroupTitleSort()); 3406 pbox3->addChild(new WatchListSettings());3403 addChild(PlaybackWatchList()); 3407 3404 addChild(pbox3); 3408 3405 3409 VerticalConfigurationGroup* seek = new VerticalConfigurationGroup(false); 3410 seek->setLabel(QObject::tr("Seeking") + 3411 QString(" (%1/%2)").arg(++i).arg(total)); 3406 GroupSetting* seek = new GroupSetting(); 3407 seek->setLabel(QObject::tr("Seeking")); 3412 3408 seek->addChild(SmartForward()); 3413 3409 seek->addChild(FFRewReposTime()); 3414 3410 seek->addChild(FFRewReverse()); 3415 3411 seek->addChild(ExactSeeking()); 3416 3412 addChild(seek); 3417 3413 3418 VerticalConfigurationGroup* comms = new VerticalConfigurationGroup(false); 3419 comms->setLabel(QObject::tr("Commercial Skip") + 3420 QString(" (%1/%2)").arg(++i).arg(total)); 3414 GroupSetting* comms = new GroupSetting(); 3415 comms->setLabel(QObject::tr("Commercial Skip")); 3421 3416 comms->addChild(AutoCommercialSkip()); 3422 3417 comms->addChild(CommRewindAmount()); 3423 3418 comms->addChild(CommNotifyAmount()); … … PlaybackSettings::PlaybackSettings() 3426 3421 addChild(comms); 3427 3422 3428 3423 #if CONFIG_DARWIN 3429 VerticalConfigurationGroup* mac1 = new VerticalConfigurationGroup(false); 3430 mac1->setLabel(QObject::tr("Mac OS X Video Settings") + 3431 QString(" (%1/%2)").arg(++i).arg(total)); 3432 mac1->addChild(MacGammaCorrect()); 3433 mac1->addChild(MacScaleUp()); 3434 mac1->addChild(MacFullSkip()); 3435 addChild(mac1); 3436 3437 VerticalConfigurationGroup* mac2 = new VerticalConfigurationGroup(false); 3438 mac2->setLabel(QObject::tr("Mac OS X Video Settings") + 3439 QString(" (%1/%2)").arg(++i).arg(total)); 3440 mac2->addChild(new MacMainSettings()); 3441 mac2->addChild(new MacFloatSettings()); 3442 3443 HorizontalConfigurationGroup *row = 3444 new HorizontalConfigurationGroup(false, false, true, true); 3445 row->addChild(new MacDockSettings()); 3446 row->addChild(new MacDesktopSettings()); 3447 mac2->addChild(row); 3448 3424 GroupSetting* mac = new GroupSetting(); 3425 mac->setLabel(QObject::tr("Mac OS X Video Settings")); 3426 mac->addChild(MacGammaCorrect()); 3427 mac->addChild(MacScaleUp()); 3428 mac->addChild(MacFullSkip()); 3429 mac->addChild(MacMainEnabled()); 3430 mac->addChild(MacFloatEnabled()); 3431 mac->addChild(MacDockEnabled()); 3432 mac->addChild(MacDesktopSettings()); 3449 3433 addChild(mac2); 3450 3434 #endif 3451 3435 } 3452 3436 3453 3437 OSDSettings::OSDSettings() 3454 3438 { 3455 VerticalConfigurationGroup* osd = new VerticalConfigurationGroup(false); 3456 osd->setLabel(QObject::tr("On-screen Display")); 3439 setLabel(QObject::tr("On-screen Display")); 3457 3440 3458 osd->addChild(EnableMHEG()); 3459 osd->addChild(PersistentBrowseMode()); 3460 osd->addChild(BrowseAllTuners()); 3461 osd->addChild(CCBackground()); 3462 osd->addChild(DefaultCCMode()); 3463 osd->addChild(PreferCC708()); 3464 osd->addChild(SubtitleFont()); 3465 osd->addChild(OSDCC708TextZoomPercentage()); 3466 osd->addChild(SubtitleCodec()); 3467 addChild(osd); 3441 addChild(EnableMHEG()); 3442 addChild(PersistentBrowseMode()); 3443 addChild(BrowseAllTuners()); 3444 addChild(CCBackground()); 3445 addChild(DefaultCCMode()); 3446 addChild(PreferCC708()); 3447 addChild(SubtitleFont()); 3448 addChild(OSDCC708TextZoomPercentage()); 3449 addChild(SubtitleCodec()); 3468 3450 3469 3451 //VerticalConfigurationGroup *cc = new VerticalConfigurationGroup(false); 3470 3452 //cc->setLabel(QObject::tr("Closed Captions")); … … OSDSettings::OSDSettings() 3479 3461 3480 3462 GeneralSettings::GeneralSettings() 3481 3463 { 3482 VerticalConfigurationGroup* general = new VerticalConfigurationGroup(false); 3483 general->setLabel(QObject::tr("General (Basic)")); 3464 setLabel(QObject::tr("General")); 3465 GroupSetting* general = new GroupSetting(); 3466 general->setLabel(QObject::tr("Basic")); 3484 3467 general->addChild(ChannelOrdering()); 3485 3468 general->addChild(ChannelFormat()); 3486 3469 general->addChild(LongChannelFormat()); … … GeneralSettings::GeneralSettings() 3488 3471 general->addChild(LiveTVPriority()); 3489 3472 addChild(general); 3490 3473 3491 VerticalConfigurationGroup* autoexp = new VerticalConfigurationGroup(false);3492 autoexp->setLabel(QObject::tr(" General (Auto-Expire)"));3474 GroupSetting* autoexp = new GroupSetting(); 3475 autoexp->setLabel(QObject::tr("Auto-Expire")); 3493 3476 autoexp->addChild(AutoExpireMethod()); 3494 3495 VerticalConfigurationGroup *expgrp0 = 3496 new VerticalConfigurationGroup(false, false, true, true); 3497 expgrp0->addChild(AutoExpireDefault()); 3498 expgrp0->addChild(RerecordWatched()); 3499 expgrp0->addChild(AutoExpireWatchedPriority()); 3500 3501 VerticalConfigurationGroup *expgrp1 = 3502 new VerticalConfigurationGroup(false, false, true, true); 3503 expgrp1->addChild(AutoExpireLiveTVMaxAge()); 3504 expgrp1->addChild(AutoExpireDayPriority()); 3505 expgrp1->addChild(AutoExpireExtraSpace()); 3506 3507 HorizontalConfigurationGroup *expgrp = 3508 new HorizontalConfigurationGroup(false, false, true, true); 3509 expgrp->addChild(expgrp0); 3510 expgrp->addChild(expgrp1); 3511 3512 autoexp->addChild(expgrp); 3513 autoexp->addChild(new DeletedExpireOptions()); 3514 3477 autoexp->addChild(AutoExpireDefault()); 3478 autoexp->addChild(RerecordWatched()); 3479 autoexp->addChild(AutoExpireWatchedPriority()); 3480 autoexp->addChild(AutoExpireLiveTVMaxAge()); 3481 autoexp->addChild(AutoExpireDayPriority()); 3482 autoexp->addChild(AutoExpireExtraSpace()); 3483 autoexp->addChild(AutoExpireInsteadOfDelete()); 3515 3484 addChild(autoexp); 3516 3485 3517 VerticalConfigurationGroup* jobs = new VerticalConfigurationGroup(false);3518 jobs->setLabel(QObject::tr(" General (Jobs)"));3486 GroupSetting* jobs = new GroupSetting(); 3487 jobs->setLabel(QObject::tr("Jobs")); 3519 3488 jobs->addChild(CommercialSkipMethod()); 3520 3489 jobs->addChild(CommFlagFast()); 3521 3490 jobs->addChild(AggressiveCommDetect()); 3522 3491 jobs->addChild(DefaultTranscoder()); 3523 3492 jobs->addChild(DeferAutoTranscodeDays()); 3524 3493 3525 VerticalConfigurationGroup* autogrp0 = 3526 new VerticalConfigurationGroup(false, false, true, true); 3527 autogrp0->addChild(AutoMetadataLookup()); 3528 autogrp0->addChild(AutoCommercialFlag()); 3529 autogrp0->addChild(AutoTranscode()); 3530 3531 VerticalConfigurationGroup* autogrp1 = 3532 new VerticalConfigurationGroup(false, false, true, true); 3533 autogrp0->addChild(AutoRunUserJob(1)); 3534 autogrp1->addChild(AutoRunUserJob(2)); 3535 autogrp1->addChild(AutoRunUserJob(3)); 3536 autogrp1->addChild(AutoRunUserJob(4)); 3537 3538 HorizontalConfigurationGroup *autogrp = 3539 new HorizontalConfigurationGroup(true, true, false, true); 3494 GroupSetting* autogrp = new GroupSetting(); 3540 3495 autogrp->setLabel( 3541 3496 QObject::tr("Default Job Queue Settings for New Scheduled Recordings")); 3542 autogrp->addChild(autogrp0); 3543 autogrp->addChild(autogrp1); 3497 autogrp->addChild(AutoMetadataLookup()); 3498 autogrp->addChild(AutoCommercialFlag()); 3499 autogrp->addChild(AutoTranscode()); 3500 autogrp->addChild(AutoRunUserJob(1)); 3501 autogrp->addChild(AutoRunUserJob(2)); 3502 autogrp->addChild(AutoRunUserJob(3)); 3503 autogrp->addChild(AutoRunUserJob(4)); 3504 3544 3505 jobs->addChild(autogrp); 3545 3506 3546 3507 addChild(jobs); 3547 3508 3548 VerticalConfigurationGroup* general2 = new VerticalConfigurationGroup(false);3549 general2->setLabel(QObject::tr(" General (Advanced)"));3509 GroupSetting* general2 = new GroupSetting(); 3510 general2->setLabel(QObject::tr("Advanced")); 3550 3511 general2->addChild(RecordPreRoll()); 3551 3512 general2->addChild(RecordOverTime()); 3552 3513 general2->addChild(CategoryOverTimeSettings()); 3553 3514 addChild(general2); 3554 3515 3555 VerticalConfigurationGroup* changrp = new VerticalConfigurationGroup(false); 3556 changrp->setLabel(QObject::tr("General (Channel Groups)")); 3557 ChannelGroupSettings *changroupsettings = new ChannelGroupSettings(); 3558 changrp->addChild(changroupsettings); 3516 GroupSetting* changrp = new GroupSetting(); 3517 changrp->setLabel(QObject::tr("Channel Groups")); 3518 changrp->addChild(ChannelGroupRememberLast()); 3559 3519 changrp->addChild(BrowseChannelGroup()); 3560 3520 addChild(changrp); 3561 3521 } 3562 3522 3563 3523 EPGSettings::EPGSettings() 3564 3524 { 3565 VerticalConfigurationGroup* epg = new VerticalConfigurationGroup(false); 3566 epg->setLabel(QObject::tr("Program Guide") + " 1/1"); 3567 epg->addChild(WatchTVGuide()); 3568 epg->addChild(DefaultTVChannel()); 3569 epg->addChild(EPGRecThreshold()); 3570 addChild(epg); 3525 setLabel(QObject::tr("Program Guide")); 3526 addChild(WatchTVGuide()); 3527 addChild(DefaultTVChannel()); 3528 addChild(EPGRecThreshold()); 3571 3529 } 3572 3530 3573 3531 GeneralRecPrioritiesSettings::GeneralRecPrioritiesSettings() 3574 3532 { 3575 VerticalConfigurationGroup* sched = new VerticalConfigurationGroup(false); 3533 setLabel(QObject::tr("Recording Priorities")); 3534 3535 GroupSetting* sched = new GroupSetting(); 3576 3536 sched->setLabel(QObject::tr("Scheduler Options")); 3577 3537 3578 3538 sched->addChild(GRSchedMoveHigher()); … … GeneralRecPrioritiesSettings::GeneralRecPrioritiesSettings() 3585 3545 sched->addChild(GRAutoRecPriority()); 3586 3546 addChild(sched); 3587 3547 3588 VerticalConfigurationGroup* access = new VerticalConfigurationGroup(false);3548 GroupSetting* access = new GroupSetting(); 3589 3549 access->setLabel(QObject::tr("Accessibility Options")); 3590 3550 3591 3551 access->addChild(GRSignLangRecPriority()); … … GeneralRecPrioritiesSettings::GeneralRecPrioritiesSettings() 3595 3555 access->addChild(GRAudioDescRecPriority()); 3596 3556 addChild(access); 3597 3557 3598 VerticalConfigurationGroup* rtype = new VerticalConfigurationGroup(false);3558 GroupSetting* rtype = new GroupSetting(); 3599 3559 rtype->setLabel(QObject::tr("Recording Type Priority Settings")); 3600 3560 3601 3561 rtype->addChild(GRSingleRecordRecPriority()); … … GeneralRecPrioritiesSettings::GeneralRecPrioritiesSettings() 3610 3570 3611 3571 AppearanceSettings::AppearanceSettings() 3612 3572 { 3613 VerticalConfigurationGroup* screen = new VerticalConfigurationGroup(false); 3573 setLabel(QObject::tr("Appearance")); 3574 GroupSetting* screen = new GroupSetting(); 3614 3575 screen->setLabel(QObject::tr("Theme") + " / " + QObject::tr("Screen Settings")); 3615 3576 3616 3577 screen->addChild(MenuTheme()); … … AppearanceSettings::AppearanceSettings() 3624 3585 // screen->addChild(DisplaySizeHeight()); 3625 3586 // screen->addChild(DisplaySizeWidth()); 3626 3587 3627 VerticalConfigurationGroup *column1 = 3628 new VerticalConfigurationGroup(false, false, false, false); 3629 3630 column1->addChild(GuiWidth()); 3631 column1->addChild(GuiHeight()); 3632 column1->addChild(GuiOffsetX()); 3633 column1->addChild(GuiOffsetY()); 3634 3635 VerticalConfigurationGroup *column2 = 3636 new VerticalConfigurationGroup(false, false, false, false); 3637 3638 column2->addChild(GuiSizeForTV()); 3639 column2->addChild(HideMouseCursor()); 3640 column2->addChild(RunInWindow()); 3641 column2->addChild(UseFixedWindowSize()); 3642 3643 HorizontalConfigurationGroup *columns = 3644 new HorizontalConfigurationGroup(false, false, false, false); 3645 3646 columns->addChild(column1); 3647 columns->addChild(column2); 3648 3649 screen->addChild(columns); 3588 screen->addChild(GuiWidth()); 3589 screen->addChild(GuiHeight()); 3590 screen->addChild(GuiOffsetX()); 3591 screen->addChild(GuiOffsetY()); 3592 screen->addChild(GuiSizeForTV()); 3593 screen->addChild(HideMouseCursor()); 3594 screen->addChild(RunInWindow()); 3595 screen->addChild(UseFixedWindowSize()); 3650 3596 3651 3597 addChild(screen); 3652 3598 3653 3599 #if defined(USING_XRANDR) || CONFIG_DARWIN 3654 3600 const vector<DisplayResScreen> scr = GetVideoModes(); 3655 if (!scr.empty())3656 addChild(new VideoModeSettings()); 3601 /* TODO if (!scr.empty()) 3602 addChild(new VideoModeSettings()); */ 3657 3603 #endif 3658 VerticalConfigurationGroup* dates = new VerticalConfigurationGroup(false);3604 GroupSetting* dates = new GroupSetting(); 3659 3605 dates->setLabel(QObject::tr("Localization")); 3660 3606 dates->addChild(MythLanguage()); 3661 3607 dates->addChild(ISO639PreferredLanguage(0)); … … AppearanceSettings::AppearanceSettings() 3665 3611 dates->addChild(MythTimeFormat()); 3666 3612 addChild(dates); 3667 3613 3668 addChild( new LcdSettings());3614 addChild(LCDEnable()); 3669 3615 } 3670 3616 3671 3617 // vim:set sw=4 ts=4 expandtab: -
mythtv/programs/mythfrontend/globalsettings.h
diff --git a/mythtv/programs/mythfrontend/globalsettings.h b/mythtv/programs/mythfrontend/globalsettings.h index 93e774a..f149108 100644
a b 7 7 #include "settings.h" 8 8 #include "mythcontext.h" 9 9 #include "videodisplayprofile.h" 10 #include "standardsettings.h" 10 11 11 12 #include <QMutex> 12 13 13 14 class QFileInfo; 14 15 15 class PlaybackSettings : public ConfigurationWizard16 class PlaybackSettings : public GroupSetting 16 17 { 17 18 public: 18 19 PlaybackSettings(); 19 20 }; 20 21 21 class OSDSettings: virtual public ConfigurationWizard22 class OSDSettings: virtual public GroupSetting 22 23 { 23 24 public: 24 25 OSDSettings(); 25 26 }; 26 27 27 class GeneralSettings : public ConfigurationWizard28 class GeneralSettings : public GroupSetting 28 29 { 29 30 public: 30 31 GeneralSettings(); 31 32 }; 32 33 33 class EPGSettings : public ConfigurationWizard34 class EPGSettings : public GroupSetting 34 35 { 35 36 public: 36 37 EPGSettings(); 37 38 }; 38 39 39 class AppearanceSettings : public ConfigurationWizard40 class AppearanceSettings : public GroupSetting 40 41 { 41 42 public: 42 43 AppearanceSettings(); 43 44 }; 44 45 45 class MainGeneralSettings : public ConfigurationWizard46 class MainGeneralSettings : public GroupSetting 46 47 { 47 48 public: 48 49 MainGeneralSettings(); 49 50 }; 50 51 51 class GeneralRecPrioritiesSettings : public ConfigurationWizard52 class GeneralRecPrioritiesSettings : public GroupSetting 52 53 { 53 54 public: 54 55 GeneralRecPrioritiesSettings(); -
mythtv/programs/mythfrontend/main.cpp
diff --git a/mythtv/programs/mythfrontend/main.cpp b/mythtv/programs/mythfrontend/main.cpp index 33a8840..dbd60e0 100644
a b static void TVMenuCallback(void *data, QString &selection) 829 829 startPrevious(); 830 830 else if (sel == "settings appearance") 831 831 { 832 AppearanceSettings *settings = new AppearanceSettings(); 833 DialogCode res = settings->exec(); 834 delete settings; 832 MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); 833 StandardSettingDialog *gs = new StandardSettingDialog(mainStack, "maingeeralsettings"); 835 834 835 if (gs->Create()) 836 { 837 gs->setSettings(new AppearanceSettings()); 838 mainStack->AddScreen(gs); 839 } 840 else 841 delete gs; 842 /* TODO 836 843 if (kDialogCodeRejected != res) 837 844 { 838 845 qApp->processEvents(); 839 846 GetMythMainWindow()->JumpTo("Reload Theme"); 840 } 847 }*/ 841 848 } 842 849 else if (sel == "settings themechooser") 843 850 { … … static void TVMenuCallback(void *data, QString &selection) 889 896 } 890 897 else if (sel == "settings general") 891 898 { 892 GeneralSettings settings; 893 settings.exec(); 899 MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); 900 StandardSettingDialog *gs = new StandardSettingDialog(mainStack, "maingeeralsettings"); 901 902 if (gs->Create()) 903 { 904 gs->setSettings(new GeneralSettings()); 905 mainStack->AddScreen(gs); 906 } 907 else 908 delete gs; 894 909 } 895 910 else if (sel == "settings audiogeneral") 896 911 { … … static void TVMenuCallback(void *data, QString &selection) 899 914 } 900 915 else if (sel == "settings maingeneral") 901 916 { 902 MainGeneralSettings mainsettings; 903 mainsettings.exec(); 917 MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); 918 StandardSettingDialog *gs = new StandardSettingDialog(mainStack, "maingeeralsettings"); 919 920 if (gs->Create()) 921 { 922 gs->setSettings(new MainGeneralSettings()); 923 mainStack->AddScreen(gs); 924 } 925 else 926 delete gs; 927 928 /*TODO need to execute this after 904 929 QStringList strlist( QString("REFRESH_BACKEND") ); 905 930 gCoreContext->SendReceiveStringList(strlist); 931 */ 932 906 933 } 907 934 else if (sel == "settings playback") 908 935 { 909 PlaybackSettings settings; 910 settings.exec(); 936 MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); 937 StandardSettingDialog *gs = new StandardSettingDialog(mainStack, "maingeeralsettings"); 938 939 if (gs->Create()) 940 { 941 gs->setSettings(new PlaybackSettings()); 942 mainStack->AddScreen(gs); 943 } 944 else 945 delete gs; 911 946 } 912 947 else if (sel == "settings osd") 913 948 { 914 OSDSettings settings; 915 settings.exec(); 949 MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); 950 StandardSettingDialog *gs = new StandardSettingDialog(mainStack, "maingeeralsettings"); 951 952 if (gs->Create()) 953 { 954 gs->setSettings(new OSDSettings()); 955 mainStack->AddScreen(gs); 956 } 957 else 958 delete gs; 916 959 } 917 960 else if (sel == "settings epg") 918 961 { 919 EPGSettings settings; 920 settings.exec(); 962 MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); 963 StandardSettingDialog *gs = new StandardSettingDialog(mainStack, "maingeeralsettings"); 964 965 if (gs->Create()) 966 { 967 gs->setSettings(new EPGSettings()); 968 mainStack->AddScreen(gs); 969 } 970 else 971 delete gs; 921 972 } 922 973 else if (sel == "settings channelgroups") 923 974 { … … static void TVMenuCallback(void *data, QString &selection) 926 977 } 927 978 else if (sel == "settings generalrecpriorities") 928 979 { 929 GeneralRecPrioritiesSettings settings; 930 settings.exec(); 980 MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); 981 StandardSettingDialog *gs = new StandardSettingDialog(mainStack, "maingeeralsettings"); 982 983 if (gs->Create()) 984 { 985 gs->setSettings(new GeneralRecPrioritiesSettings()); 986 mainStack->AddScreen(gs); 987 } 988 else 989 delete gs; 931 990 } 932 991 else if (sel == "settings channelrecpriorities") 933 992 { … … static bool RunMenu(QString themedir, QString themename) 1056 1115 // the default values 1057 1116 static void WriteDefaults() 1058 1117 { 1118 /* 1059 1119 PlaybackSettings ps; 1060 1120 ps.Load(); 1061 1121 ps.Save(); … … static void WriteDefaults() 1079 1139 grs.Save(); 1080 1140 VideoGeneralSettings vgs; 1081 1141 vgs.Load(); 1082 vgs.Save(); 1142 vgs.Save();*/ 1083 1143 } 1084 1144 1085 1145 static int internal_play_media(const QString &mrl, const QString &plot, -
mythtv/programs/mythfrontend/mythfrontend.pro
diff --git a/mythtv/programs/mythfrontend/mythfrontend.pro b/mythtv/programs/mythfrontend/mythfrontend.pro index cf985d6..debf109 100644
a b HEADERS += videoplayercommand.h videopopups.h 39 39 HEADERS += videofilter.h videolist.h 40 40 HEADERS += videoplayersettings.h videodlg.h 41 41 HEADERS += videoglobalsettings.h upnpscanner.h 42 HEADERS += commandlineparser.h 42 HEADERS += commandlineparser.h 43 # maingeneralsettingssetup.h setup_video_general.h 44 HEADERS += standardsettings.h 43 45 44 46 SOURCES += main.cpp playbackbox.cpp viewscheduled.cpp audiogeneralsettings.cpp 45 47 SOURCES += globalsettings.cpp manualschedule.cpp programrecpriority.cpp … … SOURCES += videoplayercommand.cpp videopopups.cpp 60 62 SOURCES += videofilter.cpp videolist.cpp 61 63 SOURCES += videoplayersettings.cpp videodlg.cpp 62 64 SOURCES += videoglobalsettings.cpp upnpscanner.cpp 63 SOURCES += commandlineparser.cpp 65 SOURCES += commandlineparser.cpp 66 #maingeneralsettingssetup.cpp setup_video_general.cpp 67 SOURCES += standardsettings.cpp 64 68 65 69 macx { 66 70 mac_bundle { -
new file mythtv/programs/mythfrontend/standardsettings.cpp
diff --git a/mythtv/programs/mythfrontend/standardsettings.cpp b/mythtv/programs/mythfrontend/standardsettings.cpp new file mode 100755 index 0000000..b15ee98
- + 1 #include "standardsettings.h" 2 #include <QCoreApplication> 3 4 #include <mythcontext.h> 5 #include <mythmainwindow.h> 6 #include <mythdialogbox.h> 7 #include <mythuispinbox.h> 8 #include <mythuitext.h> 9 #include <mythuibutton.h> 10 #include "mythlogging.h" 11 12 13 StandardSetting::StandardSetting(const QString &settingName, const QString &text) 14 : GroupSetting(text), 15 m_settingName(settingName), 16 m_haveChanged(false) 17 { 18 this->SetData(QVariant::fromValue((MythGenericTree*)this)); 19 } 20 21 StandardSetting::~StandardSetting() 22 { 23 } 24 25 void StandardSetting::SetDBValue(const QString &text){ 26 LOG(VB_GENERAL, LOG_ERR, QString("StandardSettingDialog::SetDBValue(%1) for %2").arg(text).arg(m_settingName)); 27 setSettingValue(text); 28 }; 29 30 void StandardSetting::setSettingValue(const QString newValue) 31 { 32 m_settingValue=newValue; 33 } 34 35 const QString StandardSetting::getHelpText() 36 { 37 return GetText("help"); 38 } 39 40 const QString StandardSetting::getTextValue() const 41 { 42 return GetText("value"); 43 } 44 45 bool StandardSetting::haveChanged() 46 { 47 if (m_haveChanged) 48 return true; 49 return GroupSetting::haveChanged(); 50 } 51 52 GroupSetting::GroupSetting(const QString &text) 53 :MythGenericTree (text, 0, true) 54 { 55 } 56 57 void GroupSetting::setLabel(const QString &label) 58 { 59 SetText(label); 60 } 61 62 void GroupSetting::addChild(GroupSetting *standardSetting) 63 { 64 addNode(standardSetting); 65 } 66 void GroupSetting::setHelpText(const QString &description) 67 { 68 SetText(description,"help"); 69 } 70 71 //TODO remove the need for this 72 void GroupSetting::setScreen(MythScreenType *screen) 73 { 74 m_screen = screen; 75 76 QList<MythGenericTree*>::iterator it; 77 QList<MythGenericTree*> *children = this->getAllChildren(); 78 79 if (!children) 80 return; 81 82 MythGenericTree *child = NULL; 83 84 for (it = children->begin(); it != children->end(); ++it) 85 { 86 child = *it; 87 if (!child) 88 continue; 89 GroupSetting * setting = dynamic_cast<GroupSetting*>(child); 90 if (setting) 91 setting->setScreen(screen); 92 } 93 } 94 95 bool GroupSetting::haveChanged() 96 { 97 98 QList<MythGenericTree*>::iterator it; 99 QList<MythGenericTree*> *children = this->getAllChildren(); 100 101 if (!children) 102 return false; 103 104 MythGenericTree *child = NULL; 105 106 for (it = children->begin(); it != children->end(); ++it) 107 { 108 child = *it; 109 if (!child) 110 continue; 111 GroupSetting * setting = dynamic_cast<GroupSetting*>(child); 112 if (setting && setting->haveChanged()) 113 return true; 114 } 115 return false; 116 } 117 118 void GroupSetting::Save() 119 { 120 QList<MythGenericTree*>::iterator it; 121 QList<MythGenericTree*> *children = this->getAllChildren(); 122 123 if (!children) 124 return; 125 126 MythGenericTree *child = NULL; 127 128 for (it = children->begin(); it != children->end(); ++it) 129 { 130 child = *it; 131 if (!child) 132 continue; 133 GroupSetting * setting = dynamic_cast<GroupSetting*>(child); 134 if (setting) 135 setting->Save(); 136 } 137 } 138 139 void GroupSetting::Load() 140 { 141 QList<MythGenericTree*>::iterator it; 142 QList<MythGenericTree*> *children = this->getAllChildren(); 143 144 if (!children) 145 return; 146 147 MythGenericTree *child = NULL; 148 149 for (it = children->begin(); it != children->end(); ++it) 150 { 151 child = *it; 152 if (!child) 153 continue; 154 GroupSetting * setting = dynamic_cast<GroupSetting*>(child); 155 if (setting) 156 setting->Load(); 157 } 158 } 159 160 void GroupSetting::edit() 161 { 162 DialogCompletionEvent *dce = 163 new DialogCompletionEvent("editsetting", 0, "", ""); 164 QCoreApplication::postEvent(m_screen, dce); 165 } 166 167 TextualSetting::TextualSetting(const QString &settingName, const QString &text, bool password) 168 : StandardSetting(settingName, text), 169 m_password(password) 170 { 171 } 172 173 void TextualSetting::setValue(const QString &newValue) 174 { 175 setSettingValue(newValue); 176 } 177 178 void TextualSetting::edit() 179 { 180 MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack"); 181 182 MythTextInputDialog *settingdialog = 183 new MythTextInputDialog(popupStack, 184 this->GetText(),FilterNone, m_password,m_settingValue); 185 186 if (settingdialog->Create()) 187 { 188 settingdialog->SetReturnEvent(m_screen, "editsetting"); 189 popupStack->AddScreen(settingdialog); 190 } 191 } 192 193 void TextualSetting::resultEdit(DialogCompletionEvent *dce) 194 { 195 if (m_settingValue!=dce->GetResultText()) 196 { 197 m_haveChanged=true; 198 setSettingValue(dce->GetResultText()); 199 } 200 } 201 202 void TextualSetting::setSettingValue(const QString newValue) 203 { 204 m_settingValue = newValue; 205 206 if (m_password) 207 if (m_settingValue.isEmpty()) 208 SetText("","value"); 209 else 210 SetText("****","value"); 211 else 212 SetText(m_settingValue,"value"); 213 } 214 215 BoolSetting::BoolSetting(const QString &settingName, const QString &text) 216 : StandardSetting(settingName, text) 217 { 218 } 219 220 void BoolSetting::edit() 221 { 222 //LOG(VB_GENERAL, LOG_ERR, "BoolSetting::edit()"); 223 DialogCompletionEvent *dce = 224 new DialogCompletionEvent("editsetting", 0, "", QVariant::fromValue((MythGenericTree*)this)); 225 QCoreApplication::postEvent(m_screen, dce); 226 } 227 228 void BoolSetting::addChild (bool value, GroupSetting *child) 229 { 230 if (value) 231 m_OnChildren.append(child); 232 else 233 m_OffChildren.append(child); 234 /* 235 child = StandardSetting::addNode(child); 236 child->SetVisible(m_settingValue=="1"); 237 return child;*/ 238 } 239 240 void BoolSetting::setSettingValue(const QString newValue) 241 { 242 m_settingValue = newValue; 243 244 QList< GroupSetting * > *nodes = NULL; 245 246 if (m_settingValue=="1") 247 { 248 SetText(QObject::tr("On"),"value"); 249 nodes=&m_OnChildren; 250 } 251 else 252 { 253 SetText(QObject::tr("Off"),"value"); 254 nodes=&m_OffChildren; 255 } 256 257 QList< MythGenericTree * > *children = getAllChildren (); 258 MythGenericTree *child; 259 foreach(child, *children) 260 { 261 this->removeNode(child); 262 } 263 264 265 GroupSetting *node; 266 foreach(node, *nodes) 267 { 268 this->addNode(node); 269 } 270 } 271 272 void BoolSetting::setValue(bool newValue) 273 { 274 if (newValue) 275 setSettingValue("1"); 276 else 277 setSettingValue("0"); 278 } 279 280 void BoolSetting::resultEdit(DialogCompletionEvent *dce) 281 { 282 if (m_settingValue=="1") 283 setSettingValue(m_settingValue="0"); 284 else 285 setSettingValue(m_settingValue="1"); 286 m_haveChanged=true; 287 } 288 289 RangeSetting::RangeSetting(const QString &settingName, int min, int max, int step, bool allow_single_step) 290 : StandardSetting(settingName) 291 { 292 m_min = min; 293 m_max = max; 294 } 295 296 void RangeSetting::setValue(int newValue) 297 { 298 m_settingValue=QString("%1").arg(newValue); 299 update(); 300 } 301 302 void RangeSetting::edit() 303 { 304 MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack"); 305 306 307 MythTextInputDialog *settingdialog = 308 new MythTextInputDialog(popupStack, 309 "Range: " +this->GetText(),(InputFilter)(FilterAlpha | FilterSymbols | FilterPunct) ,false, m_settingValue); 310 if (settingdialog->Create()) 311 { 312 settingdialog->SetReturnEvent(m_screen, "editsetting"); 313 popupStack->AddScreen(settingdialog); 314 } 315 } 316 317 void RangeSetting::resultEdit(DialogCompletionEvent *dce) 318 { 319 if (m_settingValue!=dce->GetResultText()) 320 { 321 int newValue=dce->GetResultText().toInt(); 322 if (newValue< m_min || newValue > m_max) 323 { 324 //TODO display out of bound message; 325 MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack"); 326 MythConfirmationDialog * errorDialog = new MythConfirmationDialog(popupStack, 327 QObject::tr("out of bound, the value should be between %1 and %2") 328 .arg(m_min).arg(m_max),false); 329 if (errorDialog->Create()) 330 popupStack->AddScreen(errorDialog); 331 } 332 else 333 { 334 m_haveChanged=true; 335 setSettingValue(dce->GetResultText()); 336 337 } 338 update(); 339 } 340 } 341 342 void RangeSetting::update() 343 { 344 SetText(m_settingValue,"value"); 345 } 346 347 ListSetting::ListSetting(const QString &settingName, const QString &text) 348 :StandardSetting(settingName, text) 349 { 350 Load(); 351 } 352 353 void ListSetting::setValue(int newValue) 354 { 355 QMapIterator<QString, QString> i(m_options); 356 while (i.hasNext()) 357 { 358 i.next(); 359 if (newValue==0) 360 { 361 setSettingValue(i.key()); 362 return; 363 } 364 newValue--; 365 } 366 } 367 368 void ListSetting::setSettingValue(const QString newValue) 369 { 370 LOG(VB_GENERAL, LOG_ERR, QString("ListSetting::setSettingValue(%1) for %2") 371 .arg(newValue).arg(m_settingName)); 372 m_settingValue=newValue; 373 if (m_options.contains(m_settingValue)) 374 { 375 LOG(VB_GENERAL, LOG_ERR, QString("ListSetting::setSettingValue(%1) for %2 => %3") 376 .arg(newValue).arg(m_settingName).arg(m_options[m_settingValue])); 377 SetText(m_options[m_settingValue],"value"); 378 } 379 else 380 { 381 LOG(VB_GENERAL, LOG_ERR, QString("*ListSetting::setSettingValue(%1) for %2") 382 .arg(newValue).arg(m_settingName)); 383 SetText(newValue+"*","value"); 384 } 385 } 386 387 388 void ListSetting::addSelection(QString label, QString value, bool select) 389 { 390 m_options[value]=label; 391 //TODO do something with select 392 LOG(VB_GENERAL, LOG_ERR, QString("%1 => %2 =? %3") 393 .arg(m_settingName).arg(value).arg(m_settingValue)); 394 if (value == m_settingValue && m_options.contains(m_settingValue)) 395 SetText(m_options[m_settingValue],"value"); 396 } 397 398 void ListSetting::clearSelections() 399 { 400 m_options.clear(); 401 } 402 403 void ListSetting::edit() 404 { 405 MythScreenStack *popupStack = 406 GetMythMainWindow()->GetStack("popup stack"); 407 408 MythDialogBox * m_menuPopup = 409 new MythDialogBox(GetText(), popupStack, "optionmenu"); 410 411 if (m_menuPopup->Create()) 412 popupStack->AddScreen(m_menuPopup); 413 414 m_menuPopup->SetReturnEvent(m_screen, "editsetting"); 415 416 //populate the list of choice 417 QMapIterator<QString, QString> i(m_options); 418 while (i.hasNext()) 419 { 420 i.next(); 421 if (i.key()==m_settingValue) 422 m_menuPopup->AddButton(i.value(),i.key(),false,true); 423 else 424 m_menuPopup->AddButton(i.value(),i.key()); 425 } 426 } 427 428 void ListSetting::resultEdit(DialogCompletionEvent *dce) 429 { 430 if (dce->GetResult()!=-1 && m_settingValue!=dce->GetData().toString()) 431 { 432 m_haveChanged=true; 433 setSettingValue(dce->GetData().toString()); 434 } 435 } 436 437 MythSpinBoxDialog::MythSpinBoxDialog(MythScreenStack *parent, 438 const QString &message, 439 const QString &defaultValue) 440 : MythScreenType(parent, "mythspinboxpopup") 441 { 442 m_message = message; 443 m_defaultValue = defaultValue; 444 m_spinBox = NULL; 445 446 m_id = ""; 447 m_retObject = NULL; 448 } 449 450 bool MythSpinBoxDialog::Create(void) 451 { 452 if (!LoadWindowFromXML("standardsetting-ui.xml", "MythSpinBoxDialog", this)) 453 return false; 454 455 MythUIText *messageText = NULL; 456 MythUIButton *okButton = NULL; 457 MythUIButton *cancelButton = NULL; 458 459 bool err = false; 460 UIUtilE::Assign(this, m_spinBox, "input", &err); 461 UIUtilE::Assign(this, messageText, "message", &err); 462 UIUtilE::Assign(this, okButton, "ok", &err); 463 UIUtilW::Assign(this, cancelButton, "cancel"); 464 if (!m_spinBox)LOG(VB_GENERAL, LOG_ERR, "spinBox"); 465 if (!messageText)LOG(VB_GENERAL, LOG_ERR, "messageText"); 466 if (!okButton)LOG(VB_GENERAL, LOG_ERR, "okButton"); 467 468 if (err) 469 { 470 LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'MythSpinBoxDialog'"); 471 return false; 472 } 473 474 if (cancelButton) 475 connect(cancelButton, SIGNAL(Clicked()), SLOT(Close())); 476 connect(okButton, SIGNAL(Clicked()), SLOT(sendResult())); 477 478 m_spinBox->SetValue(m_defaultValue); 479 480 messageText->SetText(m_message); 481 482 BuildFocusList(); 483 484 return true; 485 } 486 487 void MythSpinBoxDialog::SetReturnEvent(QObject *retobject, 488 const QString &resultid) 489 { 490 m_retObject = retobject; 491 m_id = resultid; 492 } 493 494 void MythSpinBoxDialog::sendResult() 495 { 496 QString inputString = m_spinBox->GetValue(); 497 emit haveResult(inputString); 498 499 if (m_retObject) 500 { 501 DialogCompletionEvent *dce = new DialogCompletionEvent(m_id, 0, 502 inputString, ""); 503 QCoreApplication::postEvent(m_retObject, dce); 504 } 505 506 Close(); 507 } 508 509 void MythSpinBoxDialog::SetRange(int low, int high, int step, uint pageMultiple) 510 { 511 if (m_spinBox) 512 m_spinBox->SetRange(low, high, step, pageMultiple); 513 } 514 515 StandardSettingDialog::StandardSettingDialog(MythScreenStack *parent, const char *name) : 516 MythScreenType(parent, name), 517 m_buttonTree(0), 518 m_title(0), 519 m_grouphelp(0), 520 m_titleList(0), 521 m_selectedSettingLabel(0), 522 m_selectedSettingValue(0), 523 m_selectedSettingHelp(0), 524 m_cancelButton(0), 525 m_saveButton(0), 526 m_menuPopup(0), 527 m_loaded(false), 528 m_editedSetting(0) 529 { 530 m_settingsTree=new GroupSetting(name); 531 m_settingsTree->setScreen(this); 532 } 533 534 StandardSettingDialog::~StandardSettingDialog() 535 { 536 } 537 538 bool StandardSettingDialog::Create(void) 539 { 540 LOG(VB_GENERAL, LOG_ERR, "StandardSettingDialog::Create"); 541 if (!LoadWindowFromXML("standardsetting-ui.xml", "settingssetup", this)) 542 return false; 543 544 bool error=false; 545 UIUtilE::Assign(this, m_title, "title",&error); 546 UIUtilW::Assign(this, m_grouphelp,"grouphelp",&error); 547 UIUtilE::Assign(this, m_buttonTree,"settingstree",&error); 548 549 UIUtilW::Assign(this, m_selectedSettingLabel, "selectedsettinglabel"); 550 UIUtilW::Assign(this, m_selectedSettingValue, "selectedsettingvalue"); 551 UIUtilW::Assign(this, m_selectedSettingHelp, "selectedsettinghelp"); 552 553 connect(m_buttonTree,SIGNAL(itemSelected(MythUIButtonListItem*)), this,SLOT(settingSelected(MythUIButtonListItem*))); 554 connect(m_buttonTree,SIGNAL(itemClicked(MythUIButtonListItem*)), this,SLOT(settingClicked(MythUIButtonListItem*))); 555 556 if (error) 557 { 558 LOG(VB_GENERAL, LOG_ERR, "error."); 559 return false; 560 } 561 BuildFocusList(); 562 return true; 563 } 564 565 void StandardSettingDialog::settingSelected(MythUIButtonListItem *item) 566 { 567 MythGenericTree * node = qVariantValue<MythGenericTree*>(item->GetData()); 568 if (m_title) 569 { 570 if (node) 571 { 572 /*QString newTitle; 573 MythGenericTree * parentNode; 574 while (parentNode = node->getParent()) 575 { 576 newTitle=QString("%1 > %2").arg(parentNode->GetText()).arg(newTitle); 577 node = parentNode; 578 } 579 m_title->SetText(newTitle);*/ 580 m_title->SetText(node->getParent()->GetText()); 581 } 582 } 583 584 if (m_grouphelp) 585 { 586 m_grouphelp->SetText(node->getParent()->GetText("help")); 587 } 588 else 589 LOG(VB_GENERAL, LOG_ERR, "StandardSettingDialog::settingSelected()"); 590 591 if (m_selectedSettingLabel) 592 m_selectedSettingLabel->SetText(item->GetText()); 593 if (m_selectedSettingValue) 594 m_selectedSettingValue->SetText(item->GetText("value")); 595 if (m_selectedSettingHelp) 596 m_selectedSettingHelp->SetText(item->GetText("help")); 597 598 599 } 600 601 void StandardSettingDialog::settingClicked(MythUIButtonListItem *item) 602 { 603 MythGenericTree* tree = item->GetData().value<MythGenericTree*>(); 604 StandardSetting *ss = dynamic_cast<StandardSetting*>(tree); 605 if (ss) 606 { 607 m_editedSetting=ss; 608 ss->edit(); 609 } 610 else 611 { 612 GroupSetting *gs = dynamic_cast<GroupSetting*>(tree); 613 if (gs) 614 { 615 MythGenericTree *child = gs->getVisibleChildAt(0); 616 if (child) 617 m_buttonTree->SetCurrentNode(child); 618 } 619 } 620 } 621 622 void StandardSettingDialog::customEvent(QEvent *event) 623 { 624 if (event->type() == DialogCompletionEvent::kEventType) 625 { 626 DialogCompletionEvent *dce = (DialogCompletionEvent*)(event); 627 QString resultid = dce->GetId(); 628 629 if (resultid == "editsetting") 630 { 631 if (!m_editedSetting) return; 632 m_editedSetting->resultEdit(dce); 633 m_editedSetting=NULL; 634 635 //Force to refresh the button tree. not very elegant but no choice at the moment 636 MythGenericTree *currentNode = m_buttonTree->GetCurrentNode(); 637 m_buttonTree->AssignTree(m_settingsTree); 638 m_buttonTree->SetCurrentNode(currentNode); 639 } 640 else if (resultid == "exit") 641 { 642 int buttonnum = dce->GetResult(); 643 if (buttonnum == 0) 644 { 645 Save(); 646 MythScreenType::Close(); 647 } 648 else if (buttonnum == 1) 649 MythScreenType::Close(); 650 } 651 } 652 } 653 654 void StandardSettingDialog::setSettings(GroupSetting * groupSettings) 655 { 656 m_settingsTree=groupSettings; 657 m_settingsTree->setScreen(this); 658 m_settingsTree->Load(); 659 m_buttonTree->AssignTree(m_settingsTree); 660 BuildFocusList(); 661 } 662 663 void StandardSettingDialog::Save() 664 { 665 if (m_settingsTree) 666 m_settingsTree->Save(); 667 } 668 669 void StandardSettingDialog::Close(void) 670 { 671 if (m_settingsTree->haveChanged()) 672 { 673 QString label = tr("Exit ?"); 674 675 MythScreenStack *popupStack = 676 GetMythMainWindow()->GetStack("popup stack"); 677 678 MythDialogBox * m_menuPopup = 679 new MythDialogBox(label, popupStack, "exitmenu"); 680 681 if (m_menuPopup->Create()) 682 popupStack->AddScreen(m_menuPopup); 683 684 m_menuPopup->SetReturnEvent(this, "exit"); 685 686 m_menuPopup->AddButton(tr("Save then Exit")); 687 m_menuPopup->AddButton(tr("Exit without saving changes")); 688 m_menuPopup->AddButton(tr("Cancel")); 689 } 690 else 691 MythScreenType::Close(); 692 } 693 694 695 696 697 698 -
new file mythtv/programs/mythfrontend/standardsettings.h
diff --git a/mythtv/programs/mythfrontend/standardsettings.h b/mythtv/programs/mythfrontend/standardsettings.h new file mode 100755 index 0000000..095057d
- + 1 #ifndef STANDARDSETTINGS_H_ 2 #define STANDARDSETTINGS_H_ 3 4 #include "mythuibuttonlist.h" 5 #include <mythdialogbox.h> 6 #include <mythuibuttontree.h> 7 #include <mythgenerictree.h> 8 #include <QMap> 9 10 /** TODO LIST 11 ListSetting is not properly initialize, it should show the label not the value 12 Implement Save method 13 */ 14 15 /* 16 MythUIButtonListItem Type 17 18 *TextualSetting 19 PasswordSetting 20 DirectorySetting 21 FileSetting 22 *BooleanSetting 23 SpinSetting 24 GroupSetting 25 GroupBooleanSetting 26 GroupListSetting 27 ListSetting 28 ListSetting+refresh 29 FreeListSetting 30 Button for testing 31 */ 32 /* 33 34 35 class DBSetting 36 { 37 public: 38 virtual const QString getSetting(const QString &settingName)=0; 39 virtual void setSetting(const QString &settingName, const QString &settingValue)=0; 40 }; 41 42 class HostDBSetting : public DBSetting 43 { 44 public: 45 virtual const QString getSetting(const QString &settingName){return "host";}; 46 virtual void setSetting(const QString &settingName, const QString &settingValue){}; 47 }; 48 49 class GlobalDBSetting : public DBSetting 50 { 51 public: 52 virtual const QString getSetting(const QString &settingName){return "global";}; 53 virtual void setSetting(const QString &settingName, const QString &settingValue){}; 54 55 };*/ 56 57 /** 58 * Group Setting together 59 */ 60 class GroupSetting : public MythGenericTree, public Storage 61 { 62 public: 63 GroupSetting(const QString &text = ""); 64 virtual ~GroupSetting(){}; 65 66 void setLabel(const QString &label); 67 QString getLabel(){return GetText();}; 68 void addChild(GroupSetting *groupSetting); 69 void setHelpText(const QString &description); 70 QString getHelpText(){return GetText("help");}; 71 72 void setScreen(MythScreenType *screen); 73 74 void Save(); 75 void Load(); 76 virtual void edit(); 77 //virtual void resultEdit(DialogCompletionEvent *dce); 78 virtual bool haveChanged(); 79 protected: 80 const QString getSettingName(){return "";}; 81 void setSettingValue(const QString newValue){}; 82 MythScreenType *m_screen; 83 84 }; 85 86 87 // allow to set a textual setting 88 class StandardSetting : public GroupSetting, public StorageUser 89 { 90 public: 91 StandardSetting(const QString &settingName, const QString &text = ""); 92 virtual ~StandardSetting(); 93 94 const QString getHelpText(); 95 96 97 const QString getTextValue() const; 98 const QString getValue() const{return GetText("value");}; 99 virtual void resultEdit(DialogCompletionEvent *dce)=0; 100 bool haveChanged(); 101 102 void SetDBValue(const QString &text); 103 QString GetDBValue(void) const { return m_settingValue ;}; 104 105 protected: 106 //void SaveChildren(); 107 //void LoadChildren(); 108 //const QString settingName();//{return m_settingName;}; 109 virtual void setSettingValue(const QString newValue);//{m_settingValue=newValue;}; 110 QString m_settingName; 111 QString m_settingValue; 112 113 114 bool m_haveChanged; 115 //DBSetting * m_DBSetting; 116 }; 117 118 119 /** 120 * Display and edit a textual value 121 */ 122 class TextualSetting : public StandardSetting 123 { 124 public: 125 TextualSetting(const QString &settingName, const QString &text = "", bool password=false); 126 virtual ~TextualSetting(){}; 127 void setValue(const QString &newValue); 128 void setSettingValue(const QString newValue); 129 void edit(); 130 virtual void resultEdit(DialogCompletionEvent *dce); 131 132 protected: 133 bool m_password; 134 }; 135 136 class GlobalTextualSetting : public TextualSetting, public GlobalDBStorage 137 { 138 public: 139 GlobalTextualSetting(const QString &settingName, const QString &text = "", bool password=false) 140 :TextualSetting(settingName, text, password), GlobalDBStorage (this, settingName) 141 { 142 }; 143 void Load() 144 { 145 TextualSetting::Load(); 146 GlobalDBStorage::Load(); 147 } 148 void Save() 149 { 150 TextualSetting::Save(); 151 GlobalDBStorage::Save(); 152 } 153 154 155 156 }; 157 158 class HostTextualSetting : public TextualSetting, public HostDBStorage 159 { 160 public: 161 HostTextualSetting(const QString &settingName, const QString &text = "", bool password=false) 162 :TextualSetting(settingName, text, password), HostDBStorage (this, settingName) 163 { 164 }; 165 void Load() 166 { 167 TextualSetting::Load(); 168 HostDBStorage::Load(); 169 } 170 171 void Save() 172 { 173 TextualSetting::Save(); 174 HostDBStorage::Save(); 175 } 176 }; 177 178 class TransTextualSetting : public TextualSetting, public TransientStorage 179 { 180 public: 181 TransTextualSetting(bool password=false) 182 :TextualSetting("", "", password), TransientStorage() 183 { 184 }; 185 }; 186 187 188 /** 189 * Display and edit a textual value 190 */ 191 192 class ListSetting : public StandardSetting 193 { 194 public: 195 ListSetting(const QString &settingName, const QString &text = ""); 196 virtual ~ListSetting(){}; 197 void setValue(int newValue); 198 void setSettingValue(const QString newValue); 199 void addSelection(QString label, QString value, bool select = false); 200 void clearSelections(); 201 virtual void edit(); 202 virtual void resultEdit(DialogCompletionEvent *dce); 203 private: 204 QMap<QString, QString> m_options; 205 }; 206 207 class GlobalListSetting : public ListSetting, public GlobalDBStorage 208 { 209 public: 210 GlobalListSetting(const QString &settingName, const QString &text = "") 211 :ListSetting(settingName, text), GlobalDBStorage (this, settingName) 212 { 213 }; 214 void Load() 215 { 216 ListSetting::Load(); 217 GlobalDBStorage::Load(); 218 } 219 void Save() 220 { 221 ListSetting::Save(); 222 GlobalDBStorage::Save(); 223 } 224 }; 225 226 class HostListSetting : public ListSetting, public HostDBStorage 227 { 228 public: 229 HostListSetting(const QString &settingName, const QString &text = "") 230 :ListSetting(settingName, text), HostDBStorage (this, settingName) 231 { 232 }; 233 void Load() 234 { 235 ListSetting::Load(); 236 HostDBStorage::Load(); 237 } 238 void Save() 239 { 240 ListSetting::Save(); 241 HostDBStorage::Save(); 242 } 243 }; 244 245 class TransListSetting : public ListSetting, public TransientStorage 246 { 247 public: 248 TransListSetting() 249 :ListSetting("", ""), TransientStorage() 250 { 251 }; 252 }; 253 254 /** 255 * Display and edit a textual value 256 */ 257 258 class BoolSetting : public StandardSetting 259 { 260 public: 261 BoolSetting(const QString &settingName, const QString &text = ""); 262 virtual ~BoolSetting(){}; 263 void setValue(bool newValue); 264 bool boolValue() const{return GetText("value")=="1";}; 265 void edit(); 266 void resultEdit(DialogCompletionEvent *dce); 267 void addChild (bool value, GroupSetting *child); 268 269 protected: 270 virtual void setSettingValue(const QString newValue); 271 private: 272 QList<GroupSetting *> m_OnChildren; 273 QList<GroupSetting *> m_OffChildren; 274 }; 275 276 class GlobalBoolSetting : public BoolSetting, public GlobalDBStorage 277 { 278 public: 279 GlobalBoolSetting(const QString &settingName, const QString &text = "") 280 : BoolSetting(settingName, text), GlobalDBStorage (this, settingName) 281 { 282 }; 283 void Load() 284 { 285 BoolSetting::Load(); 286 GlobalDBStorage::Load(); 287 } 288 void Save() 289 { 290 BoolSetting::Save(); 291 GlobalDBStorage::Save(); 292 } 293 }; 294 295 class HostBoolSetting : public BoolSetting, public HostDBStorage 296 { 297 public: 298 HostBoolSetting(const QString &settingName, const QString &text = "") 299 : BoolSetting(settingName, text), HostDBStorage (this, settingName) 300 { 301 }; 302 void Load() 303 { 304 BoolSetting::Load(); 305 HostDBStorage::Load(); 306 } 307 void Save() 308 { 309 BoolSetting::Save(); 310 HostDBStorage::Save(); 311 } 312 }; 313 314 class TransBoolSetting : public BoolSetting, public TransientStorage 315 { 316 public: 317 TransBoolSetting() 318 : BoolSetting(""), TransientStorage() 319 { 320 }; 321 }; 322 323 324 325 class RangeSetting : public StandardSetting 326 { 327 public: 328 RangeSetting(const QString &settingName, int min, int max, int step, bool allow_single_step = false); 329 virtual ~RangeSetting(){}; 330 virtual void edit(); 331 virtual void resultEdit(DialogCompletionEvent *dce); 332 // void SetRange(int min, int max); 333 void setValue(int newValue); 334 int intValue() const{return GetText("value").toInt();}; 335 protected: 336 void update(); 337 private: 338 int m_min; 339 int m_max; 340 }; 341 342 class GlobalRangeSetting: public RangeSetting, public GlobalDBStorage 343 { 344 public: 345 GlobalRangeSetting(const QString &settingName, int min, int max, int step, bool allow_single_step = false) 346 :RangeSetting(settingName, min, max, step, allow_single_step), GlobalDBStorage (this, settingName) 347 { 348 }; 349 void Load() 350 { 351 RangeSetting::Load(); 352 GlobalDBStorage::Load(); 353 } 354 void Save() 355 { 356 RangeSetting::Save(); 357 GlobalDBStorage::Save(); 358 } 359 }; 360 361 class HostRangeSetting: public RangeSetting, public HostDBStorage 362 { 363 public: 364 HostRangeSetting(const QString &settingName, int min, int max, int step, bool allow_single_step = false) 365 :RangeSetting(settingName, min, max, step, allow_single_step), HostDBStorage (this, settingName) 366 { 367 }; 368 void Load() 369 { 370 RangeSetting::Load(); 371 HostDBStorage::Load(); 372 } 373 void Save() 374 { 375 RangeSetting::Save(); 376 HostDBStorage::Save(); 377 } 378 }; 379 380 class TransRangeSetting: public RangeSetting, public TransientStorage 381 { 382 public: 383 TransRangeSetting(int min, int max, int step, bool allow_single_step = false) 384 :RangeSetting("", min, max, step, allow_single_step), TransientStorage() 385 { 386 }; 387 }; 388 389 390 391 392 393 class /*MUI_PUBLIC*/ MythSpinBoxDialog : public MythScreenType 394 { 395 Q_OBJECT 396 397 public: 398 MythSpinBoxDialog(MythScreenStack *parent, const QString &message, 399 const QString &defaultValue = ""); 400 401 bool Create(void); 402 403 void SetRange(int low, int high, int step, uint pageMultiple = 5); 404 405 void SetReturnEvent(QObject *retobject, const QString &resultid); 406 407 signals: 408 void haveResult(QString); 409 410 protected: 411 MythUISpinBox *m_spinBox; 412 QString m_message; 413 QString m_defaultValue; 414 QObject *m_retObject; 415 QString m_id; 416 417 protected slots: 418 void sendResult(); 419 }; 420 421 422 423 424 class StandardSettingDialog : public MythScreenType 425 { 426 Q_OBJECT 427 428 public: 429 430 StandardSettingDialog(MythScreenStack *parent, const char *name); 431 ~StandardSettingDialog(); 432 bool Create(void); 433 virtual void customEvent(QEvent *event); 434 void setSettings(GroupSetting * groupSettings); 435 public slots: 436 void Close(void); 437 protected: 438 GroupSetting *m_settingsTree; 439 MythUIButtonTree *m_buttonTree; 440 private slots: 441 void settingSelected(MythUIButtonListItem *item); 442 void settingClicked(MythUIButtonListItem *item); 443 private: 444 void Save(); 445 MythUIText *m_title; 446 MythUIText *m_grouphelp; 447 MythUIButtonList *m_titleList; 448 MythUIText *m_selectedSettingLabel; 449 MythUIText *m_selectedSettingValue; 450 MythUIText *m_selectedSettingHelp; 451 MythUIButton *m_cancelButton; 452 MythUIButton *m_saveButton; 453 MythDialogBox *m_menuPopup; 454 bool m_loaded; 455 StandardSetting * m_editedSetting; 456 }; 457 458 459 460 #endif
