From 0af498ec7d2af08ea8e01b54cc29fae9975b8c91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Sun, 18 Aug 2013 16:22:39 +0200 Subject: Initial TQt conversion --- kkbswitch/boldlistboxitem.cpp | 14 ++-- kkbswitch/boldlistboxitem.h | 8 +-- kkbswitch/boldmenuitem.cpp | 22 +++--- kkbswitch/boldmenuitem.h | 24 +++---- kkbswitch/kbconfig.cpp | 106 +++++++++++++-------------- kkbswitch/kbconfig.h | 28 ++++---- kkbswitch/kbconfigdlg.cpp | 146 +++++++++++++++++++------------------- kkbswitch/kbconfigdlg.h | 34 ++++----- kkbswitch/kbgroup.cpp | 2 +- kkbswitch/kbgroup.h | 22 +++--- kkbswitch/kbpickicondlg.cpp | 88 +++++++++++------------ kkbswitch/kbpickicondlg.h | 28 ++++---- kkbswitch/kbswitchapp.cpp | 24 +++---- kkbswitch/kbswitchapp.h | 4 +- kkbswitch/kbswitchintf.cpp | 8 +-- kkbswitch/kbswitchintf.h | 10 +-- kkbswitch/kbswitchintf_skel.cpp | 14 ++-- kkbswitch/kbswitchtrayicon.cpp | 42 +++++------ kkbswitch/kbswitchtrayicon.h | 2 +- kkbswitch/pathlistboxitem.cpp | 4 +- kkbswitch/pathlistboxitem.h | 12 ++-- kkbswitch/singlewindowwatcher.cpp | 2 +- kkbswitch/singlewindowwatcher.h | 6 +- kkbswitch/windowclasswatcher.cpp | 16 ++--- kkbswitch/windowclasswatcher.h | 12 ++-- kkbswitch/windowwatcher.cpp | 4 +- kkbswitch/windowwatcher.h | 6 +- kkbswitch/xkeyboard.cpp | 18 ++--- kkbswitch/xkeyboard.h | 8 +-- 29 files changed, 357 insertions(+), 357 deletions(-) (limited to 'kkbswitch') diff --git a/kkbswitch/boldlistboxitem.cpp b/kkbswitch/boldlistboxitem.cpp index a136f0c..7e247d0 100644 --- a/kkbswitch/boldlistboxitem.cpp +++ b/kkbswitch/boldlistboxitem.cpp @@ -16,11 +16,11 @@ ***************************************************************************/ #include "boldlistboxitem.h" -#include +#include -BoldListBoxItem::BoldListBoxItem(QListBox *listbox, const QPixmap &pix, - const QString &text, bool bold) - : QListBoxPixmap(listbox, pix, text), m_bold(bold) +BoldListBoxItem::BoldListBoxItem(TQListBox *listbox, const TQPixmap &pix, + const TQString &text, bool bold) + : TQListBoxPixmap(listbox, pix, text), m_bold(bold) { } @@ -28,12 +28,12 @@ BoldListBoxItem::~BoldListBoxItem() { } -void BoldListBoxItem::paint(QPainter *painter) +void BoldListBoxItem::paint(TQPainter *painter) { if (m_bold) { - QFont font = painter->font(); + TQFont font = painter->font(); font.setBold(true); painter->setFont(font); } - QListBoxPixmap::paint(painter); + TQListBoxPixmap::paint(painter); } diff --git a/kkbswitch/boldlistboxitem.h b/kkbswitch/boldlistboxitem.h index 49ca269..78949c7 100644 --- a/kkbswitch/boldlistboxitem.h +++ b/kkbswitch/boldlistboxitem.h @@ -18,19 +18,19 @@ #ifndef BOLDLISTBOXITEM_H #define BOLDLISTBOXITEM_H -#include +#include /**Listbox item that can optionally display its text in bold *@author Leonid Zeitlin */ -class BoldListBoxItem : public QListBoxPixmap { +class BoldListBoxItem : public TQListBoxPixmap { private: bool m_bold; protected: - virtual void paint (QPainter *painter); + virtual void paint (TQPainter *painter); public: - BoldListBoxItem(QListBox *listbox, const QPixmap &pix, const QString &text, + BoldListBoxItem(TQListBox *listbox, const TQPixmap &pix, const TQString &text, bool bold = false); ~BoldListBoxItem(); bool bold() { return m_bold; } diff --git a/kkbswitch/boldmenuitem.cpp b/kkbswitch/boldmenuitem.cpp index 1c12656..69dee04 100644 --- a/kkbswitch/boldmenuitem.cpp +++ b/kkbswitch/boldmenuitem.cpp @@ -16,10 +16,10 @@ ***************************************************************************/ #include "boldmenuitem.h" -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include @@ -30,7 +30,7 @@ #endif -BoldMenuItem::BoldMenuItem(const QString &text, const QColor &active_text_color, +BoldMenuItem::BoldMenuItem(const TQString &text, const TQColor &active_text_color, bool bold) : m_text(text), m_active_text_color(active_text_color), m_bold(bold) { @@ -39,10 +39,10 @@ BoldMenuItem::BoldMenuItem(const QString &text, const QColor &active_text_color, BoldMenuItem::~BoldMenuItem(){ } -void BoldMenuItem::paint(QPainter* painter, const QColorGroup& /*cg*/, +void BoldMenuItem::paint(TQPainter* painter, const TQColorGroup& /*cg*/, bool act, bool /*enabled*/, int x, int y, int w, int h) { - QFont font = painter->font(); + TQFont font = painter->font(); if (font.bold() != m_bold) { font.setBold(m_bold); painter->setFont(font); @@ -54,15 +54,15 @@ void BoldMenuItem::paint(QPainter* painter, const QColorGroup& /*cg*/, painter->drawText(x, y, w, h, AlignLeft | AlignVCenter | ShowPrefix | DontClip, m_text); - //KApplication::style().drawItem(painter, QRect(x, y, w, h), AlignLeft | AlignVCenter | ShowPrefix | DontClip, + //KApplication::style().drawItem(painter, TQRect(x, y, w, h), AlignLeft | AlignVCenter | ShowPrefix | DontClip, // cg, enabled, 0, m_text); } -void BoldMenuItem::setFont(const QFont& font) +void BoldMenuItem::setFont(const TQFont& font) { - m_size = QFontMetrics(font).size(AlignLeft | AlignVCenter | ShowPrefix | DontClip, + m_size = TQFontMetrics(font).size(AlignLeft | AlignVCenter | ShowPrefix | DontClip, m_text); - QCustomMenuItem::setFont(font); + TQCustomMenuItem::setFont(font); } diff --git a/kkbswitch/boldmenuitem.h b/kkbswitch/boldmenuitem.h index 99ed2b9..bc87c95 100644 --- a/kkbswitch/boldmenuitem.h +++ b/kkbswitch/boldmenuitem.h @@ -18,35 +18,35 @@ #ifndef BOLDMENUITEM_H #define BOLDMENUITEM_H -#include +#include /**A custom menu item that can display its text in bold *@author Leonid Zeitlin * 02.09.2001: somehow I cannot make it work. The item looks ok when not * selected, but appears empty when selected. I have a suspicion that this * is a problem with some KDE styles (B3 in particular), the style doesn't - * paint custom menu items correctly. With some other styles, such as Qt built-in + * paint custom menu items correctly. With some other styles, such as TQt built-in * Windows style, everything works correctly. I suspend the work on this for the * time being... */ -class BoldMenuItem : public QCustomMenuItem { +class BoldMenuItem : public TQCustomMenuItem { private: - QString m_text; - QColor m_active_text_color; + TQString m_text; + TQColor m_active_text_color; bool m_bold; - QSize m_size; + TQSize m_size; public: - BoldMenuItem(const QString &text, const QColor &active_text_color, bool bold = false); + BoldMenuItem(const TQString &text, const TQColor &active_text_color, bool bold = false); ~BoldMenuItem(); - QString& text() { return m_text; }; - void setText(const QString& value) { m_text = value; }; + TQString& text() { return m_text; }; + void setText(const TQString& value) { m_text = value; }; bool bold() { return m_bold; }; void setBold(bool value) { m_bold = value; }; - virtual void paint(QPainter* painter, const QColorGroup& /*cg*/, + virtual void paint(TQPainter* painter, const TQColorGroup& /*cg*/, bool act, bool /*enabled*/, int x, int y, int w, int h); - virtual void setFont(const QFont& font); - virtual QSize sizeHint() { return m_size; }; + virtual void setFont(const TQFont& font); + virtual TQSize sizeHint() { return m_size; }; }; #endif diff --git a/kkbswitch/kbconfig.cpp b/kkbswitch/kbconfig.cpp index b7c5cac..41bb6f1 100644 --- a/kkbswitch/kbconfig.cpp +++ b/kkbswitch/kbconfig.cpp @@ -30,9 +30,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "kbconfig.h" #include "xkeyboard.h" @@ -79,20 +79,20 @@ void KBConfig::load(KConfig *config){ m_use_shortcuts = config->readBoolEntry(USE_SHORTCUTS_ENTRY, false); XKeyboard *xkb = XKeyboard::self(); - QStringList list; + TQStringList list; xkb->getGroupNames(list); unsigned int i = 0; m_groups.clear(); m_groups.resize(xkb->getNumKbdGroups()); - QString name; - for (QStringList::Iterator iter = list.begin(); iter != list.end(); iter++, i++) { + TQString name; + for (TQStringList::Iterator iter = list.begin(); iter != list.end(); iter++, i++) { name = *iter; - if (name == QString::null) name = i18n(""); + if (name == TQString::null) name = i18n(""); m_groups.insert(i, new KBGroup(name)); } - QValueVector pixlist; - QStringList iconpaths; + TQValueVector pixlist; + TQStringList iconpaths; drawIcons(m_icon_style, &pixlist, &iconpaths); for (i = 0; i < m_groups.count(); i++) { m_groups[i]->setPixmap(pixlist[i]); @@ -102,9 +102,9 @@ void KBConfig::load(KConfig *config){ if (m_keys) delete m_keys; m_keys = new KGlobalAccel(NULL); for (int i = 0; i < groupCount(); i++) { - m_keys->insert(QString::fromLatin1("SetGroup %1").arg(i), + m_keys->insert(TQString::fromLatin1("SetGroup %1").arg(i), i18n("Activate %1 keyboard layout").arg(m_groups[i]->getName()), - QString::null, Qt::ALT+Qt::CTRL+Qt::Key_1 + i, KKey::QtWIN+Qt::CTRL+Qt::Key_1 + i, + TQString::null, TQt::ALT+TQt::CTRL+TQt::Key_1 + i, KKey::QtWIN+TQt::CTRL+TQt::Key_1 + i, kapp, SLOT(slotGroupSelected(int))); } m_keys->readSettings(config); @@ -124,11 +124,11 @@ void KBConfig::save(KConfig *config) m_keys->writeSettings(config); } -void KBConfig::drawIcons(IconStyle icon_style, QValueVector *icons, - QStringList *iconpaths) +void KBConfig::drawIcons(IconStyle icon_style, TQValueVector *icons, + TQStringList *iconpaths) { - QString path, countryCode, langCode; - QStringList layouts; + TQString path, countryCode, langCode; + TQStringList layouts; KGlobal::dirs()->addResourceDir("appdata", "."); KConfig map("group_names", true, true, "appdata"); @@ -147,9 +147,9 @@ void KBConfig::drawIcons(IconStyle icon_style, QValueVector *icons, map.setGroup("Languages"); langCode = map.readEntry(m_groups[i]->getName()); if (langCode.isEmpty()) langCode = countryCode; - QPixmap &pix = (*icons)[i]; + TQPixmap &pix = (*icons)[i]; pix.resize(0, 0); - path = QString::null; + path = TQString::null; if (icon_style == ICON_FLAG /*&& !countryCode.isEmpty()*/) drawFlagPixmap(pix, path, countryCode, i, config); else if (icon_style == ICON_CODE_AND_FLAG /*&& !countryCode.isEmpty()*/) @@ -165,8 +165,8 @@ void KBConfig::drawIcons(IconStyle icon_style, QValueVector *icons, /*void KBConfig::guessGroupPixmaps(){ KGlobal::dirs()->addResourceDir("appdata", "."); KConfig map("group_names", true, true, "appdata"); - QString path, countryCode, langCode; - QPixmap pix; + TQString path, countryCode, langCode; + TQPixmap pix; for (unsigned int i = 0; i < m_groups.count(); i++) { if (m_groups[i]->getPixmap().isNull()) { @@ -187,7 +187,7 @@ void KBConfig::drawIcons(IconStyle icon_style, QValueVector *icons, } }*/ -bool KBConfig::getGroupImage(QImage &img, QString &path, const QString &code, +bool KBConfig::getGroupImage(TQImage &img, TQString &path, const TQString &code, int group, KConfig *config) { bool ret = true; @@ -197,12 +197,12 @@ bool KBConfig::getGroupImage(QImage &img, QString &path, const QString &code, if (path.isEmpty() || !img.load(path)) { if (code.isEmpty()) ret = false; else { - path = locate("locale", QString("l10n/%1/flag.png").arg(code)); + path = locate("locale", TQString("l10n/%1/flag.png").arg(code)); if (!path.isEmpty()) ret = img.load(path); else { // I am told in Red Hat 9 standard KDE flag pixmaps are missing. // Workaround: we have to simulate them by rescaling GKB's pixmaps - path = QString("/usr/share/pixmaps/gkb/%1.png").arg(code); + path = TQString("/usr/share/pixmaps/gkb/%1.png").arg(code); ret = img.load(path) && !img.isNull(); need_to_scale = true; } @@ -216,62 +216,62 @@ bool KBConfig::getGroupImage(QImage &img, QString &path, const QString &code, return ret; } -void KBConfig::drawFlagPixmap(QPixmap &pix, QString &path, const QString &code, +void KBConfig::drawFlagPixmap(TQPixmap &pix, TQString &path, const TQString &code, int group, KConfig *config) { - QImage img; + TQImage img; if (getGroupImage(img, path, code, group, config)) pix.convertFromImage(img); } -void KBConfig::drawCodePixmap(QPixmap &pix, const QString &code) +void KBConfig::drawCodePixmap(TQPixmap &pix, const TQString &code) { pix.resize(19, 16); - QPainter painter(&pix); - QFont font("helvetica", 9, QFont::Bold); + TQPainter painter(&pix); + TQFont font("helvetica", 9, TQFont::Bold); font.setPixelSize(10); painter.setFont(font); painter.setPen(KGlobalSettings::highlightedTextColor()); pix.fill(KGlobalSettings::highlightColor()); painter.drawText(1, 0, pix.width(), pix.height(), - Qt::AlignHCenter | Qt::AlignVCenter, code.upper()); + TQt::AlignHCenter | TQt::AlignVCenter, code.upper()); - /*QSize size = painter.fontMetrics().size(0, code.upper()); + /*TQSize size = painter.fontMetrics().size(0, code.upper()); kdDebug() << size.width() << " x " << size.height() << endl;*/ } -void KBConfig::drawCodeAndFlagPixmap(QPixmap &pix, QString &path, - const QString &countryCode, const QString &langCode, int group, KConfig *config) +void KBConfig::drawCodeAndFlagPixmap(TQPixmap &pix, TQString &path, + const TQString &countryCode, const TQString &langCode, int group, KConfig *config) { - QImage img; + TQImage img; if (!getGroupImage(img, path, countryCode, group, config)) return; // could not find flag if (img.depth() <= 8) img = img.convertDepth(32); // the following code is taken from kdebase/kxkb/pixmap.cpp for (int y = 0; y < img.height(); y++) for(int x = 0; x < img.width(); x++) { - QRgb rgb = img.pixel(x, y); - img.setPixel(x, y, qRgb(qRed(rgb)*3/4, qGreen(rgb)*3/4, qBlue(rgb)*3/4)); + TQRgb rgb = img.pixel(x, y); + img.setPixel(x, y, tqRgb(tqRed(rgb)*3/4, tqGreen(rgb)*3/4, tqBlue(rgb)*3/4)); } pix.convertFromImage(img); - QPainter painter(&pix); - painter.setPen(Qt::black); - painter.setFont(QFont("helvetica", 10, QFont::Bold)); - painter.drawText(1, 1, pix.width(), pix.height()-2, Qt::AlignCenter, langCode); - painter.setPen(Qt::white); - painter.drawText(0, 0, pix.width(), pix.height()-2, Qt::AlignCenter, langCode); + TQPainter painter(&pix); + painter.setPen(TQt::black); + painter.setFont(TQFont("helvetica", 10, TQFont::Bold)); + painter.drawText(1, 1, pix.width(), pix.height()-2, TQt::AlignCenter, langCode); + painter.setPen(TQt::white); + painter.drawText(0, 0, pix.width(), pix.height()-2, TQt::AlignCenter, langCode); } -void KBConfig::drawDefaultPixmap(QPixmap &pix, int group) +void KBConfig::drawDefaultPixmap(TQPixmap &pix, int group) { pix.resize(FLAG_ICON_WIDTH, FLAG_ICON_HEIGHT); - QPainter painter(&pix); + TQPainter painter(&pix); pix.fill(); painter.drawText(0, 0, pix.width(), pix.height(), - Qt::AlignHCenter | Qt::AlignVCenter, QString::number(group+1)); + TQt::AlignHCenter | TQt::AlignVCenter, TQString::number(group+1)); } void KBConfig::checkKeysEnabled() @@ -283,14 +283,14 @@ void KBConfig::checkKeysEnabled() /** No descriptions */ /*void KBConfig::drawDefaultPixmaps(){ - QPixmap pix(16, 16); - QPainter painter(&pix); + TQPixmap pix(16, 16); + TQPainter painter(&pix); for (unsigned int i = 0; i < m_groups.count(); i++) { if (m_groups[i]->getPixmap().isNull()) { pix.fill(); painter.drawText(0, 0, pix.width(), pix.height(), - Qt::AlignHCenter | Qt::AlignVCenter, QString::number(i+1)); + TQt::AlignHCenter | TQt::AlignVCenter, TQString::number(i+1)); m_groups[i]->setPixmap(pix); } } @@ -298,8 +298,8 @@ void KBConfig::checkKeysEnabled() /** No descriptions */ /*void KBConfig::loadConfiguredPixmaps(KConfig *config){ - QString path; - QPixmap pix; + TQString path; + TQPixmap pix; config->setGroup(ICONS_SECTION); for (unsigned int i = 0; i < m_groups.count(); i++) { path = config->readEntry(entryForGroup(i)); @@ -315,18 +315,18 @@ void KBConfig::checkKeysEnabled() /*! - \fn KBConfig::getXkbLayouts(const QStringList &layouts) + \fn KBConfig::getXkbLayouts(const TQStringList &layouts) */ -void KBConfig::getXkbLayouts(QStringList &layouts) +void KBConfig::getXkbLayouts(TQStringList &layouts) { #if HAVE_X11_EXTENSIONS_XKBRULES_H && HAVE_LIBXKBFILE XkbRF_VarDefsRec vardefs; int i; usleep(10000); - if (XkbRF_GetNamesProp(qt_xdisplay(), NULL, &vardefs)) { - layouts = QStringList::split(',', vardefs.layout, true); - for (QStringList::Iterator it = layouts.begin(); it != layouts.end(); ++it) { + if (XkbRF_GetNamesProp(tqt_xdisplay(), NULL, &vardefs)) { + layouts = TQStringList::split(',', vardefs.layout, true); + for (TQStringList::Iterator it = layouts.begin(); it != layouts.end(); ++it) { i = 0; while ((*it)[i] >= 'a' && (*it)[i] <= 'z') i++; *it = (*it).left(i); diff --git a/kkbswitch/kbconfig.h b/kkbswitch/kbconfig.h index 7187263..c5ecaac 100644 --- a/kkbswitch/kbconfig.h +++ b/kkbswitch/kbconfig.h @@ -20,8 +20,8 @@ #include "kbgroup.h" -#include -#include +#include +#include #include #define ICONS_SECTION "Icons" @@ -32,7 +32,7 @@ class KGlobalAccel; -typedef QPtrVector KBGroupVector; +typedef TQPtrVector KBGroupVector; /**The class that stores configuration information of KBSwitch *@author Leonid Zeitlin @@ -79,11 +79,11 @@ public: void save(KConfig *config); /** No descriptions */ /*void notifyChanged();*/ - /*static QString entryForGroup(int i) { - return QString("Group%1").arg(i+1); + /*static TQString entryForGroup(int i) { + return TQString("Group%1").arg(i+1); }*/ - void drawIcons(IconStyle icon_style, QValueVector *icons, - QStringList *iconpaths); + void drawIcons(IconStyle icon_style, TQValueVector *icons, + TQStringList *iconpaths); void checkKeysEnabled(); int getNextGroup(int groupno) { return groupno >= groupCount() - 1 ? 0 : groupno + 1; @@ -95,16 +95,16 @@ private: // Private methods //void drawDefaultPixmaps(); /** No descriptions */ //void loadConfiguredPixmaps(KConfig *config); - void drawFlagPixmap(QPixmap &pix, QString &path, const QString &code, + void drawFlagPixmap(TQPixmap &pix, TQString &path, const TQString &code, int group, KConfig *config); - void drawCodePixmap(QPixmap &pix, const QString &code); - void drawCodeAndFlagPixmap(QPixmap &pix, QString &path, - const QString &countryCode, const QString &langCode, int group, + void drawCodePixmap(TQPixmap &pix, const TQString &code); + void drawCodeAndFlagPixmap(TQPixmap &pix, TQString &path, + const TQString &countryCode, const TQString &langCode, int group, KConfig *config); - void drawDefaultPixmap(QPixmap &pix, int group); - bool getGroupImage(QImage &img, QString &path, const QString &code, int group, + void drawDefaultPixmap(TQPixmap &pix, int group); + bool getGroupImage(TQImage &img, TQString &path, const TQString &code, int group, KConfig *config); - void getXkbLayouts(QStringList &layouts); + void getXkbLayouts(TQStringList &layouts); }; #endif diff --git a/kkbswitch/kbconfigdlg.cpp b/kkbswitch/kbconfigdlg.cpp index 6f583b3..3a5b74d 100644 --- a/kkbswitch/kbconfigdlg.cpp +++ b/kkbswitch/kbconfigdlg.cpp @@ -19,17 +19,17 @@ #include "kbpickicondlg.h" #include "boldlistboxitem.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -50,12 +50,12 @@ */ class SmallerKeyChooser : public KKeyChooser { private: - QSize m_size_hint; + TQSize m_size_hint; void calcSizeHint(); public: - SmallerKeyChooser(KGlobalAccel *accel, QWidget *parent) : + SmallerKeyChooser(KGlobalAccel *accel, TQWidget *parent) : KKeyChooser(accel, parent) { calcSizeHint(); } - virtual QSize sizeHint() const { return m_size_hint; } + virtual TQSize sizeHint() const { return m_size_hint; } }; void SmallerKeyChooser::calcSizeHint() @@ -63,28 +63,28 @@ void SmallerKeyChooser::calcSizeHint() m_size_hint = KKeyChooser::sizeHint(); KListView *lv = NULL; - QGroupBox *gb = NULL; - const QObjectList *objects = children(); - QObjectListIt iter(*objects); - QObject *obj; + TQGroupBox *gb = NULL; + const TQObjectList *objects = children(); + TQObjectListIt iter(*objects); + TQObject *obj; while ( (obj = iter.current()) ) { ++iter; if (obj->inherits("KListView")) lv = dynamic_cast(obj); - else if (obj->inherits("QGroupBox")) - gb = dynamic_cast(obj); + else if (obj->inherits("TQGroupBox")) + gb = dynamic_cast(obj); } if (!lv || !gb) return; // oops, should not happen - QListViewItem *item = lv->firstChild(); + TQListViewItem *item = lv->firstChild(); if (!item) return; int height = item->height() * (1 + item->childCount()) + lv->header()->height() + - style().pixelMetric(QStyle::PM_ScrollBarExtent) + gb->sizeHint().height() + + style().pixelMetric(TQStyle::PM_ScrollBarExtent) + gb->sizeHint().height() + layout()->spacing() * 2; int width = lv->columnWidth(0) + lv->columnWidth(1); - m_size_hint = QSize(width, height); + m_size_hint = TQSize(width, height); } static inline bool iconTypeShowsFlag(KBConfig::IconStyle icon_style) @@ -92,14 +92,14 @@ static inline bool iconTypeShowsFlag(KBConfig::IconStyle icon_style) return icon_style == KBConfig::ICON_FLAG || icon_style == KBConfig::ICON_CODE_AND_FLAG; } -KBConfigDlg::KBConfigDlg(KBConfig *kbconf, QWidget *parent, const char *name ) +KBConfigDlg::KBConfigDlg(KBConfig *kbconf, TQWidget *parent, const char *name ) : KDialogBase(Tabbed, i18n("Configure")/*caption*/, Ok | Apply | Cancel | Help, Ok, parent, name, true /*modal*/) { m_kbconf = kbconf; m_default_groupno = m_kbconf->default_groupno(); - setHelp(QString("configure-kkbswitch")); + setHelp(TQString("configure-kkbswitch")); setButtonBoxOrientation(Horizontal); setupGeneralPage(); setupShortcutsPage(); @@ -113,64 +113,64 @@ KBConfigDlg::~KBConfigDlg(){ void KBConfigDlg::setupGeneralPage() { - QFrame *page = addPage(i18n("&General")); //makeMainWidget(); - QVBoxLayout *vlayout = new QVBoxLayout(page); + TQFrame *page = addPage(i18n("&General")); //makeMainWidget(); + TQVBoxLayout *vlayout = new TQVBoxLayout(page); vlayout->setSpacing(2); - QLabel *lbl = new QLabel(i18n("Available &keyboard layouts:"), page); + TQLabel *lbl = new TQLabel(i18n("Available &keyboard layouts:"), page); vlayout->addWidget(lbl); - QHBoxLayout *groupsLayout = new QHBoxLayout(vlayout); + TQHBoxLayout *groupsLayout = new TQHBoxLayout(vlayout); groupsLayout->setSpacing(2); lbGroups = new KListBox(page); - QObject::connect(lbGroups, SIGNAL(selectionChanged()), this, SLOT(slotLayoutSelected())); - QObject::connect(lbGroups, SIGNAL(doubleClicked(QListBoxItem *)), this, - SLOT(slotListBoxExecuted(QListBoxItem *))); + TQObject::connect(lbGroups, SIGNAL(selectionChanged()), this, SLOT(slotLayoutSelected())); + TQObject::connect(lbGroups, SIGNAL(doubleClicked(TQListBoxItem *)), this, + SLOT(slotListBoxExecuted(TQListBoxItem *))); groupsLayout->addWidget(lbGroups); lbl->setBuddy(lbGroups); - QWhatsThis::add(lbGroups, i18n("This list box shows keyboard layouts available in your system.\n" + TQWhatsThis::add(lbGroups, i18n("This list box shows keyboard layouts available in your system.\n" "Select a layout and click \"Change Icon...\" button to change the icon for a layout.\n" "If you have configured a non-default icon, you can reset the icon to default with \"Use Default Icon\" button.\n" "The layout shown is bold is the default layout. Use \"Set as default\" button " "to set the default layout.")); - QVBoxLayout *btnLayout = new QVBoxLayout(groupsLayout); + TQVBoxLayout *btnLayout = new TQVBoxLayout(groupsLayout); btnLayout->setSpacing(2); - btnChangeIcon = new QPushButton(i18n("Cha&nge Icon..."), page); - QObject::connect(btnChangeIcon, SIGNAL(clicked()), this, SLOT(slotPickIcon())); - btnLayout->addWidget(btnChangeIcon, 0, Qt::AlignTop); - QWhatsThis::add(btnChangeIcon, i18n("Click this button to change the icon for the " + btnChangeIcon = new TQPushButton(i18n("Cha&nge Icon..."), page); + TQObject::connect(btnChangeIcon, SIGNAL(clicked()), this, SLOT(slotPickIcon())); + btnLayout->addWidget(btnChangeIcon, 0, TQt::AlignTop); + TQWhatsThis::add(btnChangeIcon, i18n("Click this button to change the icon for the " "layout selected in the list box to the left.")); - btnSetDefaultIcon = new QPushButton(i18n("Use &Default Icon"), page); - QObject::connect(btnSetDefaultIcon, SIGNAL(clicked()), this, SLOT(slotSetDefaultIcon())); - btnLayout->addWidget(btnSetDefaultIcon, 0, Qt::AlignTop); - QWhatsThis::add(btnSetDefaultIcon, i18n("Click this button to use default icon for the " + btnSetDefaultIcon = new TQPushButton(i18n("Use &Default Icon"), page); + TQObject::connect(btnSetDefaultIcon, SIGNAL(clicked()), this, SLOT(slotSetDefaultIcon())); + btnLayout->addWidget(btnSetDefaultIcon, 0, TQt::AlignTop); + TQWhatsThis::add(btnSetDefaultIcon, i18n("Click this button to use default icon for the " "layout selected in the list box to the left.")); - btnSetDefaultGroup = new QPushButton(i18n("&Set as Default"), page); - QObject::connect(btnSetDefaultGroup, SIGNAL(clicked()), this, SLOT(slotSetDefaultGroup())); - btnLayout->addWidget(btnSetDefaultGroup, 0, Qt::AlignTop); - QWhatsThis::add(btnSetDefaultGroup, i18n("Click this button to set the layout selected " + btnSetDefaultGroup = new TQPushButton(i18n("&Set as Default"), page); + TQObject::connect(btnSetDefaultGroup, SIGNAL(clicked()), this, SLOT(slotSetDefaultGroup())); + btnLayout->addWidget(btnSetDefaultGroup, 0, TQt::AlignTop); + TQWhatsThis::add(btnSetDefaultGroup, i18n("Click this button to set the layout selected " "in the list box to the left as the default")); - btnLayout->addItem(new QSpacerItem(1, 1, QSizePolicy::Minimum, - QSizePolicy::MinimumExpanding)); + btnLayout->addItem(new TQSpacerItem(1, 1, TQSizePolicy::Minimum, + TQSizePolicy::MinimumExpanding)); - lbl = new QLabel(i18n("Layout &icon style:"), page); + lbl = new TQLabel(i18n("Layout &icon style:"), page); vlayout->addWidget(lbl); - cbxIconType = new QComboBox(page); + cbxIconType = new TQComboBox(page); cbxIconType->setEditable(false); cbxIconType->insertItem(i18n("Country flag")); cbxIconType->insertItem(i18n("Language code")); cbxIconType->insertItem(i18n("Flag and code")); - QObject::connect(cbxIconType, SIGNAL(activated(int)), this, SLOT(slotIconTypeSelected(int))); + TQObject::connect(cbxIconType, SIGNAL(activated(int)), this, SLOT(slotIconTypeSelected(int))); vlayout->addWidget(cbxIconType); lbl->setBuddy(cbxIconType); - QWhatsThis::add(cbxIconType, i18n("

