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()