3 * Copyright (C) 2011 Roman Moravcik
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include "satellitesignalstrengthwindow.h"
25 SatelliteSignalStrengthWindow::SatelliteSignalStrengthWindow(QWidget *parent) : QMainWindow(parent)
27 m_screenLocked = false;
31 connect(parent, SIGNAL(screenLocked(bool)), this, SLOT(onScreenLocked(bool)));
34 void SatelliteSignalStrengthWindow::createUi()
36 setAttribute(Qt::WA_DeleteOnClose);
38 setWindowTitle(tr("Signal strength"));
40 m_satelliteSignalStrength = new SatelliteSignalStrength();
41 m_satelliteSignalStrength->showTitle(false);
42 setCentralWidget(m_satelliteSignalStrength);
44 QAction* backSoftkey = new QAction(tr("Back"), this);
45 backSoftkey->setSoftKeyRole(QAction::NegativeSoftKey);
46 connect(backSoftkey, SIGNAL(triggered()), this, SLOT(close()));
47 addAction(backSoftkey);
50 void SatelliteSignalStrengthWindow::onScreenLocked(bool locked)
52 m_screenLocked = locked;
55 void SatelliteSignalStrengthWindow::onSatellitesInViewUpdated(const QList<QGeoSatelliteInfo> &satellites)
60 m_satelliteSignalStrength->updateWidget(satellites, false);
63 void SatelliteSignalStrengthWindow::onSatellitesInUseUpdated(const QList<QGeoSatelliteInfo> &satellites)
68 m_satelliteSignalStrength->updateWidget(satellites, true);
71 void SatelliteSignalStrengthWindow::setSatelliteInfoSource(QGeoSatelliteInfoSource *satelliteInfoSource)
73 m_satellite = satelliteInfoSource;
75 connect(m_satellite, SIGNAL(satellitesInViewUpdated(const QList<QGeoSatelliteInfo> &)), this,
76 SLOT(onSatellitesInViewUpdated(const QList<QGeoSatelliteInfo> &)));
77 connect(m_satellite, SIGNAL(satellitesInUseUpdated(const QList<QGeoSatelliteInfo> &)), this,
78 SLOT(onSatellitesInUseUpdated(const QList<QGeoSatelliteInfo> &)));
80 m_satellite->requestUpdate();