connect( ui->actionAbout, SIGNAL(triggered()), this, SLOT(about()) );
connect( ui->freq_adjust, SIGNAL(valueChanged(int)), this, SLOT(adjustFreq()) );
connect(QApplication::desktop(), SIGNAL(resized(int)), this, SLOT(orientationChanged()));
+ connect( ui->sr_btn, SIGNAL(clicked()), this, SLOT(setSmartReflex()) );
}
/**
+ * Returns the current CPU temperature
+ */
+QString MainWindow::getCPUTemp()
+{
+#if defined(Q_WS_MAEMO_5)
+ return readSysFile( "devices/platform/omap34xx_temp/temp1_input_raw" );
+#endif
+ return "Unknown";
+}
+
+
+/**
* Returns the maximum CPU frequency
*/
int MainWindow::getMaxFreq()
//display the current governor
ui->freq_governor->setText( getScalingGovernor() );
+ //display current temperature
+ ui->cpu_temp->setText( getCPUTemp() );
+
//smart reflex button
if ( getSmartReflexState() == 1 ) {
ui->sr_btn->setDown( true );
/**
+ * SLOT: Enables or disables Smart Reflex(tm) after pressing sr_btn
+ */
+void MainWindow::setSmartReflex()
+{
+//SmartReflex is only supprted on Maemo5
+#if defined(Q_WS_MAEMO_5)
+ QStringList arguments;
+ arguments.append( "/opt/usr/bin/set_sr" );
+
+ if ( getSmartReflexState() == 1 )
+ arguments.append( "off" );
+ else
+ arguments.append( "on" );
+
+ //execute the sr script script
+ QProcess script;
+ script.execute( "sudo", arguments );
+
+#endif
+ //refresh the UI
+ refresh();
+}
+
+
+/**
* Returns true when the device is in portrait mode
*/
bool MainWindow::usePortrait()
</widget>
</item>
<item row="3" column="0">
+ <widget class="QLabel" name="label_6">
+ <property name="text">
+ <string>Current CPU temperature:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1">
+ <widget class="QLabel" name="cpu_temp">
+ <property name="text">
+ <string>Unknown</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0">
<widget class="QLabel" name="label_5">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
</property>
</widget>
</item>
- <item row="3" column="1">
+ <item row="4" column="1">
<widget class="QPushButton" name="sr_btn">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">