Select the style of icons representing the " + TQWhatsThis::add(cbxIconType, i18n("

Select the style of icons representing the " "current keyboard layout.\n" "You can choose from the following styles:" "

  • Country flag - displays the corresponding country flag" @@ -178,17 +178,17 @@ void KBConfigDlg::setupGeneralPage() "
  • Flag and code - displays the language code superimposed over the country flag." "

")); - lbl = new QLabel(i18n("&Layout applies to:"), page); + lbl = new TQLabel(i18n("&Layout applies to:"), page); vlayout->addWidget(lbl); - cbxGroupScope = new QComboBox(page); + cbxGroupScope = new TQComboBox(page); cbxGroupScope->setEditable(false); cbxGroupScope->insertItem(i18n("All windows")); cbxGroupScope->insertItem(i18n("Windows of one application")); cbxGroupScope->insertItem(i18n("One window")); vlayout->addWidget(cbxGroupScope); lbl->setBuddy(cbxGroupScope); - QWhatsThis::add(cbxGroupScope, i18n("

Select what windows the currently selected " + TQWhatsThis::add(cbxGroupScope, i18n("

Select what windows the currently selected " "keyboard layout applies to:\n" "

  • All windows - one layout applies to all windows on your desktop\n" "
  • Windows of one application - layout applies to one application; each " @@ -196,30 +196,30 @@ void KBConfigDlg::setupGeneralPage() "
  • One window - layout applies to one window only; each window can have its own layout. " "When you switch between windows, layout follows the active window.

