summaryrefslogtreecommitdiffstats
path: root/src/configuredialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/configuredialog.cpp')
-rw-r--r--src/configuredialog.cpp94
1 files changed, 49 insertions, 45 deletions
diff --git a/src/configuredialog.cpp b/src/configuredialog.cpp
index a767508..5e933c6 100644
--- a/src/configuredialog.cpp
+++ b/src/configuredialog.cpp
@@ -25,6 +25,10 @@
* \date 2005
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
// KDE - Headers
#include <kaudioplayer.h>
#include <tdeconfig.h>
@@ -34,7 +38,7 @@
#include <kinputdialog.h>
#include <tdeaccelmanager.h>
- // QT - Headers
+ // TQt - Headers
#include <tqcheckbox.h>
#include <tqcombobox.h>
#include <tqdialog.h>
@@ -74,9 +78,9 @@ ConfigureDialog::ConfigureDialog( TDEConfig *_config, HardwareInfo *_hwinfo, Set
scheme_changed = false;
displayed_WARN_autosuspend = false;
- // check if brightness is supporte
+ // check if brightness is supported
if(hwinfo->supportBrightness()) {
- brightnessLevels = hwinfo->getMaxBrightnessLevel() -1;
+ brightnessLevels = hwinfo->getMaxBrightnessLevel();
brightness_last = hwinfo->getCurrentBrightnessLevel();
} else {
brightnessLevels = -1;
@@ -115,7 +119,7 @@ ConfigureDialog::ConfigureDialog( TDEConfig *_config, HardwareInfo *_hwinfo, Set
tL_valueBrightness->setFrameStyle(TQFrame::Panel | TQFrame::Sunken);
tL_valueBrightness->setBackgroundMode(TQt::PaletteBase);
tL_valueBrightness->setAlignment(TQt::AlignCenter);
- tL_valueBrightness->setFocusPolicy(TQ_NoFocus);
+ tL_valueBrightness->setFocusPolicy(TQWidget::NoFocus);
// hide Lid item if this is not a laptop
if (!hwinfo->isLaptop())
@@ -565,7 +569,7 @@ void ConfigureDialog::setConfigToDialog( int schemeID ){
else {
cB_Brightness->setEnabled(false);
gB_Brightness->setEnabled(false);
- tL_brightness->setText(i18n("Your Hardware currently not support changing the brightness "
+ tL_brightness->setText(i18n("Your hardware does not currently support changing the brightness "
"of your display."));
}
@@ -901,7 +905,7 @@ void ConfigureDialog::saveGeneralSettings() {
/* ---- START monitor changes SECTION ---- */
/*!
- * SLOT: Called if a value within the Tab 'General Settings' is changed.
+ * Slot called if a value within the Tab 'General Settings' is changed.
*/
void ConfigureDialog::general_valueChanged(){
kdDebugFuncIn(trace);
@@ -924,7 +928,7 @@ void ConfigureDialog::general_valueChanged(){
}
/*!
- * SLOT: Called if a value within the Tab 'Scheme Settings' is changed.
+ * Slot called if a value within the Tab 'Scheme Settings' is changed.
*/
void ConfigureDialog::scheme_valueChanged(){
kdDebugFuncIn(trace);
@@ -938,7 +942,7 @@ void ConfigureDialog::scheme_valueChanged(){
}
/*!
- * SLOT: called if the current scheme in the TQListBox listBox_schemes is
+ * Slot called if the current scheme in the TQListBox listBox_schemes is
* changed/ a other scheme was selected.
*/
void ConfigureDialog::listBox_schemes_currentChanged(){
@@ -973,7 +977,7 @@ void ConfigureDialog::listBox_schemes_currentChanged(){
/* ---- START BUTTON SECTION ---- */
/*!
- * SLOT: called if the 'Apply' button is clicked.
+ * Slot called if the 'Apply' button is clicked.
*/
void ConfigureDialog::buttonApply_clicked(){
kdDebugFuncIn(trace);
@@ -991,7 +995,7 @@ void ConfigureDialog::buttonApply_clicked(){
}
/*!
- * SLOT: called if the 'Cancel' button is clicked.
+ * Slot called if the 'Cancel' button is clicked.
*/
void ConfigureDialog::buttonCancel_clicked(){
kdDebugFuncOut(trace);
@@ -1013,7 +1017,7 @@ void ConfigureDialog::buttonCancel_clicked(){
}
/*!
- * SLOT: called if the 'OK' button is clicked.
+ * Slot called if the 'OK' button is clicked.
*/
void ConfigureDialog::buttonOk_clicked(){
kdDebugFuncIn(trace);
@@ -1026,7 +1030,7 @@ void ConfigureDialog::buttonOk_clicked(){
}
/*!
- * SLOT: called if the 'Help' button is clicked.
+ * Slot called if the 'Help' button is clicked.
*/
void ConfigureDialog::buttonHelp_clicked(){
kdDebugFuncIn(trace);
@@ -1041,7 +1045,7 @@ void ConfigureDialog::buttonHelp_clicked(){
/* ---- START SCHEME ADD/DELETE SECTION ---- */
/*!
- * SLOT: called if the 'New' scheme button is clicked.
+ * Slot called if the 'New' scheme button is clicked.
*/
void ConfigureDialog::pB_newScheme_clicked(){
kdDebugFuncIn(trace);
@@ -1087,7 +1091,7 @@ void ConfigureDialog::pB_newScheme_clicked(){
}
/*!
- * SLOT: called if the 'Delete' scheme button is clicked.
+ * Slot called if the 'Delete' scheme button is clicked.
*/
void ConfigureDialog::pB_deleteScheme_clicked(){
kdDebugFuncIn(trace);
@@ -1125,7 +1129,7 @@ void ConfigureDialog::pB_deleteScheme_clicked(){
/* ---- START SCREENSAVER SECTION ---- */
/*!
- * SLOT: called if TQCheckBox cB_specificSettings is toggled.
+ * Slot called if TQCheckBox cB_specificSettings is toggled.
* \param state boolean, true if toggled on
* false if toggled off
*/
@@ -1153,7 +1157,7 @@ void ConfigureDialog::cB_specificSettings_toggled(bool state){
}
/*!
- * SLOT: called if TQCheckBox cB_disable_Ss is toggled.
+ * Slot called if TQCheckBox cB_disable_Ss is toggled.
* \param state boolean, true if toggled on
* false if toggled off
*/
@@ -1173,7 +1177,7 @@ void ConfigureDialog::cB_disable_Ss_toggled(bool state){
/* ---- START DPMS SECTION ---- */
/*!
- * SLOT: called if TQCheckBox cB_SpecificPM is toggled.
+ * Slot called if TQCheckBox cB_SpecificPM is toggled.
* \param state boolean, true if toggled on
* false if toggled offtrue
*/
@@ -1198,7 +1202,7 @@ void ConfigureDialog::cB_SpecificPM_toggled(bool state){
}
/*!
- * SLOT: called if TQCheckBox cB_disablePM is toggled.
+ * Slot called if TQCheckBox cB_disablePM is toggled.
* \param state boolean, true if toggled on
* false if toggled off
*/
@@ -1219,7 +1223,7 @@ void ConfigureDialog::cB_disablePM_toggled(bool state){
}
/*!
- * SLOT: called if the standby TQSpinBoxes for DPMS timout is changed.
+ * Slot called if the standby TQSpinBoxes for DPMS timout is changed.
*/
void ConfigureDialog::sB_standby_valueChanged() {
kdDebugFuncIn(trace);
@@ -1236,7 +1240,7 @@ void ConfigureDialog::sB_standby_valueChanged() {
}
/*!
- * SLOT: called if the suspend TQSpinBoxes for DPMS timout is changed.
+ * Slot called if the suspend TQSpinBoxes for DPMS timout is changed.
*/
void ConfigureDialog::sB_suspend_valueChanged() {
kdDebugFuncIn(trace);
@@ -1257,7 +1261,7 @@ void ConfigureDialog::sB_suspend_valueChanged() {
}
/*!
- * SLOT: called if the powerOff TQSpinBoxes for DPMS timout is changed.
+ * Slot called if the powerOff TQSpinBoxes for DPMS timout is changed.
*/
void ConfigureDialog::sB_powerOff_valueChanged() {
kdDebugFuncIn(trace);
@@ -1333,7 +1337,7 @@ void ConfigureDialog::cB_autoSuspend_toggled( bool toggled ) {
}
/*!
- * SLOT: called if a new item in cB_autoInactivity is selected.
+ * Slot called if a new item in cB_autoInactivity is selected.
* \param selectedItem Integer, contains the ID of the new item in the
* comboBox.
*/
@@ -1384,7 +1388,7 @@ void ConfigureDialog::cB_autoInactivity_activated( int selectedItem ) {
}
/*!
- * SLOT: Called if the 'Enable scheme specific blacklist' is toggled.
+ * Slot called if the 'Enable scheme specific blacklist' is toggled.
* \param toggled boolean, true if toggled on
* false if toggled off
*/
@@ -1404,7 +1408,7 @@ void ConfigureDialog::cB_Blacklist_toggled( bool toggled ){
}
/*!
- * SLOT: Called if the 'edit blacklist' button is toggled.
+ * Slot called if the 'edit blacklist' button is toggled.
*/
void ConfigureDialog::pB_editBlacklistSuspend_clicked(){
kdDebugFuncIn(trace);
@@ -1441,15 +1445,15 @@ void ConfigureDialog::pB_editBlacklistSuspend_clicked(){
}
blacklistEDlgAS = new blacklistEditDialog(blacklist, _top_text, initialiseImport, this);
- connect( blacklistEDlgAS, TQT_SIGNAL(config_finished(TQStringList)), this,
- TQT_SLOT(saveSchemeSuspendBlacklist(TQStringList)));
+ connect( blacklistEDlgAS, TQ_SIGNAL(config_finished(TQStringList)), this,
+ TQ_SLOT(saveSchemeSuspendBlacklist(TQStringList)));
blacklistEDlgAS->exec();
kdDebugFuncOut(trace);
}
/*!
- * SLOT: Called if the signal config_finished(TQStringList) recieved
+ * Slot called if the signal config_finished(TQStringList) recieved
* and the autosuspend blacklist is edited.
* \param new_blacklist TQStringlist with the edited blacklisted processes
*/
@@ -1514,7 +1518,7 @@ void ConfigureDialog::cB_autoDimm_toggled( bool toggled ) {
}
/*!
- * SLOT: Called if the 'Enable scheme specific blacklist' is toggled.
+ * Slot called if the 'Enable scheme specific blacklist' is toggled.
* \param toggled boolean, true if toggled on
* false if toggled off
*/
@@ -1534,7 +1538,7 @@ void ConfigureDialog::cB_BlacklistDimm_toggled( bool toggled ){
}
/*!
- * SLOT: Called if the 'edit blacklist' button for autodimm is toggled.
+ * Slot called if the 'edit blacklist' button for autodimm is toggled.
*/
void ConfigureDialog::pB_editBlacklistDimm_clicked(){
kdDebugFuncIn(trace);
@@ -1571,15 +1575,15 @@ void ConfigureDialog::pB_editBlacklistDimm_clicked(){
}
blacklistEDlgAD = new blacklistEditDialog(blacklist, _top_text, initialiseImport, this);
- connect( blacklistEDlgAD, TQT_SIGNAL(config_finished(TQStringList)), this,
- TQT_SLOT(saveSchemeDimmBlacklist(TQStringList)));
+ connect( blacklistEDlgAD, TQ_SIGNAL(config_finished(TQStringList)), this,
+ TQ_SLOT(saveSchemeDimmBlacklist(TQStringList)));
blacklistEDlgAD->exec();
kdDebugFuncOut(trace);
}
/*!
- * SLOT: Called if the signal config_finished(TQStringList) recieved
+ * Slot called if the signal config_finished(TQStringList) recieved
* and the autdimm blacklist is edited.
* \param new_blacklist TQStringlist with the edited blacklisted processes
*/
@@ -1601,7 +1605,7 @@ void ConfigureDialog::saveSchemeDimmBlacklist( TQStringList new_blacklist){
}
/*!
- * SLOT: Called if there \ref sB_autoDimmTime get changed
+ * Slot called if there \ref sB_autoDimmTime get changed
* \param value Integer with the new value
*/
void ConfigureDialog::sB_autoDimmTime_valueChanged( int value ) {
@@ -1630,25 +1634,25 @@ void ConfigureDialog::sB_autoDimmTime_valueChanged( int value ) {
/* ---- END Autodimm SECTION ---- */
/* ---- START Brightness SECTION ---- */
-/*! \b SLOT: to enable the brigthness related widgets */
+/*! \b Slot: to enable the brigthness related widgets */
void ConfigureDialog::cB_Brightness_toggled( bool toggled ) {
kdDebugFuncIn(trace);
gB_Brightness->setEnabled(toggled);
cB_Brightness->setChecked(toggled);
- connect(brightnessSlider, TQT_SIGNAL(valueChanged (int)), this, TQT_SLOT(brightnessSlider_sliderMoved(int)));
+ connect(brightnessSlider, TQ_SIGNAL(valueChanged (int)), this, TQ_SLOT(brightnessSlider_sliderMoved(int)));
kdDebugFuncOut(trace);
}
-/*! \b SLOT: to change the brightness if the slider is changed */
+/*! \b Slot: to change the brightness if the slider is changed */
void ConfigureDialog::brightnessSlider_sliderMoved( int new_value ) {
kdDebugFuncIn(trace);
if (cB_Brightness->isEnabled() && cB_Brightness->isChecked()) {
scheme_valueChanged();
tL_valueBrightness->setText(TQString::number(new_value) + " %");
- hwinfo->setBrightness(-1, new_value);
+ hwinfo->setBrightnessPercentage(new_value);
pB_resetBrightness->setEnabled(true);
brightness_changed = true;
}
@@ -1656,11 +1660,11 @@ void ConfigureDialog::brightnessSlider_sliderMoved( int new_value ) {
kdDebugFuncOut(trace);
}
-/*! \b SLOT: to reset the brightness if the reset button clicked */
+/*! \b Slot: to reset the brightness if the reset button clicked */
void ConfigureDialog::pB_resetBrightness_clicked( ) {
kdDebugFuncIn(trace);
- hwinfo->setBrightness(brightness_last, -1);
+ hwinfo->setBrightnessLevel(brightness_last);
brightnessSlider->setValue(brightness_last);
pB_resetBrightness->setEnabled(false);
brightness_changed = false;
@@ -1672,7 +1676,7 @@ void ConfigureDialog::pB_resetBrightness_clicked( ) {
/* ---- START battery level SECTION ---- */
/*!
- * SLOT: called if the warning TQSpinBoxes for battery level is changed.
+ * Slot called if the warning TQSpinBoxes for battery level is changed.
*/
void ConfigureDialog::sB_batWarning_valueChanged() {
kdDebugFuncIn(trace);
@@ -1689,7 +1693,7 @@ void ConfigureDialog::sB_batWarning_valueChanged() {
}
/*!
- * SLOT: called if the low TQSpinBoxes for battery level is changed.
+ * Slot called if the low TQSpinBoxes for battery level is changed.
*/
void ConfigureDialog::sB_batLow_valueChanged() {
kdDebugFuncIn(trace);
@@ -1710,7 +1714,7 @@ void ConfigureDialog::sB_batLow_valueChanged() {
}
/*!
- * SLOT: called if the critical TQSpinBoxes for battery level is changed.
+ * Slot called if the critical TQSpinBoxes for battery level is changed.
*/
void ConfigureDialog::sB_batCritical_valueChanged() {
kdDebugFuncIn(trace);
@@ -1727,7 +1731,7 @@ void ConfigureDialog::sB_batCritical_valueChanged() {
}
/*!
- * SLOT: called if the TQComboBox for the battery warning level action changed,
+ * Slot called if the TQComboBox for the battery warning level action changed,
* used to hide/show the related TQSpinboxes if needed.
*/
void ConfigureDialog::cB_batWarning_activated() {
@@ -1759,7 +1763,7 @@ void ConfigureDialog::cB_batLow_activated() {
}
/*!
- * SLOT: called if the TQComboBox for the battery critical level action changed,
+ * Slot called if the TQComboBox for the battery critical level action changed,
* used to hide/show the related TQSpinboxes if needed.
*/
void ConfigureDialog::cB_batCritical_activated() {
@@ -1776,7 +1780,7 @@ void ConfigureDialog::cB_batCritical_activated() {
/* ---- END battery level SECTION ---- */
-/*! \b SLOT: to open the KNotify config dialog */
+/*! \b Slot: to open the KNotify config dialog */
void ConfigureDialog::pB_configNotify_released( ) {
kdDebugFuncIn(trace);