X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Fmainwindow.cpp;h=f89e370cc8e5a46b089626959a1d0aea1800fda8;hb=66671cd3a408d0bb97a85680ae776abb474c2934;hp=273659c5d94c8483bef71e25166eb3d99801968e;hpb=70ed4d7dfe8443c04567fcfce6bc86659f0c1e6f;p=qcpufreq diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 273659c..f89e370 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -82,6 +82,7 @@ MainWindow::MainWindow(QWidget *parent) : connect(ui->actionHelp, SIGNAL(triggered()), this, SLOT(showHelp())); connect( ui->actionAbout, SIGNAL(triggered()), this, SLOT(about()) ); connect( ui->freq_adjust, SIGNAL(sliderReleased()), this, SLOT(adjustFreq()) ); + connect(ui->freq_adjust, SIGNAL(valueChanged(int)), this, SLOT(showTemporaryMaxFreq())); connect(QApplication::desktop(), SIGNAL(resized(int)), this, SLOT(orientationChanged())); connect(ui->sr_box, SIGNAL(clicked()), this, SLOT(setSmartReflex())); connect(&refreshTimer, SIGNAL(timeout()), this, SLOT(refresh())); @@ -592,6 +593,22 @@ void MainWindow::showSettings() /** + * SLOT: This temporarily updates the maximum frequency while using the + * maxFreq slider. + */ +void MainWindow::showTemporaryMaxFreq() +{ + //calulate frequency from slider position + int newmax = getScalingFreq( ui->freq_adjust->sliderPosition() ) / 1000; + //convert it to a string and display it in the UI + QString display; + display.setNum( newmax ); + display.append( " MHz" ); + ui->freq_max->setText( display ); +} + + +/** * Returns true when the device is in portrait mode */ bool MainWindow::usePortrait()