From: Daniel Klaffenbach Date: Mon, 27 Dec 2010 11:38:16 +0000 (+0100) Subject: Display proposed frequency in UI before applying X-Git-Tag: v0.4.3~4 X-Git-Url: https://vcs.maemo.org/git/?p=qcpufreq;a=commitdiff_plain;h=66671cd3a408d0bb97a85680ae776abb474c2934 Display proposed frequency in UI before applying --- 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() diff --git a/src/mainwindow.h b/src/mainwindow.h index 93c39c5..c895bf2 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -53,8 +53,8 @@ public slots: void setAutoRotation(); void setSmartReflex(); void showHelp(); - //void showLoadPresetDialog(); void showSettings(); + void showTemporaryMaxFreq(); private: