MythTV  master
frequencytablesetting.cpp
Go to the documentation of this file.
1 /* -*- Mode: c++ -*-
2  * vim: set expandtab tabstop=4 shiftwidth=4:
3  *
4  * Original Project
5  * MythTV http://www.mythtv.org
6  *
7  * Copyright (c) 2004, 2005 John Pullan <john@pullan.org>
8  * Copyright (c) 2005 - 2007 Daniel Kristjansson
9  *
10  * Description:
11  * Collection of classes to provide channel scanning functionallity
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software
25  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
26  * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
27  *
28  */
29 
30 #include "frequencytablesetting.h"
31 
32 // libmythbase headers
33 #include "mythcorecontext.h"
34 #include "mythlocale.h"
35 
37 {
38  addSelection(QObject::tr("Broadcast"), "us", true);
39  addSelection(QObject::tr("Cable") + " " +
40  QObject::tr("High"), "uscablehigh", false);
41  addSelection(QObject::tr("Cable HRC") + " " +
42  QObject::tr("High"), "ushrchigh", false);
43  addSelection(QObject::tr("Cable IRC") + " " +
44  QObject::tr("High"), "usirchigh", false);
45  addSelection(QObject::tr("Cable"), "uscable", false);
46  addSelection(QObject::tr("Cable HRC"), "ushrc", false);
47  addSelection(QObject::tr("Cable IRC"), "usirc", false);
48 
49  setLabel(QObject::tr("Frequency Table"));
50  setHelpText(QObject::tr("Frequency table to use.") + " " +
51  QObject::tr(
52  "The option of scanning only \"High\" "
53  "frequency channels is useful because most "
54  "digital channels are on the higher frequencies."));
55 }
56 
58 {
59  // Default to saved country
60  QString country = gCoreContext->GetLocale()->GetCountryCode().toLower();
61 
62  setLabel(QObject::tr("Country"));
63  addSelection(QObject::tr("Australia"), "au", country == "au");
64  addSelection(QObject::tr("Chile"), "cl", country == "cl");
65  addSelection(QObject::tr("Czech Republic"), "cz", country == "cz");
66  addSelection(QObject::tr("Denmark"), "dk", country == "dk");
67  addSelection(QObject::tr("Finland"), "fi", country == "fi");
68  addSelection(QObject::tr("France"), "fr", country == "fr");
69  addSelection(QObject::tr("Germany"), "de", country == "de");
70  addSelection(QObject::tr("Greece"), "gr", country == "gr");
71  addSelection(QObject::tr("Israel"), "il", country == "il");
72  addSelection(QObject::tr("Italy"), "it", country == "it");
73  addSelection(QObject::tr("Netherlands"), "nl", country == "nl");
74  addSelection(QObject::tr("New Zealand"), "nz", country == "nz");
75  addSelection(QObject::tr("Spain"), "es", country == "es");
76  addSelection(QObject::tr("Sweden"), "se", country == "se");
77  addSelection(QObject::tr("United Kingdom"), "gb", country == "gb");
78 }
79 
80 
82 {
83  // Default to saved country
84  QString country = gCoreContext->GetLocale()->GetCountryCode().toLower();
85 
86  setLabel(QObject::tr("Country"));
87  addSelection(QObject::tr("Germany"), "de", country == "de");
88  addSelection(QObject::tr("United Kingdom"), "gb", country == "gb");
89 }
MythLocale * GetLocale(void) const
void addSelection(const QString &label, QString value=QString(), bool select=false)
virtual void setHelpText(const QString &str)
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
QString GetCountryCode() const
Definition: mythlocale.cpp:58
virtual void setLabel(QString str)