+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() &&
+ QSettings(this).value("remoteName", "").toString() != "") {
+ setBusy();
+ m_remote.updateInfo();
+ enableRateBtns();
+ } else if (!m_netConfMan->isOnline()) {
+ m_ratingLabel->setText(tr("Offline"));
+ setBusy(false);
+ } else {
+ setBusy(false);
+ }
+}
+
+void SettingsDlg::updateRemoteInfo()
+{
+ setBusy(false);
+ m_remoteNameLabel->setText(m_remote.mfg() + " " + m_remote.name());
+ m_ratingLabel->setText(tr("Rating") + ": "
+ + QString::number(m_remote.rating()));
+}
+
+void SettingsDlg::rateUpClicked()
+{
+ processRatingSent();
+ m_remote.sendRating(Rating::Up);
+}
+
+void SettingsDlg::rateDownClicked()
+{
+ processRatingSent();
+ m_remote.sendRating(Rating::Down);
+}
+
+void SettingsDlg::processRatingSent()
+{
+ setBusy();
+ enableRateBtns(false);
+}
+
+void SettingsDlg::enableRateBtns(bool enable)
+{
+ m_rateUpBtn->setEnabled(enable);
+ m_rateDownBtn->setEnabled(enable);
+}
+
+void SettingsDlg::showEvent(QShowEvent *event)
+{
+ setBusy(m_busy);
+ QDialog::showEvent(event);
+}
+
+
+