summaryrefslogtreecommitdiffstats
path: root/src/configuredialog.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-04-16 23:01:29 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-04-16 23:01:29 +0000
commit4304e8d9dab8e20513e38e71b0debdf6937b630c (patch)
tree76a86f013a811449a5b5bfbbbb962e7db0bbcc6a /src/configuredialog.cpp
parentba24506b3bb46312d998468ad3c1a7f28058b2bd (diff)
downloadkpowersave-4304e8d9dab8e20513e38e71b0debdf6937b630c.tar.gz
kpowersave-4304e8d9dab8e20513e38e71b0debdf6937b630c.zip
Finish TQt4 port of kpowersave
This enables both Qt3 and Qt4 builds git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kpowersave@1228282 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/configuredialog.cpp')
-rw-r--r--src/configuredialog.cpp356
1 files changed, 178 insertions, 178 deletions
diff --git a/src/configuredialog.cpp b/src/configuredialog.cpp
index a0e45ae..3c0387b 100644
--- a/src/configuredialog.cpp
+++ b/src/configuredialog.cpp
@@ -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 <tqcheckbox.h>
+ #include <tqcombobox.h>
+ #include <tqdialog.h>
+ #include <tqgroupbox.h>
+ #include <tqlabel.h>
+ #include <tqlineedit.h>
+ #include <tqlistbox.h>
+ #include <tqpushbutton.h>
+ #include <tqslider.h>
+ #include <tqspinbox.h>
+ #include <tqstringlist.h>
+ #include <tqtabwidget.h>
+ #include <tqtoolbox.h>
+ #include <tqtooltip.h>
+ #include <tqstring.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 )
+ TQWidget *tqparent, const char *name)
+ :configure_Dialog(tqparent, 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");
+ TQString 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(TQFrame::Panel | TQFrame::Sunken);
+ tL_valueBrightness->setBackgroundMode(TQt::PaletteBase);
+ tL_valueBrightness->tqsetAlignment(TQt::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, TQt 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 TQListBox listBox_schemes and the scheme related TQComboBoxes
* 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 ( TQStringList::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", TQIconSet::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", TQIconSet::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", TQIconSet::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", TQIconSet::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"));
+ TQIconSet::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 TQString with the name of the scheme
*/
-void ConfigureDialog::selectScheme (QString _scheme){
+void ConfigureDialog::selectScheme (TQString _scheme){
kdDebugFuncIn(trace);
// select the current scheme in the listbox
if(!_scheme.isEmpty()) {
- int pos = schemes.findIndex(_scheme);
+ int pos = schemes.tqfindIndex(_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", TQIconSet::Automatic));
+ buttonApply->setIconSet(SmallIconSet("apply", TQIconSet::Automatic));
+ buttonCancel->setIconSet(SmallIconSet("cancel", TQIconSet::Automatic));
+ buttonOk->setIconSet(SmallIconSet("ok", TQIconSet::Automatic));
+ buttonHelp->setIconSet(SmallIconSet("help", TQIconSet::Automatic));
+
+ pB_editBlacklist->setIconSet(SmallIconSet("configure", TQIconSet::Automatic));
+ pB_editBlacklistDimm->setIconSet(SmallIconSet("configure", TQIconSet::Automatic));
+ pB_editAutosuspendGBlacklist->setIconSet(SmallIconSet("configure", TQIconSet::Automatic));
+ pB_editAutodimmGBlacklist->setIconSet(SmallIconSet("configure", TQIconSet::Automatic));
+
+ tB_scheme->setItemIconSet( 0 ,SmallIcon("kscreensaver", TQIconSet::Automatic));
+ tB_scheme->setItemIconSet( 1 ,SmallIcon("display", TQIconSet::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", TQIconSet::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", TQIconSet::Automatic));
else if(actions[0] == "Standby")
- tB_scheme->setItemIconSet( 2 ,SmallIcon("stand_by", QIconSet::Automatic));
+ tB_scheme->setItemIconSet( 2 ,SmallIcon("stand_by", TQIconSet::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", TQIconSet::Automatic));
+ tB_scheme->setItemIconSet( 4 ,SmallIcon("processor", TQIconSet::Automatic));
+ tB_scheme->setItemIconSet( 5 ,SmallIcon("misc", TQIconSet::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", TQIconSet::Automatic));
+ tB_general->setItemIconSet( 1, SmallIcon( "button", TQIconSet::Automatic));
+ tB_general->setItemIconSet( 2, SmallIcon( "scheme_power", TQIconSet::Automatic));
+ tB_general->setItemIconSet( 3, SmallIcon( "lock", TQIconSet::Automatic));
+ tB_general->setItemIconSet( 4, SmallIcon( "misc", TQIconSet::Automatic));
+ pB_configNotify->setIconSet(SmallIconSet("knotify", TQIconSet::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"
+ // TQToolTip::setWakeUpDelay ( 1000 );
+ TQToolTip::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"
+ TQToolTip::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"
+ TQToolTip::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"
+ TQToolTip::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."));
+ TQToolTip::add(cB_disablePM, i18n("This disables DPMS support."));
+ TQToolTip::add(cB_lockSuspend, i18n("If selected, the screen is locked on suspend or standby."));
+ TQToolTip::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 "
+ TQToolTip::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 "
+ TQToolTip::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"
+ TQToolTip::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 "
+ TQToolTip::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 TQString with the 'current' name of the scheme
+ * \return TQString with the english name of the scheme
*/
-QString ConfigureDialog::getSchemeRealName(QString s_scheme) {
+TQString ConfigureDialog::getSchemeRealName(TQString s_scheme) {
kdDebugFuncIn(trace);
- QString ret = s_scheme;
+ TQString 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 TQListBox 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]);
+ TQString 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 "
+ TQToolTip::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 "
+ TQToolTip::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."));
+ TQToolTip::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");
+ TQString _action = kconfig->readEntry("autoInactiveAction", "NULL");
if( _action != "NULL") {
- int _index = actions.findIndex(_action);
+ int _index = actions.tqfindIndex(_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.tqfindIndex(_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(TQString::number(i_brightnessPercent) + " %");
}
else {
brightnessSlider->setValue(100);
- tL_valueBrightness->setText(QString::number(100)+ " %");
+ tL_valueBrightness->setText(TQString::number(100)+ " %");
}
tL_brightness->setText(i18n("Your hardware supports to change the brightness. The "
@@ -602,7 +602,7 @@ void ConfigureDialog::setConfigToDialog( int schemeID ){
}
if (hwinfo->supportCPUFreq()) {
- QString cpuFreqPolicy = kconfig->readEntry("cpuFreqPolicy");
+ TQString cpuFreqPolicy = kconfig->readEntry("cpuFreqPolicy");
if (cpuFreqPolicy.isEmpty()) {
// load value from default-scheme
@@ -659,7 +659,7 @@ void ConfigureDialog::setGeneralSettings() {
cB_autostart->setChecked(kconfig->readBoolEntry("Autostart",false));
cB_autostart_neverAsk->setChecked(kconfig->readBoolEntry("AutostartNeverAsk",false));
- QString lockmethod = kconfig->readEntry("lockMethod", "NULL");
+ TQString lockmethod = kconfig->readEntry("lockMethod", "NULL");
if(comboB_lock->count() == 0 ){
comboB_lock->insertItem(i18n("Select Automatically"),0);
comboB_lock->insertItem(i18n("KScreensaver"),1);
@@ -696,21 +696,21 @@ void ConfigureDialog::setGeneralSettings() {
sB_batLowAction_value->hide();
sB_batCritAction_value->hide();
- QString _select;
- QStringList _actions = kconfig->readListEntry("batteryAllowedActions", QString());
- _select = kconfig->readEntry("batteryWarningAction", QString());
+ TQString _select;
+ TQStringList _actions = kconfig->readListEntry("batteryAllowedActions", TQString());
+ _select = kconfig->readEntry("batteryWarningAction", TQString());
fillActionComboBox(cB_batWarning, _actions, _select);
if (_select == "BRIGHTNESS" && hwinfo->supportBrightness()) {
sB_batWarnAction_value->show();
sB_batWarnAction_value->setValue(kconfig->readNumEntry( "batteryWarningActionValue",0));
}
- _select = kconfig->readEntry("batteryLowAction", QString());
+ _select = kconfig->readEntry("batteryLowAction", TQString());
fillActionComboBox(cB_batLow, _actions, _select);
if (_select == "BRIGHTNESS" && hwinfo->supportBrightness()) {
sB_batLowAction_value->show();
sB_batLowAction_value->setValue( kconfig->readNumEntry( "batteryLowActionValue",0));
}
- _select = kconfig->readEntry("batteryCriticalAction", QString());
+ _select = kconfig->readEntry("batteryCriticalAction", TQString());
fillActionComboBox(cB_batCritical, _actions, _select);
if (_select == "BRIGHTNESS" && hwinfo->supportBrightness()) {
sB_batCritAction_value->show();
@@ -723,19 +723,19 @@ void ConfigureDialog::setGeneralSettings() {
}
// buttons tab:
- QStringList _actions = kconfig->readListEntry("buttonsAllowedActions", QString());
- fillActionComboBox(cB_PowerButton, _actions, kconfig->readEntry("ActionOnPowerButton", QString()));
- fillActionComboBox(cB_SleepButton, _actions, kconfig->readEntry("ActionOnSleepButton", QString()));
- fillActionComboBox(cB_S2DiskButton, _actions, kconfig->readEntry("ActionOnS2DiskButton", QString()));
+ TQStringList _actions = kconfig->readListEntry("buttonsAllowedActions", TQString());
+ fillActionComboBox(cB_PowerButton, _actions, kconfig->readEntry("ActionOnPowerButton", TQString()));
+ fillActionComboBox(cB_SleepButton, _actions, kconfig->readEntry("ActionOnSleepButton", TQString()));
+ fillActionComboBox(cB_S2DiskButton, _actions, kconfig->readEntry("ActionOnS2DiskButton", TQString()));
// avoid logout dialog for lidclose - this make no sense
_actions.remove("LOGOUT_DIALOG");
- fillActionComboBox(cB_LidcloseButton, _actions, kconfig->readEntry("ActionOnLidClose", QString()));
+ fillActionComboBox(cB_LidcloseButton, _actions, kconfig->readEntry("ActionOnLidClose", TQString()));
// default scheme tab:
- QString _ac_scheme = kconfig->readEntry( "ac_scheme", "Performance");
- QString _bat_scheme = kconfig->readEntry( "battery_scheme", "Powersave");
- cB_acScheme->setCurrentItem(schemes.findIndex(_ac_scheme));
- cB_batteryScheme->setCurrentItem(schemes.findIndex(_bat_scheme));
+ TQString _ac_scheme = kconfig->readEntry( "ac_scheme", "Performance");
+ TQString _bat_scheme = kconfig->readEntry( "battery_scheme", "Powersave");
+ cB_acScheme->setCurrentItem(schemes.tqfindIndex(_ac_scheme));
+ cB_batteryScheme->setCurrentItem(schemes.tqfindIndex(_bat_scheme));
kdDebugFuncOut(trace);
}
@@ -750,7 +750,7 @@ void ConfigureDialog::setGeneralSettings() {
void ConfigureDialog::saveSchemeSettings() {
kdDebugFuncIn(trace);
- QString s_scheme = getSchemeRealName(schemes[currentScheme]);
+ TQString s_scheme = getSchemeRealName(schemes[currentScheme]);
kconfig->setGroup(s_scheme);
kconfig->writeEntry("specSsSettings",cB_specificSettings->isOn());
@@ -829,7 +829,7 @@ void ConfigureDialog::saveGeneralSettings() {
kconfig->writeEntry("Autostart",cB_autostart->isOn());
kconfig->writeEntry("AutostartNeverAsk",cB_autostart_neverAsk->isOn());
- QString selected_method = "";
+ TQString selected_method = "";
int _selected = comboB_lock->currentItem();
if(_selected == 0) selected_method = "automatic";
else if(_selected == 1) selected_method = "kscreensaver";
@@ -843,7 +843,7 @@ void ConfigureDialog::saveGeneralSettings() {
kconfig->writeEntry("batteryCritical", sB_batCritical->value());
// battery level tab
- QString _action = mapDescriptionToAction(cB_batWarning->currentText());
+ TQString _action = mapDescriptionToAction(cB_batWarning->currentText());
kconfig->writeEntry("batteryWarningAction", _action);
if (_action == "BRIGHTNESS") {
kconfig->writeEntry("batteryWarningActionValue", sB_batWarnAction_value->value());
@@ -918,7 +918,7 @@ void ConfigureDialog::scheme_valueChanged(){
}
/*!
- * SLOT: called if the current scheme in the QListBox 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(){
@@ -1028,21 +1028,21 @@ void ConfigureDialog::pB_newScheme_clicked(){
bool _ok = false;
bool _end = false;
- QString _new;
- QString _text = i18n("Please insert a name for the new scheme:");
- QString _error;
+ TQString _new;
+ TQString _text = i18n("Please insert a name for the new scheme:");
+ TQString _error;
getSchemeList();
while (!_end) {
_new = KInputDialog::getText( i18n("KPowersave Configuration"),
- _error + _text, QString::null, &_ok, this);
+ _error + _text, TQString(), &_ok, this);
if (!_ok ) {
_end = true;
} else {
- _error = QString();
+ _error = TQString();
if (!_new.isEmpty()) {
- if ( schemes.contains(_new))
+ if ( schemes.tqcontains(_new))
_error = i18n("Error: A scheme with this name already exist.\n");
else
_end = true;
@@ -1074,12 +1074,12 @@ void ConfigureDialog::pB_deleteScheme_clicked(){
if (pB_deleteScheme->isEnabled()) {
int answer = KMessageBox::questionYesNo( this, i18n("Do you really want to delete the "
- "%1 scheme?").arg(schemes[currentScheme]),
+ "%1 scheme?").tqarg(schemes[currentScheme]),
i18n("Confirm delete scheme"),
i18n("Delete"), i18n("Cancel"));
if (answer == KMessageBox::Yes) {
// delete the scheme, we can be sure this is a userscheme
- QString _s_tmp = getSchemeRealName(schemes[currentScheme]);
+ TQString _s_tmp = getSchemeRealName(schemes[currentScheme]);
if (kconfig->hasGroup(_s_tmp) && kconfig->deleteGroup(_s_tmp)) {
schemes.remove(_s_tmp);
kconfig->setGroup("General");
@@ -1105,7 +1105,7 @@ void ConfigureDialog::pB_deleteScheme_clicked(){
/* ---- START SCREENSAVER SECTION ---- */
/*!
- * SLOT: called if QCheckBox cB_specificSettings is toggled.
+ * SLOT: called if TQCheckBox cB_specificSettings is toggled.
* \param state boolean, true if toggled on
* false if toggled off
*/
@@ -1133,7 +1133,7 @@ void ConfigureDialog::cB_specificSettings_toggled(bool state){
}
/*!
- * SLOT: called if QCheckBox 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
*/
@@ -1153,7 +1153,7 @@ void ConfigureDialog::cB_disable_Ss_toggled(bool state){
/* ---- START DPMS SECTION ---- */
/*!
- * SLOT: called if QCheckBox cB_SpecificPM is toggled.
+ * SLOT: called if TQCheckBox cB_SpecificPM is toggled.
* \param state boolean, true if toggled on
* false if toggled offtrue
*/
@@ -1178,7 +1178,7 @@ void ConfigureDialog::cB_SpecificPM_toggled(bool state){
}
/*!
- * SLOT: called if QCheckBox cB_disablePM is toggled.
+ * SLOT: called if TQCheckBox cB_disablePM is toggled.
* \param state boolean, true if toggled on
* false if toggled off
*/
@@ -1199,7 +1199,7 @@ void ConfigureDialog::cB_disablePM_toggled(bool state){
}
/*!
- * SLOT: called if the standby QSpinBoxes for DPMS timout is changed.
+ * SLOT: called if the standby TQSpinBoxes for DPMS timout is changed.
*/
void ConfigureDialog::sB_standby_valueChanged() {
kdDebugFuncIn(trace);
@@ -1216,7 +1216,7 @@ void ConfigureDialog::sB_standby_valueChanged() {
}
/*!
- * SLOT: called if the suspend QSpinBoxes for DPMS timout is changed.
+ * SLOT: called if the suspend TQSpinBoxes for DPMS timout is changed.
*/
void ConfigureDialog::sB_suspend_valueChanged() {
kdDebugFuncIn(trace);
@@ -1237,7 +1237,7 @@ void ConfigureDialog::sB_suspend_valueChanged() {
}
/*!
- * SLOT: called if the powerOff QSpinBoxes for DPMS timout is changed.
+ * SLOT: called if the powerOff TQSpinBoxes for DPMS timout is changed.
*/
void ConfigureDialog::sB_powerOff_valueChanged() {
kdDebugFuncIn(trace);
@@ -1267,10 +1267,10 @@ void ConfigureDialog::setInactivityBox(){
// add "nothing" at start of the list
actions.push_front(" ");
// add "Turn Off Computer" at end of the list
- // QString _to_i18n = i18n("Turn Off Computer");
+ // TQString _to_i18n = i18n("Turn Off Computer");
// actions.append("Turn Off Computer");
- for ( QStringList::Iterator it = actions.begin(); it != actions.end(); ++it ) {
+ for ( TQStringList::Iterator it = actions.begin(); it != actions.end(); ++it ) {
cB_autoInactivity->insertItem( i18n( (*it).ascii() ) );
}
@@ -1321,7 +1321,7 @@ void ConfigureDialog::cB_autoInactivity_activated( int selectedItem ) {
if( actions[selectedItem] != " " ) {
if(!displayed_WARN_autosuspend && initalised) {
- QString _msg = "<qt>" + i18n("<b>Note:</b> If you select this option, the computer "
+ TQString _msg = "<qt>" + i18n("<b>Note:</b> If you select this option, the computer "
"will suspend or standby if the current user is "
"inactive for the defined time even if somebody is "
"logged in remotely to the X server.<br><br> This "
@@ -1388,20 +1388,20 @@ void ConfigureDialog::cB_Blacklist_toggled( bool toggled ){
void ConfigureDialog::pB_editBlacklistSuspend_clicked(){
kdDebugFuncIn(trace);
- QString _top_text = "";
+ TQString _top_text = "";
bool initialiseImport = false;
if(tabWidget->currentPageIndex() == 0 ) {
- QString s_scheme = getSchemeRealName(schemes[listBox_schemes->currentItem()]);
+ TQString s_scheme = getSchemeRealName(schemes[listBox_schemes->currentItem()]);
_top_text = listBox_schemes->currentText();
if (kconfig->hasGroup(s_scheme)){
kconfig->setGroup(s_scheme);
}
blacklist = kconfig->readListEntry("autoInactiveSchemeBlacklist", ',');
if( blacklist.empty()) {
- QString _msg = i18n("The blacklist of the selected scheme is empty. "
+ TQString _msg = i18n("The blacklist of the selected scheme is empty. "
"Import the general blacklist?");
- int tmp = KMessageBox::questionYesNo(this, _msg, QString(), i18n("Import"), i18n("Do Not Import"));
+ int tmp = KMessageBox::questionYesNo(this, _msg, TQString(), i18n("Import"), i18n("Do Not Import"));
if (tmp == KMessageBox::Yes) {
initialiseImport = true;
if(kconfig->hasGroup("General")){
@@ -1420,24 +1420,24 @@ void ConfigureDialog::pB_editBlacklistSuspend_clicked(){
}
blacklistEDlgAS = new blacklistEditDialog(blacklist, _top_text, initialiseImport, this);
- connect( blacklistEDlgAS, SIGNAL(config_finished(QStringList)), this,
- SLOT(saveSchemeSuspendBlacklist(QStringList)));
+ connect( blacklistEDlgAS, TQT_SIGNAL(config_finished(TQStringList)), this,
+ TQT_SLOT(saveSchemeSuspendBlacklist(TQStringList)));
blacklistEDlgAS->exec();
kdDebugFuncOut(trace);
}
/*!
- * SLOT: Called if the signal config_finished(QStringList) recieved
+ * SLOT: Called if the signal config_finished(TQStringList) recieved
* and the autosuspend blacklist is edited.
- * \param new_blacklist QStringlist with the edited blacklisted processes
+ * \param new_blacklist TQStringlist with the edited blacklisted processes
*/
-void ConfigureDialog::saveSchemeSuspendBlacklist( QStringList new_blacklist){
+void ConfigureDialog::saveSchemeSuspendBlacklist( TQStringList new_blacklist){
kdDebugFuncIn(trace);
if(tabWidget->currentPageIndex() == 0 ) {
- QString s_scheme = getSchemeRealName(schemes[currentScheme]);
+ TQString s_scheme = getSchemeRealName(schemes[currentScheme]);
kconfig->setGroup(s_scheme);
kconfig->writeEntry("autoInactiveSchemeBlacklist", new_blacklist, ',');
}
@@ -1518,20 +1518,20 @@ void ConfigureDialog::cB_BlacklistDimm_toggled( bool toggled ){
void ConfigureDialog::pB_editBlacklistDimm_clicked(){
kdDebugFuncIn(trace);
- QString _top_text = "";
+ TQString _top_text = "";
bool initialiseImport = false;
if(tabWidget->currentPageIndex() == 0 ) {
- QString s_scheme = getSchemeRealName(schemes[listBox_schemes->currentItem()]);
+ TQString s_scheme = getSchemeRealName(schemes[listBox_schemes->currentItem()]);
_top_text = listBox_schemes->currentText();
if (kconfig->hasGroup(s_scheme)){
kconfig->setGroup(s_scheme);
}
blacklist = kconfig->readListEntry("autoDimmSchemeBlacklist", ',');
if( blacklist.empty()) {
- QString _msg = i18n("The blacklist of the selected scheme is empty. "
+ TQString _msg = i18n("The blacklist of the selected scheme is empty. "
"Import the general blacklist?");
- int tmp = KMessageBox::questionYesNo(this, _msg, QString(), i18n("Import"), i18n("Do Not Import"));
+ int tmp = KMessageBox::questionYesNo(this, _msg, TQString(), i18n("Import"), i18n("Do Not Import"));
if (tmp == KMessageBox::Yes) {
initialiseImport = true;
if(kconfig->hasGroup("General")){
@@ -1550,23 +1550,23 @@ void ConfigureDialog::pB_editBlacklistDimm_clicked(){
}
blacklistEDlgAD = new blacklistEditDialog(blacklist, _top_text, initialiseImport, this);
- connect( blacklistEDlgAD, SIGNAL(config_finished(QStringList)), this,
- SLOT(saveSchemeDimmBlacklist(QStringList)));
+ connect( blacklistEDlgAD, TQT_SIGNAL(config_finished(TQStringList)), this,
+ TQT_SLOT(saveSchemeDimmBlacklist(TQStringList)));
blacklistEDlgAD->exec();
kdDebugFuncOut(trace);
}
/*!
- * SLOT: Called if the signal config_finished(QStringList) recieved
+ * SLOT: Called if the signal config_finished(TQStringList) recieved
* and the autdimm blacklist is edited.
- * \param new_blacklist QStringlist with the edited blacklisted processes
+ * \param new_blacklist TQStringlist with the edited blacklisted processes
*/
-void ConfigureDialog::saveSchemeDimmBlacklist( QStringList new_blacklist){
+void ConfigureDialog::saveSchemeDimmBlacklist( TQStringList new_blacklist){
kdDebugFuncIn(trace);
if(tabWidget->currentPageIndex() == 0 ) {
- QString s_scheme = getSchemeRealName(schemes[currentScheme]);
+ TQString s_scheme = getSchemeRealName(schemes[currentScheme]);
kconfig->setGroup(s_scheme);
kconfig->writeEntry("autoDimmSchemeBlacklist", new_blacklist, ',');
}
@@ -1615,7 +1615,7 @@ void ConfigureDialog::cB_Brightness_toggled( bool toggled ) {
gB_Brightness->setEnabled(toggled);
cB_Brightness->setChecked(toggled);
- connect(brightnessSlider, SIGNAL(valueChanged (int)), this, SLOT(brightnessSlider_sliderMoved(int)));
+ connect(brightnessSlider, TQT_SIGNAL(valueChanged (int)), this, TQT_SLOT(brightnessSlider_sliderMoved(int)));
kdDebugFuncOut(trace);
}
@@ -1626,7 +1626,7 @@ void ConfigureDialog::brightnessSlider_sliderMoved( int new_value ) {
if (cB_Brightness->isEnabled() && cB_Brightness->isChecked()) {
scheme_valueChanged();
- tL_valueBrightness->setText(QString::number(new_value) + " %");
+ tL_valueBrightness->setText(TQString::number(new_value) + " %");
hwinfo->setBrightness(-1, new_value);
pB_resetBrightness->setEnabled(true);
brightness_changed = true;
@@ -1651,7 +1651,7 @@ void ConfigureDialog::pB_resetBrightness_clicked( ) {
/* ---- START battery level SECTION ---- */
/*!
- * SLOT: called if the warning QSpinBoxes for battery level is changed.
+ * SLOT: called if the warning TQSpinBoxes for battery level is changed.
*/
void ConfigureDialog::sB_batWarning_valueChanged() {
kdDebugFuncIn(trace);
@@ -1668,7 +1668,7 @@ void ConfigureDialog::sB_batWarning_valueChanged() {
}
/*!
- * SLOT: called if the low QSpinBoxes for battery level is changed.
+ * SLOT: called if the low TQSpinBoxes for battery level is changed.
*/
void ConfigureDialog::sB_batLow_valueChanged() {
kdDebugFuncIn(trace);
@@ -1689,7 +1689,7 @@ void ConfigureDialog::sB_batLow_valueChanged() {
}
/*!
- * SLOT: called if the critical QSpinBoxes for battery level is changed.
+ * SLOT: called if the critical TQSpinBoxes for battery level is changed.
*/
void ConfigureDialog::sB_batCritical_valueChanged() {
kdDebugFuncIn(trace);
@@ -1706,8 +1706,8 @@ void ConfigureDialog::sB_batCritical_valueChanged() {
}
/*!
- * SLOT: called if the QComboBox for the battery warning level action changed,
- * used to hide/show the related QSpinboxes if needed.
+ * 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() {
kdDebugFuncIn(trace);
@@ -1721,9 +1721,9 @@ void ConfigureDialog::cB_batWarning_activated() {
kdDebugFuncOut(trace);
}
-//! called if the QComboBox for the battery low level action changed
+//! called if the TQComboBox for the battery low level action changed
/*!
- * used to hide/show the related QSpinboxes if needed.
+ * used to hide/show the related TQSpinboxes if needed.
*/
void ConfigureDialog::cB_batLow_activated() {
kdDebugFuncIn(trace);
@@ -1738,8 +1738,8 @@ void ConfigureDialog::cB_batLow_activated() {
}
/*!
- * SLOT: called if the QComboBox for the battery critical level action changed,
- * used to hide/show the related QSpinboxes if needed.
+ * 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() {
kdDebugFuncIn(trace);
@@ -1767,31 +1767,31 @@ void ConfigureDialog::pB_configNotify_released( ) {
/* ---- START helper functions SECTION ---- */
/*!
* Map the key from config for a action to a descriptive name.
- * \param action QString with the config key value
- * \return QString with the description
+ * \param action TQString with the config key value
+ * \return TQString with the description
*/
-QString ConfigureDialog::mapActionToDescription( QString action ) {
+TQString ConfigureDialog::mapActionToDescription( TQString action ) {
kdDebugFuncIn(trace);
- QString ret;
+ TQString ret;
if (action.startsWith("SHUTDOWN")) {
ret = i18n("Shutdown");
} else if (action.startsWith("LOGOUT_DIALOG")) {
ret = i18n("Logout Dialog");
} else if (action.startsWith("SUSPEND2DISK")) {
- if (actions.contains("Suspend to Disk"))
+ if (actions.tqcontains("Suspend to Disk"))
ret = i18n("Suspend to Disk");
} else if (action.startsWith("SUSPEND2RAM")) {
- if (actions.contains("Suspend to RAM"))
+ if (actions.tqcontains("Suspend to RAM"))
ret = i18n("Suspend to RAM");
- } else if (action.startsWith("CPUFREQ_POWERSAVE")) {
+ } else if (action.startsWith("CPUFRETQ_POWERSAVE")) {
if (hwinfo->supportCPUFreq())
ret = i18n("CPU Powersave policy");
- } else if (action.startsWith("CPUFREQ_DYNAMIC")) {
+ } else if (action.startsWith("CPUFRETQ_DYNAMIC")) {
if (hwinfo->supportCPUFreq())
ret = i18n("CPU Dynamic policy");
- } else if (action.startsWith("CPUFREQ_PERFORMANCE")) {
+ } else if (action.startsWith("CPUFRETQ_PERFORMANCE")) {
if (hwinfo->supportCPUFreq())
ret = i18n("CPU Performance policy");
} else if (action.startsWith("BRIGHTNESS")) {
@@ -1804,14 +1804,14 @@ QString ConfigureDialog::mapActionToDescription( QString action ) {
}
/*!
- * Map the action description (maybe translated) back to a QString key for the config.
- * \param description QString with the description
- * \return QString with the config key value
+ * Map the action description (maybe translated) back to a TQString key for the config.
+ * \param description TQString with the description
+ * \return TQString with the config key value
*/
-QString ConfigureDialog::mapDescriptionToAction( QString description ) {
+TQString ConfigureDialog::mapDescriptionToAction( TQString description ) {
kdDebugFuncIn(trace);
- QString ret;
+ TQString ret;
if (description.startsWith("Shutdown") || description.startsWith(i18n("Shutdown"))) {
ret = "SHUTDOWN";
@@ -1826,13 +1826,13 @@ QString ConfigureDialog::mapDescriptionToAction( QString description ) {
ret = "SUSPEND2RAM";
} else if (description.startsWith("CPU Powersave policy") ||
description.startsWith(i18n("CPU Powersave policy"))) {
- ret = "CPUFREQ_POWERSAVE";
+ ret = "CPUFRETQ_POWERSAVE";
} else if (description.startsWith("CPU Dynamic policy") ||
description.startsWith(i18n("CPU Dynamic policy"))) {
- ret = "CPUFREQ_DYNAMIC";
+ ret = "CPUFRETQ_DYNAMIC";
} else if (description.startsWith("CPU Performance policy") ||
description.startsWith(i18n("CPU Performance policy"))) {
- ret = "CPUFREQ_PERFORMANCE";
+ ret = "CPUFRETQ_PERFORMANCE";
} else if (description.startsWith("Set Brightness to") ||
description.startsWith(i18n("Set Brightness to"))) {
ret = "BRIGHTNESS";
@@ -1843,21 +1843,21 @@ QString ConfigureDialog::mapDescriptionToAction( QString description ) {
}
/*!
- * Helper to fill a QComboBox with their text and select the correct item
- * \param _cb Pointer to the QComboBox
- * \param _actions QStringList with the allowed actions
- * \param _select QString with the action to select
+ * Helper to fill a TQComboBox with their text and select the correct item
+ * \param _cb Pointer to the TQComboBox
+ * \param _actions TQStringList with the allowed actions
+ * \param _select TQString with the action to select
*/
-void ConfigureDialog::fillActionComboBox(QComboBox *_cb, QStringList _actions, QString _select) {
+void ConfigureDialog::fillActionComboBox(TQComboBox *_cb, TQStringList _actions, TQString _select) {
kdDebugFuncIn(trace);
_cb->clear();
_cb->insertItem("");
- for ( QStringList::Iterator it = _actions.begin(); it != _actions.end(); ++it ) {
- QString _tmp = *it;
+ for ( TQStringList::Iterator it = _actions.begin(); it != _actions.end(); ++it ) {
+ TQString _tmp = *it;
- QString _desc = mapActionToDescription( _tmp );
+ TQString _desc = mapActionToDescription( _tmp );
if (!_desc.isEmpty()) {
_cb->insertItem( _desc );
if (_tmp == _select) {