@ -35,28 +35,28 @@
# include <kaccelmanager.h>
// QT - Headers
# include < qcheckbox.h>
# include < qcombobox.h>
# include < qdialog.h>
# include < qgroupbox.h>
# include < qlabel.h>
# include < qlineedit.h>
# include < qlistbox.h>
# include < qpushbutton.h>
# include < qslider.h>
# include < qspinbox.h>
# include < qstringlist.h>
# include < qtabwidget.h>
# include < qtoolbox.h>
# include < qtooltip.h>
# include < qstring.h>
# include < t qcheckbox.h>
# include < t qcombobox.h>
# include < t qdialog.h>
# include < t qgroupbox.h>
# include < t qlabel.h>
# include < t qlineedit.h>
# include < t qlistbox.h>
# include < t qpushbutton.h>
# include < t qslider.h>
# include < t qspinbox.h>
# include < t qstringlist.h>
# include < t qtabwidget.h>
# include < t qtoolbox.h>
# include < t qtooltip.h>
# include < t qstring.h>
# include "configuredialog.h"
/*! This is the default constructor of the class ConfigureDialog. */
ConfigureDialog : : ConfigureDialog ( KConfig * _config , HardwareInfo * _hwinfo , Settings * _settings ,
QWidget * parent, const char * name )
: configure_Dialog ( parent, name , false , WDestructiveClose )
T QWidget * tq parent, const char * name )
: configure_Dialog ( tq parent, name , false , WDestructiveClose )
{
kdDebugFuncIn ( trace ) ;
@ -65,7 +65,7 @@ ConfigureDialog::ConfigureDialog( KConfig *_config, HardwareInfo *_hwinfo, Setti
hwinfo = _hwinfo ;
suspend = hwinfo - > getSuspendSupport ( ) ;
QString session = getenv ( " DESKTOP_SESSION " ) ;
T QString session = getenv ( " DESKTOP_SESSION " ) ;
if ( session . startsWith ( " gnome " ) ) gnome_session = true ;
else gnome_session = false ;
@ -103,10 +103,10 @@ ConfigureDialog::ConfigureDialog( KConfig *_config, HardwareInfo *_hwinfo, Setti
setInactivityBox ( ) ;
selectScheme ( settings - > currentScheme ) ;
tL_valueBrightness - > setFrameStyle ( QFrame: : Panel | QFrame: : Sunken ) ;
tL_valueBrightness - > setBackgroundMode ( Qt: : PaletteBase ) ;
tL_valueBrightness - > setAlignment( Qt: : AlignCenter ) ;
tL_valueBrightness - > setFocusPolicy ( NoFocus) ;
tL_valueBrightness - > setFrameStyle ( T QFrame: : Panel | T QFrame: : Sunken ) ;
tL_valueBrightness - > setBackgroundMode ( T Qt: : PaletteBase ) ;
tL_valueBrightness - > tq setAlignment( T Qt: : AlignCenter ) ;
tL_valueBrightness - > setFocusPolicy ( TQ_ NoFocus) ;
// hide Lid item if this is not a laptop
if ( ! hwinfo - > isLaptop ( ) )
@ -129,13 +129,13 @@ ConfigureDialog::ConfigureDialog( KConfig *_config, HardwareInfo *_hwinfo, Setti
/*! This is the default destructor of the class ConfigureDialog. */
ConfigureDialog : : ~ ConfigureDialog ( ) {
kdDebugFuncIn ( trace ) ;
// no need to delete child widgets, Qt does it all for us
// no need to delete child widgets, T Qt does it all for us
}
/* ---- START General setup SECTION ---- */
/*!
* This used to fill the QListBox listBox_schemes and the scheme related QComboBoxes
* This used to fill the T QListBox listBox_schemes and the scheme related T QComboBoxes
* with the existing schemes .
*/
void ConfigureDialog : : setSchemeList ( ) {
@ -145,30 +145,30 @@ void ConfigureDialog::setSchemeList(){
cB_acScheme - > clear ( ) ;
cB_batteryScheme - > clear ( ) ;
for ( QStringList: : Iterator it = schemes . begin ( ) ; it ! = schemes . end ( ) ; + + it ) {
for ( T QStringList: : Iterator it = schemes . begin ( ) ; it ! = schemes . end ( ) ; + + it ) {
const char * _tmp = ( * it ) . ascii ( ) ;
if ( _tmp = = " Performance " | | _tmp = = i18n ( " Performance " ) ) {
listBox_schemes - > insertItem ( SmallIcon ( " scheme_power " , QIconSet: : Automatic ) , i18n ( _tmp ) ) ;
listBox_schemes - > insertItem ( SmallIcon ( " scheme_power " , T QIconSet: : Automatic ) , i18n ( _tmp ) ) ;
cB_acScheme - > insertItem ( i18n ( _tmp ) ) ;
cB_batteryScheme - > insertItem ( i18n ( _tmp ) ) ;
} else if ( _tmp = = " Powersave " | | _tmp = = i18n ( " Powersave " ) ) {
listBox_schemes - > insertItem ( SmallIcon ( " scheme_powersave " , QIconSet: : Automatic ) ,
listBox_schemes - > insertItem ( SmallIcon ( " scheme_powersave " , T QIconSet: : Automatic ) ,
i18n ( _tmp ) ) ;
cB_acScheme - > insertItem ( i18n ( _tmp ) ) ;
cB_batteryScheme - > insertItem ( i18n ( _tmp ) ) ;
} else if ( _tmp = = " Presentation " | | _tmp = = i18n ( " Presentation " ) ) {
listBox_schemes - > insertItem ( SmallIcon ( " scheme_presentation " , QIconSet: : Automatic ) ,
listBox_schemes - > insertItem ( SmallIcon ( " scheme_presentation " , T QIconSet: : Automatic ) ,
i18n ( _tmp ) ) ;
cB_acScheme - > insertItem ( i18n ( _tmp ) ) ;
cB_batteryScheme - > insertItem ( i18n ( _tmp ) ) ;
} else if ( _tmp = = " Acoustic " | | _tmp = = i18n ( " Acoustic " ) ) {
listBox_schemes - > insertItem ( SmallIcon ( " scheme_acoustic " , QIconSet: : Automatic ) ,
listBox_schemes - > insertItem ( SmallIcon ( " scheme_acoustic " , T QIconSet: : Automatic ) ,
i18n ( _tmp ) ) ;
cB_acScheme - > insertItem ( i18n ( _tmp ) ) ;
cB_batteryScheme - > insertItem ( i18n ( _tmp ) ) ;
} else if ( _tmp = = " AdvancedPowersave " | | _tmp = = i18n ( " Advanced Powersave " ) ) {
listBox_schemes - > insertItem ( SmallIcon ( " scheme_advanced_powersave " ,
QIconSet: : Automatic ) , i18n ( " Advanced Powersave " ) ) ;
T QIconSet: : Automatic ) , i18n ( " Advanced Powersave " ) ) ;
cB_acScheme - > insertItem ( i18n ( " Advanced Powersave " ) ) ;
cB_batteryScheme - > insertItem ( i18n ( " Advanced Powersave " ) ) ;
} else {
@ -198,14 +198,14 @@ void ConfigureDialog::getSchemeList(){
/*!
* This used to set the current scheme based on the name of the scheme
* \ param _scheme QString with the name of the scheme
* \ param _scheme T QString with the name of the scheme
*/
void ConfigureDialog : : selectScheme ( QString _scheme ) {
void ConfigureDialog : : selectScheme ( T QString _scheme ) {
kdDebugFuncIn ( trace ) ;
// select the current scheme in the listbox
if ( ! _scheme . isEmpty ( ) ) {
int pos = schemes . findIndex( _scheme ) ;
int pos = schemes . tq findIndex( _scheme ) ;
if ( pos > - 1 ) {
listBox_schemes - > setCurrentItem ( pos ) ;
currentScheme = pos ;
@ -226,37 +226,37 @@ void ConfigureDialog::setIcons(){
kdDebugFuncIn ( trace ) ;
/* set all Icons */
this - > setIcon ( SmallIcon ( " kpowersave " , QIconSet: : Automatic ) ) ;
buttonApply - > setIconSet ( SmallIconSet ( " apply " , QIconSet: : Automatic ) ) ;
buttonCancel - > setIconSet ( SmallIconSet ( " cancel " , QIconSet: : Automatic ) ) ;
buttonOk - > setIconSet ( SmallIconSet ( " ok " , QIconSet: : Automatic ) ) ;
buttonHelp - > setIconSet ( SmallIconSet ( " help " , QIconSet: : Automatic ) ) ;
pB_editBlacklist - > setIconSet ( SmallIconSet ( " configure " , QIconSet: : Automatic ) ) ;
pB_editBlacklistDimm - > setIconSet ( SmallIconSet ( " configure " , QIconSet: : Automatic ) ) ;
pB_editAutosuspendGBlacklist - > setIconSet ( SmallIconSet ( " configure " , QIconSet: : Automatic ) ) ;
pB_editAutodimmGBlacklist - > setIconSet ( SmallIconSet ( " configure " , QIconSet: : Automatic ) ) ;
tB_scheme - > setItemIconSet ( 0 , SmallIcon ( " kscreensaver " , QIconSet: : Automatic ) ) ;
tB_scheme - > setItemIconSet ( 1 , SmallIcon ( " display " , QIconSet: : Automatic ) ) ;
this - > setIcon ( SmallIcon ( " kpowersave " , T QIconSet: : Automatic ) ) ;
buttonApply - > setIconSet ( SmallIconSet ( " apply " , T QIconSet: : Automatic ) ) ;
buttonCancel - > setIconSet ( SmallIconSet ( " cancel " , T QIconSet: : Automatic ) ) ;
buttonOk - > setIconSet ( SmallIconSet ( " ok " , T QIconSet: : Automatic ) ) ;
buttonHelp - > setIconSet ( SmallIconSet ( " help " , T QIconSet: : Automatic ) ) ;
pB_editBlacklist - > setIconSet ( SmallIconSet ( " configure " , T QIconSet: : Automatic ) ) ;
pB_editBlacklistDimm - > setIconSet ( SmallIconSet ( " configure " , T QIconSet: : Automatic ) ) ;
pB_editAutosuspendGBlacklist - > setIconSet ( SmallIconSet ( " configure " , T QIconSet: : Automatic ) ) ;
pB_editAutodimmGBlacklist - > setIconSet ( SmallIconSet ( " configure " , T QIconSet: : Automatic ) ) ;
tB_scheme - > setItemIconSet ( 0 , SmallIcon ( " kscreensaver " , T QIconSet: : Automatic ) ) ;
tB_scheme - > setItemIconSet ( 1 , SmallIcon ( " display " , T QIconSet: : Automatic ) ) ;
if ( actions [ 0 ] = = " Suspend to Disk " )
tB_scheme - > setItemIconSet ( 2 , SmallIcon ( " suspend_to_disk " , QIconSet: : Automatic ) ) ;
tB_scheme - > setItemIconSet ( 2 , SmallIcon ( " suspend_to_disk " , T QIconSet: : Automatic ) ) ;
else if ( actions [ 0 ] = = " Suspend to RAM " )
tB_scheme - > setItemIconSet ( 2 , SmallIcon ( " suspend_to_ram " , QIconSet: : Automatic ) ) ;
tB_scheme - > setItemIconSet ( 2 , SmallIcon ( " suspend_to_ram " , T QIconSet: : Automatic ) ) ;
else if ( actions [ 0 ] = = " Standby " )
tB_scheme - > setItemIconSet ( 2 , SmallIcon ( " stand_by " , QIconSet: : Automatic ) ) ;
tB_scheme - > setItemIconSet ( 2 , SmallIcon ( " stand_by " , T QIconSet: : Automatic ) ) ;
tB_scheme - > setItemIconSet ( 3 , SmallIcon ( " autodimm " , QIconSet: : Automatic ) ) ;
tB_scheme - > setItemIconSet ( 4 , SmallIcon ( " processor " , QIconSet: : Automatic ) ) ;
tB_scheme - > setItemIconSet ( 5 , SmallIcon ( " misc " , QIconSet: : Automatic ) ) ;
tB_scheme - > setItemIconSet ( 3 , SmallIcon ( " autodimm " , T QIconSet: : Automatic ) ) ;
tB_scheme - > setItemIconSet ( 4 , SmallIcon ( " processor " , T QIconSet: : Automatic ) ) ;
tB_scheme - > setItemIconSet ( 5 , SmallIcon ( " misc " , T QIconSet: : Automatic ) ) ;
tB_general - > setItemIconSet ( 0 , SmallIcon ( " scheme_powersave " , QIconSet: : Automatic ) ) ;
tB_general - > setItemIconSet ( 1 , SmallIcon ( " button " , QIconSet: : Automatic ) ) ;
tB_general - > setItemIconSet ( 2 , SmallIcon ( " scheme_power " , QIconSet: : Automatic ) ) ;
tB_general - > setItemIconSet ( 3 , SmallIcon ( " lock " , QIconSet: : Automatic ) ) ;
tB_general - > setItemIconSet ( 4 , SmallIcon ( " misc " , QIconSet: : Automatic ) ) ;
pB_configNotify - > setIconSet ( SmallIconSet ( " knotify " , QIconSet: : Automatic ) ) ;
tB_general - > setItemIconSet ( 0 , SmallIcon ( " scheme_powersave " , T QIconSet: : Automatic ) ) ;
tB_general - > setItemIconSet ( 1 , SmallIcon ( " button " , T QIconSet: : Automatic ) ) ;
tB_general - > setItemIconSet ( 2 , SmallIcon ( " scheme_power " , T QIconSet: : Automatic ) ) ;
tB_general - > setItemIconSet ( 3 , SmallIcon ( " lock " , T QIconSet: : Automatic ) ) ;
tB_general - > setItemIconSet ( 4 , SmallIcon ( " misc " , T QIconSet: : Automatic ) ) ;
pB_configNotify - > setIconSet ( SmallIconSet ( " knotify " , T QIconSet: : Automatic ) ) ;
kdDebugFuncOut ( trace ) ;
}
@ -267,36 +267,36 @@ void ConfigureDialog::setIcons(){
void ConfigureDialog : : setTooltips ( ) {
kdDebugFuncIn ( trace ) ;
// QToolTip::setWakeUpDelay ( 1000 );
QToolTip: : add ( cB_specificSettings , i18n ( " This enables specific screen saver settings. \n "
// T QToolTip::setWakeUpDelay ( 1000 );
T QToolTip: : add ( cB_specificSettings , i18n ( " This enables specific screen saver settings. \n "
" Note: If selected, the global screen saver settings are \n "
" overwritten while kpowersave runs. " ) ) ;
QToolTip: : add ( cB_disable_Ss , i18n ( " This disables the screen saver. \n "
T QToolTip: : add ( cB_disable_Ss , i18n ( " This disables the screen saver. \n "
" Note: If selected, the global screen saver settings are \n "
" overwritten while kpowersave runs. " ) ) ;
QToolTip: : add ( cB_blankScreen , i18n ( " This blanks the screen instead of using a specific screen saver. \n "
T QToolTip: : add ( cB_blankScreen , i18n ( " This blanks the screen instead of using a specific screen saver. \n "
" Note: This may work only with KScreensaver. " ) ) ;
QToolTip: : add ( cB_SpecificPM , i18n ( " This enables specific DPMS settings. \n "
T QToolTip: : add ( cB_SpecificPM , i18n ( " This enables specific DPMS settings. \n "
" Note: If selected, the global DPMS settings are \n "
" overwritten while kpowersave runs. " ) ) ;
QToolTip: : add ( cB_disablePM , i18n ( " This disables DPMS support. " ) ) ;
QToolTip: : add ( cB_lockSuspend , i18n ( " If selected, the screen is locked on suspend or standby. " ) ) ;
QToolTip: : add ( cB_lockLid , i18n ( " If selected, the screen is locked if the lid close event is triggered. " ) ) ;
T QToolTip: : add ( cB_disablePM , i18n ( " This disables DPMS support. " ) ) ;
T QToolTip: : add ( cB_lockSuspend , i18n ( " If selected, the screen is locked on suspend or standby. " ) ) ;
T QToolTip: : add ( cB_lockLid , i18n ( " If selected, the screen is locked if the lid close event is triggered. " ) ) ;
QToolTip: : add ( cB_autoSuspend , i18n ( " Check this box to enable or disable automatic suspension of "
T QToolTip: : add ( cB_autoSuspend , i18n ( " Check this box to enable or disable automatic suspension of "
" the computer. " ) ) ;
QToolTip: : add ( cB_autoInactivity , i18n ( " Activate this action if the user was inactive for the defined "
T QToolTip: : add ( cB_autoInactivity , i18n ( " Activate this action if the user was inactive for the defined "
" time \n (greater than 0 minutes). If empty, nothing happens. " ) ) ;
tB_scheme - > setItemToolTip ( 0 , i18n ( " All scheme-related screen saver and DPMS settings. " ) ) ;
tB_scheme - > setItemToolTip ( 1 , i18n ( " All scheme-related display brightness settings. " ) ) ;
tB_scheme - > setItemToolTip ( 2 , i18n ( " All scheme-related automatic suspend settings. " ) ) ;
QToolTip: : add ( brightnessSlider , i18n ( " Here you can change the brightness of your display. \n "
T QToolTip: : add ( brightnessSlider , i18n ( " Here you can change the brightness of your display. \n "
" Use the slider to change the brightness directly for \n "
" testing. To reset back to previous level, please press \n "
" the 'Reset' button. " ) ) ;
QToolTip: : add ( pB_resetBrightness , i18n ( " Use this button to set back the slider and the "
T QToolTip: : add ( pB_resetBrightness , i18n ( " Use this button to set back the slider and the "
" display brightness. " ) ) ;
kdDebugFuncOut ( trace ) ;
@ -307,12 +307,12 @@ void ConfigureDialog::setTooltips(){
* This is a workaround for the case if Yast translated the name of the
* scheme In this case is a new config section created and the old settings
* would be lost .
* \ param s_scheme QString with the ' current ' name of the scheme
* \ return QString with the english name of the scheme
* \ param s_scheme T QString with the ' current ' name of the scheme
* \ return T QString with the english name of the scheme
*/
QString ConfigureDialog : : getSchemeRealName ( QString s_scheme ) {
T QString ConfigureDialog : : getSchemeRealName ( T QString s_scheme ) {
kdDebugFuncIn ( trace ) ;
QString ret = s_scheme ;
T QString ret = s_scheme ;
if ( s_scheme = = " Performance " | | s_scheme = = i18n ( " Performance " ) )
ret = " Performance " ;
@ -331,14 +331,14 @@ QString ConfigureDialog::getSchemeRealName(QString s_scheme) {
* This function is used to read the settings from configfile and
* set the values to the related dialog elements .
* \ param schemeID Integer value , represent the position of the
* scheme in the QListBox and within the pdaemon - list .
* scheme in the T QListBox and within the pdaemon - list .
*/
void ConfigureDialog : : setConfigToDialog ( int schemeID ) {
if ( trace ) kdDebug ( ) < < funcinfo < < " IN , scheme: " < < schemeID < < endl ;
initalised = false ;
QString s_scheme = getSchemeRealName ( schemes [ schemeID ] ) ;
T QString s_scheme = getSchemeRealName ( schemes [ schemeID ] ) ;
if ( kconfig - > hasGroup ( s_scheme ) ) {
settings - > load_general_settings ( ) ;
@ -349,18 +349,18 @@ void ConfigureDialog::setConfigToDialog( int schemeID ){
! s_scheme . startsWith ( settings - > battery_scheme ) ) {
// enable delete button
pB_deleteScheme - > setEnabled ( true ) ;
QToolTip: : add ( pB_deleteScheme , i18n ( " Press this button to delete the "
T QToolTip: : add ( pB_deleteScheme , i18n ( " Press this button to delete the "
" selected scheme. " ) ) ;
} else {
// disable button
pB_deleteScheme - > setEnabled ( false ) ;
QToolTip: : add ( pB_deleteScheme , i18n ( " You can't delete the current AC "
T QToolTip: : add ( pB_deleteScheme , i18n ( " You can't delete the current AC "
" or battery scheme. " ) ) ;
}
} else {
// disable button, can't delete these scheme, they are default
pB_deleteScheme - > setEnabled ( false ) ;
QToolTip: : add ( pB_deleteScheme , i18n ( " You can't delete this default scheme. " ) ) ;
T QToolTip: : add ( pB_deleteScheme , i18n ( " You can't delete this default scheme. " ) ) ;
}
kconfig - > setGroup ( s_scheme ) ;
@ -449,9 +449,9 @@ void ConfigureDialog::setConfigToDialog( int schemeID ){
cB_disablePM_toggled ( kconfig - > readBoolEntry ( " disableDPMS " , false ) ) ;
// set autosuspend related settings
QString _action = kconfig - > readEntry ( " autoInactiveAction " , " NULL " ) ;
T QString _action = kconfig - > readEntry ( " autoInactiveAction " , " NULL " ) ;
if ( _action ! = " NULL " ) {
int _index = actions . findIndex( _action ) ;
int _index = actions . tq findIndex( _action ) ;
if ( _index ! = - 1 ) {
cB_autoInactivity - > setCurrentItem ( _index ) ;
cB_autoInactivity_activated ( _index ) ;
@ -473,7 +473,7 @@ void ConfigureDialog::setConfigToDialog( int schemeID ){
kconfig - > setGroup ( " default-scheme " ) ;
_action = kconfig - > readEntry ( " autoInactiveAction " , " NULL " ) ;
if ( _action ! = " NULL " ) {
int _index = actions . findIndex( _action ) ;
int _index = actions . tq findIndex( _action ) ;
if ( _index ! = - 1 ) {
cB_autoInactivity - > setCurrentItem ( _index ) ;
tL_autoInactivity_After - > setEnabled ( true ) ;
@ -536,11 +536,11 @@ void ConfigureDialog::setConfigToDialog( int schemeID ){
int i_brightnessPercent = kconfig - > readNumEntry ( " brightnessPercent " , - 1 ) ;
if ( i_brightnessPercent > = 0 ) {
brightnessSlider - > setValue ( i_brightnessPercent ) ;
tL_valueBrightness - > setText ( QString: : number ( i_brightnessPercent ) + " % " ) ;
tL_valueBrightness - > setText ( T QString: : number ( i_brightnessPercent ) + " % " ) ;
}
else {
brightnessSlider - > setValue ( 100 ) ;
tL_valueBrightness - > setText ( QString: : number ( 100 ) + " % " ) ;
tL_valueBrightness - > setText ( T QString: : number ( 100 ) + " % " ) ;
}
tL_brightness - > setText ( i18n ( " Your hardware supports to change the brightness. The "