Initial TQt conversion

pull/1/head
Slávek Banko 11 years ago
parent 43e0b376e7
commit 0af498ec7d

@ -1033,7 +1033,7 @@ elif test "$kde_use_qt_emb" = "yes"; then
x_includes=""
x_libraries=""
elif test "$kde_use_qt_mac" = "yes"; then
dnl We're using QT/Mac (I use QT_MAC so that qglobal.h doesn't *have* to
dnl We're using QT/Mac (I use QT_MAC so that ntqglobal.h doesn't *have* to
dnl be included to get the information) --Sam
CXXFLAGS="$CXXFLAGS -DQT_MAC -no-cpp-precomp"
CFLAGS="$CFLAGS -DQT_MAC -no-cpp-precomp"
@ -1065,19 +1065,19 @@ AC_DEFUN([KDE_PRINT_QT_PROGRAM],
AC_REQUIRE([KDE_USE_QT])
cat > conftest.$ac_ext <<EOF
#include "confdefs.h"
#include <qglobal.h>
#include <qapplication.h>
#include <ntqglobal.h>
#include <ntqapplication.h>
EOF
if test "$kde_qtver" = "2"; then
cat >> conftest.$ac_ext <<EOF
#include <qevent.h>
#include <qstring.h>
#include <qstyle.h>
#include <ntqevent.h>
#include <ntqstring.h>
#include <ntqstyle.h>
EOF
if test $kde_qtsubver -gt 0; then
cat >> conftest.$ac_ext <<EOF
#if QT_VERSION < 210
#if TQT_VERSION < 210
#error 1
#endif
EOF
@ -1086,8 +1086,8 @@ fi
if test "$kde_qtver" = "3"; then
cat >> conftest.$ac_ext <<EOF
#include <qcursor.h>
#include <qstylefactory.h>
#include <ntqcursor.h>
#include <ntqstylefactory.h>
#include <private/qucomextra_p.h>
EOF
fi
@ -1170,22 +1170,22 @@ fi
if test -z "$3"; then
if test $kde_qtver = 3; then
if test $kde_qtsubver -gt 0; then
kde_qt_verstring="QT_VERSION >= 0x03@VER@00"
kde_qt_verstring="TQT_VERSION >= 0x03@VER@00"
qtsubver=`echo "00$kde_qtsubver" | sed -e 's,.*\(..\)$,\1,'`
kde_qt_verstring=`echo $kde_qt_verstring | sed -e "s,@VER@,$qtsubver,"`
else
kde_qt_verstring="QT_VERSION >= 300"
kde_qt_verstring="TQT_VERSION >= 300"
fi
fi
if test $kde_qtver = 2; then
if test $kde_qtsubver -gt 0; then
kde_qt_verstring="QT_VERSION >= 222"
kde_qt_verstring="TQT_VERSION >= 222"
else
kde_qt_verstring="QT_VERSION >= 200"
kde_qt_verstring="TQT_VERSION >= 200"
fi
fi
if test $kde_qtver = 1; then
kde_qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200"
kde_qt_verstring="TQT_VERSION >= 142 && TQT_VERSION < 200"
fi
else
kde_qt_verstring="$3"
@ -1291,7 +1291,7 @@ AC_ARG_ENABLE(
USING_QT_MT=""
dnl ------------------------------------------------------------------------
dnl If we not get --disable-qt-mt then adjust some vars for the host.
dnl If we not get --disable-tqt-mt then adjust some vars for the host.
dnl ------------------------------------------------------------------------
KDE_MT_LDFLAGS=
@ -1354,7 +1354,7 @@ dnl ------------------------------------------------------------
fi
dnl ------------------------------------------------------------------------
dnl If we got --enable-qt-mt then adjust the Qt library name for the host.
dnl If we got --enable-tqt-mt then adjust the Qt library name for the host.
dnl ------------------------------------------------------------------------
if test "x$kde_use_qt_mt" = "xyes"; then
@ -1425,9 +1425,9 @@ if test ! "$ac_qt_includes" = "NO"; then
fi
if test "$kde_qtver" != "1"; then
kde_qt_header=qstyle.h
kde_qt_header=ntqstyle.h
else
kde_qt_header=qglobal.h
kde_qt_header=ntqglobal.h
fi
AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir)
@ -1979,7 +1979,7 @@ AC_CACHE_VAL(kde_cv_have_kdeqtaddon,
LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS"
AC_TRY_LINK([
#include <qdom.h>
#include <ntqdom.h>
],
[
QDomDocument doc;
@ -2498,7 +2498,7 @@ LIBS=`echo $LIBS | sed "s/$LIBJPEG//"`
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
AC_TRY_LINK(
[#include <qapplication.h>],
[#include <ntqapplication.h>],
[
int argc;
char** argv;
@ -4205,7 +4205,7 @@ CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
AC_TRY_RUN(dnl
[
#include <qimageio.h>
#include <qstring.h>
#include <ntqstring.h>
int main() {
QString t = "hallo";
t.fill('t');
@ -4989,7 +4989,7 @@ if test "${with_qt_dir+set}" = set; then
kde_qtdir="$with_qt_dir"
fi
AC_FIND_FILE(qsql.html, [ $kde_qtdir/doc/html $QTDIR/doc/html /usr/share/doc/packages/qt3/html /usr/lib/qt/doc /usr/lib/qt3/doc /usr/lib/qt3/doc/html /usr/doc/qt3/html /usr/doc/qt3 /usr/share/doc/qt3-doc /usr/share/qt3/doc/html /usr/X11R6/share/doc/qt/html ], QTDOCDIR)
AC_FIND_FILE(ntqsql.html, [ $kde_qtdir/doc/html $QTDIR/doc/html /usr/share/doc/packages/qt3/html /usr/lib/qt/doc /usr/lib/qt3/doc /usr/lib/qt3/doc/html /usr/doc/qt3/html /usr/doc/qt3 /usr/share/doc/qt3-doc /usr/share/qt3/doc/html /usr/X11R6/share/doc/qt/html ], QTDOCDIR)
AC_MSG_RESULT($QTDOCDIR)
AC_SUBST(QTDOCDIR)
@ -5010,7 +5010,7 @@ AC_SUBST(DOXYGEN_PROJECT_NAME)
AC_SUBST(DOXYGEN_PROJECT_NUMBER)
KDE_HAS_DOXYGEN=no
if test -n "$DOXYGEN" && test -x "$DOXYGEN" && test -f $QTDOCDIR/qsql.html; then
if test -n "$DOXYGEN" && test -x "$DOXYGEN" && test -f $QTDOCDIR/ntqsql.html; then
KDE_HAS_DOXYGEN=yes
fi
AC_SUBST(KDE_HAS_DOXYGEN)

46
aclocal.m4 vendored

@ -1045,7 +1045,7 @@ elif test "$kde_use_qt_emb" = "yes"; then
x_includes=""
x_libraries=""
elif test "$kde_use_qt_mac" = "yes"; then
dnl We're using QT/Mac (I use QT_MAC so that qglobal.h doesn't *have* to
dnl We're using QT/Mac (I use QT_MAC so that ntqglobal.h doesn't *have* to
dnl be included to get the information) --Sam
CXXFLAGS="$CXXFLAGS -DQT_MAC -no-cpp-precomp"
CFLAGS="$CFLAGS -DQT_MAC -no-cpp-precomp"
@ -1077,19 +1077,19 @@ AC_DEFUN([KDE_PRINT_QT_PROGRAM],
AC_REQUIRE([KDE_USE_QT])
cat > conftest.$ac_ext <<EOF
#include "confdefs.h"
#include <qglobal.h>
#include <qapplication.h>
#include <ntqglobal.h>
#include <ntqapplication.h>
EOF
if test "$kde_qtver" = "2"; then
cat >> conftest.$ac_ext <<EOF
#include <qevent.h>
#include <qstring.h>
#include <qstyle.h>
#include <ntqevent.h>
#include <ntqstring.h>
#include <ntqstyle.h>
EOF
if test $kde_qtsubver -gt 0; then
cat >> conftest.$ac_ext <<EOF
#if QT_VERSION < 210
#if TQT_VERSION < 210
#error 1
#endif
EOF
@ -1098,8 +1098,8 @@ fi
if test "$kde_qtver" = "3"; then
cat >> conftest.$ac_ext <<EOF
#include <qcursor.h>
#include <qstylefactory.h>
#include <ntqcursor.h>
#include <ntqstylefactory.h>
#include <private/qucomextra_p.h>
EOF
fi
@ -1182,22 +1182,22 @@ fi
if test -z "$3"; then
if test $kde_qtver = 3; then
if test $kde_qtsubver -gt 0; then
kde_qt_verstring="QT_VERSION >= 0x03@VER@00"
kde_qt_verstring="TQT_VERSION >= 0x03@VER@00"
qtsubver=`echo "00$kde_qtsubver" | sed -e 's,.*\(..\)$,\1,'`
kde_qt_verstring=`echo $kde_qt_verstring | sed -e "s,@VER@,$qtsubver,"`
else
kde_qt_verstring="QT_VERSION >= 300"
kde_qt_verstring="TQT_VERSION >= 300"
fi
fi
if test $kde_qtver = 2; then
if test $kde_qtsubver -gt 0; then
kde_qt_verstring="QT_VERSION >= 222"
kde_qt_verstring="TQT_VERSION >= 222"
else
kde_qt_verstring="QT_VERSION >= 200"
kde_qt_verstring="TQT_VERSION >= 200"
fi
fi
if test $kde_qtver = 1; then
kde_qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200"
kde_qt_verstring="TQT_VERSION >= 142 && TQT_VERSION < 200"
fi
else
kde_qt_verstring="$3"
@ -1303,7 +1303,7 @@ AC_ARG_ENABLE(
USING_QT_MT=""
dnl ------------------------------------------------------------------------
dnl If we not get --disable-qt-mt then adjust some vars for the host.
dnl If we not get --disable-tqt-mt then adjust some vars for the host.
dnl ------------------------------------------------------------------------
KDE_MT_LDFLAGS=
@ -1366,7 +1366,7 @@ dnl ------------------------------------------------------------
fi
dnl ------------------------------------------------------------------------
dnl If we got --enable-qt-mt then adjust the Qt library name for the host.
dnl If we got --enable-tqt-mt then adjust the Qt library name for the host.
dnl ------------------------------------------------------------------------
if test "x$kde_use_qt_mt" = "xyes"; then
@ -1437,9 +1437,9 @@ if test ! "$ac_qt_includes" = "NO"; then
fi
if test "$kde_qtver" != "1"; then
kde_qt_header=qstyle.h
kde_qt_header=ntqstyle.h
else
kde_qt_header=qglobal.h
kde_qt_header=ntqglobal.h
fi
AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir)
@ -1991,7 +1991,7 @@ AC_CACHE_VAL(kde_cv_have_kdeqtaddon,
LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS"
AC_TRY_LINK([
#include <qdom.h>
#include <ntqdom.h>
],
[
QDomDocument doc;
@ -2510,7 +2510,7 @@ LIBS=`echo $LIBS | sed "s/$LIBJPEG//"`
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
AC_TRY_LINK(
[#include <qapplication.h>],
[#include <ntqapplication.h>],
[
int argc;
char** argv;
@ -4217,7 +4217,7 @@ CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
AC_TRY_RUN(dnl
[
#include <qimageio.h>
#include <qstring.h>
#include <ntqstring.h>
int main() {
QString t = "hallo";
t.fill('t');
@ -5001,7 +5001,7 @@ if test "${with_qt_dir+set}" = set; then
kde_qtdir="$with_qt_dir"
fi
AC_FIND_FILE(qsql.html, [ $kde_qtdir/doc/html $QTDIR/doc/html /usr/share/doc/packages/qt3/html /usr/lib/qt/doc /usr/lib/qt3/doc /usr/lib/qt3/doc/html /usr/doc/qt3/html /usr/doc/qt3 /usr/share/doc/qt3-doc /usr/share/qt3/doc/html /usr/X11R6/share/doc/qt/html ], QTDOCDIR)
AC_FIND_FILE(ntqsql.html, [ $kde_qtdir/doc/html $QTDIR/doc/html /usr/share/doc/packages/qt3/html /usr/lib/qt/doc /usr/lib/qt3/doc /usr/lib/qt3/doc/html /usr/doc/qt3/html /usr/doc/qt3 /usr/share/doc/qt3-doc /usr/share/qt3/doc/html /usr/X11R6/share/doc/qt/html ], QTDOCDIR)
AC_MSG_RESULT($QTDOCDIR)
AC_SUBST(QTDOCDIR)
@ -5022,7 +5022,7 @@ AC_SUBST(DOXYGEN_PROJECT_NAME)
AC_SUBST(DOXYGEN_PROJECT_NUMBER)
KDE_HAS_DOXYGEN=no
if test -n "$DOXYGEN" && test -x "$DOXYGEN" && test -f $QTDOCDIR/qsql.html; then
if test -n "$DOXYGEN" && test -x "$DOXYGEN" && test -f $QTDOCDIR/ntqsql.html; then
KDE_HAS_DOXYGEN=yes
fi
AC_SUBST(KDE_HAS_DOXYGEN)

@ -16,11 +16,11 @@
***************************************************************************/
#include "boldlistboxitem.h"
#include <qpainter.h>
#include <ntqpainter.h>
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);
}

@ -18,19 +18,19 @@
#ifndef BOLDLISTBOXITEM_H
#define BOLDLISTBOXITEM_H
#include <qlistbox.h>
#include <ntqlistbox.h>
/**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; }

@ -16,10 +16,10 @@
***************************************************************************/
#include "boldmenuitem.h"
#include <qfont.h>
#include <qpainter.h>
#include <qpalette.h>
#include <qstyle.h>
#include <ntqfont.h>
#include <ntqpainter.h>
#include <ntqpalette.h>
#include <ntqstyle.h>
#include <kdebug.h>
#include <kglobalsettings.h>
#include <kdeversion.h>
@ -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);
}

@ -18,35 +18,35 @@
#ifndef BOLDMENUITEM_H
#define BOLDMENUITEM_H
#include <qmenudata.h>
#include <ntqmenudata.h>
/**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

@ -30,9 +30,9 @@
#include <kdebug.h>
#include <kglobalaccel.h>
#include <qnamespace.h>
#include <qpainter.h>
#include <qimage.h>
#include <ntqnamespace.h>
#include <ntqpainter.h>
#include <ntqimage.h>
#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("<Unnamed>");
if (name == TQString::null) name = i18n("<Unnamed>");
m_groups.insert(i, new KBGroup(name));
}
QValueVector<QPixmap> pixlist;
QStringList iconpaths;
TQValueVector<TQPixmap> 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<QPixmap> *icons,
QStringList *iconpaths)
void KBConfig::drawIcons(IconStyle icon_style, TQValueVector<TQPixmap> *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<QPixmap> *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<QPixmap> *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<QPixmap> *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);

@ -20,8 +20,8 @@
#include "kbgroup.h"
#include <qptrvector.h>
#include <qvaluevector.h>
#include <ntqptrvector.h>
#include <ntqvaluevector.h>
#include <kconfig.h>
#define ICONS_SECTION "Icons"
@ -32,7 +32,7 @@
class KGlobalAccel;
typedef QPtrVector<KBGroup> KBGroupVector;
typedef TQPtrVector<KBGroup> 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<QPixmap> *icons,
QStringList *iconpaths);
void drawIcons(IconStyle icon_style, TQValueVector<TQPixmap> *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

@ -19,17 +19,17 @@
#include "kbpickicondlg.h"
#include "boldlistboxitem.h"
#include <qlayout.h>
#include <qlabel.h>
#include <qcheckbox.h>
#include <qwhatsthis.h>
#include <qvbox.h>
#include <qstyle.h>
#include <qgroupbox.h>
#include <qheader.h>
#include <qobjectlist.h>
#include <qpushbutton.h>
#include <qcombobox.h>
#include <ntqlayout.h>
#include <ntqlabel.h>
#include <ntqcheckbox.h>
#include <ntqwhatsthis.h>
#include <ntqvbox.h>
#include <ntqstyle.h>
#include <ntqgroupbox.h>
#include <ntqheader.h>
#include <ntqobjectlist.h>
#include <ntqpushbutton.h>
#include <ntqcombobox.h>
#include <kdeversion.h>
#include <klistbox.h>
@ -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<KListView*>(obj);
else if (obj->inherits("QGroupBox"))
gb = dynamic_cast<QGroupBox*>(obj);
else if (obj->inherits("TQGroupBox"))
gb = dynamic_cast<TQGroupBox*>(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("<p>Select the style of icons representing the "
TQWhatsThis::add(cbxIconType, i18n("<p>Select the style of icons representing the "
"current keyboard layout.\n"
"You can choose from the following styles:"
"<ul><li><b>Country flag</b> - displays the corresponding country flag"
@ -178,17 +178,17 @@ void KBConfigDlg::setupGeneralPage()
"<li><b>Flag and code</b> - displays the language code superimposed over the country flag."
"</ul></p>"));
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("<p>Select what windows the currently selected "
TQWhatsThis::add(cbxGroupScope, i18n("<p>Select what windows the currently selected "
"keyboard layout applies to:\n"
"<ul><li><b>All windows</b> - one layout applies to all windows on your desktop\n"
"<li><b>Windows of one application</b> - layout applies to one application; each "
@ -196,30 +196,30 @@ void KBConfigDlg::setupGeneralPage()
"<li><b>One window</b> - layout applies to one window only; each window can have its own layout. "
"When you switch between windows, layout follows the active window.</ul></p>"));
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<BoldListBoxItem*>(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<QPixmap> pixlist;
TQValueVector<TQPixmap> 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<BoldListBoxItem*>(lbGroups->item(i));

@ -21,11 +21,11 @@
#include <kdialogbase.h>
#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();

@ -18,7 +18,7 @@
#include "kbgroup.h"
#include <kdebug.h>
KBGroup::KBGroup(const QString& name){
KBGroup::KBGroup(const TQString& name){
m_name = name;
}

@ -18,8 +18,8 @@
#ifndef KBGROUP_H
#define KBGROUP_H
#include <qpixmap.h>
#include <qstring.h>
#include <ntqpixmap.h>
#include <ntqstring.h>
/**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

@ -17,11 +17,11 @@
#include "kbpickicondlg.h"
#include <qvbox.h>
#include <qdir.h>
#include <qwhatsthis.h>
#include <qpushbutton.h>
#include <qimage.h>
#include <ntqvbox.h>
#include <ntqdir.h>
#include <ntqwhatsthis.h>
#include <ntqpushbutton.h>
#include <ntqimage.h>
#include <kdeversion.h>
#include <klocale.h>
@ -37,21 +37,21 @@
#include "kbconfig.h"
#include "pathlistboxitem.h"
KBPickIconDlg::KBPickIconDlg(const QString &currentPath, const QPixmap &currentPixmap,
QWidget *parent, const char *name )
KBPickIconDlg::KBPickIconDlg(const TQString &currentPath, const TQPixmap &currentPixmap,
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<PathListBoxItem*>(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 &currentPath,
const QPixmap &currentPixmap)
void KBPickIconDlg::showCurrentPath(const TQString &currentPath,
const TQPixmap &currentPixmap)
{
PathListBoxItem *item = NULL;
bool itemFound = false;
@ -193,11 +193,11 @@ void KBPickIconDlg::showCurrentPath(const QString &currentPath,
// 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);
}

@ -20,9 +20,9 @@
#include <kdialogbase.h>
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 &currentPath, const QPixmap &currentPixmap,
QWidget *parent=0, const char *name=0);
KBPickIconDlg(const TQString &currentPath, const TQPixmap &currentPixmap,
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 &currentPath, const QPixmap &currentPixmap);
void showCurrentPath(const TQString &currentPath, const TQPixmap &currentPixmap);
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

@ -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;*/

@ -29,7 +29,7 @@
#include <kuniqueapp.h>
#endif
//#include <qmap.h>
//#include <ntqmap.h>
#include "kbgroup.h"
#include "kbswitchtrayicon.h"
@ -45,7 +45,7 @@ typedef struct _KBWinInfo {
int next_groupno;
} KBWinInfo;
typedef QMap<WId, KBWinInfo> KBWindowMap;*/
typedef TQMap<WId, KBWinInfo> KBWindowMap;*/
/**
*@author Leonid Zeitlin

@ -18,8 +18,8 @@
#include "kbswitchintf.h"
//#include <kapp.h>
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;

@ -19,8 +19,8 @@
#define KBSWITCHINTF_H
#include <dcopobject.h>
#include <qobject.h>
#include <qstringlist.h>
#include <ntqobject.h>
#include <ntqstringlist.h>
#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

@ -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;

@ -42,20 +42,20 @@
#include <kiconloader.h>
#include <kdebug.h>
#include <kdeversion.h>
#include <qtooltip.h>
#include <qstyle.h>
#include <qpainter.h>
#include <ntqtooltip.h>
#include <ntqstyle.h>
#include <ntqpainter.h>
#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<BoldMenuItem*>(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 */

@ -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();

@ -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)
{
}

@ -18,18 +18,18 @@
#ifndef PATHLISTBOXITEM_H
#define PATHLISTBOXITEM_H
#include <qlistbox.h>
#include <qstring.h>
#include <ntqlistbox.h>
#include <ntqstring.h>
/**
*@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();
};

@ -23,7 +23,7 @@
#include <kwinmodule.h>
#include <kdebug.h>
SingleWindowWatcher::SingleWindowWatcher(KBConfig *kbconf, QObject *parent, const char *name)
SingleWindowWatcher::SingleWindowWatcher(KBConfig *kbconf, TQObject *parent, const char *name)
: WindowWatcher(kbconf, parent, name)
{
reset();

@ -21,7 +21,7 @@
#define SINGLEWINDOWWATCHER_H
#include "windowwatcher.h"
#include <qmap.h>
#include <ntqmap.h>
/**
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<WId, KBWinInfo> KBWindowMap;
typedef TQMap<WId, KBWinInfo> 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();

@ -25,7 +25,7 @@
#include <X11/Xutil.h>
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<WId> windows = m_kwin_module->windows();
const QValueList<WId>::ConstIterator end = windows.end();
for (QValueList<WId>::ConstIterator it = windows.begin(); it != end; ++it)
const TQValueList<WId> windows = m_kwin_module->windows();
const TQValueList<WId>::ConstIterator end = windows.end();
for (TQValueList<WId>::ConstIterator it = windows.begin(); it != end; ++it)
windowAdded(*it);
WId active_window = m_kwin_module->activeWindow();

@ -21,9 +21,9 @@
#define WINDOWCLASSWATCHER_H
#include "windowwatcher.h"
#include <qmap.h>
#include <ntqmap.h>
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<WId, QString> WinClassMap;
typedef TQMap<WId, TQString> WinClassMap;
WinClassMap m_win_class_map;
struct KBClassInfo {
int groupno;
@ -41,16 +41,16 @@ private:
int refcount;
KBClassInfo() : refcount(0) {}
};
typedef QMap<QString, KBClassInfo> ClassGroupMap;
typedef TQMap<TQString, KBClassInfo> 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();

@ -21,8 +21,8 @@
#include <kwinmodule.h>
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);

@ -22,7 +22,7 @@
#ifndef WINDOWWATCHER_H
#define WINDOWWATCHER_H
#include <qobject.h>
#include <ntqobject.h>
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;

@ -17,8 +17,8 @@
#include "xkeyboard.h"
#include <qwindowdefs.h>
#include <qstringlist.h>
#include <ntqwindowdefs.h>
#include <ntqstringlist.h>
#include <kdebug.h>
#include <klocale.h>
@ -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);
}

@ -20,7 +20,7 @@
#include "config.h"
#include <qobject.h>
#include <ntqobject.h>
#include <X11/Xlib.h>
#include <X11/XKBlib.h>
@ -29,13 +29,13 @@
#include <libxklavier/xklavier.h>
#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();

Loading…
Cancel
Save