diff options
Diffstat (limited to 'src/kpowersave.cpp')
-rw-r--r-- | src/kpowersave.cpp | 456 |
1 files changed, 228 insertions, 228 deletions
diff --git a/src/kpowersave.cpp b/src/kpowersave.cpp index 085753e..8e1e27b 100644 --- a/src/kpowersave.cpp +++ b/src/kpowersave.cpp @@ -31,14 +31,14 @@ #include <kpassivepopup.h> #include <kpopupmenu.h> -// other Qt headers: -#include <qcursor.h> -#include <qevent.h> -#include <qfile.h> -#include <qimage.h> -#include <qpixmap.h> -#include <qtimer.h> -#include <qtooltip.h> +// other TQt headers: +#include <tqcursor.h> +#include <tqevent.h> +#include <tqfile.h> +#include <tqimage.h> +#include <tqpixmap.h> +#include <tqtimer.h> +#include <tqtooltip.h> // own headers: #include "kpowersave.h" @@ -95,26 +95,26 @@ kpowersave::kpowersave( bool force_acpi_check, bool trace_func ) : KSystemTray(0 settings->batteryCriticalLevel); // connect to signals for changes - connect(hwinfo, SIGNAL(generalDataChanged()), this, SLOT(update())); - connect(hwinfo, SIGNAL(primaryBatteryChanged()), this, SLOT(update())); - connect(hwinfo, SIGNAL(ACStatus(bool)), this, SLOT(handleACStatusChange (bool))); - connect(hwinfo, SIGNAL(resumed(int)), this, SLOT(forwardResumeSignal(int))); + connect(hwinfo, TQT_SIGNAL(generalDataChanged()), this, TQT_SLOT(update())); + connect(hwinfo, TQT_SIGNAL(primaryBatteryChanged()), this, TQT_SLOT(update())); + connect(hwinfo, TQT_SIGNAL(ACtqStatus(bool)), this, TQT_SLOT(handleACStatusChange (bool))); + connect(hwinfo, TQT_SIGNAL(resumed(int)), this, TQT_SLOT(forwardResumeSignal(int))); // connect to error mesages - connect(autoSuspend, SIGNAL(displayErrorMsg(QString)), this, SLOT(showErrorMessage(QString))); - connect(hwinfo, SIGNAL(halRunning(bool)), this, SLOT(showHalErrorMsg())); - connect(hwinfo, SIGNAL(dbusRunning(int)), this, SLOT(showDBusErrorMsg(int))); + connect(autoSuspend, TQT_SIGNAL(displayErrorMsg(TQString)), this, TQT_SLOT(showErrorMessage(TQString))); + connect(hwinfo, TQT_SIGNAL(halRunning(bool)), this, TQT_SLOT(showHalErrorMsg())); + connect(hwinfo, TQT_SIGNAL(dbusRunning(int)), this, TQT_SLOT(showDBusErrorMsg(int))); // connect to events - connect(hwinfo, SIGNAL(lidcloseStatus(bool)), this, SLOT(handleLidEvent(bool))); - connect(hwinfo, SIGNAL(powerButtonPressed()), this, SLOT (handlePowerButtonEvent())); - connect(hwinfo, SIGNAL(sleepButtonPressed()), this, SLOT (handleSleepButtonEvent())); - connect(hwinfo, SIGNAL(s2diskButtonPressed()), this, SLOT (handleS2DiskButtonEvent())); - connect(hwinfo, SIGNAL(batteryWARNState(int,int)), this, SLOT(notifyBatteryStatusChange (int,int))); - connect(hwinfo, SIGNAL(desktopSessionIsActive(bool)), this, SLOT (handleSessionState(bool))); - connect(autoSuspend, SIGNAL(inactivityTimeExpired()), this, SLOT(do_autosuspendWarn())); - connect(autoDimm, SIGNAL(inactivityTimeExpired()), this, SLOT(do_downDimm())); - connect(autoDimm, SIGNAL(UserIsActiveAgain()), this, SLOT(do_upDimm())); + connect(hwinfo, TQT_SIGNAL(lidclosetqStatus(bool)), this, TQT_SLOT(handleLidEvent(bool))); + connect(hwinfo, TQT_SIGNAL(powerButtonPressed()), this, TQT_SLOT (handlePowerButtonEvent())); + connect(hwinfo, TQT_SIGNAL(sleepButtonPressed()), this, TQT_SLOT (handleSleepButtonEvent())); + connect(hwinfo, TQT_SIGNAL(s2diskButtonPressed()), this, TQT_SLOT (handleS2DiskButtonEvent())); + connect(hwinfo, TQT_SIGNAL(batteryWARNState(int,int)), this, TQT_SLOT(notifyBatteryStatusChange (int,int))); + connect(hwinfo, TQT_SIGNAL(desktopSessionIsActive(bool)), this, TQT_SLOT (handleSessionState(bool))); + connect(autoSuspend, TQT_SIGNAL(inactivityTimeExpired()), this, TQT_SLOT(do_autosuspendWarn())); + connect(autoDimm, TQT_SIGNAL(inactivityTimeExpired()), this, TQT_SLOT(do_downDimm())); + connect(autoDimm, TQT_SIGNAL(UserIsActiveAgain()), this, TQT_SLOT(do_upDimm())); config->sync(); @@ -131,13 +131,13 @@ kpowersave::kpowersave( bool force_acpi_check, bool trace_func ) : KSystemTray(0 pixmap_name = "NONE"; suspendType = "NULL"; - BAT_WARN_ICON_Timer = new QTimer(this); - connect(BAT_WARN_ICON_Timer, SIGNAL(timeout()), this, SLOT(do_setIconBG())); + BAT_WARN_ICON_Timer = new TQTimer(this); + connect(BAT_WARN_ICON_Timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(do_setIconBG())); - DISPLAY_HAL_ERROR_Timer = new QTimer(this); - connect(DISPLAY_HAL_ERROR_Timer, SIGNAL(timeout()), this, SLOT(showHalErrorMsg())); + DISPLAY_HAL_ERROR_Timer = new TQTimer(this); + connect(DISPLAY_HAL_ERROR_Timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(showHalErrorMsg())); - AUTODIMM_Timer = new QTimer(this); + AUTODIMM_Timer = new TQTimer(this); initMenu(); update(); @@ -167,76 +167,76 @@ kpowersave::~kpowersave(){ void kpowersave::initMenu() { kdDebugFuncIn(trace); - CONFIGURE_ID = this->contextMenu()->insertItem(SmallIcon("configure", QIconSet::Automatic), + CONFIGURE_ID = this->contextMenu()->insertItem(SmallIcon("configure", TQIconSet::Automatic), i18n("Configure KPowersave..."), - this, SLOT(showConfigureDialog())); - CONFIGURE_EVENTS_ID = this->contextMenu()->insertItem(SmallIcon("knotify", QIconSet::Automatic), + this, TQT_SLOT(showConfigureDialog())); + CONFIGURE_EVENTS_ID = this->contextMenu()->insertItem(SmallIcon("knotify", TQIconSet::Automatic), i18n("Configure Notifications..."), - this, SLOT(showConfigureNotificationsDialog())); + this, TQT_SLOT(showConfigureNotificationsDialog())); #ifdef ENABLE_YAST_ENTRY - YAST_MODULE_MENU_ID = this->contextMenu()->insertItem(SmallIcon("yast", QIconSet::Automatic), + YAST_MODULE_MENU_ID = this->contextMenu()->insertItem(SmallIcon("yast", TQIconSet::Automatic), i18n("Start YaST2 Power Management Module..."), - this, SLOT(do_config())); + this, TQT_SLOT(do_config())); #endif SLEEP_SEPARATOR_MENU_ID = this->contextMenu()->insertSeparator(); SUSPEND2DISK_MENU_ID = this->contextMenu()->insertItem( SmallIconSet("suspend_to_disk", - QIconSet::Automatic), + TQIconSet::Automatic), i18n("Suspend to Disk"), this, - SLOT(do_suspend2disk())); + TQT_SLOT(do_suspend2disk())); SUSPEND2RAM_MENU_ID = this->contextMenu()->insertItem( SmallIconSet("suspend_to_ram", - QIconSet::Automatic), + TQIconSet::Automatic), i18n("Suspend to RAM"), this, - SLOT(do_suspend2ram())); - STANDBY_MENU_ID = this->contextMenu()->insertItem( SmallIconSet("stand_by", QIconSet::Automatic), - i18n("Standby"), this, SLOT(do_standby())); + TQT_SLOT(do_suspend2ram())); + STANDBY_MENU_ID = this->contextMenu()->insertItem( SmallIconSet("stand_by", TQIconSet::Automatic), + i18n("Standby"), this, TQT_SLOT(do_standby())); - speed_menu = new QPopupMenu(this, i18n("Set CPU Frequency Policy").ascii()); + speed_menu = new TQPopupMenu(this, i18n("Set CPU Frequency Policy").ascii()); speed_menu->insertItem(i18n("Performance"), PERFORMANCE); speed_menu->insertItem(i18n("Dynamic"), DYNAMIC); speed_menu->insertItem(i18n("Powersave"), POWERSAVE); - CPUFREQ_SEPARATOR_MENU_ID = contextMenu()->insertSeparator(); + CPUFRETQ_SEPARATOR_MENU_ID = contextMenu()->insertSeparator(); - CPUFREQ_MENU_ID = contextMenu()->insertItem(i18n("Set CPU Frequency Policy"), speed_menu); - connect(speed_menu, SIGNAL(activated(int)), this, SLOT(do_setSpeedPolicy(int))); - connect(hwinfo, SIGNAL(currentCPUFreqPolicyChanged()), this, SLOT(updateCPUFreqMenu())); + CPUFRETQ_MENU_ID = contextMenu()->insertItem(i18n("Set CPU Frequency Policy"), speed_menu); + connect(speed_menu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(do_setSpeedPolicy(int))); + connect(hwinfo, TQT_SIGNAL(currentCPUFreqPolicyChanged()), this, TQT_SLOT(updateCPUFreqMenu())); SCHEME_SEPARATOR_MENU_ID = contextMenu()->insertSeparator(); - scheme_menu = new QPopupMenu(this, i18n("Set Active Scheme").ascii()); + scheme_menu = new TQPopupMenu(this, i18n("Set Active Scheme").ascii()); SCHEME_MENU_ID = contextMenu()->insertItem(i18n("Set Active Scheme"), scheme_menu); - connect(scheme_menu, SIGNAL(activated(int)), this, SLOT(do_setActiveScheme(int))); + connect(scheme_menu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(do_setActiveScheme(int))); // menu entry for the autosuspend disable checkbox, disabled by default, only // displayed if autosuspend for the current scheme is activated AUTOSUSPEND_SEPARATOR_MENU_ID = contextMenu()->insertSeparator(); AUTOSUSPEND_MENU_ID = this->contextMenu()->insertItem( i18n("Disable Actions on Inactivity"), - this,SLOT(do_setAutosuspend())); + this,TQT_SLOT(do_setAutosuspend())); this->contextMenu()->setItemVisible(AUTOSUSPEND_SEPARATOR_MENU_ID, false); this->contextMenu()->setItemVisible(AUTOSUSPEND_MENU_ID, false); HELP_SEPARATOR_MENU_ID = contextMenu()->insertSeparator(); - help_menu = new QPopupMenu(this, i18n("&Help").ascii()); + help_menu = new TQPopupMenu(this, i18n("&Help").ascii()); - help_menu->insertItem( SmallIcon("help", QIconSet::Automatic), i18n("&KPowersave Handbook"), - this, SLOT(slotHelp())); + help_menu->insertItem( SmallIcon("help", TQIconSet::Automatic), i18n("&KPowersave Handbook"), + this, TQT_SLOT(slotHelp())); help_menu->insertSeparator(); - help_menu->insertItem( i18n("&Report a bug ..."), this, SLOT(slotReportBug())); - help_menu->insertItem( SmallIcon("kpowersave", QIconSet::Automatic), - i18n("&About KPowersave"), this, SLOT(slotAbout())); + help_menu->insertItem( i18n("&Report a bug ..."), this, TQT_SLOT(slotReportBug())); + help_menu->insertItem( SmallIcon("kpowersave", TQIconSet::Automatic), + i18n("&About KPowersave"), this, TQT_SLOT(slotAbout())); - HELP_MENU = contextMenu()->insertItem(SmallIcon("help", QIconSet::Automatic), + HELP_MENU = contextMenu()->insertItem(SmallIcon("help", TQIconSet::Automatic), i18n("&Help"), help_menu); - connect(this, SIGNAL(quitSelected()), this, SLOT(_quit())); + connect(this, TQT_SIGNAL(quitSelected()), this, TQT_SLOT(_quit())); kdDebugFuncOut(trace); } -void kpowersave::resizeEvent ( QResizeEvent * ) +void kpowersave::resizeEvent ( TQResizeEvent * ) { // Honor Free Desktop specifications that allow for arbitrary system tray icon sizes loadIcon(); @@ -277,9 +277,9 @@ void kpowersave::showConfigureDialog() { configDlg = new ConfigureDialog(config, hwinfo, settings); configDlg->show(); config_dialog_shown = true; - connect(configDlg, SIGNAL(destroyed()), this, SLOT(observeConfigDlg())); - connect(configDlg, SIGNAL(openHelp()), this, SLOT(slotHelp())); - connect(configDlg, SIGNAL(openKNotify()), this, SLOT(showConfigureNotificationsDialog())); + connect(configDlg, TQT_SIGNAL(destroyed()), this, TQT_SLOT(observeConfigDlg())); + connect(configDlg, TQT_SIGNAL(openHelp()), this, TQT_SLOT(slotHelp())); + connect(configDlg, TQT_SIGNAL(openKNotify()), this, TQT_SLOT(showConfigureNotificationsDialog())); } else { KPassivePopup::message(i18n("WARNING"), i18n("Cannot find any schemes."), @@ -287,7 +287,7 @@ void kpowersave::showConfigureDialog() { i18n("Warning").ascii(), 15000); } } else { - configDlg->setWindowState(configDlg->windowState() & ~WindowMinimized | WindowActive); + configDlg->setWindowState(configDlg->windowState() & ~Qt::WindowMinimized | Qt::WindowActive); configDlg->setActiveWindow(); } @@ -313,40 +313,40 @@ void kpowersave::showConfigureNotificationsDialog() { void kpowersave::loadIcon(){ kdDebugFuncIn(trace); - QString pixmap_name_tmp = "NONE"; + TQString pixmap_name_tmp = "NONE"; BatteryCollection *primary = hwinfo->getPrimaryBatteries(); if (hwinfo->hal_terminated || !hwinfo->isOnline() ) { - pixmap_name_tmp = QString("ERROR"); + pixmap_name_tmp = TQString("ERROR"); } else if (hwinfo->getAcAdapter() || primary->getBatteryState() == BAT_NONE) { icon_set_colored = false; if (primary->getBatteryState() == BAT_NONE || (primary->getRemainingPercent() < 0 || primary->getRemainingPercent() >= 99)) - pixmap_name_tmp = QString("laptoppower"); + pixmap_name_tmp = TQString("laptoppower"); else - pixmap_name_tmp = QString("laptopcharge"); + pixmap_name_tmp = TQString("laptopcharge"); } else { switch(primary->getBatteryState()) { case BAT_CRIT: case BAT_LOW: - if (icon_BG_is_colored) pixmap_name_tmp = QString("laptopbattery"); - else pixmap_name_tmp = QString("laptopbatteryRED"); + if (icon_BG_is_colored) pixmap_name_tmp = TQString("laptopbattery"); + else pixmap_name_tmp = TQString("laptopbatteryRED"); icon_BG_is_colored = !icon_BG_is_colored; icon_set_colored = true; break; case BAT_WARN: - if (icon_BG_is_colored) pixmap_name_tmp = QString("laptopbattery"); - else pixmap_name_tmp = QString("laptopbatteryORANGE"); + if (icon_BG_is_colored) pixmap_name_tmp = TQString("laptopbattery"); + else pixmap_name_tmp = TQString("laptopbatteryORANGE"); icon_BG_is_colored = !icon_BG_is_colored; icon_set_colored = true; break; default: // if battery is discharging and not in warning, low or critical state - pixmap_name_tmp = QString("laptopbattery"); + pixmap_name_tmp = TQString("laptopbattery"); icon_set_colored = false; icon_BG_is_colored = false; } @@ -382,39 +382,39 @@ void kpowersave::drawIcon(){ BatteryCollection *primary = hwinfo->getPrimaryBatteries(); - QImage image = pixmap.convertToImage(); + TQImage image = pixmap.convertToImage(); int w = image.width(); int h = image.height(); int x, y; countWhiteIconPixel = 0; - if((pixmap_name.contains("laptopbattery") || pixmap_name.contains("charge")) && + if((pixmap_name.tqcontains("laptopbattery") || pixmap_name.tqcontains("charge")) && countWhiteIconPixel == 0) { for (x = 0; x < w; x++) for (y = 0; y < h; y++) - if(QColor(image.pixel(x, y)) == Qt::white) countWhiteIconPixel++; + if(TQColor(image.pixel(x, y)) == TQt::white) countWhiteIconPixel++; } int c = (countWhiteIconPixel * primary->getRemainingPercent()) / 100; if (c > 0) { uint ui; - QRgb Rgb_set; + TQRgb Rgb_set; if (hwinfo->getAcAdapter()) { - Rgb_set = qRgb(0x00, 0xff, 0x00); //green + Rgb_set = tqRgb(0x00, 0xff, 0x00); //green } else { switch(primary->getBatteryState()) { case BAT_CRIT: case BAT_LOW: - Rgb_set = qRgb(0xff, 0x00, 0x00);//red + Rgb_set = tqRgb(0xff, 0x00, 0x00);//red break; case BAT_WARN: - Rgb_set = qRgb(0xff, 0x55, 0x00); //orange + Rgb_set = tqRgb(0xff, 0x55, 0x00); //orange break; default: - Rgb_set = qRgb(0x00, 0xff, 0x00); //green + Rgb_set = tqRgb(0x00, 0xff, 0x00); //green } } if (image.depth() <= 8) { @@ -426,7 +426,7 @@ void kpowersave::drawIcon(){ for (y = h - 1; y >= 0; y--) { for (x = 0; x < w ; x++) { - if(QColor(image.pixel(x, y)) == Qt::white) { + if(TQColor(image.pixel(x, y)) == TQt::white) { image.setPixel(x, y, ui); c--; if (c <= 0) goto quit; @@ -457,7 +457,7 @@ void kpowersave::updateTooltip(){ int minutes = primary->getRemainingMinutes(); int charging_state = primary->getChargingState(); - QString tmp, num3; + TQString tmp, num3; num3.setNum(minutes % 60); num3 = num3.rightJustify(2, '0'); @@ -474,26 +474,26 @@ void kpowersave::updateTooltip(){ else if (minutes > 0){ if (charging_state == CHARGING) tmp = i18n("Plugged in -- %1% charged (%2:%3 h until full " - "charged)").arg(percent).arg(minutes / 60).arg(num3); + "charged)").tqarg(percent).tqarg(minutes / 60).tqarg(num3); else tmp = i18n("Plugged in -- %1% charged (%2:%3 remaining hours)") - .arg(percent).arg(minutes / 60).arg(num3); + .tqarg(percent).tqarg(minutes / 60).tqarg(num3); } else if (charging_state == CHARGING && hwinfo->hasAPM()) { - tmp = i18n("Plugged in -- %1% charged").arg(percent); + tmp = i18n("Plugged in -- %1% charged").tqarg(percent); } else{ if (percent == -1) tmp = i18n("Plugged in -- no battery"); - else tmp = i18n("Plugged in -- %1% charged").arg(percent); + else tmp = i18n("Plugged in -- %1% charged").tqarg(percent); } } } else{ if (minutes >= 0){ tmp = i18n("Running on batteries -- %1% charged (%2:%3 hours remaining)") - .arg(percent).arg(minutes / 60).arg(num3); + .tqarg(percent).tqarg(minutes / 60).tqarg(num3); } else { - tmp = i18n("Running on batteries -- %1% charged").arg(percent); + tmp = i18n("Running on batteries -- %1% charged").tqarg(percent); } } // add string whether battery is charging, but only if < 100% to avoid @@ -502,13 +502,13 @@ void kpowersave::updateTooltip(){ if (charging_state == CHARGING && percent < 100) tmp += i18n(" -- battery is charging"); - QToolTip::add(this, tmp); + TQToolTip::add(this, tmp); kdDebugFuncOut(trace); } /*! - * \b SLOT to starts the Yast2-power-management module. This called by the menuentry + * \b TQT_SLOT to starts the Yast2-power-management module. This called by the menuentry * with ID \ref YAST_MODULE_MENU_ID, named "Start YaST2 Power Management Module". * It create a new KProcess and execute "/sbin/yast2 power-management" with kdesu. */ @@ -521,8 +521,8 @@ void kpowersave::do_config(){ yast2 = new KProcess; *yast2 << "kdesu" << "--nonewdcop" << "/sbin/yast2" << "power-management"; - connect(yast2, SIGNAL(processExited(KProcess *)), - SLOT(slotConfigProcessExited(KProcess *))); + connect(yast2, TQT_SIGNAL(processExited(KProcess *)), + TQT_SLOT(slotConfigProcessExited(KProcess *))); if(!yast2->start(KProcess::NotifyOnExit)) { delete yast2; @@ -537,7 +537,7 @@ void kpowersave::do_config(){ } /*! - * \b SLOT to open the KPowersave help + * \b TQT_SLOT to open the KPowersave help */ void kpowersave::slotHelp() { @@ -545,7 +545,7 @@ void kpowersave::slotHelp() } /*! - * \b SLOT to open the KPowersave About dialog + * \b TQT_SLOT to open the KPowersave About dialog */ void kpowersave::slotAbout() { @@ -554,7 +554,7 @@ void kpowersave::slotAbout() } /*! - * \b SLOT to open the website to report bugs + * \b TQT_SLOT to open the website to report bugs */ void kpowersave::slotReportBug() { @@ -582,10 +582,10 @@ void kpowersave::slotReportBug() } /*! - * \b SLOT to set the icon background on/off if battery is in critical, low or warning-state. Within + * \b TQT_SLOT to set the icon background on/off if battery is in critical, low or warning-state. Within * this function we set \ref icon_state_changed to true and call \ref redrawPixmap() to redraw the * kickerapplet icon and create a icon with blinking background. \n \n - * The slot called by the QTimer \ref BAT_WARN_ICON_Timer . The interval of the timer is defined + * The slot called by the TQTimer \ref BAT_WARN_ICON_Timer . The interval of the timer is defined * trough \ref BAT_icon_BG_intervall and starts here: \ref loadIcon() . */ void kpowersave::do_setIconBG(){ @@ -597,7 +597,7 @@ void kpowersave::do_setIconBG(){ kdDebugFuncOut(trace); } /*! - * \b SLOT to enable/disable the autosuspend. + * \b TQT_SLOT to enable/disable the autosuspend. */ void kpowersave::do_setAutosuspend(){ kdDebugFuncIn(trace); @@ -622,7 +622,7 @@ void kpowersave::do_setAutosuspend(){ } /*! - * \b SLOT which called if the \ref configDlg is destroyed. We set within this SLOT + * \b TQT_SLOT which called if the \ref configDlg is destroyed. We set within this SLOT * \ref config_dialog_shown to false. * TODO: check if we maybe should force here the current default scheme depending on the AC/battery state */ @@ -648,7 +648,7 @@ void kpowersave::observeConfigDlg(){ } /*! - * \b SLOT which called from \ref do_config() if the 'kdesu yast2' KProcess exited. + * \b TQT_SLOT which called from \ref do_config() if the 'kdesu yast2' KProcess exited. * This function control the return value and display if needed a errormessage on failure. */ void kpowersave::slotConfigProcessExited(KProcess *proc){ @@ -679,7 +679,7 @@ void kpowersave::slotConfigProcessExited(KProcess *proc){ } /*! - * \b SLOT to send the command for "suspend to disk" to HAL daemon. + * \b TQT_SLOT to send the command for "suspend to disk" to HAL daemon. * If there is a error while "suspend to disk" the user get e messagebox. * This function need a running HAL daemon for "suspend to disk". * \return boolean with the result of the operation @@ -735,7 +735,7 @@ bool kpowersave::do_suspend2disk(){ } /*! - * \b SLOT to send the command for "suspend to RAM" to the HAL daemon. + * \b TQT_SLOT to send the command for "suspend to RAM" to the HAL daemon. * If there is a error while "suspend to RAM" the user get e messagebox. * This function need a running HAL daemon for "suspend to RAM". * \return boolean with the result of the operation @@ -791,7 +791,7 @@ bool kpowersave::do_suspend2ram(){ } /*! - * \b SLOT to send the command for "stand-by" to the HAL daemon. + * \b TQT_SLOT to send the command for "stand-by" to the HAL daemon. * If there is a error while "stand-by" the user get e messagebox. * This function need a running HAL daemon for "stand-by". * \return boolean with the result of the operation @@ -846,7 +846,7 @@ bool kpowersave::do_standby(){ } /*! - * \b SLOT to send check if we should display the warning dialog and display + * \b TQT_SLOT to send check if we should display the warning dialog and display * the dialog if needed or call directly autosuspend after the signal * \ref autosuspend::inactivityTimeExpired was recieved. */ @@ -856,7 +856,7 @@ void kpowersave::do_autosuspendWarn() { if (settings->autoSuspendCountdown && (settings->autoSuspendCountdownTimeout > 0)) { // we have to display the warn dialog if(!contextMenu()->isItemChecked(AUTOSUSPEND_MENU_ID)) { - QString message; + TQString message; countdown = new countDownDialog(settings->autoSuspendCountdownTimeout); @@ -873,12 +873,12 @@ void kpowersave::do_autosuspendWarn() { // TODO: rework this after translation round for openSUSE 10.3 ! message = i18n("Inactivity detected.") + " " + i18n("To stop the %1 press the 'Cancel' button before the countdown " - "expire.").arg(i18n("Autosuspend")) + "\n\n" + + "expire.").tqarg(i18n("Autosuspend")) + "\n\n" + i18n("The computer autosuspend in: "); countdown->setMessageText(message); - connect(countdown, SIGNAL(dialogClosed(bool)), this, SLOT(do_autosuspend(bool))); + connect(countdown, TQT_SIGNAL(dialogClosed(bool)), this, TQT_SLOT(do_autosuspend(bool))); countdown->showDialog(); } } else { @@ -889,7 +889,7 @@ void kpowersave::do_autosuspendWarn() { } /*! - * \b SLOT to send the related suspend command for autosuspend + * \b TQT_SLOT to send the related suspend command for autosuspend * \param chancel boolean with info if the autosuspend should get chanceld * \return boolean with the result of the operation * \retval true if successful @@ -930,7 +930,7 @@ bool kpowersave::do_autosuspend(bool chancel) { } /*! - * \b SLOT to dimm the display down to the configured level if the signal + * \b TQT_SLOT to dimm the display down to the configured level if the signal * \ref autodimm::inactivityTimeExpired was recieved. * \param * \return boolean with the result of the operation @@ -951,15 +951,15 @@ void kpowersave::do_downDimm() { autoDimmDown = true; - AUTODIMM_Timer = new QTimer(this); - connect(AUTODIMM_Timer, SIGNAL(timeout()), this, SLOT(do_dimm())); + AUTODIMM_Timer = new TQTimer(this); + connect(AUTODIMM_Timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(do_dimm())); AUTODIMM_Timer->start(timePerStep, false); } else { kdWarning() << "Don't dimm down, current level is already lower than requested Level" << endl; } } else { // wait until the timer is stopped, try later! - QTimer::singleShot(1500, this, SLOT(do_downDimm())); + TQTimer::singleShot(1500, this, TQT_SLOT(do_downDimm())); } } @@ -967,7 +967,7 @@ void kpowersave::do_downDimm() { } /*! - * \b SLOT to dimm the display up to the configured level if the signal + * \b TQT_SLOT to dimm the display up to the configured level if the signal * \ref autodimm::UserIsActiveAgain was recieved. * \param * \return boolean with the result of the operation @@ -990,8 +990,8 @@ void kpowersave::do_upDimm() { autoDimmDown = false; - AUTODIMM_Timer = new QTimer(this); - connect(AUTODIMM_Timer, SIGNAL(timeout()), this, SLOT(do_dimm())); + AUTODIMM_Timer = new TQTimer(this); + connect(AUTODIMM_Timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(do_dimm())); AUTODIMM_Timer->start(timePerStep, false); // start autodimm again @@ -1001,7 +1001,7 @@ void kpowersave::do_upDimm() { } } else { // wait until the timer is stopped, try later! - QTimer::singleShot(750, this, SLOT(do_downDimm())); + TQTimer::singleShot(750, this, TQT_SLOT(do_downDimm())); } } @@ -1010,7 +1010,7 @@ void kpowersave::do_upDimm() { /*! - * \b SLOT to dimm the display down + * \b TQT_SLOT to dimm the display down * \return boolean with the result of the operation * \retval true if successful * \retval false else @@ -1057,10 +1057,10 @@ bool kpowersave::handleMounts( bool suspend ) { if (trace) kdDebug() << funcinfo << "IN: " << "called suspend: " << suspend << endl; bool _ret = false; - QString _errormsg; + TQString _errormsg; if (settings->unmountExternalOnSuspend) { - QString _method; + TQString _method; DCOPRef dcop_ref = DCOPRef( "kded", "mediamanager" ); if (suspend) { @@ -1090,9 +1090,9 @@ bool kpowersave::handleMounts( bool suspend ) { // on resume a simple error msg should be enough if (!_ret && suspend) { // handle error case - QString _msg; - QString _e_msg; - QString _suspend; + TQString _msg; + TQString _e_msg; + TQString _suspend; if (!_errormsg.isEmpty()) { _e_msg = _errormsg; @@ -1104,13 +1104,13 @@ bool kpowersave::handleMounts( bool suspend ) { _msg = "<qt>" + i18n("Could not umount external media before suspend/standby. \n " "(Reason: %1)\n \n Would you like to continue suspend/standby " - "anyway? \n(Warning: Continue suspend can cause data loss!)").arg(_e_msg) + + "anyway? \n(Warning: Continue suspend can cause data loss!)").tqarg(_e_msg) + "</qt>"; _suspend = getSuspendString(calledSuspend); int answer = KMessageBox::questionYesNo( 0, _msg, - i18n("Error while prepare %1").arg(_suspend), + i18n("Error while prepare %1").tqarg(_suspend), i18n("Suspend anyway"), i18n("Cancel suspend"), "ignoreMountOnSuspend"); @@ -1168,7 +1168,7 @@ void kpowersave::handleS2DiskButtonEvent(){ } /*! - * \b SLOT to handle the lidclose event. If the screen get locked + * \b TQT_SLOT to handle the lidclose event. If the screen get locked * depends on the user specific settings. * \param closed boolean with info if the lid is closed or not */ @@ -1226,7 +1226,7 @@ void kpowersave::handleLidEvent( bool closed ){ } /*! - * \b SLOT to show the login dialog if the desktop was locked before the suspend. + * \b TQT_SLOT to show the login dialog if the desktop was locked before the suspend. */ void kpowersave::activateLoginScreen(){ kdDebugFuncIn(trace); @@ -1236,16 +1236,16 @@ void kpowersave::activateLoginScreen(){ settings->load_general_settings(); if(settings->timeToFakeKeyAfterLock >= 0) { - QTimer::singleShot(settings->timeToFakeKeyAfterLock, display, SLOT(fakeShiftKeyEvent())); + TQTimer::singleShot(settings->timeToFakeKeyAfterLock, display, TQT_SLOT(fakeShiftKeyEvent())); } kdDebugFuncOut(trace); } /*! - * \b SLOT to set the current suspend type for later use. + * \b TQT_SLOT to set the current suspend type for later use. */ -void kpowersave::setSuspendType( QString suspendtype){ +void kpowersave::setSuspendType( TQString suspendtype){ kdDebugFuncIn(trace); suspendType = suspendtype; @@ -1254,7 +1254,7 @@ void kpowersave::setSuspendType( QString suspendtype){ } /*! - * \b SLOT which called if kpowersave is exited by the user. In this case the user + * \b TQT_SLOT which called if kpowersave is exited by the user. In this case the user * is asked through a yes/no box if "KPowersave start automatically on log in" and the * result is written to the KDE configfile. */ @@ -1281,13 +1281,13 @@ void kpowersave::_quit (){ } // set, if this is a GNOME session, XScreensaver settings back to user default - QString session = getenv("DESKTOP_SESSION"); + TQString session = getenv("DESKTOP_SESSION"); if(session.startsWith("gnome")) { display->resetXScreensaver(); } if(!settings->autostartNeverAsk) { - QString tmp1 = i18n ("Start KPowersave automatically when you log in?"); + TQString tmp1 = i18n ("Start KPowersave automatically when you log in?"); int tmp2 = KMessageBox::questionYesNo ( 0, tmp1, i18n("Question"), i18n("Start Automatically"), i18n("Do Not Start")); config->setGroup("General"); @@ -1299,14 +1299,14 @@ void kpowersave::_quit (){ } /*! - * \b SLOT called if the user select a 'CPU Frequency Policy' from the menu ( \ref CPUFREQ_MENU_ID ). + * \b TQT_SLOT called if the user select a 'CPU Frequency Policy' from the menu ( \ref CPUFRETQ_MENU_ID ). */ void kpowersave::do_setSpeedPolicy(int menu_id){ if (trace) kdDebug() << funcinfo << "IN: " << "menu_id/set policy to: " << menu_id << endl; if(!hwinfo->setCPUFreq((cpufreq_type)menu_id, settings->cpuFreqDynamicPerformance)) { KPassivePopup::message(i18n("WARNING"), - i18n("CPU Freq Policy %1 could not be set.").arg(speed_menu->text(menu_id)), + i18n("CPU Freq Policy %1 could not be set.").tqarg(speed_menu->text(menu_id)), SmallIcon("messagebox_warning", 20), this, i18n("Warning").ascii(), 10000); } else { hwinfo->checkCurrentCPUFreqPolicy(); @@ -1317,7 +1317,7 @@ void kpowersave::do_setSpeedPolicy(int menu_id){ } /*! - * \b SLOT called if the user select a scheme from the menu. If there is any errormessage + * \b TQT_SLOT called if the user select a scheme from the menu. If there is any errormessage * while try to set the selected scheme, the user get a messagebox with info. */ void kpowersave::do_setActiveScheme( int i ){ @@ -1335,7 +1335,7 @@ void kpowersave::do_setActiveScheme( int i ){ notifySchemeSwitch(); } else if (!settings->schemes[i]){ KPassivePopup::message( i18n("WARNING"), - i18n("Scheme %1 could not be activated.").arg(scheme_menu->text(i)), + i18n("Scheme %1 could not be activated.").tqarg(scheme_menu->text(i)), SmallIcon("messagebox_warning", 20), this, i18n("Warning").ascii(), 5000); } @@ -1351,7 +1351,7 @@ void kpowersave::update(){ kdDebugFuncIn(trace); int redraw_pixmap = 0; - QString justMins; + TQString justMins; /* need to redraw pixmap in toolbar */ if (hwinfo->update_info_ac_changed){ @@ -1452,9 +1452,9 @@ void kpowersave::updateCPUFreqMenu(){ if (hwinfo->supportCPUFreq() && hwinfo->isOnline() && hwinfo->isCpuFreqAllowed()) { /* set CPU frequency menu entries *********/ /* speed menu has id 3 in context menu */ - contextMenu()->setItemVisible(CPUFREQ_MENU_ID, true); - contextMenu()->setItemEnabled(CPUFREQ_MENU_ID, true); - contextMenu()->setItemVisible(CPUFREQ_SEPARATOR_MENU_ID, true); + contextMenu()->setItemVisible(CPUFRETQ_MENU_ID, true); + contextMenu()->setItemEnabled(CPUFRETQ_MENU_ID, true); + contextMenu()->setItemVisible(CPUFRETQ_SEPARATOR_MENU_ID, true); switch (hwinfo->getCurrentCPUFreqPolicy()){ case PERFORMANCE: @@ -1478,13 +1478,13 @@ void kpowersave::updateCPUFreqMenu(){ if (!speed_menu) { return ; } else if (hwinfo->supportCPUFreq() && (hwinfo->isCpuFreqAllowed() != 1)) { - contextMenu()->setItemEnabled(CPUFREQ_MENU_ID, false); - contextMenu()->setItemVisible(CPUFREQ_SEPARATOR_MENU_ID, true); + contextMenu()->setItemEnabled(CPUFRETQ_MENU_ID, false); + contextMenu()->setItemVisible(CPUFRETQ_SEPARATOR_MENU_ID, true); } else{ /* there were CPU freq policies, but they are not accessible any more */ /* delete speed_menu */ - contextMenu()->setItemVisible(CPUFREQ_MENU_ID, false); - contextMenu()->setItemVisible(CPUFREQ_SEPARATOR_MENU_ID, false); + contextMenu()->setItemVisible(CPUFRETQ_MENU_ID, false); + contextMenu()->setItemVisible(CPUFRETQ_SEPARATOR_MENU_ID, false); } } @@ -1524,34 +1524,34 @@ void kpowersave::updateSchemeMenu(){ org_schemenames = settings->schemes; int x = 0; - for ( QStringList::iterator it = org_schemenames.begin(); it != org_schemenames.end(); ++it ) { + for ( TQStringList::iterator it = org_schemenames.begin(); it != org_schemenames.end(); ++it ) { - QString _t = *it; + TQString _t = *it; if ( *it == settings->ac_scheme ){ - scheme_menu->insertItem( SmallIcon("scheme_power", QIconSet::Automatic), - i18n( ((QString)*it).ascii() ), x, x); + scheme_menu->insertItem( SmallIcon("scheme_power", TQIconSet::Automatic), + i18n( ((TQString)*it).ascii() ), x, x); } else{ if ( *it == settings->battery_scheme ){ - scheme_menu->insertItem(SmallIcon("scheme_powersave", QIconSet::Automatic), + scheme_menu->insertItem(SmallIcon("scheme_powersave", TQIconSet::Automatic), i18n( (*it).ascii() ), x, x); } else{ - if ((QString)*it == "Acoustic"){ + if ((TQString)*it == "Acoustic"){ scheme_menu->insertItem(SmallIcon("scheme_acoustic", - QIconSet::Automatic), + TQIconSet::Automatic), i18n("Acoustic"), x, x); } - else if ((QString)*it == "Presentation"){ + else if ((TQString)*it == "Presentation"){ scheme_menu->insertItem(SmallIcon("scheme_presentation", - QIconSet::Automatic), + TQIconSet::Automatic), i18n("Presentation"), x, x); } - else if((QString)*it == "AdvancedPowersave") { + else if((TQString)*it == "AdvancedPowersave") { scheme_menu->insertItem(SmallIcon("scheme_advanced_powersave", - QIconSet::Automatic), + TQIconSet::Automatic), i18n( "Advanced Powersave" ), x, x); } else { @@ -1584,10 +1584,10 @@ void kpowersave::updateSchemeMenu(){ * enters the widget. In this case if the user move the mouse cursor over the kpowersave * trayicon. \n \n * We use this event to update the Tooltip with all needed information. The time beetween - * the event and the automatically popup of the QToolTip should be long enought to collect + * the event and the automatically popup of the TQToolTip should be long enought to collect * the needed values and add a updated Tooltip. */ -void kpowersave::enterEvent( QEvent */*qee*/ ){ +void kpowersave::enterEvent( TQEvent */*qee*/ ){ updateTooltip(); @@ -1599,14 +1599,14 @@ void kpowersave::enterEvent( QEvent */*qee*/ ){ * this will raise the brightness by one level for wheel up events and lower the * brightness by one level for wheel down events. */ -void kpowersave::wheelEvent (QWheelEvent *qwe) +void kpowersave::wheelEvent (TQWheelEvent *qwe) { kdDebugFuncIn(trace); if (!hwinfo->supportBrightness() && settings->brightness) return; - if (qwe->orientation () == Vertical) { + if (qwe->orientation () == Qt::Vertical) { if (qwe->delta() > 0) { do_brightnessUp(5); } else { @@ -1623,15 +1623,15 @@ void kpowersave::wheelEvent (QWheelEvent *qwe) * right and the left mousebutton activate the menu. In the future this can also used * to popup maybe a other menu. */ -void kpowersave::mousePressEvent(QMouseEvent *qme){ +void kpowersave::mousePressEvent(TQMouseEvent *qme){ kdDebugFuncIn(trace); KSystemTray::mousePressEvent(qme); if (hwinfo->isOnline()) { - if (qme->button() == RightButton){ + if (qme->button() == Qt::RightButton){ // TODO check if maybe some rechecks needed - this->contextMenu()->exec(QCursor::pos()); - } else if (qme->button() == LeftButton) { + this->contextMenu()->exec(TQCursor::pos()); + } else if (qme->button() == Qt::LeftButton) { showDetailedDialog(); } } @@ -1640,7 +1640,7 @@ void kpowersave::mousePressEvent(QMouseEvent *qme){ } /*! - * \b SLOT called if the detaileddialog is closed. With this we prevent open + * \b TQT_SLOT called if the detaileddialog is closed. With this we prevent open * the dialog twice, use this function to reset the used variables. */ void kpowersave::closedetaileddialog() { @@ -1648,7 +1648,7 @@ void kpowersave::closedetaileddialog() { } /*! - * \b SLOT used to display error messages related to D-Bus in kpowersave. This function + * \b TQT_SLOT used to display error messages related to D-Bus in kpowersave. This function * block all messeges which we have in kpowersave! * TODO: do something usefull */ @@ -1657,8 +1657,8 @@ void kpowersave::showDBusErrorMsg( int type ){ static bool displayed = false; - QString msg; - QString dlg_name; + TQString msg; + TQString dlg_name; switch (type) { case DBUS_RUNNING: @@ -1689,7 +1689,7 @@ void kpowersave::showDBusErrorMsg( int type ){ } /*! - * \b SLOT to display the HAL error message. We use this + * \b TQT_SLOT to display the HAL error message. We use this * function to delay the message, and prevent display them is HAL or * powersaved restarted. */ @@ -1727,10 +1727,10 @@ void kpowersave::showHalErrorMsg() { } /*! - * \b SLOT used to display messeges in kpowersave. This function + * \b TQT_SLOT used to display messeges in kpowersave. This function * block all messeges which we have in kpowersave! */ -void kpowersave::showErrorMessage( QString msg ){ +void kpowersave::showErrorMessage( TQString msg ){ kdDebugFuncIn(trace); if(settings->psMsgAsPassivePopup) { @@ -1869,7 +1869,7 @@ void kpowersave::setSchemeSettings(){ } /*! - * \b SLOT which called to set and start the autosuspend monitoring. + * \b TQT_SLOT which called to set and start the autosuspend monitoring. * \param resumed boolean value which represent information if machine * currently back from suspend/standby */ @@ -1887,8 +1887,8 @@ void kpowersave::setAutoSuspend( bool resumed ){ autoSuspend->stop(); delete autoSuspend; autoSuspend = new autosuspend(); - connect(autoSuspend, SIGNAL(inactivityTimeExpired()), this, - SLOT(do_autosuspendWarn())); + connect(autoSuspend, TQT_SIGNAL(inactivityTimeExpired()), this, + TQT_SLOT(do_autosuspendWarn())); } if (settings->autoSuspendCountdown && (settings->autoSuspendCountdownTimeout > 0)) { @@ -1921,7 +1921,7 @@ void kpowersave::setAutoSuspend( bool resumed ){ } /*! - * \b SLOT which called to set and start the autodimm monitoring. + * \b TQT_SLOT which called to set and start the autodimm monitoring. * \param resumed boolean value which represent information if machine * currently back from suspend/standby */ @@ -1938,8 +1938,8 @@ void kpowersave::setAutoDimm( bool resumed ){ autoDimm->stop(); delete autoDimm; autoDimm = new autodimm(); - connect(autoDimm, SIGNAL(inactivityTimeExpired()), this, SLOT(do_downDimm())); - connect(autoDimm, SIGNAL(UserIsActiveAgain()), this, SLOT(do_upDimm())); + connect(autoDimm, TQT_SIGNAL(inactivityTimeExpired()), this, TQT_SLOT(do_downDimm())); + connect(autoDimm, TQT_SIGNAL(UserIsActiveAgain()), this, TQT_SLOT(do_upDimm())); } if (settings->autoDimmSBlistEnabled) { @@ -1959,7 +1959,7 @@ void kpowersave::setAutoDimm( bool resumed ){ // -------- start KNotify functions ------------- // /*! - * \b SLOT called if a battery warning state reached and related signal recieved. + * \b TQT_SLOT called if a battery warning state reached and related signal recieved. * Here we emit the related KNotify event, if not disabled. * \param type integer with the type of the battery * \param state integer represent the reached battery state @@ -1990,7 +1990,7 @@ void kpowersave::notifyBatteryStatusChange ( int type, int state ) { if (!settings->disableNotifications) KNotifyClient::event(this->winId(), "battery_warning_event", i18n("Battery state changed to WARNING -- remaining time: " - "%1 hours and %2 minutes.").arg(min/60).arg(min%60)); + "%1 hours and %2 minutes.").tqarg(min/60).tqarg(min%60)); // set/call related actions handleActionCall(settings->batteryWarningLevelAction, settings->batteryWarningLevelActionValue); @@ -1999,7 +1999,7 @@ void kpowersave::notifyBatteryStatusChange ( int type, int state ) { if (!settings->disableNotifications) KNotifyClient::event(this->winId(), "battery_low_event", i18n("Battery state changed to LOW -- remaining time: " - "%1 hours and %2 minutes.").arg(min/60).arg(min%60)); + "%1 hours and %2 minutes.").tqarg(min/60).tqarg(min%60)); // set/call related actions handleActionCall(settings->batteryLowLevelAction, settings->batteryLowLevelActionValue); @@ -2014,9 +2014,9 @@ void kpowersave::notifyBatteryStatusChange ( int type, int state ) { "Shut down your system or plug in the power " "cable immediately. Otherwise the machine\n" "will go shutdown in 30 seconds") - .arg(min/ 60).arg(min%60)); + .tqarg(min/ 60).tqarg(min%60)); - QTimer::singleShot(30000, this, SLOT(handleCriticalBatteryActionCall())); + TQTimer::singleShot(30000, this, TQT_SLOT(handleCriticalBatteryActionCall())); } else { if (!settings->disableNotifications) KNotifyClient::event(this->winId(), "battery_critical_event", @@ -2024,7 +2024,7 @@ void kpowersave::notifyBatteryStatusChange ( int type, int state ) { "remaining time: %1 hours and %2 minutes.\n" "Shut down your system or plug in the power " "cable immediately.") - .arg(min/ 60).arg(min%60)); + .tqarg(min/ 60).tqarg(min%60)); handleActionCall(settings->batteryCriticalLevelAction, settings->batteryCriticalLevelActionValue); @@ -2043,7 +2043,7 @@ void kpowersave::notifyBatteryStatusChange ( int type, int state ) { /*! * Function to call the action for battery critical event. This is ugly, but - * because of QTimer::singleShot() can't take param ... + * because of TQTimer::singleShot() can't take param ... * NOTE: Use this only for SHUTDOWN atm */ void kpowersave::handleCriticalBatteryActionCall () { @@ -2080,21 +2080,21 @@ void kpowersave::handleActionCall ( action action, int value , bool checkAC, boo } break; case GO_SUSPEND2RAM: - QTimer::singleShot(100, this, SLOT(do_suspend2ram())); + TQTimer::singleShot(100, this, TQT_SLOT(do_suspend2ram())); break; case GO_SUSPEND2DISK: - QTimer::singleShot(100, this, SLOT(do_suspend2disk())); + TQTimer::singleShot(100, this, TQT_SLOT(do_suspend2disk())); break; case BRIGHTNESS: hwinfo->setBrightness( -1, value ); break; - case CPUFREQ_POWERSAVE: + case CPUFRETQ_POWERSAVE: hwinfo->setCPUFreq( POWERSAVE ); break; - case CPUFREQ_DYNAMIC: + case CPUFRETQ_DYNAMIC: hwinfo->setCPUFreq( DYNAMIC, settings->cpuFreqDynamicPerformance ); break; - case CPUFREQ_PERFORMANCE: + case CPUFRETQ_PERFORMANCE: hwinfo->setCPUFreq( PERFORMANCE ); break; case SWITCH_SCHEME: // not supported atm @@ -2126,7 +2126,7 @@ void kpowersave::handleActionCall ( action action, int value , bool checkAC, boo } /*! - * \b SLOT called if ac stated changed. Here we emit the related KNotify event. + * \b TQT_SLOT called if ac stated changed. Here we emit the related KNotify event. * and switch to the AC/battery scheme depending on the state of AC * \param acstate boolean represent the state of AC (true == AC plugged in ...) */ @@ -2148,9 +2148,9 @@ void kpowersave::handleACStatusChange ( bool acstate , bool notifyEvent ) { // handle switch to AC/battery default scheme if (acstate) { - index = settings->schemes.findIndex(settings->ac_scheme); + index = settings->schemes.tqfindIndex(settings->ac_scheme); } else { - index = settings->schemes.findIndex(settings->battery_scheme); + index = settings->schemes.tqfindIndex(settings->battery_scheme); } if (index != -1) @@ -2164,15 +2164,15 @@ void kpowersave::handleACStatusChange ( bool acstate , bool notifyEvent ) { } /*! - * \b SLOT called if scheme switched. Here we emit the related KNotify events + * \b TQT_SLOT called if scheme switched. Here we emit the related KNotify events * if they are not disabled. */ void kpowersave::notifySchemeSwitch() { kdDebugFuncIn(trace); if(!settings->disableNotifications) { - QString _scheme = settings->currentScheme; - QString eventType; + TQString _scheme = settings->currentScheme; + TQString eventType; if( _scheme != "Performance" && _scheme != "Powersave" && _scheme != "Acoustic" && _scheme != "Presentation" && _scheme != "AdvancedPowersave" ) @@ -2181,14 +2181,14 @@ void kpowersave::notifySchemeSwitch() { eventType = "scheme_" + _scheme; KNotifyClient::event( this->winId(), eventType, - i18n("Switched to scheme: %1").arg(i18n(_scheme.ascii())).ascii()); + i18n("Switched to scheme: %1").tqarg(i18n(_scheme.ascii())).ascii()); } kdDebugFuncOut(trace); } /*! - * \b SLOT called if the machine suspend. Here we emit the related KNotify events + * \b TQT_SLOT called if the machine suspend. Here we emit the related KNotify events * if they are not disabled. */ void kpowersave::notifySuspend( int suspendType ) { @@ -2220,7 +2220,7 @@ void kpowersave::notifySuspend( int suspendType ) { } /*! - * \b SLOT called to independent handleResumeSignal() from event loop and + * \b TQT_SLOT called to independent handleResumeSignal() from event loop and * to avoid problems with the QT3 D-Bus bindings */ void kpowersave::forwardResumeSignal( int result ) { @@ -2228,13 +2228,13 @@ void kpowersave::forwardResumeSignal( int result ) { resume_result = result; - QTimer::singleShot(100, this, SLOT(handleResumeSignal())); + TQTimer::singleShot(100, this, TQT_SLOT(handleResumeSignal())); kdDebugFuncOut(trace); } /*! - * \b SLOT called if the machine suspend. Here we emit the related KNotify events + * \b TQT_SLOT called if the machine suspend. Here we emit the related KNotify events * if they are not disabled. */ void kpowersave::handleResumeSignal() { @@ -2258,17 +2258,17 @@ void kpowersave::handleResumeSignal() { switch (calledSuspend) { case SUSPEND2DISK: KNotifyClient::event( this->winId(), "resume_from_suspend2disk_event", - i18n("System is resumed from %1.").arg( + i18n("System is resumed from %1.").tqarg( i18n("Suspend to Disk"))); break; case SUSPEND2RAM: KNotifyClient::event( this->winId(), "resume_from_suspend2ram_event", - i18n("System is resumed from %1.").arg( + i18n("System is resumed from %1.").tqarg( i18n("Suspend to RAM"))); break; case STANDBY: KNotifyClient::event( this->winId(), "resume_from_standby_event", - i18n("System is resumed from %1.").arg( + i18n("System is resumed from %1.").tqarg( i18n("Standby"))); break; default: @@ -2294,10 +2294,10 @@ void kpowersave::handleResumeSignal() { } } else { kdError() << "Unknown error while suspend. Errorcode: " << resume_result << endl; - QString msg; + TQString msg; msg = i18n("An unknown error occurred while %1. The errorcode is: '%2'"). - arg(getSuspendString(calledSuspend)).arg(resume_result); + tqarg(getSuspendString(calledSuspend)).tqarg(resume_result); #if defined(DISTRO_IS_SUSE) || defined(DISTRO_IS_SLES_SLED) || defined(DISTRO_IS_PARDUS) // okay we know this system use pm-utils and log is under /var/log/pm-suspend.log @@ -2328,7 +2328,7 @@ void kpowersave::handleResumeSignal() { #endif } #else - KMessageBox::error(0, msg, i18n("Error while %1").arg(getSuspendString(calledSuspend))); + KMessageBox::error(0, msg, i18n("Error while %1").tqarg(getSuspendString(calledSuspend))); #endif } // set back ... suspend is handled @@ -2339,7 +2339,7 @@ void kpowersave::handleResumeSignal() { } /*! - * \b SLOT called if the state of the current session change + * \b TQT_SLOT called if the state of the current session change * \param state boolean represent the state of the session * TODO: fix scheme handling * TODO: fix critical battery situations (see the todo file in the source) @@ -2370,9 +2370,9 @@ void kpowersave::handleSessionState (bool state) { /*! * Helper function to get a i18n name for a suspend type. * \param type Integer value with the suspend type - * \return QString with the translated name or NULL if it fail + * \return TQString with the translated name or NULL if it fail */ -QString kpowersave::getSuspendString (int type) { +TQString kpowersave::getSuspendString (int type) { kdDebugFuncIn(trace); switch (type) { @@ -2386,7 +2386,7 @@ QString kpowersave::getSuspendString (int type) { return i18n("Standby"); break; default: - return QString(); + return TQString(); } kdDebugFuncOut(trace); @@ -2413,9 +2413,9 @@ bool kpowersave::lockScreen(){ /*! * DCOP Interface funtion to return the name of the current powersave scheme. - * \return QString with the name of the current scheme + * \return TQString with the name of the current scheme */ -QString kpowersave::currentScheme (){ +TQString kpowersave::currentScheme (){ kdDebugFuncIn(trace); if(hwinfo->isOnline()) { @@ -2429,13 +2429,13 @@ QString kpowersave::currentScheme (){ /*! * DCOP Interface funtion to return the name of the current cpuFreqPolicy. - * \return QString with the name of the current cpuFreqPolicy + * \return TQString with the name of the current cpuFreqPolicy */ -QString kpowersave::currentCPUFreqPolicy() { +TQString kpowersave::currentCPUFreqPolicy() { kdDebugFuncIn(trace); if(hwinfo->isOnline()) { - QString _cpuFreq = ""; + TQString _cpuFreq = ""; switch (hwinfo->getCurrentCPUFreqPolicy()){ case PERFORMANCE: _cpuFreq = "PERFORMANCE"; @@ -2461,12 +2461,12 @@ QString kpowersave::currentCPUFreqPolicy() { /*! * DCOP Interface funtion to send a list with the allowed * CPU Frequency states. - * \return QStringList with the supported CPUFreq states + * \return TQStringList with the supported CPUFreq states */ -QStringList kpowersave::listCPUFreqPolicies() { +TQStringList kpowersave::listCPUFreqPolicies() { kdDebugFuncIn(trace); - QStringList ret_list; + TQStringList ret_list; if (hwinfo->isCpuFreqAllowed()) { ret_list.append("PERFORMANCE"); ret_list.append("DYNAMIC"); @@ -2482,13 +2482,13 @@ QStringList kpowersave::listCPUFreqPolicies() { /*! * DCOP Interface funtion to set the current CPUFreq policy - * \param policy QString with the policy to set, only values from + * \param policy TQString with the policy to set, only values from * list_CPUFreqPolicies are allowed (except "NOT SUPPORTED") * \return boolean with the result of set the requested CPUFreq policy * \retval true if successful set * \retval false if not supported or any other failure */ -bool kpowersave::do_setCPUFreqPolicy( QString policy ) { +bool kpowersave::do_setCPUFreqPolicy( TQString policy ) { if (trace) kdDebug() << funcinfo << "IN: " << "policy: " << policy << endl; @@ -2516,12 +2516,12 @@ bool kpowersave::do_setCPUFreqPolicy( QString policy ) { /*! * DCOP Interface funtion to send a list with the supported and enabled * sleeping states. - * \return QStringList with the supported spleeping states + * \return TQStringList with the supported spleeping states */ -QStringList kpowersave::allowed_sleepingStates(){ +TQStringList kpowersave::allowed_sleepingStates(){ kdDebugFuncIn(trace); - QStringList sleepList; + TQStringList sleepList; if(hwinfo->isOnline()) { if (suspend.suspend2disk && (suspend.suspend2disk_allowed || suspend.suspend2disk_allowed == -1)){ @@ -2548,12 +2548,12 @@ QStringList kpowersave::allowed_sleepingStates(){ /*! * DCOP Interface funtion to send a list with the all schemes. - * \return QStringList with all schemes + * \return TQStringList with all schemes */ -QStringList kpowersave::listSchemes(){ +TQStringList kpowersave::listSchemes(){ kdDebugFuncIn(trace); - QStringList _schemeList; + TQStringList _schemeList; if(hwinfo->isOnline()) { if (settings->schemes.count() > 0){ _schemeList = settings->schemes; @@ -2573,14 +2573,14 @@ QStringList kpowersave::listSchemes(){ * \return boolean with the result of set the requested scheme * \retval false if failed (e.g. scheme is not in the list) * \retval true if scheme found and set - * \param _scheme QString with the scheme to set, scheme should be + * \param _scheme TQString with the scheme to set, scheme should be * named as list from list_schemes() */ -bool kpowersave::do_setScheme( QString /*_scheme*/ ) { +bool kpowersave::do_setScheme( TQString /*_scheme*/ ) { kdDebugFuncIn(trace); /* int index; - index = settings->schemes.findIndex(_scheme); + index = settings->schemes.tqfindIndex(_scheme); if (index != -1) { do_setActiveScheme(index); @@ -2705,7 +2705,7 @@ void kpowersave::showDetailedDialog( ){ detailedIsShown = true; } - connect(detailedDlg, SIGNAL(destroyed()), this, SLOT(closedetaileddialog())); + connect(detailedDlg, TQT_SIGNAL(destroyed()), this, TQT_SLOT(closedetaileddialog())); kdDebugFuncOut(trace); } |