")); - chkToggleMode = new QCheckBox(i18n("Use \"&Toggle Mode\""), page); + chkToggleMode = new TQCheckBox(i18n("Use \"&Toggle Mode\""), page); vlayout->addWidget(chkToggleMode); - QWhatsThis::add(chkToggleMode, i18n("Toggle mode is useful when you have more than two keyboard " + TQWhatsThis::add(chkToggleMode, i18n("Toggle mode is useful when you have more than two keyboard " "layouts defined. When toggle mode is on your normal layout switch key toggles between two most frequently used layouts. " "To activate other layouts use KKBSwitch's tray popup menu")); - /*chkPerwindowGroup = new QCheckBox(i18n("Use &per-window layout"), page); + /*chkPerwindowGroup = new TQCheckBox(i18n("Use &per-window layout"), page); vlayout->addWidget(chkPerwindowGroup); - QWhatsThis::add(chkPerwindowGroup, i18n("When this checkbox is checked, " + TQWhatsThis::add(chkPerwindowGroup, i18n("When this checkbox is checked, " "each window has its own current keyboard layout. When it's unchecked, " "the current layout affects all windows"));*/ - chkAutostart = new QCheckBox(i18n("A&utostart"), page); + chkAutostart = new TQCheckBox(i18n("A&utostart"), page); vlayout->addWidget(chkAutostart); - QWhatsThis::add(chkAutostart, i18n("When this checkbox is checked, KKBSwitch " + TQWhatsThis::add(chkAutostart, i18n("When this checkbox is checked, KKBSwitch " "will start automatically when you log in")); } void KBConfigDlg::setupShortcutsPage() { - QVBox *box = addVBoxPage(i18n("Sho&rtcuts")); - chkUseShortcuts = new QCheckBox(i18n("Use shortcuts to &activate keyboard layouts"), box); + TQVBox *box = addVBoxPage(i18n("Sho&rtcuts")); + chkUseShortcuts = new TQCheckBox(i18n("Use shortcuts to &activate keyboard layouts"), box); connect(chkUseShortcuts, SIGNAL(toggled(bool)), this, SLOT(slotUseShortcutsToggled(bool))); - QWhatsThis::add(chkUseShortcuts, i18n("Check this checkbox to be able to quickly " + TQWhatsThis::add(chkUseShortcuts, i18n("Check this checkbox to be able to quickly " "activate any keyboard layout with keyboard shorcuts. Once this checkbox " "is checked, you can adjust the shortcuts at the key chooser pane below. " "Especially useful if you have three or four keyboard layouts configured")); @@ -256,11 +256,11 @@ void KBConfigDlg::showConfig(){ /** Fire up "Pick Icon" dialog */ void KBConfigDlg::slotPickIcon(){ int index = lbGroups->currentItem(); - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + TQApplication::setOverrideCursor(TQCursor(TQt::WaitCursor)); KBPickIconDlg dlg(m_iconpaths[index], *(lbGroups->pixmap(index)), this); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); if (dlg.exec()) { - QString path = dlg.getIconPath(); + TQString path = dlg.getIconPath(); KBGroup *group = m_kbconf->getGroup(index); if (!path.isEmpty() && path != group->getIconPath()) { kapp->config()->writeEntry(group->getName()/*KBConfig::entryForGroup(index)*/, path); @@ -277,7 +277,7 @@ void KBConfigDlg::slotSetDefaultGroup() BoldListBoxItem *item = dynamic_cast(lbGroups->item(m_default_groupno)); item->setBold(false); m_default_groupno = new_default_group; - // NB: don't use selectedItem(); it's not present in Qt 3.0, and + // NB: don't use selectedItem(); it's not present in TQt 3.0, and // we want to maintain compatibility with it int curitem = lbGroups->currentItem(); if (curitem > -1) { // should not be -1, but just in case @@ -298,15 +298,15 @@ void KBConfigDlg::slotLayoutSelected(){ } /** No descriptions */ -void KBConfigDlg::slotListBoxExecuted(QListBoxItem *){ +void KBConfigDlg::slotListBoxExecuted(TQListBoxItem *){ if (iconTypeShowsFlag(KBConfig::IconStyle(cbxIconType->currentItem()))) slotPickIcon(); } /** No descriptions */ void KBConfigDlg::saveConfig(){ - QString path; - const QPixmap *pix; + TQString path; + const TQPixmap *pix; KConfig *conf = kapp->config(); conf->setGroup(ICONS_SECTION); for (int i = 0; i < m_kbconf->groupCount(); i++) { @@ -353,10 +353,10 @@ void KBConfigDlg::slotIconTypeSelected(int index) void KBConfigDlg::redrawIcons(KBConfig::IconStyle icon_style) { - QValueVector pixlist; + TQValueVector pixlist; m_kbconf->drawIcons(icon_style, &pixlist, &m_iconpaths); int curIndex = lbGroups->currentItem(); - // NB: don't use count(), use size(); count() is not present in Qt 3.0, and + // NB: don't use count(), use size(); count() is not present in TQt 3.0, and // we want to maintain compatibility with it for (unsigned int i = 0; i < pixlist.size(); i++) { BoldListBoxItem *curItem = dynamic_cast(lbGroups->item(i)); diff --git a/kkbswitch/kbconfigdlg.h b/kkbswitch/kbconfigdlg.h index f708a65..bead1ad 100644 --- a/kkbswitch/kbconfigdlg.h +++ b/kkbswitch/kbconfigdlg.h @@ -21,11 +21,11 @@ #include #include "kbconfig.h" -class QWidget; -class QCheckBox; -class QPushButton; -class QComboBox; -class QStringList; +class TQWidget; +class TQCheckBox; +class TQPushButton; +class TQComboBox; +class TQStringList; class KKeyChooser; @@ -36,23 +36,23 @@ class KKeyChooser; class KBConfigDlg : public KDialogBase { Q_OBJECT public: - KBConfigDlg(KBConfig *kbconf, QWidget *parent=0, const char *name=0); + KBConfigDlg(KBConfig *kbconf, TQWidget *parent=0, const char *name=0); ~KBConfigDlg(); private: // Private attributes /** */ KListBox *lbGroups; /** */ - QCheckBox *chkToggleMode; - //QCheckBox *chkPerwindowGroup; - QCheckBox *chkAutostart; - QPushButton *btnChangeIcon; - QPushButton *btnSetDefaultIcon; - QPushButton *btnSetDefaultGroup; - QComboBox *cbxIconType; - QComboBox *cbxGroupScope; + TQCheckBox *chkToggleMode; + //TQCheckBox *chkPerwindowGroup; + TQCheckBox *chkAutostart; + TQPushButton *btnChangeIcon; + TQPushButton *btnSetDefaultIcon; + TQPushButton *btnSetDefaultGroup; + TQComboBox *cbxIconType; + TQComboBox *cbxGroupScope; KKeyChooser *keyChooser; - QCheckBox *chkUseShortcuts; - QStringList m_iconpaths; + TQCheckBox *chkUseShortcuts; + TQStringList m_iconpaths; int m_default_groupno; KBConfig *m_kbconf; /** Display the current KBSwitch configuration in the dialog */ @@ -69,7 +69,7 @@ private slots: // Private slots /** No descriptions */ void slotLayoutSelected(); /** No descriptions */ - void slotListBoxExecuted(QListBoxItem *item); + void slotListBoxExecuted(TQListBoxItem *item); void slotIconTypeSelected(int index); void slotUseShortcutsToggled(bool on); void slotSetDefaultIcon(); diff --git a/kkbswitch/kbgroup.cpp b/kkbswitch/kbgroup.cpp index 77d999f..9ef242e 100644 --- a/kkbswitch/kbgroup.cpp +++ b/kkbswitch/kbgroup.cpp @@ -18,7 +18,7 @@ #include "kbgroup.h" #include -KBGroup::KBGroup(const QString& name){ +KBGroup::KBGroup(const TQString& name){ m_name = name; } diff --git a/kkbswitch/kbgroup.h b/kkbswitch/kbgroup.h index 0c5997c..3e5eb43 100644 --- a/kkbswitch/kbgroup.h +++ b/kkbswitch/kbgroup.h @@ -18,8 +18,8 @@ #ifndef KBGROUP_H #define KBGROUP_H -#include -#include +#include +#include /**A helper class the holds keyboard group's name and pixmap *@author Leonid Zeitlin @@ -27,22 +27,22 @@ class KBGroup { public: - KBGroup(const QString& name); + KBGroup(const TQString& name); ~KBGroup(); /** */ - const QPixmap& getPixmap() { return m_pixmap; } + const TQPixmap& getPixmap() { return m_pixmap; } /** No descriptions */ - const QString& getName() { return m_name; } + const TQString& getName() { return m_name; } /** No descriptions */ - void setPixmap(const QPixmap& pixmap) { m_pixmap = pixmap; } - const QString& getIconPath() { return m_iconpath; } - void setIconPath(const QString &iconpath) { m_iconpath = iconpath; } + void setPixmap(const TQPixmap& pixmap) { m_pixmap = pixmap; } + const TQString& getIconPath() { return m_iconpath; } + void setIconPath(const TQString &iconpath) { m_iconpath = iconpath; } private: // Private attributes /** */ - QString m_name; + TQString m_name; /** */ - QPixmap m_pixmap; - QString m_iconpath; + TQPixmap m_pixmap; + TQString m_iconpath; }; #endif diff --git a/kkbswitch/kbpickicondlg.cpp b/kkbswitch/kbpickicondlg.cpp index d745f7c..c4dc299 100644 --- a/kkbswitch/kbpickicondlg.cpp +++ b/kkbswitch/kbpickicondlg.cpp @@ -17,11 +17,11 @@ #include "kbpickicondlg.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -37,21 +37,21 @@ #include "kbconfig.h" #include "pathlistboxitem.h" -KBPickIconDlg::KBPickIconDlg(const QString ¤tPath, const QPixmap ¤tPixmap, - QWidget *parent, const char *name ) +KBPickIconDlg::KBPickIconDlg(const TQString ¤tPath, const TQPixmap ¤tPixmap, + TQWidget *parent, const char *name ) : KDialogBase(parent, name, true /*modal*/, i18n("Pick an icon") /*caption*/, Ok | Cancel) { - QVBox *page = makeVBoxMainWidget(); + TQVBox *page = makeVBoxMainWidget(); lbIcons = new KListBox(page); - QObject::connect(lbIcons, SIGNAL(doubleClicked(QListBoxItem*)), + TQObject::connect(lbIcons, SIGNAL(doubleClicked(TQListBoxItem*)), this, SLOT(slotOk())); - QObject::connect(lbIcons, SIGNAL(returnPressed(QListBoxItem*)), + TQObject::connect(lbIcons, SIGNAL(returnPressed(TQListBoxItem*)), this, SLOT(slotOk())); - QWhatsThis::add(lbIcons, i18n("Select one of the icons")); + TQWhatsThis::add(lbIcons, i18n("Select one of the icons")); - QPushButton *btnBrowse = new QPushButton(i18n("&Browse..."), page); - QObject::connect(btnBrowse, SIGNAL(clicked()), this, SLOT(slotBrowseForIcon())); - QWhatsThis::add(btnBrowse, i18n("Browse for an image file to use as an icon")); + TQPushButton *btnBrowse = new TQPushButton(i18n("&Browse..."), page); + TQObject::connect(btnBrowse, SIGNAL(clicked()), this, SLOT(slotBrowseForIcon())); + TQWhatsThis::add(btnBrowse, i18n("Browse for an image file to use as an icon")); loadCountryFlags(); @@ -69,15 +69,15 @@ KBPickIconDlg::~KBPickIconDlg(){ } /** Get the path name of the selected icon. Returns empty string if no icon selected */ -QString KBPickIconDlg::getIconPath(){ - QListBoxItem *item = lbIcons->selectedItem(); +TQString KBPickIconDlg::getIconPath(){ + TQListBoxItem *item = lbIcons->selectedItem(); if (item) return dynamic_cast(item)->path; - else return QString::null; // should not happen + else return TQString::null; // should not happen } /** No descriptions */ -const QPixmap* KBPickIconDlg::getIcon(){ +const TQPixmap* KBPickIconDlg::getIcon(){ if (lbIcons->currentItem() != -1) return lbIcons->pixmap(lbIcons->currentItem()); else return NULL; @@ -86,13 +86,13 @@ const QPixmap* KBPickIconDlg::getIcon(){ /** Browse for an arbitrary icon file */ void KBPickIconDlg::slotBrowseForIcon() { - QString iconPath = KFileDialog::getOpenFileName(QString::null, + TQString iconPath = KFileDialog::getOpenFileName(TQString::null, i18n("*.png *.jpg *.gif *.xpm|Icon files (*.png, *.jpg, *.gif, *.xpm)\n*.*|All files (*.*)")); if (iconPath.isEmpty()) return; - QImage img; + TQImage img; if (img.load(iconPath)) { double aspectRatio = img.width() / img.height(); - QString message = QString::null; + TQString message = TQString::null; bool too_big, too_wide, too_narrow; too_narrow = aspectRatio < FLAG_ICON_WIDTH / FLAG_ICON_HEIGHT - 0.1; too_wide = aspectRatio > FLAG_ICON_WIDTH / FLAG_ICON_HEIGHT + 0.1; @@ -102,7 +102,7 @@ void KBPickIconDlg::slotBrowseForIcon() "Preferred size for the layout icons is %3 by %4.\n") .arg(img.width()).arg(img.height()).arg(FLAG_ICON_WIDTH).arg(FLAG_ICON_HEIGHT); if (too_big) { - QString msg_tail = ""; + TQString msg_tail = ""; if (too_wide) msg_tail = i18n(" and also too wide"); else if (too_narrow) msg_tail += i18n(" and also too narrow"); message += i18n("This image is too big%1.").arg(msg_tail); @@ -116,9 +116,9 @@ void KBPickIconDlg::slotBrowseForIcon() } if (img.width() > FLAG_ICON_WIDTH + 3 || img.height() > FLAG_ICON_HEIGHT + 3) img = img.smoothScale(FLAG_ICON_WIDTH, FLAG_ICON_HEIGHT); - QPixmap pix; + TQPixmap pix; pix.convertFromImage(img); - PathListBoxItem *item = new PathListBoxItem(lbIcons, pix, QFileInfo(iconPath).fileName(), + PathListBoxItem *item = new PathListBoxItem(lbIcons, pix, TQFileInfo(iconPath).fileName(), iconPath); lbIcons->setSelected(item, true); lbIcons->centerCurrentItem(); @@ -129,16 +129,16 @@ void KBPickIconDlg::slotBrowseForIcon() void KBPickIconDlg::loadCountryFlags() { - QPixmap pix; - QDir dir; - QStringList locales; - QString path; - QStringList dirs = KGlobal::dirs()->findDirs("locale", "l10n"); + TQPixmap pix; + TQDir dir; + TQStringList locales; + TQString path; + TQStringList dirs = KGlobal::dirs()->findDirs("locale", "l10n"); - for (QStringList::Iterator dirIter = dirs.begin(); dirIter != dirs.end(); dirIter++) { + for (TQStringList::Iterator dirIter = dirs.begin(); dirIter != dirs.end(); dirIter++) { dir.setPath(*dirIter); - locales = dir.entryList(QDir::Dirs, QDir::Name); - for (QStringList::Iterator iter = locales.begin(); iter != locales.end(); iter++) { + locales = dir.entryList(TQDir::Dirs, TQDir::Name); + for (TQStringList::Iterator iter = locales.begin(); iter != locales.end(); iter++) { path = dir.path() + "/" + *iter + "/flag.png"; if (*iter != "." && *iter != ".." && pix.load(path)) { KConfig config(dir.path() + "/" + *iter + "/entry.desktop", true, false, @@ -152,16 +152,16 @@ void KBPickIconDlg::loadCountryFlags() void KBPickIconDlg::loadGkbCountryFlags() { - QDir dir; - QString path, code, name; - QPixmap pix; - QImage img; + TQDir dir; + TQString path, code, name; + TQPixmap pix; + TQImage img; dir.setPath("/usr/share/pixmaps/gkb"); - const QFileInfoList *icons = dir.entryInfoList(QDir::Files, QDir::Name); + const TQFileInfoList *icons = dir.entryInfoList(TQDir::Files, TQDir::Name); if (icons) { - QFileInfoListIterator iter(*icons); - QFileInfo *info; + TQFileInfoListIterator iter(*icons); + TQFileInfo *info; for (; (info = iter.current()); ++iter) { path = info->filePath(); code = info->baseName(); @@ -178,8 +178,8 @@ void KBPickIconDlg::loadGkbCountryFlags() } } -void KBPickIconDlg::showCurrentPath(const QString ¤tPath, - const QPixmap ¤tPixmap) +void KBPickIconDlg::showCurrentPath(const TQString ¤tPath, + const TQPixmap ¤tPixmap) { PathListBoxItem *item = NULL; bool itemFound = false; @@ -193,11 +193,11 @@ void KBPickIconDlg::showCurrentPath(const QString ¤tPath, // why this strange manipulation of HScrollBarMode? // Strangely, without it, if the selected item is the last in the listbox, it ends up // being obscured by the horizontal scrollbar - lbIcons->setHScrollBarMode(QScrollView::AlwaysOn); + lbIcons->setHScrollBarMode(TQScrollView::AlwaysOn); if (!itemFound) item = new PathListBoxItem(lbIcons, currentPixmap, - QFileInfo(currentPath).fileName(), currentPath); + TQFileInfo(currentPath).fileName(), currentPath); lbIcons->updateScrollBars(); lbIcons->setSelected(item, true); lbIcons->ensureCurrentVisible(); - lbIcons->setHScrollBarMode(QScrollView::Auto); + lbIcons->setHScrollBarMode(TQScrollView::Auto); } diff --git a/kkbswitch/kbpickicondlg.h b/kkbswitch/kbpickicondlg.h index b6abb16..0f5e0f4 100644 --- a/kkbswitch/kbpickicondlg.h +++ b/kkbswitch/kbpickicondlg.h @@ -20,9 +20,9 @@ #include -class QWidget; -class QStringList; -class QPixmap; +class TQWidget; +class TQStringList; +class TQPixmap; class KListBox; /**A dialog to pick an icon for a keyboard layout @@ -32,30 +32,30 @@ class KListBox; class KBPickIconDlg : public KDialogBase { Q_OBJECT public: - KBPickIconDlg(const QString ¤tPath, const QPixmap ¤tPixmap, - QWidget *parent=0, const char *name=0); + KBPickIconDlg(const TQString ¤tPath, const TQPixmap ¤tPixmap, + TQWidget *parent=0, const char *name=0); ~KBPickIconDlg(); /** Get the path name of the selected icon. Returns empty string if no icon selected */ - QString getIconPath(); + TQString getIconPath(); /** No descriptions */ - const QPixmap* getIcon(); + const TQPixmap* getIcon(); private: // Private attributes /** */ - //QStringList m_pathnames; - //QString m_iconpath; + //TQStringList m_pathnames; + //TQString m_iconpath; //KIconView *m_iconview; KListBox *lbIcons; - //QLabel *lblIcon; - //QRadioButton *rbFlags; - //QRadioButton *rbBrowse; + //TQLabel *lblIcon; + //TQRadioButton *rbFlags; + //TQRadioButton *rbBrowse; void loadCountryFlags(); void loadGkbCountryFlags(); - void showCurrentPath(const QString ¤tPath, const QPixmap ¤tPixmap); + void showCurrentPath(const TQString ¤tPath, const TQPixmap ¤tPixmap); private slots: // Private slots /** Browse for an arbitrary icon file */ void slotBrowseForIcon(); /** Respond to user selecting a flag in the icon view */ - //void slotFlagSelected(QIconViewItem *item); + //void slotFlagSelected(TQIconViewItem *item); }; #endif diff --git a/kkbswitch/kbswitchapp.cpp b/kkbswitch/kbswitchapp.cpp index 9dab46a..7798be3 100644 --- a/kkbswitch/kbswitchapp.cpp +++ b/kkbswitch/kbswitchapp.cpp @@ -45,20 +45,20 @@ KBSwitchApp::KBSwitchApp() #endif m_intf = new KBSwitchIntf(this, &m_kbconf); - QObject::connect(m_intf, SIGNAL(nextGroupSelected()), this, SLOT(slotSelectNextGroup())); - QObject::connect(m_intf, SIGNAL(groupSelected(int)), this, SLOT(slotGroupSelected(int))); + TQObject::connect(m_intf, SIGNAL(nextGroupSelected()), this, SLOT(slotSelectNextGroup())); + TQObject::connect(m_intf, SIGNAL(groupSelected(int)), this, SLOT(slotGroupSelected(int))); - QObject::connect(&m_xkb, SIGNAL(layoutChanged()), this, SLOT(reconfigure())); - QObject::connect(&m_xkb, SIGNAL(groupChanged(int)), this, SLOT(slotXkbGroupChanged(int))); + TQObject::connect(&m_xkb, SIGNAL(layoutChanged()), this, SLOT(reconfigure())); + TQObject::connect(&m_xkb, SIGNAL(groupChanged(int)), this, SLOT(slotXkbGroupChanged(int))); m_force_group_setting = false; int start_group = m_kbconf.default_groupno(); m_trayicon = new KBSwitchTrayIcon(&m_kbconf); - QObject::connect(m_trayicon, SIGNAL(groupSelected(int)), this, + TQObject::connect(m_trayicon, SIGNAL(groupSelected(int)), this, SLOT(slotGroupSelected(int))); - QObject::connect(m_trayicon, SIGNAL(clicked()), this, SLOT(slotSelectNextGroup())); - QObject::connect(m_trayicon, SIGNAL(preferencesSelected()), this, + TQObject::connect(m_trayicon, SIGNAL(clicked()), this, SLOT(slotSelectNextGroup())); + TQObject::connect(m_trayicon, SIGNAL(preferencesSelected()), this, SLOT(slotPreferences())); if (start_group != m_xkb.getGroupNo()) { @@ -144,10 +144,10 @@ void KBSwitchApp::slotSelectNextGroup() /** No descriptions */ void KBSwitchApp::slotPreferences(){ KBConfigDlg dlg(&m_kbconf); - QObject::connect(&dlg, SIGNAL(okClicked()), m_trayicon, SLOT(slotUpdateIcons())); - QObject::connect(&dlg, SIGNAL(applyClicked()), m_trayicon, SLOT(slotUpdateIcons())); - QObject::connect(&dlg, SIGNAL(okClicked()), this, SLOT(slotPrefChanged())); - QObject::connect(&dlg, SIGNAL(applyClicked()), this, SLOT(slotPrefChanged())); + TQObject::connect(&dlg, SIGNAL(okClicked()), m_trayicon, SLOT(slotUpdateIcons())); + TQObject::connect(&dlg, SIGNAL(applyClicked()), m_trayicon, SLOT(slotUpdateIcons())); + TQObject::connect(&dlg, SIGNAL(okClicked()), this, SLOT(slotPrefChanged())); + TQObject::connect(&dlg, SIGNAL(applyClicked()), this, SLOT(slotPrefChanged())); dlg.exec(); } @@ -179,7 +179,7 @@ void KBSwitchApp::slotXkbGroupChanged(int groupno){ #ifdef HAVE_LIBXKLAVIER updateIcon(groupno); /* XWindowAttributes attrs; - XGetWindowAttributes(qt_xdisplay(), qt_xrootwin(), &attrs); + XGetWindowAttributes(tqt_xdisplay(), tqt_xrootwin(), &attrs); kdDebug() << "root event mask is " << attrs.your_event_mask << endl; kdDebug() << "SubstructureNotifyMask is " << ((attrs.your_event_mask & SubstructureNotifyMask) ? "ON" : "OFF") << endl;*/ diff --git a/kkbswitch/kbswitchapp.h b/kkbswitch/kbswitchapp.h index d08147d..f59d120 100644 --- a/kkbswitch/kbswitchapp.h +++ b/kkbswitch/kbswitchapp.h @@ -29,7 +29,7 @@ #include #endif -//#include +//#include #include "kbgroup.h" #include "kbswitchtrayicon.h" @@ -45,7 +45,7 @@ typedef struct _KBWinInfo { int next_groupno; } KBWinInfo; -typedef QMap KBWindowMap;*/ +typedef TQMap KBWindowMap;*/ /** *@author Leonid Zeitlin diff --git a/kkbswitch/kbswitchintf.cpp b/kkbswitch/kbswitchintf.cpp index 4e95839..f7e8098 100644 --- a/kkbswitch/kbswitchintf.cpp +++ b/kkbswitch/kbswitchintf.cpp @@ -18,8 +18,8 @@ #include "kbswitchintf.h" //#include -KBSwitchIntf::KBSwitchIntf(QObject *parent, KBConfig *conf) - : QObject(parent, "KBSwitchIntf"), DCOPObject("KBSwitchIntf") +KBSwitchIntf::KBSwitchIntf(TQObject *parent, KBConfig *conf) + : TQObject(parent, "KBSwitchIntf"), DCOPObject("KBSwitchIntf") { m_kbconf = conf; } @@ -42,9 +42,9 @@ ASYNC KBSwitchIntf::selectGroup(int groupno) emit groupSelected(groupno); } -QStringList KBSwitchIntf::getGroupNames() +TQStringList KBSwitchIntf::getGroupNames() { - QStringList result; + TQStringList result; for (int i = 0; i < m_kbconf->groupCount(); i++) result.append(m_kbconf->getGroup(i)->getName()); return result; diff --git a/kkbswitch/kbswitchintf.h b/kkbswitch/kbswitchintf.h index 16466c0..703254a 100644 --- a/kkbswitch/kbswitchintf.h +++ b/kkbswitch/kbswitchintf.h @@ -19,8 +19,8 @@ #define KBSWITCHINTF_H #include -#include -#include +#include +#include #include "kbconfig.h" @@ -33,14 +33,14 @@ separated the signals and k_dcop sections with the public section everything worked. Apparently, the k_dcop "keyword" confuses moc, which is only natural given that moc doesn't know about dcopidl! */ -class KBSwitchIntf : public QObject, public DCOPObject { +class KBSwitchIntf : public TQObject, public DCOPObject { K_DCOP Q_OBJECT signals: void nextGroupSelected(); void groupSelected(int groupno); public: - KBSwitchIntf(QObject *parent, KBConfig *conf); + KBSwitchIntf(TQObject *parent, KBConfig *conf); ~KBSwitchIntf(); private: KBConfig *m_kbconf; @@ -48,7 +48,7 @@ k_dcop: int getNumKbdGroups(); ASYNC selectNextGroup(); ASYNC selectGroup(int groupno); - QStringList getGroupNames(); + TQStringList getGroupNames(); }; #endif diff --git a/kkbswitch/kbswitchintf_skel.cpp b/kkbswitch/kbswitchintf_skel.cpp index e295797..1cc05e1 100644 --- a/kkbswitch/kbswitchintf_skel.cpp +++ b/kkbswitch/kbswitchintf_skel.cpp @@ -15,7 +15,7 @@ static const char* const KBSwitchIntf_ftable[5][3] = { { "int", "getNumKbdGroups()", "getNumKbdGroups()" }, { "ASYNC", "selectNextGroup()", "selectNextGroup()" }, { "ASYNC", "selectGroup(int)", "selectGroup(int groupno)" }, - { "QStringList", "getGroupNames()", "getGroupNames()" }, + { "TQStringList", "getGroupNames()", "getGroupNames()" }, { 0, 0, 0 } }; static const int KBSwitchIntf_ftable_hiddens[4] = { @@ -25,24 +25,24 @@ static const int KBSwitchIntf_ftable_hiddens[4] = { 0, }; -bool KBSwitchIntf::process(const QCString &fun, const QByteArray &data, QCString& replyType, QByteArray &replyData) +bool KBSwitchIntf::process(const TQCString &fun, const TQByteArray &data, TQCString& replyType, TQByteArray &replyData) { if ( fun == KBSwitchIntf_ftable[0][1] ) { // int getNumKbdGroups() replyType = KBSwitchIntf_ftable[0][0]; - QDataStream _replyStream( replyData, IO_WriteOnly ); + TQDataStream _replyStream( replyData, IO_WriteOnly ); _replyStream << getNumKbdGroups( ); } else if ( fun == KBSwitchIntf_ftable[1][1] ) { // void selectNextGroup() replyType = KBSwitchIntf_ftable[1][0]; selectNextGroup( ); } else if ( fun == KBSwitchIntf_ftable[2][1] ) { // void selectGroup(int) int arg0; - QDataStream arg( data, IO_ReadOnly ); + TQDataStream arg( data, IO_ReadOnly ); arg >> arg0; replyType = KBSwitchIntf_ftable[2][0]; selectGroup(arg0 ); - } else if ( fun == KBSwitchIntf_ftable[3][1] ) { // QStringList getGroupNames() + } else if ( fun == KBSwitchIntf_ftable[3][1] ) { // TQStringList getGroupNames() replyType = KBSwitchIntf_ftable[3][0]; - QDataStream _replyStream( replyData, IO_WriteOnly ); + TQDataStream _replyStream( replyData, IO_WriteOnly ); _replyStream << getGroupNames( ); } else { return DCOPObject::process( fun, data, replyType, replyData ); @@ -63,7 +63,7 @@ QCStringList KBSwitchIntf::functions() for ( int i = 0; KBSwitchIntf_ftable[i][2]; i++ ) { if (KBSwitchIntf_ftable_hiddens[i]) continue; - QCString func = KBSwitchIntf_ftable[i][0]; + TQCString func = KBSwitchIntf_ftable[i][0]; func += ' '; func += KBSwitchIntf_ftable[i][2]; funcs << func; diff --git a/kkbswitch/kbswitchtrayicon.cpp b/kkbswitch/kbswitchtrayicon.cpp index 4a51bfe..908875c 100644 --- a/kkbswitch/kbswitchtrayicon.cpp +++ b/kkbswitch/kbswitchtrayicon.cpp @@ -42,20 +42,20 @@ #include #include #include -#include -#include -#include +#include +#include +#include #ifdef USE_BOLD_MENUITEM -static QColor getActiveTextColor(KPopupMenu *menu) +static TQColor getActiveTextColor(KPopupMenu *menu) { int id = menu->insertItem("test text"); - QMenuItem *item = menu->findItem(id); - QStyleOption styleopt = QStyleOption(item); - QPainter painter(menu); - QColorGroup &cg = menu->colorGroup(); - KApplication::style().drawControl(QStyle::CE_PopupMenuItem, &painter, menu, - menu->contentsRect(), cg, QStyle::Style_Enabled | QStyle::Style_Active, + TQMenuItem *item = menu->findItem(id); + TQStyleOption styleopt = TQStyleOption(item); + TQPainter painter(menu); + TQColorGroup &cg = menu->colorGroup(); + KApplication::style().drawControl(TQStyle::CE_PopupMenuItem, &painter, menu, + menu->contentsRect(), cg, TQStyle::Style_Enabled | TQStyle::Style_Active, styleopt); menu->removeItem(id); return painter.pen().color(); @@ -63,7 +63,7 @@ static QColor getActiveTextColor(KPopupMenu *menu) #endif KBSwitchTrayIcon::KBSwitchTrayIcon(KBConfig *conf){ - QPixmap pix; + TQPixmap pix; #if KDE_VERSION_MAJOR >= 3 KActionCollection *actions = new KActionCollection(this); #define ACTION_PARENT actions @@ -72,10 +72,10 @@ KBSwitchTrayIcon::KBSwitchTrayIcon(KBConfig *conf){ #endif m_kbconf = conf; - //QObject::connect(conf, SIGNAL(changed()), this, SLOT(updateMenuIcons())); + //TQObject::connect(conf, SIGNAL(changed()), this, SLOT(updateMenuIcons())); KPopupMenu * menu = contextMenu(); addLayoutItems(menu, false); - QObject::connect(menu, SIGNAL(activated(int)), this, SLOT(slotMenuActivated(int))); + TQObject::connect(menu, SIGNAL(activated(int)), this, SLOT(slotMenuActivated(int))); menu->insertSeparator(); KAction *pref = KStdAction::preferences(this, SIGNAL(preferencesSelected()), ACTION_PARENT); @@ -85,11 +85,11 @@ KBSwitchTrayIcon::KBSwitchTrayIcon(KBConfig *conf){ KAction *about = KStdAction::aboutApp(this, SLOT(slotAbout()), ACTION_PARENT); about->plug(menu); - /*QString path = locate("icon", "hicolor/16x16/apps/locale.png"); + /*TQString path = locate("icon", "hicolor/16x16/apps/locale.png"); if (!path.isEmpty()) pix.load(path);*/ pix = kapp->iconLoader()->loadIcon("locale", KIcon::Small); menu->changeTitle(menu->idAt(0), pix, i18n("Keyboard Switch")); - setAlignment(Qt::AlignHCenter | Qt::AlignCenter); + setAlignment(TQt::AlignHCenter | TQt::AlignCenter); } KBSwitchTrayIcon::~KBSwitchTrayIcon(){ @@ -118,7 +118,7 @@ void KBSwitchTrayIcon::setToggleGroups(int group1, int group2){ for (i = 0; i < m_kbconf->groupCount(); i++) { toggling = (i == group1 || i == group2); #ifdef USE_BOLD_MENUITEM - QMenuItem *item = menu->findItem(i); + TQMenuItem *item = menu->findItem(i); BoldMenuItem *bolditem = dynamic_cast(item->custom()); bolditem->setBold(toggling); #else @@ -130,7 +130,7 @@ void KBSwitchTrayIcon::setToggleGroups(int group1, int group2){ } /** No descriptions */ -void KBSwitchTrayIcon::mouseReleaseEvent(QMouseEvent *event){ +void KBSwitchTrayIcon::mouseReleaseEvent(TQMouseEvent *event){ if (event->button() == LeftButton) { emit clicked(); } @@ -155,7 +155,7 @@ void KBSwitchTrayIcon::addLayoutItems(KPopupMenu *menu, bool clearOld) { KBGroup *group; int index; #ifdef USE_BOLD_MENUITEM - QColor active_text_color = getActiveTextColor(menu); + TQColor active_text_color = getActiveTextColor(menu); #endif if (clearOld) @@ -181,11 +181,11 @@ void KBSwitchTrayIcon::reconfigure(){ /** Update the tray icon display for the given group */ void KBSwitchTrayIcon::updateTrayIcon(int groupno){ - const QPixmap& pix = m_kbconf->getGroup(groupno)->getPixmap(); + const TQPixmap& pix = m_kbconf->getGroup(groupno)->getPixmap(); setPixmap(pix); setActiveGroup(groupno); - QToolTip::remove(this); - QToolTip::add(this, m_kbconf->getGroup(groupno)->getName()); + TQToolTip::remove(this); + TQToolTip::add(this, m_kbconf->getGroup(groupno)->getName()); } /** Update menu and tray icons after configuration has changed */ diff --git a/kkbswitch/kbswitchtrayicon.h b/kkbswitch/kbswitchtrayicon.h index a9b8000..f9348ad 100644 --- a/kkbswitch/kbswitchtrayicon.h +++ b/kkbswitch/kbswitchtrayicon.h @@ -54,7 +54,7 @@ private: // Private attributes KBConfig *m_kbconf; protected: // Protected methods /** No descriptions */ - void mouseReleaseEvent(QMouseEvent *event); + void mouseReleaseEvent(TQMouseEvent *event); public slots: // Public slots /** No descriptions */ void slotAbout(); diff --git a/kkbswitch/pathlistboxitem.cpp b/kkbswitch/pathlistboxitem.cpp index 256b843..10f4f08 100644 --- a/kkbswitch/pathlistboxitem.cpp +++ b/kkbswitch/pathlistboxitem.cpp @@ -17,8 +17,8 @@ #include "pathlistboxitem.h" -PathListBoxItem::PathListBoxItem(QListBox *listbox, const QPixmap &pix, - const QString &text, const QString &a_path) : QListBoxPixmap(listbox, pix, text), +PathListBoxItem::PathListBoxItem(TQListBox *listbox, const TQPixmap &pix, + const TQString &text, const TQString &a_path) : TQListBoxPixmap(listbox, pix, text), path(a_path) { } diff --git a/kkbswitch/pathlistboxitem.h b/kkbswitch/pathlistboxitem.h index 590969f..2d469b4 100644 --- a/kkbswitch/pathlistboxitem.h +++ b/kkbswitch/pathlistboxitem.h @@ -18,18 +18,18 @@ #ifndef PATHLISTBOXITEM_H #define PATHLISTBOXITEM_H -#include -#include +#include +#include /** *@author Leonid Zeitlin */ -class PathListBoxItem : public QListBoxPixmap { +class PathListBoxItem : public TQListBoxPixmap { public: - QString path; - PathListBoxItem(QListBox *listbox, const QPixmap &pix, const QString &text, - const QString &a_path); + TQString path; + PathListBoxItem(TQListBox *listbox, const TQPixmap &pix, const TQString &text, + const TQString &a_path); ~PathListBoxItem(); }; diff --git a/kkbswitch/singlewindowwatcher.cpp b/kkbswitch/singlewindowwatcher.cpp index 67a92ce..a4b4fa8 100644 --- a/kkbswitch/singlewindowwatcher.cpp +++ b/kkbswitch/singlewindowwatcher.cpp @@ -23,7 +23,7 @@ #include #include -SingleWindowWatcher::SingleWindowWatcher(KBConfig *kbconf, QObject *parent, const char *name) +SingleWindowWatcher::SingleWindowWatcher(KBConfig *kbconf, TQObject *parent, const char *name) : WindowWatcher(kbconf, parent, name) { reset(); diff --git a/kkbswitch/singlewindowwatcher.h b/kkbswitch/singlewindowwatcher.h index 8ca717a..2073ec4 100644 --- a/kkbswitch/singlewindowwatcher.h +++ b/kkbswitch/singlewindowwatcher.h @@ -21,7 +21,7 @@ #define SINGLEWINDOWWATCHER_H #include "windowwatcher.h" -#include +#include /** Watches for changes of active window and keep a group per each window @@ -35,7 +35,7 @@ private: int groupno; int next_groupno; }; - typedef QMap KBWindowMap; + typedef TQMap KBWindowMap; KBWindowMap m_window_map; KBWindowMap::iterator m_active_window; void addWindowToMap(WId window_id); @@ -44,7 +44,7 @@ protected: virtual void windowRemoved(WId id); virtual void activeWindowChanged(WId id); public: - SingleWindowWatcher(KBConfig *kbconf, QObject *parent = 0, const char *name = 0); + SingleWindowWatcher(KBConfig *kbconf, TQObject *parent = 0, const char *name = 0); ~SingleWindowWatcher(); virtual void changeGroup(int groupno, int next_groupno); virtual void reset(); diff --git a/kkbswitch/windowclasswatcher.cpp b/kkbswitch/windowclasswatcher.cpp index b88e781..d345a54 100644 --- a/kkbswitch/windowclasswatcher.cpp +++ b/kkbswitch/windowclasswatcher.cpp @@ -25,7 +25,7 @@ #include -WindowClassWatcher::WindowClassWatcher(KBConfig *kbconf, QObject *parent, const char *name) +WindowClassWatcher::WindowClassWatcher(KBConfig *kbconf, TQObject *parent, const char *name) : WindowWatcher(kbconf, parent, name) { reset(); @@ -35,12 +35,12 @@ WindowClassWatcher::~WindowClassWatcher() { } -QString WindowClassWatcher::getWindowClass(WId id) +TQString WindowClassWatcher::getWindowClass(WId id) { XClassHint hint; - QString ret = QString::null; + TQString ret = TQString::null; - if (XGetClassHint(qt_xdisplay(), id, &hint)) { + if (XGetClassHint(tqt_xdisplay(), id, &hint)) { ret = hint.res_class; XFree(hint.res_name); XFree(hint.res_class); @@ -50,7 +50,7 @@ QString WindowClassWatcher::getWindowClass(WId id) void WindowClassWatcher::windowAdded(WId id) { - QString wclass = getWindowClass(id); + TQString wclass = getWindowClass(id); KBClassInfo &info = m_class_group_map[wclass]; if (info.refcount == 0) { // new class @@ -93,9 +93,9 @@ void WindowClassWatcher::reset() m_class_group_map.clear(); // fill the map with existing windows - const QValueList windows = m_kwin_module->windows(); - const QValueList::ConstIterator end = windows.end(); - for (QValueList::ConstIterator it = windows.begin(); it != end; ++it) + const TQValueList windows = m_kwin_module->windows(); + const TQValueList::ConstIterator end = windows.end(); + for (TQValueList::ConstIterator it = windows.begin(); it != end; ++it) windowAdded(*it); WId active_window = m_kwin_module->activeWindow(); diff --git a/kkbswitch/windowclasswatcher.h b/kkbswitch/windowclasswatcher.h index 5479dd5..a81382e 100644 --- a/kkbswitch/windowclasswatcher.h +++ b/kkbswitch/windowclasswatcher.h @@ -21,9 +21,9 @@ #define WINDOWCLASSWATCHER_H #include "windowwatcher.h" -#include +#include -class QString; +class TQString; /** This class watcher for active window changes and keeps a group per window class @@ -33,7 +33,7 @@ This class watcher for active window changes and keeps a group per window class class WindowClassWatcher : public WindowWatcher { Q_OBJECT private: - typedef QMap WinClassMap; + typedef TQMap WinClassMap; WinClassMap m_win_class_map; struct KBClassInfo { int groupno; @@ -41,16 +41,16 @@ private: int refcount; KBClassInfo() : refcount(0) {} }; - typedef QMap ClassGroupMap; + typedef TQMap ClassGroupMap; ClassGroupMap m_class_group_map; ClassGroupMap::Iterator m_active_class; - QString getWindowClass(WId id); + TQString getWindowClass(WId id); protected: virtual void windowAdded(WId id); virtual void windowRemoved(WId id); virtual void activeWindowChanged(WId id); public: - WindowClassWatcher(KBConfig *kbconf, QObject *parent = 0, const char *name = 0); + WindowClassWatcher(KBConfig *kbconf, TQObject *parent = 0, const char *name = 0); ~WindowClassWatcher(); virtual void changeGroup(int groupno, int next_groupno); virtual void reset(); diff --git a/kkbswitch/windowwatcher.cpp b/kkbswitch/windowwatcher.cpp index 821b82c..586ea71 100644 --- a/kkbswitch/windowwatcher.cpp +++ b/kkbswitch/windowwatcher.cpp @@ -21,8 +21,8 @@ #include -WindowWatcher::WindowWatcher(KBConfig *kbconf, QObject *parent, const char *name) - : QObject(parent, name) +WindowWatcher::WindowWatcher(KBConfig *kbconf, TQObject *parent, const char *name) + : TQObject(parent, name) { m_kbconf = kbconf; m_kwin_module = new KWinModule(this); diff --git a/kkbswitch/windowwatcher.h b/kkbswitch/windowwatcher.h index cb0c835..28e59af 100644 --- a/kkbswitch/windowwatcher.h +++ b/kkbswitch/windowwatcher.h @@ -22,7 +22,7 @@ #ifndef WINDOWWATCHER_H #define WINDOWWATCHER_H -#include +#include class KBConfig; class KWinModule; @@ -32,7 +32,7 @@ class KWinModule; This class watches for active window changes and notifies KKBSwitch that the keyboard group needs to be canged */ -class WindowWatcher : public QObject { +class WindowWatcher : public TQObject { Q_OBJECT protected: KBConfig *m_kbconf; @@ -42,7 +42,7 @@ protected slots: virtual void windowRemoved(WId id) = 0; virtual void activeWindowChanged(WId id) = 0; public: - WindowWatcher(KBConfig *kbconf, QObject *parent = 0, const char *name = 0); + WindowWatcher(KBConfig *kbconf, TQObject *parent = 0, const char *name = 0); ~WindowWatcher(); virtual void changeGroup(int groupno, int next_groupno) = 0; virtual void reset() = 0; diff --git a/kkbswitch/xkeyboard.cpp b/kkbswitch/xkeyboard.cpp index 085abbf..ff3b5cd 100644 --- a/kkbswitch/xkeyboard.cpp +++ b/kkbswitch/xkeyboard.cpp @@ -17,8 +17,8 @@ #include "xkeyboard.h" -#include -#include +#include +#include #include #include @@ -27,7 +27,7 @@ XKeyboard *XKeyboard::m_self = 0; XKeyboard::XKeyboard() { - Display *display = qt_xdisplay(); + Display *display = tqt_xdisplay(); #ifdef HAVE_LIBXKLAVIER // XklSetDebugLevel(0); XklSetLogAppender(XklLogAppender); @@ -102,7 +102,7 @@ void XKeyboard::setGroupNo(int groupno){ #ifdef HAVE_LIBXKLAVIER XklLockGroup(groupno); #else - XkbLockGroup(qt_xdisplay(), XkbUseCoreKbd, groupno); + XkbLockGroup(tqt_xdisplay(), XkbUseCoreKbd, groupno); #endif } @@ -115,7 +115,7 @@ extern "C" { #endif /** Get the names of the currently configured keyboard groups */ -void XKeyboard::getGroupNames(QStringList &list){ +void XKeyboard::getGroupNames(TQStringList &list){ #ifdef HAVE_LIBXKLAVIER const char** groupnames = XklGetGroupNames(); int numgroups = XklGetNumGroups(); @@ -123,7 +123,7 @@ void XKeyboard::getGroupNames(QStringList &list){ list.append(groupnames[i]); #else XkbDescRec xkb; - Display *display = qt_xdisplay(); + Display *display = tqt_xdisplay(); char *names[XkbNumKbdGroups]; memset(&xkb, 0, sizeof(xkb)); @@ -142,7 +142,7 @@ void XKeyboard::getGroupNames(QStringList &list){ list.append(names[i]); XFree(names[i]); } - else list.append(QString::null); + else list.append(TQString::null); } XkbFreeNames(&xkb, XkbGroupNamesMask, 1); #endif @@ -159,7 +159,7 @@ int XKeyboard::getGroupNo(){ return XklGetCurrentState()->group; #else XkbStateRec rec; - XkbGetState(qt_xdisplay(), XkbUseCoreKbd, &rec); + XkbGetState(tqt_xdisplay(), XkbUseCoreKbd, &rec); return (int) rec.group; #endif } @@ -191,7 +191,7 @@ void XKeyboard::retrieveNumKbdGroups(){ it returns BadImplementation status code, and you have to specify xkb.device_spec = XkbUseCoreKbd. */ xkb.device_spec = XkbUseCoreKbd; - XkbGetControls(qt_xdisplay(), XkbGroupsWrapMask, &xkb); + XkbGetControls(tqt_xdisplay(), XkbGroupsWrapMask, &xkb); m_numgroups = xkb.ctrls->num_groups; XkbFreeControls(&xkb, XkbGroupsWrapMask, 1); } diff --git a/kkbswitch/xkeyboard.h b/kkbswitch/xkeyboard.h index 221acb9..dc2454a 100644 --- a/kkbswitch/xkeyboard.h +++ b/kkbswitch/xkeyboard.h @@ -20,7 +20,7 @@ #include "config.h" -#include +#include #include #include @@ -29,13 +29,13 @@ #include #endif -class QStringList; +class TQStringList; /**This class incapsulates XKeyboard Extension interface *@author Leonid Zeitlin */ -class XKeyboard : public QObject { +class XKeyboard : public TQObject { Q_OBJECT private: #ifndef HAVE_LIBXKLAVIER @@ -51,7 +51,7 @@ public: /** Set the current keyboard group to the given groupno */ void setGroupNo(int groupno); /** Get the names of the currently configured keyboard groups */ - void getGroupNames(QStringList &list); + void getGroupNames(TQStringList &list); static XKeyboard* self(); /** return the current keyboard group index */ int getGroupNo(); -- cgit v1.2.3