MythTV master
channelscanner_gui_scan_pane.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
35
37
39{
40 if (!XMLParseBase::LoadWindowFromXML("config-ui.xml", "channelscanner",
41 this))
42 {
43 LOG(VB_GENERAL, LOG_ERR, "Failed to load channelscanner screen");
44 return false;
45 }
46
47 bool error = false;
48 UIUtilE::Assign(this, m_statusText, "status", &error);
49 UIUtilE::Assign(this, m_log, "log", &error);
50
51 UIUtilE::Assign(this, m_progressBar, "scanprogress", &error);
52 if (error)
53 return false;
54
55 // Percent done
56 UIUtilW::Assign(this, m_progressText, "progresstext");
57 // Found status
58 UIUtilW::Assign(this, m_scanProgressText, "scanprogresstext");
59
60 UIUtilW::Assign(this, m_signalLockedText, "signallock");
63
64 UIUtilW::Assign(this, m_rotatorPositionText, "rotorprogresstext");
67
68 UIUtilW::Assign(this, m_rotatorPositionBar, "rotorprogressbar");
70 {
73 }
74
75 UIUtilW::Assign(this, m_signalStrengthText, "signalstrengthtext");
78
79 UIUtilW::Assign(this, m_signalStrengthBar, "signalstrength");
81 {
84 }
85
86 UIUtilW::Assign(this, m_signalNoiseText, "signalnoisetext");
89
90 UIUtilW::Assign(this, m_signalNoiseBar, "signalnoise");
92 {
95 }
96
97 m_statusText->SetText(tr("Tuning"));
98 m_progressBar->SetTotal(65535);
99
100 MythUIButton *exitButton = nullptr;
101 UIUtilW::Assign(this, exitButton, "exit");
102 if (exitButton)
103 connect(exitButton, &MythUIButton::Clicked, this, &MythScreenType::Close);
104
106
107 return true;
108}
109
111{
113 m_rotatorPositionText->SetText(QString("%1%")
114 .arg(static_cast<uint>(value * 100 / 65535)));
117}
118
120{
122 m_signalNoiseText->SetText(QString("%1%")
123 .arg(static_cast<uint>(value * 100 / 65535)));
126}
127
129{
131 m_signalStrengthText->SetText(QString("%1%")
132 .arg(static_cast<uint>(value * 100 / 65535)));
135}
136
138{
140 m_signalLockedText->SetText((value) ? tr("Locked") : tr("No Lock"));
141}
142
144{
145 if (m_statusText)
146 m_statusText->SetText(value);
147}
148
150{
152 m_scanProgressText->SetText(tr("%1").arg(value));
153}
154
156{
157 if (m_log)
158 {
159 auto *listItem = new MythUIButtonListItem(m_log, text);
160 m_log->SetItemCurrent(listItem);
161 }
162}
163
165{
166 if (m_progressText)
167 m_progressText->SetText(QString("%1%")
168 .arg(static_cast<uint>(value * 100)));
169 if (m_progressBar)
170 m_progressBar->SetUsed(static_cast<uint>(value * 65535));
171}
void SetStatusText(const QString &value)
void SetStatusTitleText(const QString &value)
void BuildFocusList(void)
virtual void Close()
void SetItemCurrent(MythUIButtonListItem *item)
A single button widget.
Definition: mythuibutton.h:22
void Clicked()
void SetUsed(int value)
void SetTotal(int value)
void SetVisible(bool visible) override
virtual void SetText(const QString &text)
Definition: mythuitext.cpp:115
virtual void SetVisible(bool visible)
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
unsigned int uint
Definition: compat.h:68
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39
def error(message)
Definition: smolt.py:409
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)
Definition: mythuiutils.h:27