diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-23 01:42:07 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-23 01:42:07 +0000 |
commit | a2277b6bc715464e83882b90c2a058139b8a6b54 (patch) | |
tree | ab09b14014f59b4d8e2ddd12226aa0b22e4dfc5d /klaptopdaemon | |
parent | d3f79e04b34bd1f70a458b81b28fc8799498c8dc (diff) | |
download | tdeutils-a2277b6bc715464e83882b90c2a058139b8a6b54.tar.gz tdeutils-a2277b6bc715464e83882b90c2a058139b8a6b54.zip |
TQt4 port kdeutils
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeutils@1238125 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'klaptopdaemon')
49 files changed, 493 insertions, 475 deletions
diff --git a/klaptopdaemon/Makefile.am b/klaptopdaemon/Makefile.am index 8a2e737..a70a155 100644 --- a/klaptopdaemon/Makefile.am +++ b/klaptopdaemon/Makefile.am @@ -13,6 +13,7 @@ kded_klaptopdaemon_la_LDFLAGS = $(all_libraries) -module -avoid-version -lXtst kded_klaptopdaemon_la_LIBADD = $(LIB_KDEUI) $(LIB_XSS) libkcmlaptop.la klaptop_acpi_helper_SOURCES = acpi_helper.cpp +klaptop_acpi_helper_LDADD = $(LIB_QT) klaptop_check_SOURCES = laptop_check.cpp klaptop_check_LDFLAGS = $(all_libraries) @@ -41,7 +42,7 @@ dummy.cpp: noinst_PROGRAMS = makecrc makecrc_SOURCES = makecrc.cpp -makecrc_LDADD = $(LIBZ) +makecrc_LDADD = $(LIBZ) $(LIB_QT) crcresult.h: makecrc klaptop_acpi_helper ./makecrc >crcresult.h diff --git a/klaptopdaemon/acpi.cpp b/klaptopdaemon/acpi.cpp index 94bb124..d0fd472 100644 --- a/klaptopdaemon/acpi.cpp +++ b/klaptopdaemon/acpi.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1999, 2003 Paul Campbell <[email protected]> * - * Requires the Qt widget libraries, available at no cost at + * Requires the TQt widget libraries, available at no cost at * http://www.troll.no/ * * This program is free software; you can redistribute it and/or modify @@ -39,7 +39,7 @@ #include <kstandarddirs.h> #include <kprocess.h> -// other Qt headers: +// other TQt headers: #include <tqlayout.h> #include <tqlabel.h> #include <tqcheckbox.h> @@ -51,8 +51,8 @@ #include <tqtooltip.h> extern void wake_laptop_daemon(); -AcpiConfig::AcpiConfig (TQWidget * parent, const char *name) - : KCModule(parent, name) +AcpiConfig::AcpiConfig (TQWidget * tqparent, const char *name) + : KCModule(tqparent, name) { KGlobal::locale()->insertCatalogue("klaptopdaemon"); // For translation of klaptopdaemon messages @@ -63,7 +63,7 @@ AcpiConfig::AcpiConfig (TQWidget * parent, const char *name) TQLabel *tmp_label = new TQLabel( i18n("This panel provides information about your system's ACPI implementation " "and lets you have access to some of the extra features provided by ACPI"), this ); - tmp_label->setAlignment( Qt::WordBreak ); + tmp_label->tqsetAlignment( TQt::WordBreak ); top_layout->addWidget( tmp_label ); tmp_label = new TQLabel( i18n("NOTE: the Linux ACPI implementation is still a 'work in progress'. " @@ -73,12 +73,12 @@ AcpiConfig::AcpiConfig (TQWidget * parent, const char *name) "You should test these features very gingerly - save all your work, check them " "on and try a suspend/standby/hibernate from the popup menu on the battery icon " "in the panel if it fails to come back successfully uncheck the box again."), this ); - tmp_label->setAlignment( Qt::WordBreak ); + tmp_label->tqsetAlignment( TQt::WordBreak ); top_layout->addWidget( tmp_label ); tmp_label = new TQLabel( i18n("Some changes made on this page may require you to quit the laptop panel " "and start it again to take effect"), this ); - tmp_label->setAlignment( Qt::WordBreak ); + tmp_label->tqsetAlignment( TQt::WordBreak ); top_layout->addWidget( tmp_label ); bool can_enable = laptop_portable::has_acpi(1); // is helper ready @@ -132,7 +132,7 @@ AcpiConfig::AcpiConfig (TQWidget * parent, const char *name) "/proc/acpi/sleep writeable by anyone every time your system boots " "or use the button below to make the KDE ACPI helper application " "set-uid root"), this ); - tmp_label->setAlignment( Qt::WordBreak ); + tmp_label->tqsetAlignment( TQt::WordBreak ); top_layout->addWidget( tmp_label ); ll = new TQHBoxLayout(); TQPushButton *setupButton = new TQPushButton(i18n("Setup Helper Application"), this); @@ -145,7 +145,7 @@ AcpiConfig::AcpiConfig (TQWidget * parent, const char *name) top_layout->addStretch(1); - top_layout->addWidget( new TQLabel( i18n("Version: %1").arg(LAPTOP_VERSION), this), 0, Qt::AlignRight ); + top_layout->addWidget( new TQLabel( i18n("Version: %1").tqarg(LAPTOP_VERSION), this), 0, TQt::AlignRight ); load(); @@ -185,7 +185,7 @@ void AcpiConfig::setupHelper() KMessageBox::sorry(0, i18n("The ACPI helper cannot be enabled because kdesu cannot be found. Please make sure that it is installed correctly."), i18n("KLaptopDaemon")); } - laptop_portable::acpi_set_mask(enablestandby, enablesuspend, enablehibernate, enableperformance, enablethrottle); + laptop_portable::acpi_set_tqmask(enablestandby, enablesuspend, enablehibernate, enableperformance, enablethrottle); bool can_enable = laptop_portable::has_acpi(1); // is helper ready enableStandby->setEnabled(can_enable); enableSuspend->setEnabled(can_enable); @@ -206,7 +206,7 @@ void AcpiConfig::save() enablesoftwaresuspend = (enableSoftwareSuspendHibernate?enableSoftwareSuspendHibernate->isChecked():0); enableperformance = enablePerformance->isChecked(); enablethrottle = enableThrottle->isChecked(); - laptop_portable::acpi_set_mask(enablestandby, enablesuspend, enablehibernate, enableperformance, enablethrottle); + laptop_portable::acpi_set_tqmask(enablestandby, enablesuspend, enablehibernate, enableperformance, enablethrottle); config->setGroup("AcpiDefault"); diff --git a/klaptopdaemon/acpi.h b/klaptopdaemon/acpi.h index fc9b261..e98934b 100644 --- a/klaptopdaemon/acpi.h +++ b/klaptopdaemon/acpi.h @@ -3,7 +3,7 @@ * * Copyright (c) 2002 Paul Campbell <[email protected]> * - * Requires the Qt widget libraries, available at no cost at + * Requires the TQt widget libraries, available at no cost at * http://www.troll.no/ * * This program is free software; you can redistribute it and/or modify @@ -40,8 +40,9 @@ class TQPushButton; class AcpiConfig : public KCModule { Q_OBJECT + TQ_OBJECT public: - AcpiConfig( TQWidget *parent=0, const char* name=0); + AcpiConfig( TQWidget *tqparent=0, const char* name=0); ~AcpiConfig( ); void save( void ); diff --git a/klaptopdaemon/acpi_helper.cpp b/klaptopdaemon/acpi_helper.cpp index cf5c980..0640986 100644 --- a/klaptopdaemon/acpi_helper.cpp +++ b/klaptopdaemon/acpi_helper.cpp @@ -110,7 +110,7 @@ void run_program(const char *path, const int action) if ((err = stat(path, &sb)) != 0 || sb.st_mode&S_IWOTH) { if (err != 0) { - fprintf(stderr, "Can't find %s\n", path); + fprintf(stderr, "Can't tqfind %s\n", path); return; } else { fprintf(stderr, "%s is writeable by anyone - we don't trust it\n", path); diff --git a/klaptopdaemon/apm.cpp b/klaptopdaemon/apm.cpp index 397bbb6..228683f 100644 --- a/klaptopdaemon/apm.cpp +++ b/klaptopdaemon/apm.cpp @@ -4,7 +4,7 @@ * Copyright (c) 1999 Paul Campbell <[email protected]> * Copyright (c) 2002 Marc Mutz <[email protected]> * - * Requires the Qt widget libraries, available at no cost at + * Requires the TQt widget libraries, available at no cost at * http://www.troll.no/ * * This program is free software; you can redistribute it and/or modify @@ -40,7 +40,7 @@ #include <kstandarddirs.h> #include <kprocess.h> -// other Qt headers: +// other TQt headers: #include <tqlayout.h> #include <tqlabel.h> #include <tqcheckbox.h> @@ -51,8 +51,8 @@ #include <tqtooltip.h> extern void wake_laptop_daemon(); -ApmConfig::ApmConfig (TQWidget * parent, const char *name) - : KCModule(parent, name) +ApmConfig::ApmConfig (TQWidget * tqparent, const char *name) + : KCModule(tqparent, name) { KGlobal::locale()->insertCatalogue("klaptopdaemon"); // For translation of klaptopdaemon messages @@ -63,7 +63,7 @@ ApmConfig::ApmConfig (TQWidget * parent, const char *name) TQLabel *tmp_label = new TQLabel( i18n("This panel lets you configure your APM system and lets " "you have access to some of the extra features provided by it"), this ); - tmp_label->setAlignment( Qt::WordBreak ); + tmp_label->tqsetAlignment( TQt::WordBreak ); top_layout->addWidget( tmp_label ); tmp_label = new TQLabel( i18n("NOTE: some APM implementations have buggy suspend/standby " @@ -71,12 +71,12 @@ ApmConfig::ApmConfig (TQWidget * parent, const char *name) "all your work, check them on and try a suspend/standby from " "the popup menu on the battery icon in the panel if it fails to come " "back successfully uncheck the box again."), this ); - tmp_label->setAlignment( Qt::WordBreak ); + tmp_label->tqsetAlignment( TQt::WordBreak ); top_layout->addWidget( tmp_label ); tmp_label = new TQLabel( i18n("Some changes made on this page may require you to quit the laptop panel " "and start it again to take effect"), this ); - tmp_label->setAlignment( Qt::WordBreak ); + tmp_label->tqsetAlignment( TQt::WordBreak ); top_layout->addWidget( tmp_label ); bool can_enable = laptop_portable::has_apm(1); // is helper ready @@ -100,8 +100,8 @@ ApmConfig::ApmConfig (TQWidget * parent, const char *name) "ways you can enable this application, either make the file " "/proc/apm writeable by anyone every time your system boots " "or use the button below to make the %1 application " - "set-uid root").arg(apm_name), this ); - tmp_label->setAlignment( Qt::WordBreak ); + "set-uid root").tqarg(apm_name), this ); + tmp_label->tqsetAlignment( TQt::WordBreak ); top_layout->addWidget( tmp_label ); TQHBoxLayout *ll = new TQHBoxLayout(top_layout); TQPushButton *setupButton = new TQPushButton(i18n("Setup Helper Application"), this); @@ -114,7 +114,7 @@ ApmConfig::ApmConfig (TQWidget * parent, const char *name) tmp_label = new TQLabel( i18n("Your system seems to have 'Software Suspend' installed, this can " "be used to hibernate or 'suspend to disk' your system if you want " "to use this for hibernation check the box below"), this ); - tmp_label->setAlignment( Qt::WordBreak ); + tmp_label->tqsetAlignment( TQt::WordBreak ); top_layout->addWidget( tmp_label ); enableSoftwareSuspendHibernate = new TQCheckBox( i18n("Enable software suspend for hibernate"), this ); top_layout->addWidget( enableSoftwareSuspendHibernate ); @@ -126,7 +126,7 @@ ApmConfig::ApmConfig (TQWidget * parent, const char *name) "Suspend utility - KDE provides a utility to do this, if you " "wish to use it you must make it set-uid root, the button " "below will do this for you"), this ); - tmp_label->setAlignment( Qt::WordBreak ); + tmp_label->tqsetAlignment( TQt::WordBreak ); top_layout->addWidget( tmp_label ); ll = new TQHBoxLayout(this); TQPushButton *setupSSButton = new TQPushButton(i18n("Setup SS Helper Application"), this); @@ -141,7 +141,7 @@ ApmConfig::ApmConfig (TQWidget * parent, const char *name) top_layout->addStretch(1); - top_layout->addWidget( new TQLabel( i18n("Version: %1").arg(LAPTOP_VERSION), this), 0, Qt::AlignRight ); + top_layout->addWidget( new TQLabel( i18n("Version: %1").tqarg(LAPTOP_VERSION), this), 0, TQt::AlignRight ); load(); @@ -158,7 +158,7 @@ void ApmConfig::setupHelper() if (!kdesu.isEmpty()) { int rc = KMessageBox::warningContinueCancel(0, i18n("You will need to supply a root password " - "to allow the privileges of the %1 application to change.").arg(apm_name), + "to allow the privileges of the %1 application to change.").tqarg(apm_name), "KLaptopDaemon", KStdGuiItem::cont(), ""); if (rc == KMessageBox::Continue) { @@ -170,10 +170,10 @@ void ApmConfig::setupHelper() proc.start(KProcess::Block); // run it sync so has_apm below sees the results } } else { - KMessageBox::sorry(0, i18n("%1 cannot be enabled because kdesu cannot be found. Please make sure that it is installed correctly.").arg(TQString(apm_name)), + KMessageBox::sorry(0, i18n("%1 cannot be enabled because kdesu cannot be found. Please make sure that it is installed correctly.").tqarg(TQString(apm_name)), i18n("KLaptopDaemon")); } - laptop_portable::apm_set_mask(enablestandby, enablesuspend); + laptop_portable::apm_set_tqmask(enablestandby, enablesuspend); bool can_enable = laptop_portable::has_apm(1); // is helper ready enableStandby->setEnabled(can_enable); enableSuspend->setEnabled(can_enable); @@ -207,7 +207,7 @@ void ApmConfig::setupHelper2() // we use the acpi helper to do software suspend KMessageBox::sorry(0, i18n("The Software Suspend helper cannot be enabled because kdesu cannot be found. Please make sure that it is installed correctly."), i18n("KLaptopDaemon")); } - laptop_portable::software_suspend_set_mask(enablesoftwaresuspend); + laptop_portable::software_suspend_set_tqmask(enablesoftwaresuspend); bool can_enable = laptop_portable::has_software_suspend(2); // is helper ready enableSoftwareSuspendHibernate->setEnabled(can_enable); wake_laptop_daemon(); @@ -218,9 +218,9 @@ void ApmConfig::save() { enablestandby = enableStandby->isChecked(); enablesuspend = enableSuspend->isChecked(); - laptop_portable::apm_set_mask(enablestandby, enablesuspend); + laptop_portable::apm_set_tqmask(enablestandby, enablesuspend); enablesoftwaresuspend = (enableSoftwareSuspendHibernate ? enableSoftwareSuspendHibernate->isChecked():0); - laptop_portable::software_suspend_set_mask(enablesoftwaresuspend); + laptop_portable::software_suspend_set_tqmask(enablesoftwaresuspend); config->setGroup("ApmDefault"); diff --git a/klaptopdaemon/apm.h b/klaptopdaemon/apm.h index b6e6ed3..f99e726 100644 --- a/klaptopdaemon/apm.h +++ b/klaptopdaemon/apm.h @@ -3,7 +3,7 @@ * * Copyright (c) 2003 Paul Campbell <[email protected]> * - * Requires the Qt widget libraries, available at no cost at + * Requires the TQt widget libraries, available at no cost at * http://www.troll.no/ * * This program is free software; you can redistribute it and/or modify @@ -40,8 +40,9 @@ class TQPushButton; class ApmConfig : public KCModule { Q_OBJECT + TQ_OBJECT public: - ApmConfig( TQWidget *parent=0, const char* name=0); + ApmConfig( TQWidget *tqparent=0, const char* name=0); ~ApmConfig( ); void save( void ); diff --git a/klaptopdaemon/battery.cpp b/klaptopdaemon/battery.cpp index 0c337d7..6f1d7ab 100644 --- a/klaptopdaemon/battery.cpp +++ b/klaptopdaemon/battery.cpp @@ -5,7 +5,7 @@ * Copyright (c) 2002 Marc Mutz <[email protected]> * Copyright (c) 2006 Flavio Castelli <[email protected]> * - * Requires the Qt widget libraries, available at no cost at + * Requires the TQt widget libraries, available at no cost at * http://www.troll.no/ * * This program is free software; you can redistribute it and/or modify @@ -38,7 +38,7 @@ #include <kmessagebox.h> #include <krichtextlabel.h> -// other Qt headers: +// other TQt headers: #include <tqlayout.h> #include <tqlabel.h> #include <tqcheckbox.h> @@ -51,8 +51,8 @@ extern void wake_laptop_daemon(); -BatteryConfig::BatteryConfig (TQWidget * parent, const char *name) - : KCModule(parent, name), +BatteryConfig::BatteryConfig (TQWidget * tqparent, const char *name) + : KCModule(tqparent, name), editPoll(0), iconloader(0), buttonNoBattery(0), @@ -112,10 +112,10 @@ BatteryConfig::BatteryConfig (TQWidget * parent, const char *name) // group box to hold the icons together TQVGroupBox* icons_groupbox = new TQVGroupBox( i18n("Select Battery Icons"), this ); - icons_groupbox->layout()->setSpacing( KDialog::spacingHint() ); - top_layout->addWidget( icons_groupbox, 0, Qt::AlignLeft ); + icons_groupbox->tqlayout()->setSpacing( KDialog::spacingHint() ); + top_layout->addWidget( icons_groupbox, 0, TQt::AlignLeft ); - // layout to hold the icons inside the groupbox + // tqlayout to hold the icons inside the groupbox TQGrid *icon_grid = new TQGrid( 3 /*cols*/, icons_groupbox ); icon_grid->setSpacing( KDialog::spacingHint() ); @@ -140,7 +140,7 @@ BatteryConfig::BatteryConfig (TQWidget * parent, const char *name) TQHBoxLayout *hl = new TQHBoxLayout(); top_layout->addLayout(hl); - TQHGroupBox *hb = new TQHGroupBox(i18n("Current Battery Status"), this); + TQHGroupBox *hb = new TQHGroupBox(i18n("Current Battery tqStatus"), this); for (int i = 0; i < num_batteries; i++) { TQWidget *wp; @@ -171,7 +171,7 @@ BatteryConfig::BatteryConfig (TQWidget * parent, const char *name) } // TODO: remove linefeed from string, can't do it right now coz we have a string freeze - TQLabel* explain = new KRichTextLabel( i18n("This panel controls whether the battery status monitor\nappears in the system tray and what it looks like.").replace("\n"," "), this); + TQLabel* explain = new KRichTextLabel( i18n("This panel controls whether the battery status monitor\nappears in the system tray and what it looks like.").tqreplace("\n"," "), this); top_layout->addWidget(explain, 0); laptop_portable::extra_config(this, config, top_layout); } @@ -179,7 +179,7 @@ BatteryConfig::BatteryConfig (TQWidget * parent, const char *name) top_layout->addStretch(1); startMonitor = new TQPushButton( i18n("&Start Battery Monitor"), this); connect(startMonitor, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotStartMonitor())); - top_layout->addWidget( startMonitor, 0, Qt::AlignRight ); + top_layout->addWidget( startMonitor, 0, TQt::AlignRight ); load(); } @@ -283,7 +283,7 @@ void BatteryConfig::slotStartMonitor() { wake_laptop_daemon(); if (!enablemonitor) { - KMessageBox::information(0, i18n("<qt>The battery monitor has been started, but the tray icon is currently disabled. You can make it appear by selecting the <b>Show battery monitor</b> entry on this page and applying your changes.</qt>"), TQString::null, "howToEnableMonitor"); + KMessageBox::information(0, i18n("<qt>The battery monitor has been started, but the tray icon is currently disabled. You can make it appear by selecting the <b>Show battery monitor</b> entry on this page and applying your changes.</qt>"), TQString(), "howToEnableMonitor"); } } @@ -295,14 +295,14 @@ BatteryConfig::ConvertIcon(int percent, TQPixmap &pm, TQPixmap &result) int w = image.width(); int h = image.height(); int count = 0; - QRgb rgb; + TQRgb rgb; int x, y; for (x = 0; x < w; x++) for (y = 0; y < h; y++) { rgb = image.pixel(x, y); - if (qRed(rgb) == 0xff && - qGreen(rgb) == 0xff && - qBlue(rgb) == 0xff) + if (tqRed(rgb) == 0xff && + tqGreen(rgb) == 0xff && + tqBlue(rgb) == 0xff) count++; } int c = (count*percent)/100; @@ -315,7 +315,7 @@ BatteryConfig::ConvertIcon(int percent, TQPixmap &pm, TQPixmap &result) if (c) { uint ui; - QRgb blue = qRgb(0x00,0x00,0xff); + TQRgb blue = tqRgb(0x00,0x00,0xff); if (image.depth() <= 8) { ui = image.numColors(); // this fix thanks to Sven Krumpke @@ -328,9 +328,9 @@ BatteryConfig::ConvertIcon(int percent, TQPixmap &pm, TQPixmap &result) for (y = h-1; y >= 0; y--) for (x = 0; x < w; x++) { rgb = image.pixel(x, y); - if (qRed(rgb) == 0xff && - qGreen(rgb) == 0xff && - qBlue(rgb) == 0xff) { + if (tqRed(rgb) == 0xff && + tqGreen(rgb) == 0xff && + tqBlue(rgb) == 0xff) { image.setPixel(x, y, ui); c--; if (c <= 0) diff --git a/klaptopdaemon/battery.h b/klaptopdaemon/battery.h index 687f238..8500803 100644 --- a/klaptopdaemon/battery.h +++ b/klaptopdaemon/battery.h @@ -5,7 +5,7 @@ * Copyright (c) 2002 Marc Mutz <[email protected]> * Copyright (c) 2006 Flavio Castelli <[email protected]> * - * Requires the Qt widget libraries, available at no cost at + * Requires the TQt widget libraries, available at no cost at * http://www.troll.no/ * * This program is free software; you can redistribute it and/or modify @@ -45,8 +45,9 @@ class TQLabel; class BatteryConfig : public KCModule { Q_OBJECT + TQ_OBJECT public: - BatteryConfig( TQWidget *parent=0, const char* name=0); + BatteryConfig( TQWidget *tqparent=0, const char* name=0); ~BatteryConfig( ); void save( void ); diff --git a/klaptopdaemon/buttons.cpp b/klaptopdaemon/buttons.cpp index 3c05359..4c4c65d 100644 --- a/klaptopdaemon/buttons.cpp +++ b/klaptopdaemon/buttons.cpp @@ -4,7 +4,7 @@ * Copyright (c) 1999 Paul Campbell <[email protected]> * Copyright (c) 2002 Marc Mutz <[email protected]> * - * Requires the Qt widget libraries, available at no cost at + * Requires the TQt widget libraries, available at no cost at * http://www.troll.no/ * * This program is free software; you can redistribute it and/or modify @@ -44,8 +44,8 @@ #include <tqtooltip.h> extern void wake_laptop_daemon(); -ButtonsConfig::ButtonsConfig (TQWidget * parent, const char *name) - : KCModule(parent, name), +ButtonsConfig::ButtonsConfig (TQWidget * tqparent, const char *name) + : KCModule(tqparent, name), lidBox(0), lidStandby(0), lidSuspend(0), @@ -120,7 +120,7 @@ ButtonsConfig::ButtonsConfig (TQWidget * parent, const char *name) if (laptop_portable::has_button(laptop_portable::LidButton)) { lidBox = new TQVButtonGroup(i18n("Lid Switch Closed"), this); - lidBox->layout()->setSpacing( KDialog::spacingHint() ); + lidBox->tqlayout()->setSpacing( KDialog::spacingHint() ); TQToolTip::add( lidBox, i18n( "Select which actions will occur when the laptop's lid is closed" ) ); hlay->addWidget( lidBox ); @@ -196,7 +196,7 @@ ButtonsConfig::ButtonsConfig (TQWidget * parent, const char *name) if (laptop_portable::has_button(laptop_portable::PowerButton)) { powerBox = new TQVButtonGroup(i18n("Power Switch Pressed"), this); - powerBox->layout()->setSpacing( KDialog::spacingHint() ); + powerBox->tqlayout()->setSpacing( KDialog::spacingHint() ); TQToolTip::add( powerBox, i18n( "Select which actions will occur when the laptop's power button is pressed" ) ); hlay->addWidget( powerBox ); @@ -273,12 +273,12 @@ ButtonsConfig::ButtonsConfig (TQWidget * parent, const char *name) "or power switch on your laptop is pressed. Some laptops may already " "automatically do things like this, if you cannot disable them in your BIOS " "you probably should not enable anything in this panel."), this); - explain->setAlignment( Qt::WordBreak ); + explain->tqsetAlignment( TQt::WordBreak ); top_layout->addWidget(explain); top_layout->addStretch(1); - top_layout->addWidget( new TQLabel( i18n("Version: %1").arg(LAPTOP_VERSION), this ), 0, Qt::AlignRight ); + top_layout->addWidget( new TQLabel( i18n("Version: %1").tqarg(LAPTOP_VERSION), this ), 0, TQt::AlignRight ); } } diff --git a/klaptopdaemon/buttons.h b/klaptopdaemon/buttons.h index 6c548a0..9263f5f 100644 --- a/klaptopdaemon/buttons.h +++ b/klaptopdaemon/buttons.h @@ -3,7 +3,7 @@ * * Copyright (c) 1999 Paul Campbell <[email protected]> * - * Requires the Qt widget libraries, available at no cost at + * Requires the TQt widget libraries, available at no cost at * http://www.troll.no/ * * This program is free software; you can redistribute it and/or modify @@ -40,8 +40,9 @@ class KComboBox; class ButtonsConfig : public KCModule { Q_OBJECT + TQ_OBJECT public: - ButtonsConfig( TQWidget *parent=0, const char* name=0); + ButtonsConfig( TQWidget *tqparent=0, const char* name=0); ~ButtonsConfig(); void save( void ); void load(); diff --git a/klaptopdaemon/checkcrc.h b/klaptopdaemon/checkcrc.h index 149f28b..0538750 100644 --- a/klaptopdaemon/checkcrc.h +++ b/klaptopdaemon/checkcrc.h @@ -2,7 +2,7 @@ * checkcrc.h * * Copyright (c) 2003 Paul Campbell <[email protected]> - * Requires the Qt widget libraries, available at no cost at + * Requires the TQt widget libraries, available at no cost at * http://www.troll.no/ * * This program is free software; you can redistribute it and/or modify diff --git a/klaptopdaemon/daemon_state.cpp b/klaptopdaemon/daemon_state.cpp index 49d4ade..37db2ee 100644 --- a/klaptopdaemon/daemon_state.cpp +++ b/klaptopdaemon/daemon_state.cpp @@ -83,16 +83,16 @@ void daemon_state::load() bool enablehibernate = config->readBoolEntry("EnableHibernate", false); bool enableperformance = config->readBoolEntry("EnablePerformance", false); bool enablethrottle = config->readBoolEntry("EnableThrottle", false); - laptop_portable::acpi_set_mask(enablestandby, enablesuspend, enablehibernate, enableperformance, enablethrottle); + laptop_portable::acpi_set_tqmask(enablestandby, enablesuspend, enablehibernate, enableperformance, enablethrottle); config->setGroup("ApmDefault"); enablestandby = config->readBoolEntry("EnableStandby", false); enablesuspend = config->readBoolEntry("EnableSuspend", false); - laptop_portable::apm_set_mask(enablestandby, enablesuspend); + laptop_portable::apm_set_tqmask(enablestandby, enablesuspend); config->setGroup("SoftwareSuspendDefault"); enablehibernate = config->readBoolEntry("EnableHibernate", false); - laptop_portable::software_suspend_set_mask(enablehibernate); + laptop_portable::software_suspend_set_tqmask(enablehibernate); exists = laptop_portable::has_power_management(); has_brightness = laptop_portable::has_brightness(); diff --git a/klaptopdaemon/daemon_state.h b/klaptopdaemon/daemon_state.h index 3a0e4b3..a219c0a 100644 --- a/klaptopdaemon/daemon_state.h +++ b/klaptopdaemon/daemon_state.h @@ -56,9 +56,9 @@ public: int power_action[2]; // what to do when this action is triggered int power_brightness[2]; // which brightness level to switch to bool power_brightness_enabled[2]; // and whether to switch - QString power_performance[2]; // which performance level to switch to + TQString power_performance[2]; // which performance level to switch to bool power_performance_enabled[2]; // and whether to switch - QString power_throttle[2]; // which throttling level to switch to + TQString power_throttle[2]; // which throttling level to switch to bool power_throttle_enabled[2]; // and whether to switch bool lav_enabled[2]; // check LAV first float lav_val[2]; // don't act if higher than this @@ -81,9 +81,9 @@ public: bool do_brightness[2]; int val_brightness[2]; bool do_performance[2]; - QString val_performance[2]; + TQString val_performance[2]; bool do_throttle[2]; - QString val_throttle[2]; + TQString val_throttle[2]; bool time_based_action_low, time_based_action_critical; int low[4]; int poll; // how often to pol diff --git a/klaptopdaemon/daemondock.cpp b/klaptopdaemon/daemondock.cpp index a49f312..32ed524 100644 --- a/klaptopdaemon/daemondock.cpp +++ b/klaptopdaemon/daemondock.cpp @@ -48,13 +48,13 @@ #include <kiconeffect.h> extern void wake_laptop_daemon(); -laptop_dock::laptop_dock( laptop_daemon* parent ) +laptop_dock::laptop_dock( laptop_daemon* tqparent ) : KSystemTray() { setCaption(i18n("KLaptop Daemon")); KGlobal::locale()->insertCatalogue("klaptopdaemon"); // For translation of klaptopdaemon messages _pcmcia = NULL; - pdaemon = parent; + pdaemon = tqparent; current_code = -1; brightness_widget = 0; instance = new KInstance("klaptopdaemon"); @@ -202,7 +202,7 @@ laptop_dock::invokeBrightness() brightness_slider->setMinimumHeight(40); brightness_slider->setMinimumWidth(15); connect(brightness_slider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(invokeBrightnessSlider(int))); - brightness_widget->resize(brightness_widget->sizeHint()); + brightness_widget->resize(brightness_widget->tqsizeHint()); } else { brightness_slider->setValue(255-brightness); } @@ -215,7 +215,7 @@ laptop_dock::invokeBrightness() TQPoint pos = TQCursor::pos(); int x = pos.x(); int y = pos.y(); - y -= brightness_widget->geometry().height(); + y -= brightness_widget->tqgeometry().height(); int w = brightness_widget->width(); int h = brightness_widget->height(); if (x+w > sw) @@ -268,7 +268,7 @@ void laptop_dock::slotGoRoot(int /*id*/) { void laptop_dock::slotHide() { - int confirm = KMessageBox::questionYesNo(0, i18n("Are you sure you want to hide the battery monitor? Your battery will still be monitored in the background."), TQString::null, i18n("Hide Monitor"), i18n("Do Not Hide"), "hideConfirm"); + int confirm = KMessageBox::questionYesNo(0, i18n("Are you sure you want to hide the battery monitor? Your battery will still be monitored in the background."), TQString(), i18n("Hide Monitor"), i18n("Do Not Hide"), "hideConfirm"); if (confirm != KMessageBox::Yes) return; @@ -286,12 +286,12 @@ void laptop_dock::slotHide() { void laptop_dock::slotQuit() { - int confirm = KMessageBox::questionYesNo(0, i18n("Are you sure you want to quit the battery monitor?"), TQString::null, KStdGuiItem::quit(), KStdGuiItem::cancel(), "quitConfirm"); + int confirm = KMessageBox::questionYesNo(0, i18n("Are you sure you want to quit the battery monitor?"), TQString(), KStdGuiItem::quit(), KStdGuiItem::cancel(), "quitConfirm"); if (confirm != KMessageBox::Yes) return; - confirm = KMessageBox::questionYesNo(0, i18n("Do you wish to disable the battery monitor from starting in the future?"), TQString::null, i18n("Disable"), i18n("Keep Enabled"), "restartMonitor"); + confirm = KMessageBox::questionYesNo(0, i18n("Do you wish to disable the battery monitor from starting in the future?"), TQString(), i18n("Disable"), i18n("Keep Enabled"), "restartMonitor"); if (confirm == KMessageBox::Yes) { // just tell ourselves to hide the battery @@ -362,7 +362,7 @@ KPCMCIAInfo *f = new KPCMCIAInfo(_pcmcia); void laptop_dock::mousePressEvent( TQMouseEvent *event ) { - if(event->button() == LeftButton) { + if(event->button() == Qt::LeftButton) { TQPopupMenu *popup = new TQPopupMenu(0, "popup"); if (!pdaemon->exists()) { @@ -375,10 +375,10 @@ void laptop_dock::mousePressEvent( TQMouseEvent *event ) TQString num3; num3.setNum(pdaemon->left%60); num3 = num3.rightJustify(2, '0'); - tmp = i18n("%1:%2 hours left").arg(pdaemon->left/60).arg(num3); + tmp = i18n("%1:%2 hours left").tqarg(pdaemon->left/60).tqarg(num3); } else { // no remaining time available - tmp = i18n("%1% charged").arg(pdaemon->val); + tmp = i18n("%1% charged").tqarg(pdaemon->val); } } else { tmp = i18n("No Battery"); @@ -402,7 +402,7 @@ void laptop_dock::mousePressEvent( TQMouseEvent *event ) TQString speed = laptop_portable::cpu_frequency(); if (!speed.isEmpty()) { popup->insertSeparator(); - popup->insertItem(i18n("CPU: %1").arg(speed)); + popup->insertItem(i18n("CPU: %1").tqarg(speed)); } } @@ -449,7 +449,7 @@ void laptop_dock::mousePressEvent( TQMouseEvent *event ) // add a few bits of information thisSub->insertSeparator(); - thisSub->insertItem(slotname.arg(thiscard->num()+1)); + thisSub->insertItem(slotname.tqarg(thiscard->num()+1)); if (thiscard->status() & CARD_STATUS_READY) thisSub->insertItem(i18n("Ready")); if (thiscard->status() & CARD_STATUS_BUSY) @@ -469,15 +469,15 @@ void laptop_dock::mousePressEvent( TQMouseEvent *event ) } void laptop_dock::mouseReleaseEvent( TQMouseEvent *e ) { - if ( !rect().contains( e->pos() ) ) + if ( !TQT_TQRECT_OBJECT(rect()).tqcontains( e->pos() ) ) return; switch ( e->button() ) { - case LeftButton: + case Qt::LeftButton: break; - case MidButton: + case Qt::MidButton: // fall through - case RightButton: + case Qt::RightButton: { KPopupMenu *menu = contextMenu(); contextMenuAboutToShow( menu ); @@ -519,7 +519,7 @@ void laptop_dock::invokeLockSuspend() { DCOPClient* client = kapp->dcopClient(); if (client) - client->send("kdesktop", "KScreensaverIface", "lock()", ""); + client->send("kdesktop", "KScreensaverIface", "lock()", TQString("")); laptop_portable::invoke_suspend(); } @@ -568,23 +568,23 @@ void laptop_dock::displayPixmap() // at this point, we have the file to display. so display it TQImage image = pm.convertToImage(); - const TQBitmap *bmmask = pm.mask(); - TQImage mask; - if (bmmask) - mask = bmmask->convertToImage(); + const TQBitmap *bmtqmask = pm.tqmask(); + TQImage tqmask; + if (bmtqmask) + tqmask = bmtqmask->convertToImage(); int w = image.width(); int h = image.height(); int count = 0; - QRgb rgb; + TQRgb rgb; int x, y; for (x = 0; x < w; x++) for (y = 0; y < h; y++) - if (!bmmask || mask.pixelIndex(x, y) != 0){ + if (!bmtqmask || tqmask.pixelIndex(x, y) != 0){ rgb = image.pixel(x, y); - if (qRed(rgb) == 0xff && - qGreen(rgb) == 0xff && - qBlue(rgb) == 0xff) + if (tqRed(rgb) == 0xff && + tqGreen(rgb) == 0xff && + tqBlue(rgb) == 0xff) count++; } int c = (count*pdaemon->val)/100; @@ -597,7 +597,7 @@ void laptop_dock::displayPixmap() if (c) { uint ui; - QRgb blue = qRgb(0x00,0x00,0xff); + TQRgb blue = tqRgb(0x00,0x00,0xff); if (image.depth() <= 8) { ui = image.numColors(); // this fix thanks to Sven Krumpke @@ -609,11 +609,11 @@ void laptop_dock::displayPixmap() for (y = h-1; y >= 0; y--) for (x = 0; x < w; x++) - if (!bmmask || mask.pixelIndex(x, y) != 0){ + if (!bmtqmask || tqmask.pixelIndex(x, y) != 0){ rgb = image.pixel(x, y); - if (qRed(rgb) == 0xff && - qGreen(rgb) == 0xff && - qBlue(rgb) == 0xff) { + if (tqRed(rgb) == 0xff && + tqGreen(rgb) == 0xff && + tqBlue(rgb) == 0xff) { image.setPixel(x, y, ui); c--; if (c <= 0) @@ -641,10 +641,10 @@ quit: num3.setNum(pdaemon->left%60); num3 = num3.rightJustify(2, '0'); tmp = i18n("Plugged in - %1% charged (%2:%3 hours left)") - .arg(pdaemon->val).arg(pdaemon->left/60).arg(num3); + .tqarg(pdaemon->val).tqarg(pdaemon->left/60).tqarg(num3); } else { // no remaining time available - tmp = i18n("Plugged in - %1% charged").arg(pdaemon->val); + tmp = i18n("Plugged in - %1% charged").tqarg(pdaemon->val); } } else { tmp = i18n("Plugged in - no battery"); @@ -658,9 +658,9 @@ quit: num3.setNum(pdaemon->left%60); num3 = num3.rightJustify(2, '0'); tmp = i18n("Running on batteries - %1% charged (%2:%3 hours left)") - .arg(pdaemon->val).arg(pdaemon->left/60).arg(num3); + .tqarg(pdaemon->val).tqarg(pdaemon->left/60).tqarg(num3); } else { - tmp = i18n("Running on batteries - %1% charged").arg(pdaemon->val); + tmp = i18n("Running on batteries - %1% charged").tqarg(pdaemon->val); } } else { // running without any power source... @@ -708,7 +708,7 @@ quit: // and which has a transparent background. // Unfortunately this required the following twisted code because for some // reason text that is drawn on a transparent pixmap is invisible - // (apparently the alpha channel isn't changed when the text is drawn). + // (aptqparently the alpha channel isn't changed when the text is drawn). // Therefore I have to draw the text on a solid background and then remove // the background by making it transparent with TQPixmap::setMask. This // involves the slow createHeuristicMask() function (from the API docs: @@ -722,11 +722,11 @@ quit: // unread messages, but every other approach I tried failed miserably. // IK, 2003-09-22 TQPixmap percentagePixmap( oldPixmapWidth, oldPixmapHeight ); - percentagePixmap.fill( Qt::white ); + percentagePixmap.fill( TQt::white ); TQPainter p( &percentagePixmap ); p.setFont( percentageFont ); - p.setPen( Qt::black ); - p.drawText( percentagePixmap.rect(), Qt::AlignCenter, levelString ); + p.setPen( TQt::black ); + p.drawText( percentagePixmap.rect(), TQt::AlignCenter, levelString ); percentagePixmap.setMask( percentagePixmap.createHeuristicMask() ); TQImage percentageImage = percentagePixmap.convertToImage(); @@ -743,8 +743,8 @@ quit: { TQPixmap q; q.convertFromImage(image); - if (bmmask) - q.setMask(*bmmask); + if (bmtqmask) + q.setMask(*bmtqmask); setPixmap(q); } adjustSize(); diff --git a/klaptopdaemon/daemondock.h b/klaptopdaemon/daemondock.h index 5cb78c9..f16acaf 100644 --- a/klaptopdaemon/daemondock.h +++ b/klaptopdaemon/daemondock.h @@ -41,9 +41,10 @@ class KPopupMenu; class laptop_dock : public KSystemTray { Q_OBJECT + TQ_OBJECT public: - laptop_dock(laptop_daemon* parent); + laptop_dock(laptop_daemon* tqparent); ~laptop_dock(); void displayPixmap(); @@ -89,8 +90,8 @@ private: TQVBox *brightness_widget; TQSlider *brightness_slider; laptop_daemon *pdaemon; - QPixmap pm; - QPopupMenu *performance_popup, *throttle_popup; + TQPixmap pm; + TQPopupMenu *performance_popup, *throttle_popup; int current_code; KPCMCIA *_pcmcia; TQMap<int,KPCMCIACard *> _ejectActions, diff --git a/klaptopdaemon/kpcmcia.cpp b/klaptopdaemon/kpcmcia.cpp index 50d7b4c..762959b 100644 --- a/klaptopdaemon/kpcmcia.cpp +++ b/klaptopdaemon/kpcmcia.cpp @@ -175,7 +175,7 @@ tv.tv_sec = 0; tv.tv_usec = 0; TQTextStream ts(&f); bool foundit = false; TQString _thisreg = "^Socket %1: "; - TQRegExp thisreg ( _thisreg.arg(_num) ); + TQRegExp thisreg ( _thisreg.tqarg(_num) ); if (flock(f.handle(), LOCK_SH)) return updated; @@ -186,8 +186,8 @@ tv.tv_sec = 0; tv.tv_usec = 0; TQString s; if (ts.eof()) break; s = ts.readLine(); - if (s.contains(thisreg)) { - _cardname = s.right(s.length() - s.find(':') - 1); + if (s.tqcontains(thisreg)) { + _cardname = s.right(s.length() - s.tqfind(':') - 1); _cardname = _cardname.stripWhiteSpace(); foundit = true; CHECK_CHANGED(oldValues, _cardname); @@ -200,23 +200,23 @@ tv.tv_sec = 0; tv.tv_usec = 0; int end; s.simplifyWhiteSpace(); - end = s.find(TQRegExp("[ \r\t\n]")); + end = s.tqfind(TQRegExp("[ \r\t\n]")); s = s.remove(0, end+1); - end = s.find(TQRegExp("[ \r\t\n]")); + end = s.tqfind(TQRegExp("[ \r\t\n]")); _type = s; _type.truncate(end); s = s.remove(0, end+1); - end = s.find(TQRegExp("[ \r\t\n]")); + end = s.tqfind(TQRegExp("[ \r\t\n]")); _module = s; _module.truncate(end); s = s.remove(0, end+1); - end = s.find(TQRegExp("[ \r\t\n]")); + end = s.tqfind(TQRegExp("[ \r\t\n]")); s = s.remove(0, end+1); - end = s.find(TQRegExp("[ \r\t\n]")); + end = s.tqfind(TQRegExp("[ \r\t\n]")); _device = s; _device.truncate(end); s = s.remove(0, end+1); @@ -500,7 +500,7 @@ TQFile df("/proc/devices"); TQString thisreg; thisreg = "^[0-9]+ %1$"; - thisreg = thisreg.arg(x); + thisreg = thisreg.tqarg(x); if (df.open(IO_ReadOnly)) { TQTextStream t(&df); @@ -508,7 +508,7 @@ TQString thisreg; while (!t.eof()) { s = t.readLine(); - if (s.contains(TQRegExp(thisreg))) { + if (s.tqcontains(TQRegExp(thisreg))) { int n = (s.left(3).stripWhiteSpace()).toInt(); df.close(); return n; @@ -523,7 +523,7 @@ static int openDevice(dev_t dev) { TQString tmp_path = locateLocal("tmp", KGlobal::instance()->instanceName()); TQString ext = "_socket%1"; - tmp_path += ext.arg((int)dev); + tmp_path += ext.tqarg((int)dev); int rc = mknod(tmp_path.latin1(), (S_IFCHR | S_IREAD), dev); if (rc < 0) return -1; diff --git a/klaptopdaemon/kpcmcia.h b/klaptopdaemon/kpcmcia.h index 4480683..489d3e8 100644 --- a/klaptopdaemon/kpcmcia.h +++ b/klaptopdaemon/kpcmcia.h @@ -177,7 +177,8 @@ private: class KPCMCIA : public TQObject { -Q_OBJECT + Q_OBJECT + TQ_OBJECT public: KPCMCIA(int maxSlots = 8, const char *stabPath = "/var/run/stab"); diff --git a/klaptopdaemon/kpcmciainfo.cpp b/klaptopdaemon/kpcmciainfo.cpp index 3e91f2d..2b4c315 100644 --- a/klaptopdaemon/kpcmciainfo.cpp +++ b/klaptopdaemon/kpcmciainfo.cpp @@ -36,8 +36,8 @@ #include "kpcmciainfo.h" -KPCMCIAInfo::KPCMCIAInfo(KPCMCIA *pcmcia, TQWidget *parent, const char *name) - : KDialog(parent, name, false), _pcmcia(pcmcia) { +KPCMCIAInfo::KPCMCIAInfo(KPCMCIA *pcmcia, TQWidget *tqparent, const char *name) + : KDialog(tqparent, name, false), _pcmcia(pcmcia) { setMinimumSize(300,400); @@ -57,14 +57,14 @@ KPCMCIAInfo::KPCMCIAInfo(KPCMCIA *pcmcia, TQWidget *parent, const char *name) prepareCards(); - _mainTab->resize(KDialog::sizeHint()); - resize(KDialog::sizeHint()); + _mainTab->resize(KDialog::tqsizeHint()); + resize(KDialog::tqsizeHint()); connect(_pcmcia, TQT_SIGNAL(cardUpdated(int)), this, TQT_SLOT(updateCard(int))); _sb = new KStatusBar(this); _sb->insertItem(i18n("Ready."), 0, 1, true); - _sb->resize(KDialog::sizeHint()); + _sb->resize(KDialog::tqsizeHint()); _mainGrid->addMultiCellWidget(_sb, 8, 8, 0, 4); _mainGrid->setRowStretch(8, 0); @@ -91,7 +91,7 @@ void KPCMCIAInfo::showTab(int num) { } -void KPCMCIAInfo::slotResetStatus() { +void KPCMCIAInfo::slotResettqStatus() { _sb->changeItem(i18n("Ready."), 0); } @@ -99,12 +99,12 @@ void KPCMCIAInfo::slotResetStatus() { void KPCMCIAInfo::statusNotice(const TQString& text, int life) { _sb->changeItem(text, 0); if (life > 0) - TQTimer::singleShot(life, this, TQT_SLOT(slotResetStatus())); + TQTimer::singleShot(life, this, TQT_SLOT(slotResettqStatus())); } -void KPCMCIAInfo::slotTabSetStatus(const TQString& text) { +void KPCMCIAInfo::slotTabSettqStatus(const TQString& text) { statusNotice(text); } @@ -134,9 +134,9 @@ void KPCMCIAInfo::prepareCards() { TQString tabname = i18n("Card Slot %1"); KPCMCIAInfoPage *tp = new KPCMCIAInfoPage(_pcmcia->getCard(i), _mainTab); connect(this, TQT_SIGNAL(updateNow()), tp, TQT_SLOT(update())); - connect(tp, TQT_SIGNAL(setStatusBar(const TQString&)), this, TQT_SLOT(slotTabSetStatus(const TQString&))); - tp->resize(_mainTab->sizeHint()); - _mainTab->addTab(tp, tabname.arg(i+1)); + connect(tp, TQT_SIGNAL(setStatusBar(const TQString&)), this, TQT_SLOT(slotTabSettqStatus(const TQString&))); + tp->resize(_mainTab->tqsizeHint()); + _mainTab->addTab(tp, tabname.tqarg(i+1)); _pages.insert(i, tp); } } @@ -149,8 +149,8 @@ void KPCMCIAInfo::prepareCards() { /////////////////////////////////////////////////////////////////////////// -KPCMCIAInfoPage::KPCMCIAInfoPage(KPCMCIACard *card, TQWidget *parent, const char *name) - : TQFrame(parent, name), _card(card) { +KPCMCIAInfoPage::KPCMCIAInfoPage(KPCMCIACard *card, TQWidget *tqparent, const char *name) + : TQFrame(tqparent, name), _card(card) { _mainGrid = new TQGridLayout(this, 10, 10); if (!_card) { // display an error @@ -233,13 +233,13 @@ void KPCMCIAInfoPage::update() { if (_card) { TQString tmp; _card_name->setText(_card->name()); - _card_name->resize(_card_name->sizeHint()); + _card_name->resize(_card_name->tqsizeHint()); tmp = i18n("Card type: %1 "); - _card_type->setText(tmp.arg(_card->type())); - _card_type->resize(_card_type->sizeHint()); + _card_type->setText(tmp.tqarg(_card->type())); + _card_type->resize(_card_type->tqsizeHint()); tmp = i18n("Driver: %1"); - _card_driver->setText(tmp.arg(_card->driver())); - _card_driver->resize(_card_driver->sizeHint()); + _card_driver->setText(tmp.tqarg(_card->driver())); + _card_driver->resize(_card_driver->tqsizeHint()); tmp = i18n("IRQ: %1%2"); TQString tmp2; switch (_card->intType()) { @@ -256,33 +256,33 @@ void KPCMCIAInfoPage::update() { tmp2 = ""; }; if (_card->irq() <= 0) - _card_irq->setText(tmp.arg(i18n("none")).arg("")); - else _card_irq->setText(tmp.arg(_card->irq()).arg(tmp2)); - _card_irq->resize(_card_irq->sizeHint()); + _card_irq->setText(tmp.tqarg(i18n("none")).tqarg("")); + else _card_irq->setText(tmp.tqarg(_card->irq()).tqarg(tmp2)); + _card_irq->resize(_card_irq->tqsizeHint()); tmp = i18n("I/O port(s): %1"); if (_card->ports().isEmpty()) - _card_io->setText(tmp.arg(i18n("none"))); - else _card_io->setText(tmp.arg(_card->ports())); - _card_io->resize(_card_io->sizeHint()); + _card_io->setText(tmp.tqarg(i18n("none"))); + else _card_io->setText(tmp.tqarg(_card->ports())); + _card_io->resize(_card_io->tqsizeHint()); tmp = i18n("Bus: %1 bit %2"); if (_card->busWidth() == 0) _card_bus->setText(i18n("Bus: unknown")); - else _card_bus->setText(tmp.arg(_card->busWidth()).arg(_card->busWidth() == 16 ? i18n("PC Card") : i18n("Cardbus"))); - _card_bus->resize(_card_bus->sizeHint()); + else _card_bus->setText(tmp.tqarg(_card->busWidth()).tqarg(_card->busWidth() == 16 ? i18n("PC Card") : i18n("Cardbus"))); + _card_bus->resize(_card_bus->tqsizeHint()); tmp = i18n("Device: %1"); - _card_dev->setText(tmp.arg(_card->device())); - _card_dev->resize(_card_dev->sizeHint()); + _card_dev->setText(tmp.tqarg(_card->device())); + _card_dev->resize(_card_dev->tqsizeHint()); tmp = i18n("Power: +%1V"); - _card_vcc->setText(tmp.arg(_card->vcc()/10)); - _card_vcc->resize(_card_vcc->sizeHint()); + _card_vcc->setText(tmp.tqarg(_card->vcc()/10)); + _card_vcc->resize(_card_vcc->tqsizeHint()); tmp = i18n("Programming power: +%1V, +%2V"); - _card_vpp->setText(tmp.arg(_card->vpp()/10).arg(_card->vpp2()/10)); - _card_vpp->resize(_card_vpp->sizeHint()); + _card_vpp->setText(tmp.tqarg(_card->vpp()/10).tqarg(_card->vpp2()/10)); + _card_vpp->resize(_card_vpp->tqsizeHint()); tmp = i18n("Configuration base: 0x%1"); if (_card->configBase() == 0) _card_cfgbase->setText(i18n("Configuration base: none")); - else _card_cfgbase->setText(tmp.arg(_card->configBase(), -1, 16)); - _card_cfgbase->resize(_card_cfgbase->sizeHint()); + else _card_cfgbase->setText(tmp.tqarg(_card->configBase(), -1, 16)); + _card_cfgbase->resize(_card_cfgbase->tqsizeHint()); if (!(_card->status() & (CARD_STATUS_READY|CARD_STATUS_SUSPEND))) { _card_ej_ins->setText(i18n("&Insert")); diff --git a/klaptopdaemon/kpcmciainfo.h b/klaptopdaemon/kpcmciainfo.h index f4c49b0..f8700a2 100644 --- a/klaptopdaemon/kpcmciainfo.h +++ b/klaptopdaemon/kpcmciainfo.h @@ -39,9 +39,10 @@ class KPushButton; class KPCMCIAInfo : public KDialog { Q_OBJECT + TQ_OBJECT public: - KPCMCIAInfo(KPCMCIA *pcmcia, TQWidget *parent = NULL, const char *name = 0); + KPCMCIAInfo(KPCMCIA *pcmcia, TQWidget *tqparent = NULL, const char *name = 0); virtual ~KPCMCIAInfo(); void showTab(int num); @@ -51,8 +52,8 @@ public slots: void slotClose(); void update(); void updateCard(int num); - void slotResetStatus(); - void slotTabSetStatus(const TQString& text); + void slotResettqStatus(); + void slotTabSettqStatus(const TQString& text); signals: void updateNow(); @@ -77,8 +78,9 @@ class TQLabel; class KPCMCIAInfoPage : public TQFrame { Q_OBJECT + TQ_OBJECT public: - KPCMCIAInfoPage(KPCMCIACard *card, TQWidget *parent = NULL, const char *name = 0); + KPCMCIAInfoPage(KPCMCIACard *card, TQWidget *tqparent = NULL, const char *name = 0); virtual ~KPCMCIAInfoPage(); public slots: diff --git a/klaptopdaemon/krichtextlabel.cpp b/klaptopdaemon/krichtextlabel.cpp index 089635d..a604b0d 100644 --- a/klaptopdaemon/krichtextlabel.cpp +++ b/klaptopdaemon/krichtextlabel.cpp @@ -35,20 +35,20 @@ static TQString qrichtextify( const TQString& text ) *it = TQStyleSheet::convertFromPlainText( *it, TQStyleSheetItem::WhiteSpaceNormal ); } - return lines.join(TQString::null); + return lines.join(TQString()); } -KRichTextLabel::KRichTextLabel( const TQString &text , TQWidget *parent, const char *name ) - : TQLabel ( parent, name ) { - m_defaultWidth = QMIN(400, KGlobalSettings::desktopGeometry(this).width()*2/5); - setAlignment( Qt::WordBreak ); +KRichTextLabel::KRichTextLabel( const TQString &text , TQWidget *tqparent, const char *name ) + : TQLabel ( tqparent, name ) { + m_defaultWidth = TQMIN(400, KGlobalSettings::desktopGeometry(this).width()*2/5); + tqsetAlignment( TQt::WordBreak ); setText(text); } -KRichTextLabel::KRichTextLabel( TQWidget *parent, const char *name ) - : TQLabel ( parent, name ) { - m_defaultWidth = QMIN(400, KGlobalSettings::desktopGeometry(this).width()*2/5); - setAlignment( Qt::WordBreak ); +KRichTextLabel::KRichTextLabel( TQWidget *tqparent, const char *name ) + : TQLabel ( tqparent, name ) { + m_defaultWidth = TQMIN(400, KGlobalSettings::desktopGeometry(this).width()*2/5); + tqsetAlignment( TQt::WordBreak ); } void KRichTextLabel::setDefaultWidth(int defaultWidth) @@ -62,7 +62,7 @@ TQSizePolicy KRichTextLabel::sizePolicy() const return TQSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::Minimum, false); } -TQSize KRichTextLabel::minimumSizeHint() const +TQSize KRichTextLabel::tqminimumSizeHint() const { TQString qt_text = qrichtextify( text() ); int pref_width = 0; @@ -97,9 +97,9 @@ TQSize KRichTextLabel::minimumSizeHint() const return TQSize(pref_width, rt.height()); } -TQSize KRichTextLabel::sizeHint() const +TQSize KRichTextLabel::tqsizeHint() const { - return minimumSizeHint(); + return tqminimumSizeHint(); } void KRichTextLabel::setText( const TQString &text ) { diff --git a/klaptopdaemon/krichtextlabel.h b/klaptopdaemon/krichtextlabel.h index 40ead03..42e7a75 100644 --- a/klaptopdaemon/krichtextlabel.h +++ b/klaptopdaemon/krichtextlabel.h @@ -24,29 +24,30 @@ #include <kdelibs_export.h> /** - * @short A replacement for TQLabel that supports richtext and proper layout management + * @short A replacement for TQLabel that supports richtext and proper tqlayout management * * @author Waldo Bastian <[email protected]> */ /* - * QLabel + * TQLabel */ class KDEUI_EXPORT KRichTextLabel : public TQLabel { Q_OBJECT + TQ_OBJECT public: /** * Default constructor. */ - KRichTextLabel( TQWidget *parent, const char *name = 0 ); - KRichTextLabel( const TQString &text, TQWidget *parent, const char *name = 0 ); + KRichTextLabel( TQWidget *tqparent, const char *name = 0 ); + KRichTextLabel( const TQString &text, TQWidget *tqparent, const char *name = 0 ); int defaultWidth() const { return m_defaultWidth; } void setDefaultWidth(int defaultWidth); - virtual TQSize minimumSizeHint() const; - virtual TQSize sizeHint() const; + virtual TQSize tqminimumSizeHint() const; + virtual TQSize tqsizeHint() const; TQSizePolicy sizePolicy() const; public slots: diff --git a/klaptopdaemon/laptop_daemon.cpp b/klaptopdaemon/laptop_daemon.cpp index 5b710c5..36faefa 100644 --- a/klaptopdaemon/laptop_daemon.cpp +++ b/klaptopdaemon/laptop_daemon.cpp @@ -102,7 +102,7 @@ laptop_daemon::laptop_daemon(const TQCString& obj): KDEDModule(obj) sony_disp = 0; connect(this, TQT_SIGNAL(signal_checkBattery()), TQT_SLOT(checkBatteryNow())); - //hasAudio = (audioServer.serverStatus() == 0) ? true : false; + //hasAudio = (audioServer.servertqStatus() == 0) ? true : false; // FIXME: make these configurable. Some system definitely don't // use /var/run/stab @@ -537,13 +537,13 @@ void laptop_daemon::haveBatteryLow(int t, const int num, const int type) if (type) { if (s.time_based_action_critical) { KPassivePopup::message(i18n("Battery power is running out."), - i18n("%1 % charge left.").arg(num), + i18n("%1 % charge left.").tqarg(num), BarIcon("laptop_battery"), dock_widget, 0, 20000); } else { // Will this ever be reached? KPassivePopup::message(i18n("Battery power is running out."), - i18n("%1 % charge left.").arg(num), + i18n("%1 % charge left.").tqarg(num), BarIcon("laptop_battery"), dock_widget, 0, 20000); } diff --git a/klaptopdaemon/laptop_daemon.h b/klaptopdaemon/laptop_daemon.h index 7617a0d..f5ba767 100644 --- a/klaptopdaemon/laptop_daemon.h +++ b/klaptopdaemon/laptop_daemon.h @@ -74,6 +74,7 @@ class laptop_dock; class laptop_daemon: public KDEDModule { Q_OBJECT +// TQ_OBJECT K_DCOP public: laptop_daemon(const TQCString& obj); @@ -167,7 +168,7 @@ protected: int saved_brightness_val; TQString saved_performance_val, saved_throttle_val; TQTimer *wake_timer; // the timer for the above running - QPoint wakepos; // the mouse pos at the beginning of time + TQPoint wakepos; // the mouse pos at the beginning of time void WakeUpAuto(); TQTimer *backoffTimer; // backoff diff --git a/klaptopdaemon/linux/bulkmem.h b/klaptopdaemon/linux/bulkmem.h index e0bafc8..cb59aa5 100644 --- a/klaptopdaemon/linux/bulkmem.h +++ b/klaptopdaemon/linux/bulkmem.h @@ -71,7 +71,7 @@ typedef struct eraseq_hdr_t { eraseq_entry_t *QueueEntryArray; } eraseq_hdr_t; -#define ERASE_QUEUED 0x00 +#define ERASE_TQUEUED 0x00 #define ERASE_IN_PROGRESS(n) (((n) > 0) && ((n) < 0x80)) #define ERASE_IDLE 0xff #define ERASE_PASSED 0xe0 @@ -125,25 +125,25 @@ typedef struct mtd_request_t { u_int TransferLength; u_int Function; u_long MediaID; - u_int Status; + u_int tqStatus; u_int Timeout; } mtd_request_t; /* Fields in MTD Function */ -#define MTD_REQ_ACTION 0x003 -#define MTD_REQ_ERASE 0x000 -#define MTD_REQ_READ 0x001 -#define MTD_REQ_WRITE 0x002 -#define MTD_REQ_COPY 0x003 -#define MTD_REQ_NOERASE 0x004 -#define MTD_REQ_VERIFY 0x008 -#define MTD_REQ_READY 0x010 -#define MTD_REQ_TIMEOUT 0x020 -#define MTD_REQ_LAST 0x040 -#define MTD_REQ_FIRST 0x080 -#define MTD_REQ_KERNEL 0x100 - -/* Status codes */ +#define MTD_RETQ_ACTION 0x003 +#define MTD_RETQ_ERASE 0x000 +#define MTD_RETQ_READ 0x001 +#define MTD_RETQ_WRITE 0x002 +#define MTD_RETQ_COPY 0x003 +#define MTD_RETQ_NOERASE 0x004 +#define MTD_RETQ_VERIFY 0x008 +#define MTD_RETQ_READY 0x010 +#define MTD_RETQ_TIMEOUT 0x020 +#define MTD_RETQ_LAST 0x040 +#define MTD_RETQ_FIRST 0x080 +#define MTD_RETQ_KERNEL 0x100 + +/* tqStatus codes */ #define MTD_WAITREQ 0x00 #define MTD_WAITTIMER 0x01 #define MTD_WAITRDY 0x02 diff --git a/klaptopdaemon/linux/ciscode.h b/klaptopdaemon/linux/ciscode.h index 1c536d1..622b923 100644 --- a/klaptopdaemon/linux/ciscode.h +++ b/klaptopdaemon/linux/ciscode.h @@ -66,7 +66,7 @@ #define PRODID_OLICOM_OC2232 0x3222 #define MANFID_OMEGA 0x0137 -#define PRODID_OMEGA_QSP_100 0x0025 +#define PRODID_OMEGA_TQSP_100 0x0025 #define MANFID_OSITECH 0x0140 #define PRODID_OSITECH_JACK_144 0x0001 @@ -75,10 +75,10 @@ #define MANFID_PSION 0x016c -#define MANFID_QUATECH 0x0137 -#define PRODID_QUATECH_DUAL_RS232 0x0012 -#define PRODID_QUATECH_DUAL_RS232_D1 0x0007 -#define PRODID_QUATECH_QUAD_RS232 0x001b +#define MANFID_TQUATECH 0x0137 +#define PRODID_TQUATECH_DUAL_RS232 0x0012 +#define PRODID_TQUATECH_DUAL_RS232_D1 0x0007 +#define PRODID_TQUATECH_TQUAD_RS232 0x001b #define MANFID_SMC 0x0108 #define PRODID_SMC_ETHER 0x0105 diff --git a/klaptopdaemon/linux/cisreg.h b/klaptopdaemon/linux/cisreg.h index ebe54fc..48f6f83 100644 --- a/klaptopdaemon/linux/cisreg.h +++ b/klaptopdaemon/linux/cisreg.h @@ -38,12 +38,12 @@ #define COR_MFC_CONFIG_MASK 0x38 #define COR_FUNC_ENA 0x01 #define COR_ADDR_DECODE 0x02 -#define COR_IREQ_ENA 0x04 +#define COR_IRETQ_ENA 0x04 #define COR_LEVEL_REQ 0x40 #define COR_SOFT_RESET 0x80 /* - * Card Configuration and Status Register + * Card Configuration and tqStatus Register */ #define CCSR_INTR_ACK 0x01 #define CCSR_INTR_PENDING 0x02 @@ -72,13 +72,13 @@ #define SCR_COPY_NUM 0x70 /* - * Extended Status Register + * Extended tqStatus Register */ -#define ESR_REQ_ATTN_ENA 0x01 -#define ESR_REQ_ATTN 0x10 +#define ESR_RETQ_ATTN_ENA 0x01 +#define ESR_RETQ_ATTN 0x10 /* - * CardBus Function Status Registers + * CardBus Function tqStatus Registers */ #define CBFN_EVENT 0x00 #define CBFN_MASK 0x04 diff --git a/klaptopdaemon/linux/cistpl.h b/klaptopdaemon/linux/cistpl.h index 8fee55b..6fab93a 100644 --- a/klaptopdaemon/linux/cistpl.h +++ b/klaptopdaemon/linux/cistpl.h @@ -312,7 +312,7 @@ typedef struct cistpl_ide_interface_t { /* First feature byte */ #define CISTPL_IDE_SILICON 0x04 -#define CISTPL_IDE_UNIQUE 0x08 +#define CISTPL_IDE_UNITQUE 0x08 #define CISTPL_IDE_DUAL 0x10 /* Second feature byte */ @@ -353,7 +353,7 @@ typedef struct cistpl_bar_t { typedef struct cistpl_config_t { u_char last_idx; u_int base; - u_int rmask[4]; + u_int rtqmask[4]; u_char subtuples; } cistpl_config_t; @@ -398,8 +398,8 @@ typedef struct cistpl_io_t { } cistpl_io_t; typedef struct cistpl_irq_t { - u_int IRQInfo1; - u_int IRQInfo2; + u_int IRTQInfo1; + u_int IRTQInfo2; } cistpl_irq_t; #define CISTPL_MEM_MAX_WIN 8 diff --git a/klaptopdaemon/linux/cs.h b/klaptopdaemon/linux/cs.h index b8610ca..69a38e0 100644 --- a/klaptopdaemon/linux/cs.h +++ b/klaptopdaemon/linux/cs.h @@ -62,11 +62,11 @@ typedef struct adjust_t { #define RES_IO_RANGE 2 #define RES_IRQ 3 /* Attribute field */ -#define RES_IRQ_TYPE 0x03 -#define RES_IRQ_TYPE_EXCLUSIVE 0 -#define RES_IRQ_TYPE_TIME 1 -#define RES_IRQ_TYPE_DYNAMIC 2 -#define RES_IRQ_CSC 0x04 +#define RES_IRTQ_TYPE 0x03 +#define RES_IRTQ_TYPE_EXCLUSIVE 0 +#define RES_IRTQ_TYPE_TIME 1 +#define RES_IRTQ_TYPE_DYNAMIC 2 +#define RES_IRTQ_CSC 0x04 #define RES_SHARED 0x08 #define RES_RESERVED 0x10 #define RES_ALLOCATED 0x20 @@ -96,11 +96,11 @@ typedef struct config_info_t { u_int Vcc, Vpp1, Vpp2; u_int IntType; u_int ConfigBase; - u_char Status, Pin, Copy, Option, ExtStatus; + u_char tqStatus, Pin, Copy, Option, ExttqStatus; u_int Present; u_int CardValues; u_int AssignedIRQ; - u_int IRQAttributes; + u_int IRTQAttributes; ioaddr_t BasePort1; ioaddr_t NumPorts1; u_int Attributes1; @@ -143,7 +143,7 @@ typedef struct modconf_t { } modconf_t; /* Attributes for ModifyConfiguration */ -#define CONF_IRQ_CHANGE_VALID 0x100 +#define CONF_IRTQ_CHANGE_VALID 0x100 #define CONF_VCC_CHANGE_VALID 0x200 #define CONF_VPP1_CHANGE_VALID 0x400 #define CONF_VPP2_CHANGE_VALID 0x800 @@ -154,7 +154,7 @@ typedef struct config_req_t { u_int Vcc, Vpp1, Vpp2; u_int IntType; u_int ConfigBase; - u_char Status, Pin, Copy, ExtStatus; + u_char tqStatus, Pin, Copy, ExttqStatus; u_char ConfigIndex; u_int Present; } config_req_t; @@ -194,36 +194,36 @@ typedef struct io_req_t { typedef struct irq_req_t { u_int Attributes; u_int AssignedIRQ; - u_int IRQInfo1, IRQInfo2; + u_int IRTQInfo1, IRTQInfo2; void *Handler; void *Instance; } irq_req_t; /* Attributes for RequestIRQ and ReleaseIRQ */ -#define IRQ_TYPE 0x03 -#define IRQ_TYPE_EXCLUSIVE 0x00 -#define IRQ_TYPE_TIME 0x01 -#define IRQ_TYPE_DYNAMIC_SHARING 0x02 -#define IRQ_FORCED_PULSE 0x04 -#define IRQ_FIRST_SHARED 0x08 -#define IRQ_HANDLE_PRESENT 0x10 -#define IRQ_PULSE_ALLOCATED 0x100 - -/* Bits in IRQInfo1 field */ -#define IRQ_MASK 0x0f -#define IRQ_NMI_ID 0x01 -#define IRQ_IOCK_ID 0x02 -#define IRQ_BERR_ID 0x04 -#define IRQ_VEND_ID 0x08 -#define IRQ_INFO2_VALID 0x10 -#define IRQ_LEVEL_ID 0x20 -#define IRQ_PULSE_ID 0x40 -#define IRQ_SHARE_ID 0x80 - -typedef struct eventmask_t { +#define IRTQ_TYPE 0x03 +#define IRTQ_TYPE_EXCLUSIVE 0x00 +#define IRTQ_TYPE_TIME 0x01 +#define IRTQ_TYPE_DYNAMIC_SHARING 0x02 +#define IRTQ_FORCED_PULSE 0x04 +#define IRTQ_FIRST_SHARED 0x08 +#define IRTQ_HANDLE_PRESENT 0x10 +#define IRTQ_PULSE_ALLOCATED 0x100 + +/* Bits in IRTQInfo1 field */ +#define IRTQ_MASK 0x0f +#define IRTQ_NMI_ID 0x01 +#define IRTQ_IOCK_ID 0x02 +#define IRTQ_BERR_ID 0x04 +#define IRTQ_VEND_ID 0x08 +#define IRTQ_INFO2_VALID 0x10 +#define IRTQ_LEVEL_ID 0x20 +#define IRTQ_PULSE_ID 0x40 +#define IRTQ_SHARE_ID 0x80 + +typedef struct eventtqmask_t { u_int Attributes; u_int EventMask; -} eventmask_t; +} eventtqmask_t; #define CONF_EVENT_MASK_VALID 0x01 @@ -407,7 +407,7 @@ enum service { GetClientInfo, GetConfigurationInfo, GetEventMask, GetFirstClient, GetFirstPartion, GetFirstRegion, GetFirstTuple, GetNextClient, GetNextPartition, GetNextRegion, GetNextTuple, - GetStatus, GetTupleData, MapLogSocket, MapLogWindow, MapMemPage, + GettqStatus, GetTupleData, MapLogSocket, MapLogWindow, MapMemPage, MapPhySocket, MapPhyWindow, ModifyConfiguration, ModifyWindow, OpenMemory, ParseTuple, ReadMemory, RegisterClient, RegisterEraseQueue, RegisterMTD, RegisterTimer, diff --git a/klaptopdaemon/linux/k_compat.h b/klaptopdaemon/linux/k_compat.h index 2b14312..d18eaa5 100644 --- a/klaptopdaemon/linux/k_compat.h +++ b/klaptopdaemon/linux/k_compat.h @@ -124,19 +124,19 @@ #endif #if (LINUX_VERSION_CODE < VERSION(2,1,51)) -#define INVALIDATE_INODES(r) invalidate_inodes(r) +#define INVALIDATE_INODES(r) tqinvalidate_inodes(r) #else #define INVALIDATE_INODES(r) \ do { struct super_block *sb = get_super(r); \ - if (sb) invalidate_inodes(sb); } while (0) + if (sb) tqinvalidate_inodes(sb); } while (0) #endif #if (LINUX_VERSION_CODE < VERSION(2,1,60)) -#define IRQ_MAP(irq, dev) irq2dev_map[irq] = dev +#define IRTQ_MAP(irq, dev) irq2dev_map[irq] = dev #define FOPS(i,f,b,c,p) (i,f,b,c) #define FPOS (file->f_pos) #else -#define IRQ_MAP(irq, dev) while (0) +#define IRTQ_MAP(irq, dev) while (0) #define FOPS(i,f,b,c,p) (f,b,c,p) #define FPOS (*ppos) #endif @@ -240,7 +240,7 @@ #endif typedef unsigned long k_time_t; -#define ACQUIRE_RESOURCE_LOCK do {} while (0) +#define ACTQUIRE_RESOURCE_LOCK do {} while (0) #define RELEASE_RESOURCE_LOCK do {} while (0) #endif /* _LINUX_K_COMPAT_H */ diff --git a/klaptopdaemon/linux/ss.h b/klaptopdaemon/linux/ss.h index 57ad769..b9dbb39 100644 --- a/klaptopdaemon/linux/ss.h +++ b/klaptopdaemon/linux/ss.h @@ -25,7 +25,7 @@ typedef struct ss_callback_t { void *info; } ss_callback_t; -/* Definitions for card status flags for GetStatus */ +/* Definitions for card status flags for GettqStatus */ #define SS_WRPROT 0x0001 #define SS_CARDLOCK 0x0002 #define SS_EJECTION 0x0004 @@ -44,7 +44,7 @@ typedef struct ss_callback_t { /* for InquireSocket */ typedef struct socket_cap_t { u_int features; - u_int irq_mask; + u_int irq_tqmask; u_int map_size; u_char pci_irq; u_char cardbus; @@ -56,7 +56,7 @@ typedef struct socket_cap_t { /* for GetSocket, SetSocket */ typedef struct socket_state_t { u_int flags; - u_int csc_mask; + u_int csc_tqmask; u_char Vcc, Vpp; u_char io_irq; } socket_state_t; @@ -105,7 +105,7 @@ typedef struct cb_bridge_map { enum ss_service { SS_RegisterCallback, SS_InquireSocket, - SS_GetStatus, SS_GetSocket, SS_SetSocket, + SS_GettqStatus, SS_GetSocket, SS_SetSocket, SS_GetIOMap, SS_SetIOMap, SS_GetMemMap, SS_SetMemMap, SS_GetBridge, SS_SetBridge, SS_ProcSetup }; diff --git a/klaptopdaemon/main.cpp b/klaptopdaemon/main.cpp index ca30218..c39f153 100644 --- a/klaptopdaemon/main.cpp +++ b/klaptopdaemon/main.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1999 Paul Campbell <[email protected]> * - * Requires the Qt widget libraries, available at no cost at + * Requires the TQt widget libraries, available at no cost at * http://www.troll.no/ * * This program is free software; you can redistribute it and/or modify @@ -48,46 +48,46 @@ extern void wake_laptop_daemon(); extern "C" { - KDE_EXPORT KCModule *create_pcmcia(TQWidget *parent, const char *) + KDE_EXPORT KCModule *create_pcmcia(TQWidget *tqparent, const char *) { - return new PcmciaConfig(parent, "kcmlaptop"); + return new PcmciaConfig(tqparent, "kcmlaptop"); } - KDE_EXPORT KCModule *create_bwarning(TQWidget *parent, const char *) + KDE_EXPORT KCModule *create_bwarning(TQWidget *tqparent, const char *) { - return new WarningConfig(0, parent, "kcmlaptop"); + return new WarningConfig(0, tqparent, "kcmlaptop"); } - KDE_EXPORT KCModule *create_cwarning(TQWidget *parent, const char *) + KDE_EXPORT KCModule *create_cwarning(TQWidget *tqparent, const char *) { - return new WarningConfig(1, parent, "kcmlaptop"); + return new WarningConfig(1, tqparent, "kcmlaptop"); } - KDE_EXPORT KCModule *create_battery(TQWidget *parent, const char *) + KDE_EXPORT KCModule *create_battery(TQWidget *tqparent, const char *) { - return new BatteryConfig(parent, "kcmlaptop"); + return new BatteryConfig(tqparent, "kcmlaptop"); } - KDE_EXPORT KCModule *create_power(TQWidget *parent, const char *) + KDE_EXPORT KCModule *create_power(TQWidget *tqparent, const char *) { - return new PowerConfig(parent, "kcmlaptop"); + return new PowerConfig(tqparent, "kcmlaptop"); } - KDE_EXPORT KCModule *create_acpi(TQWidget *parent, const char *) + KDE_EXPORT KCModule *create_acpi(TQWidget *tqparent, const char *) { - return new AcpiConfig(parent, "kcmlaptop"); + return new AcpiConfig(tqparent, "kcmlaptop"); } - KDE_EXPORT KCModule *create_apm(TQWidget *parent, const char *) + KDE_EXPORT KCModule *create_apm(TQWidget *tqparent, const char *) { - return new ApmConfig(parent, "kcmlaptop"); + return new ApmConfig(tqparent, "kcmlaptop"); } - KDE_EXPORT KCModule *create_Profile(TQWidget *parent, const char *) + KDE_EXPORT KCModule *create_Profile(TQWidget *tqparent, const char *) { - return new ProfileConfig(parent, "kcmlaptop"); + return new ProfileConfig(tqparent, "kcmlaptop"); } - KDE_EXPORT KCModule *create_sony(TQWidget *parent, const char *) + KDE_EXPORT KCModule *create_sony(TQWidget *tqparent, const char *) { - return new SonyConfig(parent, "kcmlaptop"); + return new SonyConfig(tqparent, "kcmlaptop"); } - KDE_EXPORT KCModule *create_buttons(TQWidget *parent, const char *) + KDE_EXPORT KCModule *create_buttons(TQWidget *tqparent, const char *) { - return new ButtonsConfig(parent, "kcmlaptop"); + return new ButtonsConfig(tqparent, "kcmlaptop"); } KDE_EXPORT void init_battery() @@ -111,9 +111,9 @@ extern "C" wake_laptop_daemon(); } - KDE_EXPORT KCModule *create_laptop(TQWidget *parent, const char *) + KDE_EXPORT KCModule *create_laptop(TQWidget *tqparent, const char *) { - return new LaptopModule(parent, "kcmlaptop"); + return new LaptopModule(tqparent, "kcmlaptop"); } KDE_EXPORT void init_laptop() @@ -124,8 +124,8 @@ extern "C" -LaptopModule::LaptopModule(TQWidget *parent, const char *) - : KCModule(parent, "kcmlaptop") +LaptopModule::LaptopModule(TQWidget *tqparent, const char *) + : KCModule(tqparent, "kcmlaptop") { { // export ACPI options KConfig config("kcmlaptoprc", true /*readonly*/, false /*no globals*/); @@ -136,34 +136,34 @@ LaptopModule::LaptopModule(TQWidget *parent, const char *) bool enablehibernate = config.readBoolEntry("EnableHibernate", false); bool enableperformance = config.readBoolEntry("EnablePerformance", false); bool enablethrottle = config.readBoolEntry("EnableThrottle", false); - laptop_portable::acpi_set_mask(enablestandby, enablesuspend, enablehibernate, enableperformance, enablethrottle); + laptop_portable::acpi_set_tqmask(enablestandby, enablesuspend, enablehibernate, enableperformance, enablethrottle); config.setGroup("ApmDefault"); enablestandby = config.readBoolEntry("EnableStandby", false); enablesuspend = config.readBoolEntry("EnableSuspend", false); - laptop_portable::apm_set_mask(enablestandby, enablesuspend); + laptop_portable::apm_set_tqmask(enablestandby, enablesuspend); config.setGroup("SoftwareSuspendDefault"); enablehibernate = config.readBoolEntry("EnableHibernate", false); - laptop_portable::software_suspend_set_mask(enablehibernate); + laptop_portable::software_suspend_set_tqmask(enablehibernate); } - TQVBoxLayout *layout = new TQVBoxLayout(this); + TQVBoxLayout *tqlayout = new TQVBoxLayout(this); tab = new TQTabWidget(this); - layout->addWidget(tab); + tqlayout->addWidget(tab); - battery = new BatteryConfig(parent, "kcmlaptop"); + battery = new BatteryConfig(tqparent, "kcmlaptop"); tab->addTab(battery, i18n("&Battery")); connect(battery, TQT_SIGNAL(changed(bool)), this, TQT_SLOT(moduleChanged(bool))); - power = new PowerConfig(parent, "kcmlaptop"); + power = new PowerConfig(tqparent, "kcmlaptop"); tab->addTab(power, i18n("&Power Control")); connect(power, TQT_SIGNAL(changed(bool)), this, TQT_SLOT(moduleChanged(bool))); - warning = new WarningConfig(0, parent, "kcmlaptop"); + warning = new WarningConfig(0, tqparent, "kcmlaptop"); tab->addTab(warning, i18n("Low Battery &Warning")); connect(warning, TQT_SIGNAL(changed(bool)), this, TQT_SLOT(moduleChanged(bool))); - critical = new WarningConfig(1, parent, "kcmlaptop"); + critical = new WarningConfig(1, tqparent, "kcmlaptop"); tab->addTab(critical, i18n("Low Battery &Critical")); connect(critical, TQT_SIGNAL(changed(bool)), this, TQT_SLOT(moduleChanged(bool))); @@ -175,28 +175,28 @@ LaptopModule::LaptopModule(TQWidget *parent, const char *) int current_throttle; bool has_throttling = laptop_portable::get_system_throttling(0, current_throttle, throttle_list, active_list); if (laptop_portable::has_brightness() || has_profile || has_throttling) { - profile = new ProfileConfig(parent, "kcmlaptop"); + profile = new ProfileConfig(tqparent, "kcmlaptop"); tab->addTab(profile, i18n("Default Power Profiles")); connect(profile, TQT_SIGNAL(changed(bool)), this, TQT_SLOT(moduleChanged(bool))); } else { profile = 0; } if (laptop_portable::has_button(laptop_portable::LidButton) || laptop_portable::has_button(laptop_portable::PowerButton)) { - buttons = new ButtonsConfig(parent, "kcmlaptop"); + buttons = new ButtonsConfig(tqparent, "kcmlaptop"); tab->addTab(buttons, i18n("Button Actions")); connect(buttons, TQT_SIGNAL(changed(bool)), this, TQT_SLOT(moduleChanged(bool))); } else { buttons = 0; } if (laptop_portable::has_acpi()) { - acpi = new AcpiConfig(parent, "kcmlaptop"); + acpi = new AcpiConfig(tqparent, "kcmlaptop"); tab->addTab(acpi, i18n("&ACPI Config")); connect(acpi, TQT_SIGNAL(changed(bool)), this, TQT_SLOT(moduleChanged(bool))); } else { acpi = 0; } if (laptop_portable::has_apm()) { - apm = new ApmConfig(parent, "kcmlaptop"); + apm = new ApmConfig(tqparent, "kcmlaptop"); tab->addTab(apm, i18n("&APM Config")); connect(apm, TQT_SIGNAL(changed(bool)), this, TQT_SLOT(moduleChanged(bool))); } else { @@ -213,7 +213,7 @@ LaptopModule::LaptopModule(TQWidget *parent, const char *) } } if (do_sony) { - sony = new SonyConfig(parent, "kcmlaptop"); + sony = new SonyConfig(tqparent, "kcmlaptop"); tab->addTab(sony, i18n("&Sony Laptop Config")); connect(sony, TQT_SIGNAL(changed(bool)), this, TQT_SLOT(moduleChanged(bool))); } else { diff --git a/klaptopdaemon/main.h b/klaptopdaemon/main.h index c944817..ddefe22 100644 --- a/klaptopdaemon/main.h +++ b/klaptopdaemon/main.h @@ -3,7 +3,7 @@ * * Copyright (c) 2002 Paul Campbell [email protected] * - * Requires the Qt widget libraries, available at no cost at + * Requires the TQt widget libraries, available at no cost at * http://www.troll.no/ * * This program is free software; you can redistribute it and/or modify @@ -44,10 +44,11 @@ class ButtonsConfig; class LaptopModule : public KCModule { Q_OBJECT + TQ_OBJECT public: - LaptopModule(TQWidget *parent, const char *name); + LaptopModule(TQWidget *tqparent, const char *name); void load(); void save(); diff --git a/klaptopdaemon/makecrc.cpp b/klaptopdaemon/makecrc.cpp index ce3d415..ee87bcc 100644 --- a/klaptopdaemon/makecrc.cpp +++ b/klaptopdaemon/makecrc.cpp @@ -2,7 +2,7 @@ * makecrc.cpp * * Copyright (c) 2003 Paul Campbell <[email protected]> - * Requires the Qt widget libraries, available at no cost at + * Requires the TQt widget libraries, available at no cost at * http://www.troll.no/ * * This program is free software; you can redistribute it and/or modify diff --git a/klaptopdaemon/pcmcia.cpp b/klaptopdaemon/pcmcia.cpp index c44567a..4bde3b3 100644 --- a/klaptopdaemon/pcmcia.cpp +++ b/klaptopdaemon/pcmcia.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1999 Paul Campbell <[email protected]> * - * Requires the Qt widget libraries, available at no cost at + * Requires the TQt widget libraries, available at no cost at * http://www.troll.no/ * * This program is free software; you can redistribute it and/or modify @@ -37,8 +37,8 @@ #include "portable.h" #include "version.h" -PcmciaConfig::PcmciaConfig (TQWidget * parent, const char *name) - : KCModule(parent, name) +PcmciaConfig::PcmciaConfig (TQWidget * tqparent, const char *name) + : KCModule(tqparent, name) { KAboutData *about = new KAboutData(I18N_NOOP("kcmlaptop"), @@ -84,7 +84,7 @@ PcmciaConfig::PcmciaConfig (TQWidget * parent, const char *name) TQString s1 = LAPTOP_VERSION; TQString s2 = i18n("Version: ")+s1; TQLabel* vers = new TQLabel(s2, this); - vers->setMinimumSize(vers->sizeHint()); + vers->setMinimumSize(vers->tqsizeHint()); v1->addWidget(vers, 0); top_layout->activate(); diff --git a/klaptopdaemon/pcmcia.h b/klaptopdaemon/pcmcia.h index f9579f9..18eec79 100644 --- a/klaptopdaemon/pcmcia.h +++ b/klaptopdaemon/pcmcia.h @@ -3,7 +3,7 @@ * * Copyright (c) 1999 Paul Campbell <[email protected]> * - * Requires the Qt widget libraries, available at no cost at + * Requires the TQt widget libraries, available at no cost at * http://www.troll.no/ * * This program is free software; you can redistribute it and/or modify @@ -41,8 +41,9 @@ class PcmciaConfig : public KCModule { Q_OBJECT + TQ_OBJECT public: - PcmciaConfig( TQWidget *parent=0, const char* name=0); + PcmciaConfig( TQWidget *tqparent=0, const char* name=0); void save( void ); void load(); diff --git a/klaptopdaemon/portable.cpp b/klaptopdaemon/portable.cpp index f1b28fa..fda010b 100644 --- a/klaptopdaemon/portable.cpp +++ b/klaptopdaemon/portable.cpp @@ -5,7 +5,7 @@ * * Copyright (c) 1999 Paul Campbell <[email protected]> * - * Requires the Qt widget libraries, available at no cost at + * Requires the TQt widget libraries, available at no cost at * http://www.troll.no/ * * This program is free software; you can redistribute it and/or modify @@ -199,7 +199,7 @@ pmu_read(apm_info *ap) int timerem = 0; int maxcharge = 0; for (int i = 0; i < bcnt; i++) { - TQFile bf(TQString("/proc/pmu/battery_%1").arg(i)); + TQFile bf(TQString("/proc/pmu/battery_%1").tqarg(i)); if (!bf.exists() || !bf.open(IO_ReadOnly)) continue; @@ -304,7 +304,7 @@ readit: char buff2[1024]; if (fgets(buff2, sizeof(buff), f) == NULL) break; - if (strstr(buff2, "Status:") != NULL || + if (strstr(buff2, "tqStatus:") != NULL || strstr(buff2, "state:") != NULL) { if (strstr(buff2, "on-line") != NULL) { fclose(f); @@ -333,7 +333,7 @@ static void acpi_read_batteries() { f = new TQFile(bat.info_file); if (f && f->exists() && f->open(IO_ReadOnly)) { while(f->readLine(buff,1024) > 0) { - if (buff.contains("design capacity low:", false)) { + if (buff.tqcontains("design capacity low:", false)) { TQRegExp rx("(\\d*)\\D*$"); rx.search(buff); bat.cap_low = rx.cap(1).toInt(); @@ -341,7 +341,7 @@ static void acpi_read_batteries() { bat.cap_low = 0; continue; } - if (buff.contains("last full capacity:", false)) { + if (buff.tqcontains("last full capacity:", false)) { TQRegExp rx("(\\d*)\\D*$"); rx.search(buff); bat.cap = rx.cap(1).toInt(); @@ -363,7 +363,7 @@ static void acpi_read_batteries() { f = new TQFile(bat.state_file); if (f && f->exists() && f->open(IO_ReadOnly)) { while(f->readLine(buff,1024) > 0) { - if (buff.contains("present rate:", false)) { + if (buff.tqcontains("present rate:", false)) { TQRegExp rx("(\\d*)\\D*$"); rx.search(buff); bat.rate = rx.cap(1).toInt(); @@ -372,7 +372,7 @@ static void acpi_read_batteries() { present = true; continue; } - if (buff.contains("remaining capacity:", false)) { + if (buff.tqcontains("remaining capacity:", false)) { TQRegExp rx("(\\d*)\\D*$"); rx.search(buff); bat.remaining = rx.cap(1).toInt(); @@ -602,7 +602,7 @@ laptop_portable::has_software_suspend(int type) } void -laptop_portable::software_suspend_set_mask(bool hibernate) +laptop_portable::software_suspend_set_tqmask(bool hibernate) { software_suspend_is_preferred = hibernate; } @@ -677,17 +677,17 @@ has_acpi_power() return(val); } -static unsigned long acpi_sleep_enabled = 0x00; // acpi sleep functions enabled mask +static unsigned long acpi_sleep_enabled = 0x00; // acpi sleep functions enabled tqmask static bool has_acpi_sleep(int state) { static int known=0; - static unsigned long mask=0; + static unsigned long tqmask=0; if (known != last_seed) { known = last_seed; - mask = 0; + tqmask = 0; TQFile p("/sys/power/state"); TQFile f("/proc/acpi/sleep"); @@ -701,11 +701,11 @@ has_acpi_sleep(int state) TQString s = *i; if (s.compare("standby")==0) - mask |= (1<<1); + tqmask |= (1<<1); else if (s.compare("mem")==0) - mask |= (1<<3); + tqmask |= (1<<3); else if (s.compare("disk")==0) - mask |= (1<<4); + tqmask |= (1<<4); } p.close(); } @@ -719,19 +719,19 @@ has_acpi_sleep(int state) if (s[0] == 'S') { int c = s[1].digitValue(); if (c >= 0 && c <= 9) - mask |= 1<<c; + tqmask |= 1<<c; } } f.close(); } } - return((mask&acpi_sleep_enabled&(1<<state)) != 0); + return((tqmask&acpi_sleep_enabled&(1<<state)) != 0); } static bool acpi_performance_enabled = 0; static bool acpi_throttle_enabled = 0; void -laptop_portable::acpi_set_mask(bool standby, bool suspend, bool hibernate, bool perf, bool throttle) +laptop_portable::acpi_set_tqmask(bool standby, bool suspend, bool hibernate, bool perf, bool throttle) { acpi_sleep_enabled = (standby ? (1<<1)|(1<<2) : 0) | @@ -755,7 +755,7 @@ invoke_acpi_helper(const char *param, const char *param2, const char *param3) proc.start(KProcess::Block); // helper runs fast and we want to see the result } -static unsigned long apm_sleep_enabled = 0x0c; // apm sleep functions enabled mask +static unsigned long apm_sleep_enabled = 0x0c; // apm sleep functions enabled tqmask static bool has_apm_sleep(int state) { @@ -763,7 +763,7 @@ has_apm_sleep(int state) } void -laptop_portable::apm_set_mask(bool standby, bool suspend) +laptop_portable::apm_set_tqmask(bool standby, bool suspend) { apm_sleep_enabled = (standby ? 1<<2 : 0) | @@ -939,14 +939,14 @@ int laptop_portable::has_hibernation() // to get any software they lack // -KActiveLabel *laptop_portable::no_power_management_explanation(TQWidget *parent) +KActiveLabel *laptop_portable::no_power_management_explanation(TQWidget *tqparent) { if (access("/proc/acpi", F_OK) == 0) { // probably has default kernel ACPI installed - KActiveLabel* explain = new KActiveLabel(i18n("Your computer seems to have a partial ACPI installation. ACPI was probably enabled, but some of the sub-options were not - you need to enable at least 'AC Adaptor' and 'Control Method Battery' and then rebuild your kernel."), parent); + KActiveLabel* explain = new KActiveLabel(i18n("Your computer seems to have a partial ACPI installation. ACPI was probably enabled, but some of the sub-options were not - you need to enable at least 'AC Adaptor' and 'Control Method Battery' and then rebuild your kernel."), tqparent); return(explain); } - KActiveLabel* explain = new KActiveLabel(i18n("Your computer doesn't have the Linux APM (Advanced Power Management) or ACPI software installed, or doesn't have the APM kernel drivers installed - check out the <a href=\"http://www.linuxdoc.org/HOWTO/Laptop-HOWTO.html\">Linux Laptop-HOWTO</a> document for information on how to install APM."), parent); + KActiveLabel* explain = new KActiveLabel(i18n("Your computer doesn't have the Linux APM (Advanced Power Management) or ACPI software installed, or doesn't have the APM kernel drivers installed - check out the <a href=\"http://www.linuxdoc.org/HOWTO/Laptop-HOWTO.html\">Linux Laptop-HOWTO</a> document for information on how to install APM."), tqparent); return(explain); } @@ -954,23 +954,23 @@ KActiveLabel *laptop_portable::no_power_management_explanation(TQWidget *parent) // // explain to the user what they need to do to get suspend/resume to work from user mode // -TQLabel *laptop_portable::how_to_do_suspend_resume(TQWidget *parent) +TQLabel *laptop_portable::how_to_do_suspend_resume(TQWidget *tqparent) { if (::has_apm()) { // TODO: remove linefeed from string, can't do it right now coz we have a string freeze TQLabel* note = new KRichTextLabel(i18n("\nIf you make /usr/bin/apm setuid then you will also " "be able to choose 'suspend' and 'standby' in the above " "dialog - check out the help button below to find out " - "how to do this").replace("\n", TQString::null), parent); + "how to do this").tqreplace("\n", TQString()), tqparent); return(note); } if (::has_acpi()) { // TODO: remove linefeed from string, can't do it right now coz we have a string freeze - TQLabel* note = new KRichTextLabel(i18n("\nYou may need to enable ACPI suspend/resume in the ACPI panel").replace("\n", TQString::null), parent); + TQLabel* note = new KRichTextLabel(i18n("\nYou may need to enable ACPI suspend/resume in the ACPI panel").tqreplace("\n", TQString()), tqparent); return(note); } // TODO: remove linefeed from string, can't do it right now coz we have a string freeze - TQLabel* note = new KRichTextLabel(i18n("\nYour system does not support suspend/standby").replace("\n", TQString::null), parent); + TQLabel* note = new KRichTextLabel(i18n("\nYour system does not support suspend/standby").tqreplace("\n", TQString()), tqparent); return(note); } @@ -1040,20 +1040,20 @@ void get_pcmcia_info() // pcmcia support - this will be replaced by better - pcmcia support being worked on by // others // -TQLabel *laptop_portable::pcmcia_info(int x, TQWidget *parent) +TQLabel *laptop_portable::pcmcia_info(int x, TQWidget *tqparent) { if (x == 0) get_pcmcia_info(); if (!present) { if (x == 1) - return(new TQLabel(i18n("No PCMCIA controller detected"), parent)); - return(new TQLabel(i18n(""), parent)); + return(new TQLabel(i18n("No PCMCIA controller detected"), tqparent)); + return(new TQLabel(i18n(""), tqparent)); } else { switch (x) { - case 0: return(new TQLabel(i18n("Card 0:"), parent)); - case 1: return(new TQLabel(tmp0, parent)); - case 2: return(new TQLabel(i18n("Card 1:"), parent)); - default:return(new TQLabel(tmp1, parent)); + case 0: return(new TQLabel(i18n("Card 0:"), tqparent)); + case 1: return(new TQLabel(tmp0, tqparent)); + case 2: return(new TQLabel(i18n("Card 1:"), tqparent)); + default:return(new TQLabel(tmp1, tqparent)); } } } @@ -1226,7 +1226,7 @@ laptop_portable::get_battery_status(int &num_batteries, TQStringList &names, TQS for(unsigned int i = 0; i < acpi_batteries.count(); ++i) { acpi_battery_info& bat = acpi_batteries[i]; names.append(bat.name); - values.append(TQString("%1").arg(bat.percentage)); + values.append(TQString("%1").tqarg(bat.percentage)); state.append(bat.present ? "yes" : "no"); } return; @@ -1330,11 +1330,11 @@ TQString laptop_portable::cpu_frequency() { continue; if (ll.first().stripWhiteSpace() == "cpu MHz") { - rc = i18n("%1 MHz (%2)").arg(ll.last().stripWhiteSpace()).arg(rc); + rc = i18n("%1 MHz (%2)").tqarg(ll.last().stripWhiteSpace()).tqarg(rc); break; } else if (ll.first().stripWhiteSpace() == "clock") { - rc = TQString("%1 (%2)").arg(ll.last().stripWhiteSpace()).arg(rc); + rc = TQString("%1 (%2)").tqarg(ll.last().stripWhiteSpace()).tqarg(rc); break; } } @@ -1580,8 +1580,8 @@ get_acpi_list(char p, int *map, const char *dev, TQStringList &list, int &index, while (!f.atEnd() && i < MAP_SIZE) { TQString l; f.readLine(l, 500); - if (l.contains("active limit", false)) { - TQRegExp rx(TQString("%1(\\d+)").arg(p)); + if (l.tqcontains("active limit", false)) { + TQRegExp rx(TQString("%1(\\d+)").tqarg(p)); if (rx.search(l) >= 0) { bool ok; int min = rx.cap(1).toInt(&ok); @@ -1706,7 +1706,7 @@ static int get_cpufreq_24_state(TQStringList &states, int ¤t, const TQStri f.close(); cpufreq_minmax_frequency[i] = buffer; unsigned int val = buffer.toUInt() / 1000; - states.append(i18n("%1 MHz").arg(val)); + states.append(i18n("%1 MHz").tqarg(val)); if(buffer.stripWhiteSpace() == cur) current = i; } @@ -1835,7 +1835,7 @@ laptop_portable::set_system_performance(TQString val) // val = string given by g int current, result; if((result = get_acpi_list('P', acpi_performance_map, "/performance", performance_list, current, acpi_performance_cpu, false, acpi_performance_enable))) { char tmp[20]; - int ind = performance_list.findIndex(val); + int ind = performance_list.tqfindIndex(val); if (ind < 0 || ind >= MAP_SIZE || current == ind) return; snprintf(tmp, sizeof(tmp), "%d", acpi_performance_map[ind]); @@ -1857,7 +1857,7 @@ laptop_portable::set_system_performance(TQString val) // val = string given by g invoke_acpi_helper("--cpufreq-25", tmp.latin1(), 0); return; case CPUFREQ_24: - int target = performance_list.findIndex(val); + int target = performance_list.tqfindIndex(val); invoke_acpi_helper("--cpufreq-24", cpufreq_cpu.latin1(), cpufreq_minmax_frequency[target].latin1()); return; } @@ -1871,7 +1871,7 @@ laptop_portable::set_system_throttling(TQString val) // val = string given by ge { if (::has_acpi()) { char tmp[20]; - int ind = throttle_list.findIndex(val); + int ind = throttle_list.tqfindIndex(val); if (ind < 0 || ind >= MAP_SIZE) return; snprintf(tmp, sizeof(tmp), "%d", acpi_throttle_map[ind]); @@ -1909,7 +1909,7 @@ acpi_check_button(const char *prefix, TQString &result) while (!f.atEnd()) { TQString l; f.readLine(l, 500); - if (l.contains("state:")) { + if (l.tqcontains("state:")) { result = name; v = 1; break; @@ -2139,7 +2139,7 @@ int laptop_portable::has_hibernation() // explain to the user what they need to do if has_power_management() returned 0 // to get any software they lack // -KActiveLabel *laptop_portable::no_power_management_explanation(TQWidget *parent) +KActiveLabel *laptop_portable::no_power_management_explanation(TQWidget *tqparent) { int fd; KActiveLabel *explain; @@ -2148,22 +2148,22 @@ KActiveLabel *laptop_portable::no_power_management_explanation(TQWidget *parent) if (fd == -1) { switch (errno) { case ENOENT: - explain = new KActiveLabel(i18n("There is no /dev/apm file on this system. Please review the FreeBSD handbook on how to create a device node for the APM device driver (man 4 apm)."), parent); + explain = new KActiveLabel(i18n("There is no /dev/apm file on this system. Please review the FreeBSD handbook on how to create a device node for the APM device driver (man 4 apm)."), tqparent); break; case EACCES: - explain = new KActiveLabel(i18n("Your system has the proper device node for APM support, however you cannot access it. If you are logged in as root right now, you have a problem, otherwise contact your local sysadmin and ask for read/write access to /dev/apm."), parent); + explain = new KActiveLabel(i18n("Your system has the proper device node for APM support, however you cannot access it. If you are logged in as root right now, you have a problem, otherwise contact your local sysadmin and ask for read/write access to /dev/apm."), tqparent); break; case ENXIO: - explain = new KActiveLabel(i18n("Your kernel lacks support for Advanced Power Management."), parent); + explain = new KActiveLabel(i18n("Your kernel lacks support for Advanced Power Management."), tqparent); break; break; default: - explain = new KActiveLabel(i18n("There was a generic error while opening /dev/apm."), parent); + explain = new KActiveLabel(i18n("There was a generic error while opening /dev/apm."), tqparent); break; } } else { close(fd); - explain = new KActiveLabel(i18n("APM has most likely been disabled."), parent); + explain = new KActiveLabel(i18n("APM has most likely been disabled."), tqparent); } return(explain); @@ -2172,9 +2172,9 @@ KActiveLabel *laptop_portable::no_power_management_explanation(TQWidget *parent) // // explain to the user what they need to do to get suspend/resume to work from user mode // -TQLabel *laptop_portable::how_to_do_suspend_resume(TQWidget *parent) +TQLabel *laptop_portable::how_to_do_suspend_resume(TQWidget *tqparent) { - TQLabel* note = new TQLabel(" ", parent); + TQLabel* note = new TQLabel(" ", tqparent); return(note); } @@ -2183,11 +2183,11 @@ TQLabel *laptop_portable::how_to_do_suspend_resume(TQWidget *parent) // pcmcia support - this will be replaced by better - pcmcia support being worked on by // others // -TQLabel *laptop_portable::pcmcia_info(int x, TQWidget *parent) +TQLabel *laptop_portable::pcmcia_info(int x, TQWidget *tqparent) { if (x == 0) - return(new TQLabel(i18n("No PCMCIA controller detected"), parent)); - return(new TQLabel(i18n(""), parent)); + return(new TQLabel(i18n("No PCMCIA controller detected"), tqparent)); + return(new TQLabel(i18n(""), tqparent)); } // // puts us into standby mode @@ -2239,7 +2239,7 @@ void laptop_portable::invoke_hibernation() //ACPI specific - chances are you don't need to implement this one // void -laptop_portable::acpi_set_mask(bool, bool, bool, bool, bool ) +laptop_portable::acpi_set_tqmask(bool, bool, bool, bool, bool ) { // INSERT HERE } @@ -2258,7 +2258,7 @@ int laptop_portable::has_apm(int type) } void -laptop_portable::apm_set_mask(bool , bool ) +laptop_portable::apm_set_tqmask(bool , bool ) { } @@ -2267,7 +2267,7 @@ laptop_portable::apm_set_mask(bool , bool ) // adds extra widgets to the battery panel // void -laptop_portable::extra_config(TQWidget * /*parent*/, KConfig * /*config*/, TQVBoxLayout * /*layout*/) +laptop_portable::extra_config(TQWidget * /*tqparent*/, KConfig * /*config*/, TQVBoxLayout * /*tqlayout*/) { // INSERT HERE } @@ -2423,7 +2423,7 @@ laptop_portable::has_software_suspend(int /*type*/) } void -laptop_portable::software_suspend_set_mask(bool /*hibernate*/) +laptop_portable::software_suspend_set_tqmask(bool /*hibernate*/) { // software_suspend_is_preferred = hibernate; } @@ -2544,7 +2544,7 @@ int laptop_portable::has_hibernation() // explain to the user what they need to do if has_power_management() returned 0 // to get any software they lack // -KActiveLabel *laptop_portable::no_power_management_explanation(TQWidget *parent) +KActiveLabel *laptop_portable::no_power_management_explanation(TQWidget *tqparent) { int fd; KActiveLabel *explain; @@ -2553,22 +2553,22 @@ KActiveLabel *laptop_portable::no_power_management_explanation(TQWidget *parent) if (fd == -1) { switch (errno) { case ENOENT: - explain = new KActiveLabel(i18n("There is no /dev/apm file on this system. Please review the NetBSD documentation on how to create a device node for the APM device driver (man 4 apm)."), parent); + explain = new KActiveLabel(i18n("There is no /dev/apm file on this system. Please review the NetBSD documentation on how to create a device node for the APM device driver (man 4 apm)."), tqparent); break; case EACCES: - explain = new KActiveLabel(i18n("Your system has the proper device node for APM support, however you cannot access it. If you have APM compiled into the kernel this should not happen."), parent); + explain = new KActiveLabel(i18n("Your system has the proper device node for APM support, however you cannot access it. If you have APM compiled into the kernel this should not happen."), tqparent); break; case ENXIO: - explain = new KActiveLabel(i18n("Your kernel lacks support for Advanced Power Management."), parent); + explain = new KActiveLabel(i18n("Your kernel lacks support for Advanced Power Management."), tqparent); break; break; default: - explain = new KActiveLabel(i18n("There was a generic error while opening /dev/apm."), parent); + explain = new KActiveLabel(i18n("There was a generic error while opening /dev/apm."), tqparent); break; } } else { close(fd); - explain = new KActiveLabel(i18n("APM has most likely been disabled."), parent); + explain = new KActiveLabel(i18n("APM has most likely been disabled."), tqparent); } return(explain); @@ -2577,10 +2577,10 @@ KActiveLabel *laptop_portable::no_power_management_explanation(TQWidget *parent) // // explain to the user what they need to do to get suspend/resume to work from user mode // -TQLabel *laptop_portable::how_to_do_suspend_resume(TQWidget *parent) +TQLabel *laptop_portable::how_to_do_suspend_resume(TQWidget *tqparent) { // INSERT HERE - TQLabel* note = new TQLabel(" ", parent); + TQLabel* note = new TQLabel(" ", tqparent); return(note); } @@ -2588,12 +2588,12 @@ TQLabel *laptop_portable::how_to_do_suspend_resume(TQWidget *parent) // pcmcia support - this will be replaced by better - pcmcia support being worked on by // others // -TQLabel *laptop_portable::pcmcia_info(int x, TQWidget *parent) +TQLabel *laptop_portable::pcmcia_info(int x, TQWidget *tqparent) { // INSERT HERE if (x == 0) - return(new TQLabel(i18n("No PCMCIA controller detected"), parent)); - return(new TQLabel(i18n(""), parent)); + return(new TQLabel(i18n("No PCMCIA controller detected"), tqparent)); + return(new TQLabel(i18n(""), tqparent)); } // @@ -2636,7 +2636,7 @@ void laptop_portable::invoke_hibernation() //ACPI specific - chances are you don't need to implement this one // void -laptop_portable::acpi_set_mask(bool, bool, bool, bool, bool ) +laptop_portable::acpi_set_tqmask(bool, bool, bool, bool, bool ) { // INSERT HERE } @@ -2655,7 +2655,7 @@ int laptop_portable::has_apm(int type) } void -laptop_portable::apm_set_mask(bool , bool ) +laptop_portable::apm_set_tqmask(bool , bool ) { } @@ -2861,9 +2861,9 @@ int laptop_portable::has_hibernation() // explain to the user what they need to do if has_power_management() returned 0 // to get any software they lack // -KActiveLabel *laptop_portable::no_power_management_explanation(TQWidget *parent) +KActiveLabel *laptop_portable::no_power_management_explanation(TQWidget *tqparent) { - KActiveLabel* explain = new KActiveLabel(i18n("Your computer or operating system is not supported by the current version of the\nKDE laptop control panels. If you want help porting these panels to work with it\nplease contact [email protected]."), parent); + KActiveLabel* explain = new KActiveLabel(i18n("Your computer or operating system is not supported by the current version of the\nKDE laptop control panels. If you want help porting these panels to work with it\nplease contact [email protected]."), tqparent); // INSERT HERE return(explain); } @@ -2871,9 +2871,9 @@ KActiveLabel *laptop_portable::no_power_management_explanation(TQWidget *parent) // // explain to the user what they need to do to get suspend/resume to work from user mode // -TQLabel *laptop_portable::how_to_do_suspend_resume(TQWidget *parent) +TQLabel *laptop_portable::how_to_do_suspend_resume(TQWidget *tqparent) { - TQLabel* note = new TQLabel(" ", parent); + TQLabel* note = new TQLabel(" ", tqparent); // INSERT HERE return(note); } @@ -2883,12 +2883,12 @@ TQLabel *laptop_portable::how_to_do_suspend_resume(TQWidget *parent) // pcmcia support - this will be replaced by better - pcmcia support being worked on by // others // -TQLabel *laptop_portable::pcmcia_info(int x, TQWidget *parent) +TQLabel *laptop_portable::pcmcia_info(int x, TQWidget *tqparent) { // INSERT HERE if (x == 0) - return(new TQLabel(i18n("No PCMCIA controller detected"), parent)); - return(new TQLabel(i18n(""), parent)); + return(new TQLabel(i18n("No PCMCIA controller detected"), tqparent)); + return(new TQLabel(i18n(""), tqparent)); } // // puts us into standby mode @@ -2917,7 +2917,7 @@ void laptop_portable::invoke_hibernation() //ACPI specific - chances are you don't need to implement this one // void -laptop_portable::acpi_set_mask(bool, bool, bool, bool, bool ) +laptop_portable::acpi_set_tqmask(bool, bool, bool, bool, bool ) { // INSERT HERE } @@ -2929,7 +2929,7 @@ int laptop_portable::has_acpi(int) } void -laptop_portable::apm_set_mask(bool, bool) +laptop_portable::apm_set_tqmask(bool, bool) { // INSERT HERE } @@ -2945,7 +2945,7 @@ int laptop_portable::has_apm(int) // adds extra widgets to the battery panel // void -laptop_portable::extra_config(TQWidget *parent, KConfig *config, TQVBoxLayout *layout) +laptop_portable::extra_config(TQWidget *tqparent, KConfig *config, TQVBoxLayout *tqlayout) { // INSERT HERE } @@ -3080,7 +3080,7 @@ laptop_portable::has_software_suspend(int type) } void -laptop_portable::software_suspend_set_mask(bool hibernate) +laptop_portable::software_suspend_set_tqmask(bool hibernate) { // software_suspend_is_preferred = hibernate; } diff --git a/klaptopdaemon/portable.h b/klaptopdaemon/portable.h index a9fa703..d530fd4 100644 --- a/klaptopdaemon/portable.h +++ b/klaptopdaemon/portable.h @@ -72,9 +72,9 @@ public: static void set_brightness(bool blank, int val); // val = 0-255 255 brightest, 0 means dimmest (if !blank it must be still visible), static int get_brightness(); // returns 0-255 brightness, -1 if you can't static TQString cpu_frequency(); // Returns the cpu freq. - static KActiveLabel *no_power_management_explanation(TQWidget *parent); - static TQLabel *how_to_do_suspend_resume(TQWidget *parent); - static TQLabel *pcmcia_info(int x, TQWidget *parent); + static KActiveLabel *no_power_management_explanation(TQWidget *tqparent); + static TQLabel *how_to_do_suspend_resume(TQWidget *tqparent); + static TQLabel *pcmcia_info(int x, TQWidget *tqparent); /** * Put this computer into standby mode. @@ -98,10 +98,10 @@ public: static void get_battery_status(int &num_batteries, TQStringList &names, TQStringList &state, TQStringList &values); // get multiple battery status static bool has_lav(); // true if the following returns a valid value static float get_load_average(); // current short term load average - static void extra_config(TQWidget *parent, KConfig *config, TQVBoxLayout *layout); - static void acpi_set_mask(bool standby, bool suspend, bool hibernate, bool perf, bool throttle); - static void apm_set_mask(bool standby, bool suspend); - static void software_suspend_set_mask(bool hibernate); + static void extra_config(TQWidget *tqparent, KConfig *config, TQVBoxLayout *tqlayout); + static void acpi_set_tqmask(bool standby, bool suspend, bool hibernate, bool perf, bool throttle); + static void apm_set_tqmask(bool standby, bool suspend); + static void software_suspend_set_tqmask(bool hibernate); /** * Get a list of available performance profiles. diff --git a/klaptopdaemon/power.cpp b/klaptopdaemon/power.cpp index dadf654..e033148 100644 --- a/klaptopdaemon/power.cpp +++ b/klaptopdaemon/power.cpp @@ -4,7 +4,7 @@ * Copyright (c) 1999 Paul Campbell <[email protected]> * Copyright (c) 2002 Marc Mutz <[email protected]> * - * Requires the Qt widget libraries, available at no cost at + * Requires the TQt widget libraries, available at no cost at * http://www.troll.no/ * * This program is free software; you can redistribute it and/or modify @@ -45,8 +45,8 @@ #include <tqtooltip.h> extern void wake_laptop_daemon(); -PowerConfig::PowerConfig (TQWidget * parent, const char *name) - : KCModule(parent, name), +PowerConfig::PowerConfig (TQWidget * tqparent, const char *name) + : KCModule(tqparent, name), nopowerBox(0), nopowerStandby(0), nopowerSuspend(0), @@ -122,7 +122,7 @@ PowerConfig::PowerConfig (TQWidget * parent, const char *name) nopowerBox = new TQVButtonGroup(i18n("Not Powered"), this); TQToolTip::add( nopowerBox, i18n( "Options in this box apply when the laptop is unplugged from the wall and has been idle for a while" ) ); - nopowerBox->layout()->setSpacing( KDialog::spacingHint() ); + nopowerBox->tqlayout()->setSpacing( KDialog::spacingHint() ); hlay->addWidget( nopowerBox ); if (can_standby) { @@ -214,7 +214,7 @@ PowerConfig::PowerConfig (TQWidget * parent, const char *name) powerBox = new TQVButtonGroup(i18n("Powered"), this); - powerBox->layout()->setSpacing( KDialog::spacingHint() ); + powerBox->tqlayout()->setSpacing( KDialog::spacingHint() ); TQToolTip::add( powerBox, i18n( "Options in this box apply when the laptop is plugged into the wall and has been idle for a while" ) ); hlay->addWidget( powerBox ); @@ -305,19 +305,19 @@ PowerConfig::PowerConfig (TQWidget * parent, const char *name) "it works as a sort of extreme screen saver. You can configure different " "timeouts and types of behavior depending on whether or not your laptop is " "plugged in to the mains supply."), this ); - explain->setAlignment( Qt::WordBreak ); + explain->tqsetAlignment( TQt::WordBreak ); top_layout->addWidget(explain); if (can_standby) { TQLabel* explain3 = new TQLabel(i18n("Different laptops may respond to 'standby' in different ways - in many " "it is only a temporary state and may not be useful for you."), this); - explain3->setAlignment( Qt::WordBreak ); - top_layout->addWidget(explain3, 0, Qt::AlignLeft); + explain3->tqsetAlignment( TQt::WordBreak ); + top_layout->addWidget(explain3, 0, TQt::AlignLeft); } top_layout->addStretch(1); - top_layout->addWidget( new TQLabel( i18n("Version: %1").arg(LAPTOP_VERSION), this ), 0, Qt::AlignRight ); + top_layout->addWidget( new TQLabel( i18n("Version: %1").tqarg(LAPTOP_VERSION), this ), 0, TQt::AlignRight ); } } diff --git a/klaptopdaemon/power.h b/klaptopdaemon/power.h index c5d7761..d856dcd 100644 --- a/klaptopdaemon/power.h +++ b/klaptopdaemon/power.h @@ -3,7 +3,7 @@ * * Copyright (c) 1999 Paul Campbell <[email protected]> * - * Requires the Qt widget libraries, available at no cost at + * Requires the TQt widget libraries, available at no cost at * http://www.troll.no/ * * This program is free software; you can redistribute it and/or modify @@ -41,8 +41,9 @@ class KDoubleSpinBox; class PowerConfig : public KCModule { Q_OBJECT + TQ_OBJECT public: - PowerConfig( TQWidget *parent=0, const char* name=0); + PowerConfig( TQWidget *tqparent=0, const char* name=0); ~PowerConfig(); void save( void ); void load(); diff --git a/klaptopdaemon/profile.cpp b/klaptopdaemon/profile.cpp index db3cfde..d8f442f 100644 --- a/klaptopdaemon/profile.cpp +++ b/klaptopdaemon/profile.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 2003 Paul Campbell <[email protected]> * - * Requires the Qt widget libraries, available at no cost at + * Requires the TQt widget libraries, available at no cost at * http://www.troll.no/ * * This program is free software; you can redistribute it and/or modify @@ -40,7 +40,7 @@ #include <kmessagebox.h> #include <kcombobox.h> -// other Qt headers: +// other TQt headers: #include <tqlayout.h> #include <tqlabel.h> #include <tqcheckbox.h> @@ -53,8 +53,8 @@ extern void wake_laptop_daemon(); -ProfileConfig::ProfileConfig(TQWidget * parent, const char *name) - : KCModule(parent, name) +ProfileConfig::ProfileConfig(TQWidget * tqparent, const char *name) + : KCModule(tqparent, name) { TQStringList performance_list; int current_performance; @@ -205,15 +205,15 @@ ProfileConfig::ProfileConfig(TQWidget * parent, const char *name) TQLabel *tmp_label = new TQLabel(i18n("This panel allows you to set default values for system attributes " "so that they change when the laptop is plugged in to the wall or " "running on batteries."), this ); - tmp_label->setAlignment( Qt::WordBreak ); + tmp_label->tqsetAlignment( TQt::WordBreak ); top_layout->addWidget( tmp_label ); tmp_label = new TQLabel(i18n("You can also set options for these values that will be set by low battery " "conditions, or system inactivity in the other panels"), this ); - tmp_label->setAlignment( Qt::WordBreak ); + tmp_label->tqsetAlignment( TQt::WordBreak ); top_layout->addWidget( tmp_label ); top_layout->addStretch(1); - top_layout->addWidget( new TQLabel( i18n("Version: %1").arg(LAPTOP_VERSION), this), 0, Qt::AlignRight ); + top_layout->addWidget( new TQLabel( i18n("Version: %1").tqarg(LAPTOP_VERSION), this), 0, TQt::AlignRight ); load(); diff --git a/klaptopdaemon/profile.h b/klaptopdaemon/profile.h index 72c13db..2d44e59 100644 --- a/klaptopdaemon/profile.h +++ b/klaptopdaemon/profile.h @@ -3,7 +3,7 @@ * * Copyright (c) 2003 Paul Campbell <[email protected]> * - * Requires the Qt widget libraries, available at no cost at + * Requires the TQt widget libraries, available at no cost at * http://www.troll.no/ * * This program is free software; you can redistribute it and/or modify @@ -42,8 +42,9 @@ class KComboBox; class ProfileConfig : public KCModule { Q_OBJECT + TQ_OBJECT public: - ProfileConfig( TQWidget *parent=0, const char* name=0); + ProfileConfig( TQWidget *tqparent=0, const char* name=0); ~ProfileConfig( ); void save( void ); diff --git a/klaptopdaemon/sony.cpp b/klaptopdaemon/sony.cpp index b97b05e..3ecbf35 100644 --- a/klaptopdaemon/sony.cpp +++ b/klaptopdaemon/sony.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 2002 Paul Campbell <[email protected]> * - * Requires the Qt widget libraries, available at no cost at + * Requires the TQt widget libraries, available at no cost at * http://www.troll.no/ * * This program is free software; you can redistribute it and/or modify @@ -42,7 +42,7 @@ #include <kmessagebox.h> #include <krichtextlabel.h> -// other Qt headers: +// other TQt headers: #include <tqlayout.h> #include <tqlabel.h> #include <tqcheckbox.h> @@ -55,8 +55,8 @@ extern void wake_laptop_daemon(); -SonyConfig::SonyConfig(TQWidget * parent, const char *name) - : KCModule(parent, name) +SonyConfig::SonyConfig(TQWidget * tqparent, const char *name) + : KCModule(tqparent, name) { KGlobal::locale()->insertCatalogue("klaptopdaemon"); // For translation of klaptopdaemon messages @@ -68,7 +68,7 @@ SonyConfig::SonyConfig(TQWidget * parent, const char *name) // TODO: remove linefeed from string, can't do it right now coz we have a string freeze top_layout->addWidget(new KRichTextLabel(i18n("This panel allows you to control some of the features of the\n" "'sonypi' device for your laptop - you should not enable the options below if you\nalso " - "use the 'sonypid' program in your system").replace("\n", " "), this)); + "use the 'sonypid' program in your system").tqreplace("\n", " "), this)); enableScrollBar = new TQCheckBox( i18n("Enable &scroll bar"), this ); TQToolTip::add( enableScrollBar, i18n( "When checked this box enables the scrollbar so that it works under KDE" ) ); @@ -86,7 +86,7 @@ SonyConfig::SonyConfig(TQWidget * parent, const char *name) // TODO: remove linefeed from string, can't do it right now coz we have a string freeze top_layout->addWidget(new KRichTextLabel(i18n("The /dev/sonypi is not accessable, if you wish to use the above features its\n" - "protections need to be changed. Clicking on the button below will change them\n").replace("\n", " "), this)); + "protections need to be changed. Clicking on the button below will change them\n").tqreplace("\n", " "), this)); TQHBoxLayout *ll = new TQHBoxLayout(); TQPushButton *setupButton = new TQPushButton(i18n("Setup /dev/sonypi"), this); connect( setupButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(setupHelper()) ); @@ -99,7 +99,7 @@ SonyConfig::SonyConfig(TQWidget * parent, const char *name) top_layout->addStretch(1); - top_layout->addWidget( new TQLabel( i18n("Version: %1").arg(LAPTOP_VERSION), this), 0, Qt::AlignRight ); + top_layout->addWidget( new TQLabel( i18n("Version: %1").tqarg(LAPTOP_VERSION), this), 0, TQt::AlignRight ); load(); diff --git a/klaptopdaemon/sony.h b/klaptopdaemon/sony.h index b82cd09..80648e2 100644 --- a/klaptopdaemon/sony.h +++ b/klaptopdaemon/sony.h @@ -3,7 +3,7 @@ * * Copyright (c) 2002 Paul Campbell <[email protected]> * - * Requires the Qt widget libraries, available at no cost at + * Requires the TQt widget libraries, available at no cost at * http://www.troll.no/ * * This program is free software; you can redistribute it and/or modify @@ -41,8 +41,9 @@ class TQPushButton; class SonyConfig : public KCModule { Q_OBJECT + TQ_OBJECT public: - SonyConfig( TQWidget *parent=0, const char* name=0); + SonyConfig( TQWidget *tqparent=0, const char* name=0); ~SonyConfig( ); void save( void ); diff --git a/klaptopdaemon/warning.cpp b/klaptopdaemon/warning.cpp index c098718..826489a 100644 --- a/klaptopdaemon/warning.cpp +++ b/klaptopdaemon/warning.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1999 Paul Campbell <[email protected]> * - * Requires the Qt widget libraries, available at no cost at + * Requires the TQt widget libraries, available at no cost at * http://www.troll.no/ * * This program is free software; you can redistribute it and/or modify @@ -44,8 +44,8 @@ extern void wake_laptop_daemon(); -WarningConfig::WarningConfig (int t, TQWidget * parent, const char *name) - : KCModule(parent, name), +WarningConfig::WarningConfig (int t, TQWidget * tqparent, const char *name) + : KCModule(tqparent, name), checkSuspend(0), checkStandby(0), checkHibernate(0) @@ -84,9 +84,9 @@ WarningConfig::WarningConfig (int t, TQWidget * parent, const char *name) editCriticalPercent->setSuffix(i18n("keep short, unit in spinbox", "%")); TQToolTip::add(editCriticalPercent, i18n("When this amount of battery life is left the actions below will be triggered")); grid->addWidget(checkCriticalTime, curRow, 0); - grid->addWidget(editCriticalTime, curRow++, Qt::AlignLeft); + grid->addWidget(editCriticalTime, curRow++, TQt::AlignLeft); grid->addWidget(checkCriticalPercent, curRow, 0); - grid->addWidget(editCriticalPercent, curRow++, Qt::AlignLeft); + grid->addWidget(editCriticalPercent, curRow++, TQt::AlignLeft); connect(editCriticalTime, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(configChanged())); connect(editCriticalPercent, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(configChanged())); @@ -104,9 +104,9 @@ WarningConfig::WarningConfig (int t, TQWidget * parent, const char *name) editLowPercent->setSuffix(i18n("keep short, unit in spinbox", "%")); TQToolTip::add(editLowPercent, i18n("When this amount of battery life is left the actions below will be triggered")); grid->addWidget(checkLowTime, curRow, 0); - grid->addWidget(editLowTime, curRow++, Qt::AlignLeft); + grid->addWidget(editLowTime, curRow++, TQt::AlignLeft); grid->addWidget(checkLowPercent, curRow, 0); - grid->addWidget(editLowPercent, curRow++, Qt::AlignLeft); + grid->addWidget(editLowPercent, curRow++, TQt::AlignLeft); connect(editLowTime, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(configChanged())); connect(editLowPercent, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(configChanged())); @@ -164,7 +164,7 @@ WarningConfig::WarningConfig (int t, TQWidget * parent, const char *name) if (can_brightness) { checkBrightness = new TQCheckBox(i18n("Panel b&rightness"), this); - checkBrightness->setMinimumSize(checkBrightness->sizeHint()); + checkBrightness->setMinimumSize(checkBrightness->tqsizeHint()); TQToolTip::add( checkBrightness, i18n( "If enabled the back panel brightness will change" ) ); grid->addWidget(checkBrightness, curRow, 0); connect(checkBrightness, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(brightness_changed(bool))); @@ -236,23 +236,23 @@ WarningConfig::WarningConfig (int t, TQWidget * parent, const char *name) TQVButtonGroup *b = new TQVButtonGroup(i18n("System State Change"), this); TQToolTip::add( b, i18n( "You may choose one of the following to occur when the battery gets low" ) ); - b->layout()->setSpacing( KDialog::spacingHint() ); + b->tqlayout()->setSpacing( KDialog::spacingHint() ); if (can_standby) { checkStandby = new TQRadioButton(i18n("Standb&y"), b); TQToolTip::add( checkStandby, i18n( "Move the system into the standby state - a temporary lower power state" ) ); - checkStandby->setMinimumSize(checkStandby->sizeHint()); + checkStandby->setMinimumSize(checkStandby->tqsizeHint()); connect(checkStandby, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); } if (can_suspend) { checkSuspend = new TQRadioButton(i18n("&Suspend"), b); TQToolTip::add( checkSuspend, i18n( "Move the system into the suspend state - also known as 'save-to-ram'" ) ); - checkSuspend->setMinimumSize(checkSuspend->sizeHint()); + checkSuspend->setMinimumSize(checkSuspend->tqsizeHint()); connect(checkSuspend, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); } if (can_hibernate) { checkHibernate = new TQRadioButton(i18n("H&ibernate"), b); TQToolTip::add( checkHibernate, i18n( "Move the system into the hibernate state - also known as 'save-to-disk'" ) ); - checkHibernate->setMinimumSize(checkHibernate->sizeHint()); + checkHibernate->setMinimumSize(checkHibernate->tqsizeHint()); connect(checkHibernate, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); } // setup the logout option @@ -266,7 +266,7 @@ WarningConfig::WarningConfig (int t, TQWidget * parent, const char *name) checkNone = new TQRadioButton(i18n("&None"), b); connect(checkNone, TQT_SIGNAL(clicked()), this, TQT_SLOT(configChanged())); - grid->addMultiCellWidget(b, curRow, curRow, 0, 1, Qt::AlignLeft|Qt::AlignTop); + grid->addMultiCellWidget(b, curRow, curRow, 0, 1, TQt::AlignLeft|TQt::AlignTop); curRow++; @@ -276,7 +276,7 @@ WarningConfig::WarningConfig (int t, TQWidget * parent, const char *name) } else { explain = new TQLabel(i18n("This panel controls how and when you receive warnings that your battery power is about to run out"), this); } - explain->setAlignment( Qt::WordBreak ); + explain->tqsetAlignment( TQt::WordBreak ); grid->addMultiCellWidget(explain, curRow, curRow, 0, 1); ++curRow; @@ -288,8 +288,8 @@ WarningConfig::WarningConfig (int t, TQWidget * parent, const char *name) } grid->setRowStretch(curRow++, 1); - grid->addWidget(new TQLabel( i18n("Version: %1").arg(LAPTOP_VERSION), this), - curRow, 1, Qt::AlignRight); + grid->addWidget(new TQLabel( i18n("Version: %1").tqarg(LAPTOP_VERSION), this), + curRow, 1, TQt::AlignRight); } my_load(1); @@ -560,7 +560,7 @@ void WarningConfig::enablePlaySound(bool enable) void WarningConfig::browseRunCommand() { - KURL url = KFileDialog::getOpenURL(TQString::null, TQString::null, this ); + KURL url = KFileDialog::getOpenURL(TQString(), TQString(), this ); if( url.isEmpty() ) return; @@ -577,7 +577,7 @@ void WarningConfig::browseRunCommand() void WarningConfig::browsePlaySound() { - KURL url = KFileDialog::getOpenURL(TQString::null, TQString::null, this ); + KURL url = KFileDialog::getOpenURL(TQString(), TQString(), this ); if( url.isEmpty() ) return; diff --git a/klaptopdaemon/warning.h b/klaptopdaemon/warning.h index f51808d..2c52348 100644 --- a/klaptopdaemon/warning.h +++ b/klaptopdaemon/warning.h @@ -4,7 +4,7 @@ * Copyright (c) 1999 Paul Campbell <[email protected]> * Copyright (c) 2002 Marc Mutz <[email protected]> * - * Requires the Qt widget libraries, available at no cost at + * Requires the TQt widget libraries, available at no cost at * http://www.troll.no/ * * This program is free software; you can redistribute it and/or modify @@ -41,8 +41,9 @@ class KComboBox; class WarningConfig : public KCModule { Q_OBJECT + TQ_OBJECT public: - WarningConfig(int x, TQWidget *parent=0, const char* name=0); + WarningConfig(int x, TQWidget *tqparent=0, const char* name=0); ~WarningConfig(); void save( void ); void load(); diff --git a/klaptopdaemon/xautolock.cc b/klaptopdaemon/xautolock.cc index 630b175..51e1637 100644 --- a/klaptopdaemon/xautolock.cc +++ b/klaptopdaemon/xautolock.cc @@ -32,7 +32,7 @@ extern "C" { #include <X11/extensions/dpms.h> #ifndef HAVE_DPMSINFO_PROTO -Status DPMSInfo ( Display *, CARD16 *, BOOL * ); +tqStatus DPMSInfo ( Display *, CARD16 *, BOOL * ); #endif } #endif @@ -246,14 +246,14 @@ bool XAutoLock::x11Event( XEvent* ev ) // don't futher process key events that were received only because XAutoLock wants them if( ev->type == KeyPress && !ev->xkey.send_event && !xautolock_useXidle && !xautolock_useMit - && !TQWidget::find( ev->xkey.window )) + && !TQWidget::tqfind( ev->xkey.window )) return true; return false; } bool XAutoLock::ignoreWindow( WId w ) { - if( w != qt_xrootwin() && TQWidget::find( w )) + if( w != qt_xrootwin() && TQWidget::tqfind( w )) return true; return false; } diff --git a/klaptopdaemon/xautolock.h b/klaptopdaemon/xautolock.h index 35b5320..e248e5e 100644 --- a/klaptopdaemon/xautolock.h +++ b/klaptopdaemon/xautolock.h @@ -17,9 +17,10 @@ // Detect user inactivity. // Named XAutoLock after the program that it is based on. // -class XAutoLock : public QWidget +class XAutoLock : public TQWidget { Q_OBJECT + TQ_OBJECT public: XAutoLock(); ~XAutoLock(); diff --git a/klaptopdaemon/xautolock_diy.c b/klaptopdaemon/xautolock_diy.c index b9df2f8..1aacf5e 100644 --- a/klaptopdaemon/xautolock_diy.c +++ b/klaptopdaemon/xautolock_diy.c @@ -95,24 +95,24 @@ static void selectEvents (Window window, Bool substructureOnly) { Window root; /* root window of the window */ - Window parent; /* parent of the window */ - Window* children; /* children of the window */ - unsigned nofChildren = 0; /* number of children */ + Window tqparent; /* tqparent of the window */ + Window* tqchildren; /* tqchildren of the window */ + unsigned nofChildren = 0; /* number of tqchildren */ unsigned i; /* loop counter */ XWindowAttributes attribs; /* attributes of the window */ if( xautolock_ignoreWindow( window )) return; /* - * Start by querying the server about the root and parent windows. + * Start by querying the server about the root and tqparent windows. */ - if (!XQueryTree (queue.display, window, &root, &parent, - &children, &nofChildren)) + if (!XQueryTree (queue.display, window, &root, &tqparent, + &tqchildren, &nofChildren)) { return; } - if (nofChildren) (void) XFree ((char*) children); + if (nofChildren) (void) XFree ((char*) tqchildren); /* * Build the appropriate event mask. The basic idea is that we don't @@ -132,7 +132,7 @@ selectEvents (Window window, Bool substructureOnly) } else { - if (parent == None) /* the *real* rootwindow */ + if (tqparent == None) /* the *real* rootwindow */ { attribs.all_event_masks = attribs.do_not_propagate_mask = KeyPressMask; @@ -168,7 +168,7 @@ selectEvents (Window window, Bool substructureOnly) } /* - * Now ask for the list of children again, since it might have changed + * Now ask for the list of tqchildren again, since it might have changed * in between the last time and us selecting SubstructureNotifyMask. * * There is a (very small) chance that we might process a subtree twice: @@ -178,21 +178,21 @@ selectEvents (Window window, Bool substructureOnly) * XGrabServer(), but that'd be an impolite thing to do, and since it * isn't required... */ - if (!XQueryTree (queue.display, window, &root, &parent, - &children, &nofChildren)) + if (!XQueryTree (queue.display, window, &root, &tqparent, + &tqchildren, &nofChildren)) { return; } /* - * Now do the same thing for all children. + * Now do the same thing for all tqchildren. */ for (i = 0; i < nofChildren; ++i) { - selectEvents (children[i], substructureOnly); + selectEvents (tqchildren[i], substructureOnly); } - if (nofChildren) (void) XFree ((char*) children); + if (nofChildren) (void) XFree ((char*) tqchildren); } #if 0 diff --git a/klaptopdaemon/xautolock_engine.c b/klaptopdaemon/xautolock_engine.c index 62f968a..08094e7 100644 --- a/klaptopdaemon/xautolock_engine.c +++ b/klaptopdaemon/xautolock_engine.c @@ -74,7 +74,7 @@ xautolock_queryPointer (Display* d) { Window dummyWin; /* as it says */ int dummyInt; /* as it says */ - unsigned mask; /* modifier mask */ + unsigned tqmask; /* modifier tqmask */ int rootX; /* as it says */ int rootY; /* as it says */ int corner; /* corner index */ @@ -104,7 +104,7 @@ xautolock_queryPointer (Display* d) * of pointer events. */ if (!XQueryPointer (d, root, &root, &dummyWin, &rootX, &rootY, - &dummyInt, &dummyInt, &mask)) + &dummyInt, &dummyInt, &tqmask)) { /* * Pointer has moved to another screen, so let's find out which one. @@ -121,7 +121,7 @@ xautolock_queryPointer (Display* d) if ( rootX == prevRootX && rootY == prevRootY - && mask == prevMask) + && tqmask == prevMask) { xautolock_corner_t* corners = xautolock_corners; /* @@ -186,7 +186,7 @@ xautolock_queryPointer (Display* d) #endif prevRootX = rootX; prevRootY = rootY; - prevMask = mask; + prevMask = tqmask; xautolock_resetTriggers (); } @@ -224,7 +224,7 @@ evaluateTriggers (Display* d) * when we are finally re-enabled. */ #ifdef VMS - if (vmsStatus == 0) + if (vmstqStatus == 0) { #else /* VMS */ if (lockerPid) @@ -336,7 +336,7 @@ evaluateTriggers (Display* d) || now >= lockTrigger) { #ifdef VMS - if (vmsStatus != 0) + if (vmstqStatus != 0) #else /* VMS */ if (!lockerPid) #endif /* VMS */ @@ -350,9 +350,9 @@ evaluateTriggers (Display* d) case 0: (void) close (ConnectionNumber (d)); #ifdef VMS - vmsStatus = 0; + vmstqStatus = 0; lockerPid = lib$spawn ((lockNow ? &nowLockerDescr : &lockerDescr), - 0, 0, &1, 0, 0, &vmsStatus); + 0, 0, &1, 0, 0, &vmstqStatus); if (!(lockerPid & 1)) exit (lockerPid); @@ -380,7 +380,7 @@ evaluateTriggers (Display* d) * Nevertheless, simply resetting the screensaver is a * convenience action that aids many xlock users, and doesn't * harm anyone (*). The problem with older versions of xlock - * is that they can be told to replace (= disable) the real + * is that they can be told to tqreplace (= disable) the real * screensaver, but forget to reset that same screensaver if * it was already active at the time xlock starts. I guess * xlock initially wasn't designed to be run without a user |