Improved keep backlight on code a bit. Timer is started only when keep backlight...
authorWillem Liu <willem.liu@gmail.com>
Sat, 26 Nov 2011 00:11:45 +0000 (00:11 +0000)
committerWillem Liu <willem.liu@gmail.com>
Sat, 26 Nov 2011 00:11:45 +0000 (00:11 +0000)
changelog.txt
debian/changelog
debian/compat
debian/copyright
mainform.cpp
mainform.h

index e82015e..0bc989a 100755 (executable)
@@ -1,3 +1,9 @@
+easylist (0.3.30) unstable; urgency=low
+
+  * Keep backlight on code improved a bit. Timer is stopped when turned off. When turned on the interval is now 5 seconds.
+
+ -- Willem Liu <willem.liu@gmail.com>  Thu, 05 May 2011 10:43:11 +0200
+
 easylist (0.3.27) unstable; urgency=low
 
   * Added confirmation prompt when deleting List.
index 174ac1d..fd32a0a 100755 (executable)
@@ -1,5 +1,5 @@
-easylist (0.3.28) unstable; urgency=low
+easylist (0.3.29) unstable; urgency=low
 
-  * Added confirmation prompt when syncing List.
+  * Merged with keep backlight on code from Ade.
 
- -- Willem Liu <willem.liu@gmail.com>  Fri, 06 May 2011 10:42:28 +0200
+ -- Willem Liu <willem.liu@gmail.com>  Tue, 08 Nov 2011 21:51:00 +0200
index 7f8f011..7ed6ff8 100755 (executable)
@@ -1 +1 @@
-7
+5
index 393cd8e..0957403 100755 (executable)
@@ -1,5 +1,5 @@
 This package was debianized by Willem Liu <willem.liu@gmail.com> on
-Fri, 06 May 2011 10:42:28 +0200.
+Tue, 08 Nov 2011 21:51:00 +0200.
 
 It was downloaded from <url://example.com>
 
index 3870a6d..c366754 100755 (executable)
@@ -8,10 +8,9 @@ MainForm::MainForm(QWidget *parent) :
     ui->setupUi(this);\r
     settings = new QSettings(WILLEM_LIU, EASY_LIST);\r
 \r
-     /* Make a call every x milliseconds */\r
-     QTimer *timer = new QTimer(this);\r
-     connect(timer, SIGNAL(timeout()), this, SLOT(Keep_backlight_on()));\r
-     timer->start(30000);\r
+    /* Make a call every x milliseconds */\r
+    timer = new QTimer(this);\r
+    connect(timer, SIGNAL(timeout()), this, SLOT(Keep_backlight_on()));\r
 \r
     requestWebpage = new RequestWebpage(this);\r
     connect(requestWebpage, SIGNAL(finished(QNetworkReply*)), this, SLOT(slotSyncList(QNetworkReply*)));\r
@@ -280,6 +279,18 @@ void MainForm::on_actionSetting_triggered()
 void MainForm::on_actionKeep_backlight_on_triggered()\r
 {\r
     bool setBacklight = ui->actionKeep_backlight_on->isChecked();\r
+    if(setBacklight)\r
+    {\r
+       if(timer->isActive() == false)\r
+        {\r
+            timer->start(5000);\r
+        }\r
+    }\r
+    else\r
+    {\r
+        qDebug() << "Backlight: " << setBacklight;\r
+        timer->stop();\r
+    }\r
     qDebug() << "Checked Backlight" << setBacklight;\r
     settings->setValue(CHECKED_BACKLIGHT, setBacklight);\r
 }\r
@@ -289,7 +300,7 @@ void MainForm::Keep_backlight_on()
     bool setBacklight = ui->actionKeep_backlight_on->isChecked();\r
     if(setBacklight)\r
     {\r
-        /* qDebug() << "Backlight: " << setBacklight; */\r
+        qDebug() << "Backlight: " << setBacklight;\r
         QString strUnlock = "dbus-send --system --type=method_call --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_display_blanking_pause";\r
         QProcess::startDetached(strUnlock);\r
     }\r
index 448a668..2dbe44d 100755 (executable)
@@ -42,6 +42,7 @@ public slots:
     void changeWidget(int step);
     void stateOutFinished();
 private:
+    QTimer *timer;
     QSettings *settings;
     bool landscape;
     bool tempLandscapeMode;