misc bugfixes and enchantments
authorTorste Aikio <zokier@zokier.laptop>
Wed, 23 Jun 2010 08:18:19 +0000 (11:18 +0300)
committerTorste Aikio <zokier@zokier.laptop>
Wed, 23 Jun 2010 08:18:19 +0000 (11:18 +0300)
debian/postinst
debian/postrm
src/irctrl.cpp
src/irctrl.h
src/remote.cpp
src/selectremotedlg.cpp
src/settingsdlg.cpp
src/settingsdlg.h

index a08b913..a5bf173 100755 (executable)
@@ -1,3 +1,4 @@
 #!/bin/sh
 
 echo 'include "/home/user/.config/irwi/lirc.conf"' >> /etc/lircd.conf
+sed -i '/^include/!d' /etc/lircd.conf
index 34570f2..520d96d 100755 (executable)
@@ -1,2 +1,2 @@
 #!/bin/sh
-sed -i '/irwi/D' /etc/lircd.conf
+sed -i '/irwi/d' /etc/lircd.conf
index 1346b45..01c5679 100644 (file)
@@ -9,6 +9,14 @@
 IrCtrl::IrCtrl(QObject *parent)
     : QObject(parent)
 {
+    QSettings settings;
+    m_killLircTimer.setInterval(
+            settings.value("idleTimeout", "300").toInt() * 100);
+    m_killLircTimer.setSingleShot(true);
+    connect(&m_killLircTimer, SIGNAL(timeout()),
+            this, SLOT(stopLirc()));
+    startLirc();
+    m_killLircTimer.start();
 }
     
 IrCtrl::~IrCtrl()
index 0b22480..d71983d 100644 (file)
@@ -16,9 +16,9 @@ public:
 public slots:
     void sendCmd(const QString &cmd);
 
+    void stopLirc();
 private:
     void startLirc();
-    void stopLirc();
 
 private:
     QTimer m_killLircTimer;
index 6f291ab..2ba0db2 100644 (file)
@@ -137,6 +137,7 @@ void Remote::infoRequestFinished(QNetworkReply *reply)
     if (reply->error() == QNetworkReply::NoError) {
         m_rating    = QString(reply->readLine(20)).toInt();
         m_voteCount = QString(reply->readLine(20)).toInt();
+        m_mfg       = QString(reply->readLine(20));
     }
     reply->close();
     reply->deleteLater();
index e79c950..2ea45fc 100644 (file)
@@ -46,10 +46,10 @@ SelectRemoteDlg::SelectRemoteDlg(QWidget *parent)
             this, SLOT(downloadRemote()));
 
     this->setLayout(layout);
+    setBusy(true);
     connect(&remoteDBMgr, SIGNAL(dbReady(RemoteDB*)),
             this, SLOT(setDB(RemoteDB*)));
     remoteDBMgr.getDBAsync();
-    setBusy(true);
 }
 
 
index e92586a..43e590b 100644 (file)
@@ -68,6 +68,7 @@ SettingsDlg::SettingsDlg(QWidget *parent)
     } else {
         setRemote(selectedRemote);
         m_remote.updateInfo();
+        setBusy();
     }
 }
 
@@ -85,6 +86,12 @@ SettingsDlg::~SettingsDlg()
     delete m_layout;
 }
 
+void SettingsDlg::setBusy(bool busy)
+{
+    setAttribute(Qt::WA_Maemo5ShowProgressIndicator, busy);
+    setEnabled(!busy);
+}
+
 void SettingsDlg::showAdvSettingsDlg()
 {
     AdvSettingsDlg dlg(this);
@@ -114,6 +121,7 @@ void SettingsDlg::setRemote(Remote r)
 
 void SettingsDlg::setRemote(const QString &name)
 {
+    setBusy();
     m_remote = Remote(name);
     processRemoteChange();
     m_remote.updateInfo();  // request update from server
@@ -128,6 +136,7 @@ void SettingsDlg::processRemoteChange()
 
 void SettingsDlg::updateRemoteInfo()
 {
+    setBusy(false);
     m_remoteNameLabel->setText(m_remote.mfg() + " " + m_remote.name());
     m_ratingLabel->setText(tr("Rating") + ": "
             + QString::number(m_remote.rating()));
index 6197989..cf530ab 100644 (file)
@@ -34,6 +34,7 @@ private:
     void enableRateBtns(bool enable = true);
     void processRemoteChange();
     void processRatingSent();
+    void setBusy(bool busy = true);
 
 private:
     Remote m_remote;