diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:42:31 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:42:31 +0000 |
commit | 576eb4299a00bc053db35414406f46372a0f70f2 (patch) | |
tree | 4c030922d533821db464af566188e7d40cc8848c /libkdegames/kcarddialog.cpp | |
parent | 0718336b6017d1a4fc1d626544180a5a2a29ddec (diff) | |
download | tdegames-576eb4299a00bc053db35414406f46372a0f70f2.tar.gz tdegames-576eb4299a00bc053db35414406f46372a0f70f2.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1157643 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libkdegames/kcarddialog.cpp')
-rw-r--r-- | libkdegames/kcarddialog.cpp | 322 |
1 files changed, 161 insertions, 161 deletions
diff --git a/libkdegames/kcarddialog.cpp b/libkdegames/kcarddialog.cpp index a4d2ac20..73011c9a 100644 --- a/libkdegames/kcarddialog.cpp +++ b/libkdegames/kcarddialog.cpp @@ -23,13 +23,13 @@ #include <stdio.h> #include <assert.h> -#include <qgroupbox.h> -#include <qlabel.h> -#include <qcheckbox.h> -#include <qlayout.h> -#include <qtooltip.h> -#include <qslider.h> -#include <qwmatrix.h> +#include <tqgroupbox.h> +#include <tqlabel.h> +#include <tqcheckbox.h> +#include <tqlayout.h> +#include <tqtooltip.h> +#include <tqslider.h> +#include <tqwmatrix.h> #include <kapplication.h> #include <klocale.h> @@ -38,12 +38,12 @@ #include <ksimpleconfig.h> #include "kcarddialog.h" -#include <qpushbutton.h> +#include <tqpushbutton.h> #include <kdebug.h> -#define KCARD_DEFAULTDECK QString::fromLatin1("deck0.png") -#define KCARD_DEFAULTCARD QString::fromLatin1("11.png") -#define KCARD_DEFAULTCARDDIR QString::fromLatin1("cards-default/") +#define KCARD_DEFAULTDECK TQString::fromLatin1("deck0.png") +#define KCARD_DEFAULTCARD TQString::fromLatin1("11.png") +#define KCARD_DEFAULTCARDDIR TQString::fromLatin1("cards-default/") // values for the resize slider #define SLIDER_MIN 400 @@ -51,19 +51,19 @@ // KConfig entries #define CONF_GROUP "KCardDialog" -#define CONF_RANDOMDECK QString::fromLatin1("RandomDeck") -#define CONF_DECK QString::fromLatin1("Deck") -#define CONF_CARDDIR QString::fromLatin1("CardDir") -#define CONF_RANDOMCARDDIR QString::fromLatin1("RandomCardDir") -#define CONF_USEGLOBALDECK QString::fromLatin1("GlobalDeck") -#define CONF_USEGLOBALCARDDIR QString::fromLatin1("GlobalCardDir") -#define CONF_SCALE QString::fromLatin1("Scale") +#define CONF_RANDOMDECK TQString::fromLatin1("RandomDeck") +#define CONF_DECK TQString::fromLatin1("Deck") +#define CONF_CARDDIR TQString::fromLatin1("CardDir") +#define CONF_RANDOMCARDDIR TQString::fromLatin1("RandomCardDir") +#define CONF_USEGLOBALDECK TQString::fromLatin1("GlobalDeck") +#define CONF_USEGLOBALCARDDIR TQString::fromLatin1("GlobalCardDir") +#define CONF_SCALE TQString::fromLatin1("Scale") -#define CONF_GLOBAL_GROUP QString::fromLatin1("KCardDialog Settings") -#define CONF_GLOBAL_DECK QString::fromLatin1("GlobalDeck") -#define CONF_GLOBAL_CARDDIR QString::fromLatin1("GlobalCardDir") -#define CONF_GLOBAL_RANDOMDECK QString::fromLatin1("GlobalRandomDeck") -#define CONF_GLOBAL_RANDOMCARDDIR QString::fromLatin1("GlobalRandomCardDir") +#define CONF_GLOBAL_GROUP TQString::fromLatin1("KCardDialog Settings") +#define CONF_GLOBAL_DECK TQString::fromLatin1("GlobalDeck") +#define CONF_GLOBAL_CARDDIR TQString::fromLatin1("GlobalCardDir") +#define CONF_GLOBAL_RANDOMDECK TQString::fromLatin1("GlobalRandomDeck") +#define CONF_GLOBAL_RANDOMCARDDIR TQString::fromLatin1("GlobalRandomCardDir") class KCardDialogPrivate @@ -85,31 +85,31 @@ public: cScale = 1; } - QLabel* deckLabel; - QLabel* cardLabel; + TQLabel* deckLabel; + TQLabel* cardLabel; KIconView* deckIconView; KIconView* cardIconView; - QCheckBox* randomDeck; - QCheckBox* randomCardDir; - QCheckBox* globalDeck; - QCheckBox* globalCardDir; + TQCheckBox* randomDeck; + TQCheckBox* randomCardDir; + TQCheckBox* globalDeck; + TQCheckBox* globalCardDir; - QSlider* scaleSlider; - QPixmap cPreviewPix; - QLabel* cPreview; + TQSlider* scaleSlider; + TQPixmap cPreviewPix; + TQLabel* cPreview; - QMap<QIconViewItem*, QString> deckMap; - QMap<QIconViewItem*, QString> cardMap; - QMap<QString, QString> helpMap; + TQMap<TQIconViewItem*, TQString> deckMap; + TQMap<TQIconViewItem*, TQString> cardMap; + TQMap<TQString, TQString> helpMap; //set query variables KCardDialog::CardFlags cFlags; - QString cDeck; - QString cCardDir; + TQString cDeck; + TQString cCardDir; double cScale; }; -int KCardDialog::getCardDeck(QString &pDeck, QString &pCardDir, QWidget *pParent, +int KCardDialog::getCardDeck(TQString &pDeck, TQString &pCardDir, TQWidget *pParent, CardFlags pFlags, bool* pRandomDeck, bool* pRandomCardDir, double* pScale, KConfig* pConf) { @@ -123,14 +123,14 @@ int KCardDialog::getCardDeck(QString &pDeck, QString &pCardDir, QWidget *pParent dlg.showRandomDeckBox(pRandomDeck != 0); dlg.showRandomCardDirBox(pRandomCardDir != 0); int result=dlg.exec(); - if (result==QDialog::Accepted) + if (result==TQDialog::Accepted) { // TODO check for global cards/decks!!!! pDeck=dlg.deck(); pCardDir=dlg.cardDir(); - if (!pCardDir.isNull() && pCardDir.right(1)!=QString::fromLatin1("/")) + if (!pCardDir.isNull() && pCardDir.right(1)!=TQString::fromLatin1("/")) { - pCardDir+=QString::fromLatin1("/"); + pCardDir+=TQString::fromLatin1("/"); } if (pRandomDeck) { @@ -176,13 +176,13 @@ int KCardDialog::getCardDeck(QString &pDeck, QString &pCardDir, QWidget *pParent return result; } -void KCardDialog::getConfigCardDeck(KConfig* conf, QString &pDeck, QString &pCardDir, double& pScale) +void KCardDialog::getConfigCardDeck(KConfig* conf, TQString &pDeck, TQString &pCardDir, double& pScale) { // TODO check for global cards/decks!!!! if (!conf) { return; } - QString origGroup = conf->group(); + TQString origGroup = conf->group(); conf->setGroup(CONF_GROUP); if (conf->readBoolEntry(CONF_RANDOMDECK) || !conf->hasKey(CONF_DECK)) { @@ -215,39 +215,39 @@ void KCardDialog::getConfigCardDeck(KConfig* conf, QString &pDeck, QString &pCar conf->setGroup(origGroup); } -QString KCardDialog::getDefaultDeck() +TQString KCardDialog::getDefaultDeck() { KCardDialog::init(); - return locate("cards", QString::fromLatin1("decks/") + KCARD_DEFAULTDECK); + return locate("cards", TQString::fromLatin1("decks/") + KCARD_DEFAULTDECK); } -QString KCardDialog::getDefaultCardDir() +TQString KCardDialog::getDefaultCardDir() { KCardDialog::init(); - QString file = KCARD_DEFAULTCARDDIR + KCARD_DEFAULTCARD; + TQString file = KCARD_DEFAULTCARDDIR + KCARD_DEFAULTCARD; return KGlobal::dirs()->findResourceDir("cards",file) + KCARD_DEFAULTCARDDIR; } -QString KCardDialog::getCardPath(const QString &carddir, int index) +TQString KCardDialog::getCardPath(const TQString &carddir, int index) { KCardDialog::init(); - QString entry = carddir + QString::number(index); - if (KStandardDirs::exists(entry + QString::fromLatin1(".png"))) - return entry + QString::fromLatin1(".png"); + TQString entry = carddir + TQString::number(index); + if (KStandardDirs::exists(entry + TQString::fromLatin1(".png"))) + return entry + TQString::fromLatin1(".png"); // rather theoretical - if (KStandardDirs::exists(entry + QString::fromLatin1(".xpm"))) - return entry + QString::fromLatin1(".xpm"); + if (KStandardDirs::exists(entry + TQString::fromLatin1(".xpm"))) + return entry + TQString::fromLatin1(".xpm"); - return QString::null; + return TQString::null; } -const QString& KCardDialog::deck() const { return d->cDeck; } -void KCardDialog::setDeck(const QString& file) { d->cDeck=file; } -const QString& KCardDialog::cardDir() const { return d->cCardDir; } -void KCardDialog::setCardDir(const QString& dir) { d->cCardDir=dir; } +const TQString& KCardDialog::deck() const { return d->cDeck; } +void KCardDialog::setDeck(const TQString& file) { d->cDeck=file; } +const TQString& KCardDialog::cardDir() const { return d->cCardDir; } +void KCardDialog::setCardDir(const TQString& dir) { d->cCardDir=dir; } KCardDialog::CardFlags KCardDialog::flags() const { return d->cFlags; } double KCardDialog::cardScale() const { return d->cScale; } bool KCardDialog::isRandomDeck() const @@ -261,20 +261,20 @@ bool KCardDialog::isGlobalCardDir() const void KCardDialog::setupDialog(bool showResizeBox) { - QHBoxLayout* topLayout = new QHBoxLayout(plainPage(), spacingHint()); - QVBoxLayout* cardLayout = new QVBoxLayout(topLayout); - QString path, file; - QWMatrix m; + TQHBoxLayout* topLayout = new TQHBoxLayout(plainPage(), spacingHint()); + TQVBoxLayout* cardLayout = new TQVBoxLayout(topLayout); + TQString path, file; + TQWMatrix m; m.scale(0.8,0.8); - setInitialSize(QSize(600,400)); + setInitialSize(TQSize(600,400)); if (! (flags() & NoDeck)) { - QHBoxLayout* layout = new QHBoxLayout(cardLayout); + TQHBoxLayout* layout = new TQHBoxLayout(cardLayout); // Deck iconview - QGroupBox* grp1 = new QGroupBox(1, Horizontal, i18n("Choose Backside"), plainPage()); + TQGroupBox* grp1 = new TQGroupBox(1, Horizontal, i18n("Choose Backside"), plainPage()); layout->addWidget(grp1); d->deckIconView = new KIconView(grp1,"decks"); @@ -285,48 +285,48 @@ void KCardDialog::setupDialog(bool showResizeBox) */ d->deckIconView->setGridX(82); d->deckIconView->setGridY(106); - d->deckIconView->setSelectionMode(QIconView::Single); - d->deckIconView->setResizeMode(QIconView::Adjust); + d->deckIconView->setSelectionMode(TQIconView::Single); + d->deckIconView->setResizeMode(TQIconView::Adjust); d->deckIconView->setMinimumWidth(360); d->deckIconView->setMinimumHeight(170); d->deckIconView->setWordWrapIconText(false); d->deckIconView->showToolTips(); // deck select - QVBoxLayout* l = new QVBoxLayout(layout); - QGroupBox* grp3 = new QGroupBox(i18n("Backside"), plainPage()); + TQVBoxLayout* l = new TQVBoxLayout(layout); + TQGroupBox* grp3 = new TQGroupBox(i18n("Backside"), plainPage()); grp3->setFixedSize(100, 130); l->addWidget(grp3, 0, AlignTop|AlignHCenter); - d->deckLabel = new QLabel(grp3); + d->deckLabel = new TQLabel(grp3); d->deckLabel->setText(i18n("empty")); d->deckLabel->setAlignment(AlignHCenter|AlignVCenter); d->deckLabel->setGeometry(10, 20, 80, 90); - d->randomDeck = new QCheckBox(plainPage()); + d->randomDeck = new TQCheckBox(plainPage()); d->randomDeck->setChecked(false); - connect(d->randomDeck, SIGNAL(toggled(bool)), this, - SLOT(slotRandomDeckToggled(bool))); + connect(d->randomDeck, TQT_SIGNAL(toggled(bool)), this, + TQT_SLOT(slotRandomDeckToggled(bool))); d->randomDeck->setText(i18n("Random backside")); l->addWidget(d->randomDeck, 0, AlignTop|AlignHCenter); - d->globalDeck = new QCheckBox(plainPage()); + d->globalDeck = new TQCheckBox(plainPage()); d->globalDeck->setChecked(false); d->globalDeck->setText(i18n("Use global backside")); l->addWidget(d->globalDeck, 0, AlignTop|AlignHCenter); - QPushButton* b = new QPushButton(i18n("Make Backside Global"), plainPage()); - connect(b, SIGNAL(pressed()), this, SLOT(slotSetGlobalDeck())); + TQPushButton* b = new TQPushButton(i18n("Make Backside Global"), plainPage()); + connect(b, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotSetGlobalDeck())); l->addWidget(b, 0, AlignTop|AlignHCenter); - connect(d->deckIconView,SIGNAL(clicked(QIconViewItem *)), - this,SLOT(slotDeckClicked(QIconViewItem *))); + connect(d->deckIconView,TQT_SIGNAL(clicked(TQIconViewItem *)), + this,TQT_SLOT(slotDeckClicked(TQIconViewItem *))); } if (! (flags() & NoCards)) { // Cards iconview - QHBoxLayout* layout = new QHBoxLayout(cardLayout); - QGroupBox* grp2 = new QGroupBox(1, Horizontal, i18n("Choose Frontside"), plainPage()); + TQHBoxLayout* layout = new TQHBoxLayout(cardLayout); + TQGroupBox* grp2 = new TQGroupBox(1, Horizontal, i18n("Choose Frontside"), plainPage()); layout->addWidget(grp2); d->cardIconView =new KIconView(grp2,"cards"); @@ -336,40 +336,40 @@ void KCardDialog::setupDialog(bool showResizeBox) */ d->cardIconView->setGridX(82); d->cardIconView->setGridY(106); - d->cardIconView->setResizeMode(QIconView::Adjust); + d->cardIconView->setResizeMode(TQIconView::Adjust); d->cardIconView->setMinimumWidth(360); d->cardIconView->setMinimumHeight(170); d->cardIconView->setWordWrapIconText(false); d->cardIconView->showToolTips(); // Card select - QVBoxLayout* l = new QVBoxLayout(layout); - QGroupBox* grp4 = new QGroupBox(i18n("Frontside"), plainPage()); + TQVBoxLayout* l = new TQVBoxLayout(layout); + TQGroupBox* grp4 = new TQGroupBox(i18n("Frontside"), plainPage()); grp4->setFixedSize(100, 130); l->addWidget(grp4, 0, AlignTop|AlignHCenter); - d->cardLabel = new QLabel(grp4); + d->cardLabel = new TQLabel(grp4); d->cardLabel->setText(i18n("empty")); d->cardLabel->setAlignment(AlignHCenter|AlignVCenter); d->cardLabel->setGeometry(10, 20, 80, 90 ); - d->randomCardDir = new QCheckBox(plainPage()); + d->randomCardDir = new TQCheckBox(plainPage()); d->randomCardDir->setChecked(false); - connect(d->randomCardDir, SIGNAL(toggled(bool)), this, - SLOT(slotRandomCardDirToggled(bool))); + connect(d->randomCardDir, TQT_SIGNAL(toggled(bool)), this, + TQT_SLOT(slotRandomCardDirToggled(bool))); d->randomCardDir->setText(i18n("Random frontside")); l->addWidget(d->randomCardDir, 0, AlignTop|AlignHCenter); - d->globalCardDir = new QCheckBox(plainPage()); + d->globalCardDir = new TQCheckBox(plainPage()); d->globalCardDir->setChecked(false); d->globalCardDir->setText(i18n("Use global frontside")); l->addWidget(d->globalCardDir, 0, AlignTop|AlignHCenter); - QPushButton* b = new QPushButton(i18n("Make Frontside Global"), plainPage()); - connect(b, SIGNAL(pressed()), this, SLOT(slotSetGlobalCardDir())); + TQPushButton* b = new TQPushButton(i18n("Make Frontside Global"), plainPage()); + connect(b, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotSetGlobalCardDir())); l->addWidget(b, 0, AlignTop|AlignHCenter); - connect(d->cardIconView,SIGNAL(clicked(QIconViewItem *)), - this,SLOT(slotCardClicked(QIconViewItem *))); + connect(d->cardIconView,TQT_SIGNAL(clicked(TQIconViewItem *)), + this,TQT_SLOT(slotCardClicked(TQIconViewItem *))); } // Insert deck icons @@ -383,10 +383,10 @@ void KCardDialog::setupDialog(bool showResizeBox) if (!deck().isNull()) { file=deck(); - QPixmap pixmap(file); + TQPixmap pixmap(file); pixmap=pixmap.xForm(m); d->deckLabel->setPixmap(pixmap); - QToolTip::add(d->deckLabel,d->helpMap[file]); + TQToolTip::add(d->deckLabel,d->helpMap[file]); } } @@ -400,10 +400,10 @@ void KCardDialog::setupDialog(bool showResizeBox) if (!cardDir().isNull()) { file = cardDir() + KCARD_DEFAULTCARD; - QPixmap pixmap(file); + TQPixmap pixmap(file); pixmap = pixmap.xForm(m); d->cardLabel->setPixmap(pixmap); - QToolTip::add(d->cardLabel,d->helpMap[cardDir()]); + TQToolTip::add(d->cardLabel,d->helpMap[cardDir()]); } } @@ -414,36 +414,36 @@ void KCardDialog::setupDialog(bool showResizeBox) // i'm sure there is a cleaner way but i cannot find it. // whenever the pixmap is resized (aka scaled) the box is resized, too. This // leads to an always resizing dialog which is *very* ugly. i worked around - // this by using a QWidget which is the only child widget of the group box. - // The other widget are managed inside this QWidget - a stretch area on the + // this by using a TQWidget which is the only child widget of the group box. + // The other widget are managed inside this TQWidget - a stretch area on the // right ensures that the KIconViews are not resized... // note that the dialog is still resized if you you scale the pixmap very // large. This is desired behaviour as i don't want to make the box even // larger but i want the complete pixmap to be displayed. the dialog is not // resized if you make the pixmap smaller again. - QVBoxLayout* layout = new QVBoxLayout(topLayout); - QGroupBox* grp = new QGroupBox(1, Horizontal, i18n("Resize Cards"), plainPage()); - layout->setResizeMode(QLayout::Fixed); + TQVBoxLayout* layout = new TQVBoxLayout(topLayout); + TQGroupBox* grp = new TQGroupBox(1, Horizontal, i18n("Resize Cards"), plainPage()); + layout->setResizeMode(TQLayout::Fixed); layout->addWidget(grp); - QWidget* box = new QWidget(grp); - QHBoxLayout* hbox = new QHBoxLayout(box, 0, spacingHint()); - QVBoxLayout* boxLayout = new QVBoxLayout(hbox); + TQWidget* box = new TQWidget(grp); + TQHBoxLayout* hbox = new TQHBoxLayout(box, 0, spacingHint()); + TQVBoxLayout* boxLayout = new TQVBoxLayout(hbox); hbox->addStretch(0); - d->scaleSlider = new QSlider(1, SLIDER_MAX, 1, (-1000+SLIDER_MIN+SLIDER_MAX), Horizontal, box); + d->scaleSlider = new TQSlider(1, SLIDER_MAX, 1, (-1000+SLIDER_MIN+SLIDER_MAX), Horizontal, box); d->scaleSlider->setMinValue(SLIDER_MIN); - connect(d->scaleSlider, SIGNAL(valueChanged(int)), this, SLOT(slotCardResized(int))); + connect(d->scaleSlider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotCardResized(int))); boxLayout->addWidget(d->scaleSlider, 0, AlignLeft); - QPushButton* b = new QPushButton(i18n("Default Size"), box); - connect(b, SIGNAL(pressed()), this, SLOT(slotDefaultSize())); + TQPushButton* b = new TQPushButton(i18n("Default Size"), box); + connect(b, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotDefaultSize())); boxLayout->addWidget(b, 0, AlignLeft); - QLabel* l = new QLabel(i18n("Preview:"), box); + TQLabel* l = new TQLabel(i18n("Preview:"), box); boxLayout->addWidget(l); d->cPreviewPix.load(getDefaultDeck()); - d->cPreview = new QLabel(box); + d->cPreview = new TQLabel(box); boxLayout->addWidget(d->cPreview, 0, AlignCenter|AlignVCenter); slotCardResized(d->scaleSlider->value()); @@ -452,29 +452,29 @@ void KCardDialog::setupDialog(bool showResizeBox) void KCardDialog::insertCardIcons() { - QStringList list = KGlobal::dirs()->findAllResources("cards", "card*/index.desktop", false, true); + TQStringList list = KGlobal::dirs()->findAllResources("cards", "card*/index.desktop", false, true); // kdDebug(11000) << "insert " << list.count() << endl; if (list.isEmpty()) return; // We shrink the icons a little // - QWMatrix m; + TQWMatrix m; m.scale(0.8,0.8); - for (QStringList::ConstIterator it = list.begin(); it != list.end(); ++it) + for (TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it) { KSimpleConfig cfg(*it); - cfg.setGroup(QString::fromLatin1("KDE Backdeck")); - QString path = (*it).left((*it).findRev('/') + 1); + cfg.setGroup(TQString::fromLatin1("KDE Backdeck")); + TQString path = (*it).left((*it).findRev('/') + 1); assert(path[path.length() - 1] == '/'); - QPixmap pixmap(path + cfg.readEntry("Preview", "12c.png")); + TQPixmap pixmap(path + cfg.readEntry("Preview", "12c.png")); if (pixmap.isNull()) continue; - QString name=cfg.readEntry("Name", i18n("unnamed")); - QIconViewItem *item= new QIconViewItem(d->cardIconView, name, pixmap); + TQString name=cfg.readEntry("Name", i18n("unnamed")); + TQIconViewItem *item= new TQIconViewItem(d->cardIconView, name, pixmap); item->setDragEnabled(false); item->setDropEnabled(false); @@ -488,28 +488,28 @@ void KCardDialog::insertCardIcons() void KCardDialog::insertDeckIcons() { - QStringList list = KGlobal::dirs()->findAllResources("cards", "decks/*.desktop", false, true); + TQStringList list = KGlobal::dirs()->findAllResources("cards", "decks/*.desktop", false, true); if (list.isEmpty()) return; - QString label; + TQString label; // We shrink the icons a little - QWMatrix m; + TQWMatrix m; m.scale(0.8,0.8); - for (QStringList::ConstIterator it = list.begin(); it != list.end(); ++it) + for (TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it) { KSimpleConfig cfg(*it); - QPixmap pixmap(getDeckName(*it)); + TQPixmap pixmap(getDeckName(*it)); if (pixmap.isNull()) continue; // pixmap=pixmap.xForm(m); - cfg.setGroup(QString::fromLatin1("KDE Cards")); - QString name=cfg.readEntry("Name", i18n("unnamed")); - QIconViewItem *item= new QIconViewItem(d->deckIconView,name, pixmap); + cfg.setGroup(TQString::fromLatin1("KDE Cards")); + TQString name=cfg.readEntry("Name", i18n("unnamed")); + TQIconViewItem *item= new TQIconViewItem(d->deckIconView,name, pixmap); item->setDragEnabled(false); item->setDropEnabled(false); @@ -528,7 +528,7 @@ KCardDialog::~KCardDialog() // Create the dialog -KCardDialog::KCardDialog( QWidget *parent, const char *name, CardFlags mFlags) +KCardDialog::KCardDialog( TQWidget *parent, const char *name, CardFlags mFlags) : KDialogBase( Plain, i18n("Carddeck Selection"), Ok|Cancel, Ok, parent, name, true, true) { KCardDialog::init(); @@ -537,62 +537,62 @@ KCardDialog::KCardDialog( QWidget *parent, const char *name, CardFlags mFlags) d->cFlags = mFlags; } -void KCardDialog::slotDeckClicked(QIconViewItem *item) +void KCardDialog::slotDeckClicked(TQIconViewItem *item) { if (item && item->pixmap()) { d->deckLabel->setPixmap(* (item->pixmap())); - QToolTip::remove( d->deckLabel ); - QToolTip::add(d->deckLabel,d->helpMap[d->deckMap[item]]); + TQToolTip::remove( d->deckLabel ); + TQToolTip::add(d->deckLabel,d->helpMap[d->deckMap[item]]); setDeck(d->deckMap[item]); } } -void KCardDialog::slotCardClicked(QIconViewItem *item) +void KCardDialog::slotCardClicked(TQIconViewItem *item) { if (item && item->pixmap()) { d->cardLabel->setPixmap(* (item->pixmap())); - QString path = d->cardMap[item]; - QToolTip::remove( d->deckLabel ); - QToolTip::add(d->cardLabel,d->helpMap[path]); + TQString path = d->cardMap[item]; + TQToolTip::remove( d->deckLabel ); + TQToolTip::add(d->cardLabel,d->helpMap[path]); setCardDir(path); } } -QString KCardDialog::getDeckName(const QString &desktop) +TQString KCardDialog::getDeckName(const TQString &desktop) { - QString entry = desktop.left(desktop.length() - strlen(".desktop")); - if (KStandardDirs::exists(entry + QString::fromLatin1(".png"))) - return entry + QString::fromLatin1(".png"); + TQString entry = desktop.left(desktop.length() - strlen(".desktop")); + if (KStandardDirs::exists(entry + TQString::fromLatin1(".png"))) + return entry + TQString::fromLatin1(".png"); // rather theoretical - if (KStandardDirs::exists(entry + QString::fromLatin1(".xpm"))) - return entry + QString::fromLatin1(".xpm"); - return QString::null; + if (KStandardDirs::exists(entry + TQString::fromLatin1(".xpm"))) + return entry + TQString::fromLatin1(".xpm"); + return TQString::null; } -QString KCardDialog::getRandomDeck() +TQString KCardDialog::getRandomDeck() { KCardDialog::init(); - QStringList list = KGlobal::dirs()->findAllResources("cards", "decks/*.desktop"); + TQStringList list = KGlobal::dirs()->findAllResources("cards", "decks/*.desktop"); if (list.isEmpty()) - return QString::null; + return TQString::null; int d = KApplication::random() % list.count(); return getDeckName(*list.at(d)); } -QString KCardDialog::getRandomCardDir() +TQString KCardDialog::getRandomCardDir() { KCardDialog::init(); - QStringList list = KGlobal::dirs()->findAllResources("cards", "card*/index.desktop"); + TQStringList list = KGlobal::dirs()->findAllResources("cards", "card*/index.desktop"); if (list.isEmpty()) - return QString::null; + return TQString::null; int d = KApplication::random() % list.count(); - QString entry = *list.at(d); + TQString entry = *list.at(d); return entry.left(entry.length() - strlen("index.desktop")); } @@ -634,8 +634,8 @@ void KCardDialog::slotRandomCardDirToggled(bool on) if (on) { d->cardLabel->setText("random"); setCardDir(getRandomCardDir()); - if (cardDir().length()>0 && cardDir().right(1)!=QString::fromLatin1("/")) { - setCardDir(cardDir() + QString::fromLatin1("/")); + if (cardDir().length()>0 && cardDir().right(1)!=TQString::fromLatin1("/")) { + setCardDir(cardDir() + TQString::fromLatin1("/")); } } else { d->cardLabel->setText("empty"); @@ -649,7 +649,7 @@ void KCardDialog::loadConfig(KConfig* conf) return; } - QString origGroup = conf->group(); + TQString origGroup = conf->group(); conf->setGroup(CONF_GROUP); if (! (flags() & NoDeck)) { @@ -701,10 +701,10 @@ void KCardDialog::slotCardResized(int s) s *= -1; s += (SLIDER_MIN + SLIDER_MAX); - QWMatrix m; + TQWMatrix m; double scale = (double)1000/s; m.scale(scale, scale); - QPixmap pix = d->cPreviewPix.xForm(m); + TQPixmap pix = d->cPreviewPix.xForm(m); d->cPreview->setPixmap(pix); d->cScale = scale; } @@ -722,7 +722,7 @@ void KCardDialog::saveConfig(KConfig* conf) if (!conf) { return; } - QString origGroup = conf->group(); + TQString origGroup = conf->group(); conf->setGroup(CONF_GROUP); if (! (flags() & NoDeck)) { @@ -742,7 +742,7 @@ void KCardDialog::saveConfig(KConfig* conf) void KCardDialog::slotSetGlobalDeck() { - KSimpleConfig* conf = new KSimpleConfig(QString::fromLatin1("kdeglobals"), false); + KSimpleConfig* conf = new KSimpleConfig(TQString::fromLatin1("kdeglobals"), false); conf->setGroup(CONF_GLOBAL_GROUP); conf->writeEntry(CONF_GLOBAL_DECK, deck()); @@ -753,7 +753,7 @@ void KCardDialog::slotSetGlobalDeck() void KCardDialog::slotSetGlobalCardDir() { - KSimpleConfig* conf = new KSimpleConfig(QString::fromLatin1("kdeglobals"), false); + KSimpleConfig* conf = new KSimpleConfig(TQString::fromLatin1("kdeglobals"), false); conf->setGroup(CONF_GLOBAL_GROUP); conf->writePathEntry(CONF_GLOBAL_CARDDIR, cardDir()); @@ -762,9 +762,9 @@ void KCardDialog::slotSetGlobalCardDir() delete conf; } -void KCardDialog::getGlobalDeck(QString& deck, bool& random) +void KCardDialog::getGlobalDeck(TQString& deck, bool& random) { - KSimpleConfig* conf = new KSimpleConfig(QString::fromLatin1("kdeglobals"), true); + KSimpleConfig* conf = new KSimpleConfig(TQString::fromLatin1("kdeglobals"), true); conf->setGroup(CONF_GLOBAL_GROUP); if (!conf->hasKey(CONF_GLOBAL_DECK) || conf->readBoolEntry(CONF_GLOBAL_RANDOMDECK, false)) { @@ -778,9 +778,9 @@ void KCardDialog::getGlobalDeck(QString& deck, bool& random) delete conf; } -void KCardDialog::getGlobalCardDir(QString& dir, bool& random) +void KCardDialog::getGlobalCardDir(TQString& dir, bool& random) { - KSimpleConfig* conf = new KSimpleConfig(QString::fromLatin1("kdeglobals"), true); + KSimpleConfig* conf = new KSimpleConfig(TQString::fromLatin1("kdeglobals"), true); conf->setGroup(CONF_GLOBAL_GROUP); if (!conf->hasKey(CONF_GLOBAL_CARDDIR) || conf->readBoolEntry(CONF_GLOBAL_RANDOMCARDDIR, false)) { @@ -799,7 +799,7 @@ void KCardDialog::init() static bool _inited = false; if (_inited) return; - KGlobal::dirs()->addResourceType("cards", KStandardDirs::kde_default("data") + QString::fromLatin1("carddecks/")); + KGlobal::dirs()->addResourceType("cards", KStandardDirs::kde_default("data") + TQString::fromLatin1("carddecks/")); KGlobal::locale()->insertCatalogue("libkdegames"); _inited = true; |