#include <QLabel>
#include <QDebug>
#include <QNetworkConfiguration>
+#include <QShowEvent>
SettingsDlg::SettingsDlg(QWidget *parent)
: QDialog(parent)
+ , m_busy(true)
{
QSettings settings(this);
m_layout = new QVBoxLayout(this);
// Create remote by name and update it's info if online
m_remote = Remote(selectedRemote);
m_remoteNameLabel->setText(selectedRemote);
+ connect(&m_remote, SIGNAL(infoUpdated()),
+ this, SLOT(updateRemoteInfo()));
m_netConfMan = new QTM_PREPEND_NAMESPACE(
QNetworkConfigurationManager)(this);
connect(m_netConfMan, SIGNAL(updateCompleted()),
void SettingsDlg::setBusy(bool busy)
{
setAttribute(Qt::WA_Maemo5ShowProgressIndicator, busy);
- setEnabled(!busy);
+ m_busy = busy;
}
void SettingsDlg::showAdvSettingsDlg()
void SettingsDlg::setRemote(Remote r)
{
m_remote = r;
+ connect(&m_remote, SIGNAL(infoUpdated()),
+ this, SLOT(updateRemoteInfo()));
updateRemoteInfo();
enableRateBtns();
}
void SettingsDlg::onNetworkStatusUpdate()
{
if (m_netConfMan->isOnline()) {
- setBusy();
- connect(&m_remote, SIGNAL(infoUpdated()),
- this, SLOT(updateRemoteInfo()));
m_remote.updateInfo();
enableRateBtns();
} else {
m_ratingLabel->setText(tr("Offline"));
+ setBusy(false);
}
}
void SettingsDlg::processRatingSent()
{
+ setBusy();
enableRateBtns(false);
m_remote.updateInfo();
}
m_rateDownBtn->setEnabled(enable);
}
+void SettingsDlg::showEvent(QShowEvent *event)
+{
+ setBusy(m_busy);
+ QDialog::showEvent(event);
+}
+
+