-rw-r--r-- | core/settings/light-and-power/light.cpp | 30 | ||||
-rw-r--r-- | core/settings/light-and-power/light.h | 3 |
2 files changed, 31 insertions, 2 deletions
diff --git a/core/settings/light-and-power/light.cpp b/core/settings/light-and-power/light.cpp index 8b98672..68c2929 100644 --- a/core/settings/light-and-power/light.cpp +++ b/core/settings/light-and-power/light.cpp | |||
@@ -44,2 +44,3 @@ | |||
44 | #include <qgroupbox.h> | 44 | #include <qgroupbox.h> |
45 | #include <qcombobox.h> | ||
45 | 46 | ||
@@ -64,3 +65,4 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags ) | |||
64 | if (m_cres) { | 65 | if (m_cres) { |
65 | GroupLight->setTitle(tr("Backlight & Contrast")); | 66 | GroupLight->setTitle(tr("Backlight && Contrast")); |
67 | GroupLight_ac->setTitle(GroupLight->title()); | ||
66 | } else { | 68 | } else { |
@@ -70,2 +72,11 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags ) | |||
70 | 72 | ||
73 | QStrList freq = ODevice::inst()->cpuFrequencies(); | ||
74 | if ( freq.count() ) { | ||
75 | frequency->insertStrList( freq ); | ||
76 | frequency_ac->insertStrList( freq ); | ||
77 | } else { | ||
78 | frequency->hide(); | ||
79 | frequency_ac->hide(); | ||
80 | } | ||
81 | |||
71 | Config config ( "apm" ); | 82 | Config config ( "apm" ); |
@@ -79,3 +90,6 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags ) | |||
79 | // battery check and slider | 90 | // battery check and slider |
80 | LcdOffOnly-> setChecked ( config. readBoolEntry ( "LcdOffOnly", false )); | 91 | LcdOffOnly->setChecked ( config. readBoolEntry ( "LcdOffOnly", false )); |
92 | |||
93 | // CPU frequency | ||
94 | frequency->setCurrentItem( config.readNumEntry("Freq", 0) ); | ||
81 | 95 | ||
@@ -109,2 +123,5 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags ) | |||
109 | 123 | ||
124 | // CPU frequency | ||
125 | frequency_ac->setCurrentItem( config.readNumEntry("Freq", 0) ); | ||
126 | |||
110 | bright = config. readNumEntry ( "Brightness", 255 ); | 127 | bright = config. readNumEntry ( "Brightness", 255 ); |
@@ -149,2 +166,3 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags ) | |||
149 | } | 166 | } |
167 | connect( frequency, SIGNAL( activated(int) ), this, SLOT( setFrequency(int) ) ); | ||
150 | } | 168 | } |
@@ -191,2 +209,8 @@ void LightSettings::setContrast ( int contr ) | |||
191 | 209 | ||
210 | void LightSettings::setFrequency ( int index ) | ||
211 | { | ||
212 | qWarning("LightSettings::setFrequency(%d)", index); | ||
213 | ODevice::inst ( )-> setCpuFrequency(index); | ||
214 | } | ||
215 | |||
192 | void LightSettings::resetBacklight ( ) | 216 | void LightSettings::resetBacklight ( ) |
@@ -210,2 +234,3 @@ void LightSettings::accept ( ) | |||
210 | config. writeEntry ( "Contrast", contrast-> value () ); | 234 | config. writeEntry ( "Contrast", contrast-> value () ); |
235 | config. writeEntry ( "Freq", frequency->currentItem() ); | ||
211 | 236 | ||
@@ -220,2 +245,3 @@ void LightSettings::accept ( ) | |||
220 | config. writeEntry ( "Contrast", contrast_ac-> value () ); | 245 | config. writeEntry ( "Contrast", contrast_ac-> value () ); |
246 | config. writeEntry ( "Freq", frequency_ac->currentItem() ); | ||
221 | 247 | ||
diff --git a/core/settings/light-and-power/light.h b/core/settings/light-and-power/light.h index 4a8bf6b..c48e5f6 100644 --- a/core/settings/light-and-power/light.h +++ b/core/settings/light-and-power/light.h | |||
@@ -32,2 +32,3 @@ | |||
32 | #include <qstringlist.h> | 32 | #include <qstringlist.h> |
33 | #include <qlistbox.h> | ||
33 | #include "lightsettingsbase.h" | 34 | #include "lightsettingsbase.h" |
@@ -53,2 +54,3 @@ protected slots: | |||
53 | void setContrast ( int ); | 54 | void setContrast ( int ); |
55 | void setFrequency ( int ); | ||
54 | void resetBacklight ( ); | 56 | void resetBacklight ( ); |
@@ -59,2 +61,3 @@ private: | |||
59 | int m_oldcontrast; | 61 | int m_oldcontrast; |
62 | int m_oldfreq; | ||
60 | QTimer *m_resettimer; | 63 | QTimer *m_resettimer; |