summaryrefslogtreecommitdiffstats
path: root/libtdegames/kcarddialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libtdegames/kcarddialog.cpp')
-rw-r--r--libtdegames/kcarddialog.cpp94
1 files changed, 47 insertions, 47 deletions
diff --git a/libtdegames/kcarddialog.cpp b/libtdegames/kcarddialog.cpp
index fc73de22..e45e503e 100644
--- a/libtdegames/kcarddialog.cpp
+++ b/libtdegames/kcarddialog.cpp
@@ -26,7 +26,7 @@
#include <tqgroupbox.h>
#include <tqlabel.h>
#include <tqcheckbox.h>
-#include <tqlayout.h>
+#include <layout.h>
#include <tqtooltip.h>
#include <tqslider.h>
#include <tqwmatrix.h>
@@ -41,9 +41,9 @@
#include <tqpushbutton.h>
#include <kdebug.h>
-#define KCARD_DEFAULTDECK TQString::tqfromLatin1("deck0.png")
-#define KCARD_DEFAULTCARD TQString::tqfromLatin1("11.png")
-#define KCARD_DEFAULTCARDDIR TQString::tqfromLatin1("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 TQString::tqfromLatin1("RandomDeck")
-#define CONF_DECK TQString::tqfromLatin1("Deck")
-#define CONF_CARDDIR TQString::tqfromLatin1("CardDir")
-#define CONF_RANDOMCARDDIR TQString::tqfromLatin1("RandomCardDir")
-#define CONF_USEGLOBALDECK TQString::tqfromLatin1("GlobalDeck")
-#define CONF_USEGLOBALCARDDIR TQString::tqfromLatin1("GlobalCardDir")
-#define CONF_SCALE TQString::tqfromLatin1("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 TQString::tqfromLatin1("KCardDialog Settings")
-#define CONF_GLOBAL_DECK TQString::tqfromLatin1("GlobalDeck")
-#define CONF_GLOBAL_CARDDIR TQString::tqfromLatin1("GlobalCardDir")
-#define CONF_GLOBAL_RANDOMDECK TQString::tqfromLatin1("GlobalRandomDeck")
-#define CONF_GLOBAL_RANDOMCARDDIR TQString::tqfromLatin1("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
@@ -128,9 +128,9 @@ int KCardDialog::getCardDeck(TQString &pDeck, TQString &pCardDir, TQWidget *pPar
// TODO check for global cards/decks!!!!
pDeck=dlg.deck();
pCardDir=dlg.cardDir();
- if (!pCardDir.isNull() && pCardDir.right(1)!=TQString::tqfromLatin1("/"))
+ if (!pCardDir.isNull() && pCardDir.right(1)!=TQString::fromLatin1("/"))
{
- pCardDir+=TQString::tqfromLatin1("/");
+ pCardDir+=TQString::fromLatin1("/");
}
if (pRandomDeck)
{
@@ -218,7 +218,7 @@ void KCardDialog::getConfigCardDeck(KConfig* conf, TQString &pDeck, TQString &pC
TQString KCardDialog::getDefaultDeck()
{
KCardDialog::init();
- return locate("cards", TQString::tqfromLatin1("decks/") + KCARD_DEFAULTDECK);
+ return locate("cards", TQString::fromLatin1("decks/") + KCARD_DEFAULTDECK);
}
TQString KCardDialog::getDefaultCardDir()
@@ -234,12 +234,12 @@ TQString KCardDialog::getCardPath(const TQString &carddir, int index)
KCardDialog::init();
TQString entry = carddir + TQString::number(index);
- if (KStandardDirs::exists(entry + TQString::tqfromLatin1(".png")))
- return entry + TQString::tqfromLatin1(".png");
+ if (KStandardDirs::exists(entry + TQString::fromLatin1(".png")))
+ return entry + TQString::fromLatin1(".png");
// rather theoretical
- if (KStandardDirs::exists(entry + TQString::tqfromLatin1(".xpm")))
- return entry + TQString::tqfromLatin1(".xpm");
+ if (KStandardDirs::exists(entry + TQString::fromLatin1(".xpm")))
+ return entry + TQString::fromLatin1(".xpm");
return TQString();
}
@@ -271,11 +271,11 @@ void KCardDialog::setupDialog(bool showResizeBox)
if (! (flags() & NoDeck))
{
- TQHBoxLayout* tqlayout = new TQHBoxLayout(cardLayout);
+ TQHBoxLayout* layout = new TQHBoxLayout(cardLayout);
// Deck iconview
TQGroupBox* grp1 = new TQGroupBox(1,Qt::Horizontal, i18n("Choose Backside"), plainPage());
- tqlayout->addWidget(grp1);
+ layout->addWidget(grp1);
d->deckIconView = new KIconView(grp1,"decks");
d->deckIconView->setSpacing(8);
@@ -293,13 +293,13 @@ void KCardDialog::setupDialog(bool showResizeBox)
d->deckIconView->showToolTips();
// deck select
- TQVBoxLayout* l = new TQVBoxLayout(tqlayout);
+ 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 TQLabel(grp3);
d->deckLabel->setText(i18n("empty"));
- d->deckLabel->tqsetAlignment(AlignHCenter|AlignVCenter);
+ d->deckLabel->setAlignment(AlignHCenter|AlignVCenter);
d->deckLabel->setGeometry(10, 20, 80, 90);
d->randomDeck = new TQCheckBox(plainPage());
@@ -325,9 +325,9 @@ void KCardDialog::setupDialog(bool showResizeBox)
if (! (flags() & NoCards))
{
// Cards iconview
- TQHBoxLayout* tqlayout = new TQHBoxLayout(cardLayout);
+ TQHBoxLayout* layout = new TQHBoxLayout(cardLayout);
TQGroupBox* grp2 = new TQGroupBox(1,Qt::Horizontal, i18n("Choose Frontside"), plainPage());
- tqlayout->addWidget(grp2);
+ layout->addWidget(grp2);
d->cardIconView =new KIconView(grp2,"cards");
/*
@@ -343,13 +343,13 @@ void KCardDialog::setupDialog(bool showResizeBox)
d->cardIconView->showToolTips();
// Card select
- TQVBoxLayout* l = new TQVBoxLayout(tqlayout);
+ 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 TQLabel(grp4);
d->cardLabel->setText(i18n("empty"));
- d->cardLabel->tqsetAlignment(AlignHCenter|AlignVCenter);
+ d->cardLabel->setAlignment(AlignHCenter|AlignVCenter);
d->cardLabel->setGeometry(10, 20, 80, 90 );
d->randomCardDir = new TQCheckBox(plainPage());
@@ -422,10 +422,10 @@ void KCardDialog::setupDialog(bool showResizeBox)
// 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.
- TQVBoxLayout* tqlayout = new TQVBoxLayout(topLayout);
+ TQVBoxLayout* layout = new TQVBoxLayout(topLayout);
TQGroupBox* grp = new TQGroupBox(1,Qt::Horizontal, i18n("Resize Cards"), plainPage());
- tqlayout->setResizeMode(TQLayout::Fixed);
- tqlayout->addWidget(grp);
+ layout->setResizeMode(TQLayout::Fixed);
+ layout->addWidget(grp);
TQWidget* box = new TQWidget(grp);
TQHBoxLayout* hbox = new TQHBoxLayout(box, 0, spacingHint());
TQVBoxLayout* boxLayout = new TQVBoxLayout(hbox);
@@ -465,7 +465,7 @@ void KCardDialog::insertCardIcons()
for (TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it)
{
KSimpleConfig cfg(*it);
- cfg.setGroup(TQString::tqfromLatin1("KDE Backdeck"));
+ cfg.setGroup(TQString::fromLatin1("KDE Backdeck"));
TQString path = (*it).left((*it).findRev('/') + 1);
assert(path[path.length() - 1] == '/');
TQPixmap pixmap(path + cfg.readEntry("Preview", "12c.png"));
@@ -507,7 +507,7 @@ void KCardDialog::insertDeckIcons()
// pixmap=pixmap.xForm(m);
- cfg.setGroup(TQString::tqfromLatin1("KDE Cards"));
+ cfg.setGroup(TQString::fromLatin1("KDE Cards"));
TQString name=cfg.readEntry("Name", i18n("unnamed"));
TQIconViewItem *item= new TQIconViewItem(d->deckIconView,name, pixmap);
@@ -562,12 +562,12 @@ void KCardDialog::slotCardClicked(TQIconViewItem *item)
TQString KCardDialog::getDeckName(const TQString &desktop)
{
TQString entry = desktop.left(desktop.length() - strlen(".desktop"));
- if (KStandardDirs::exists(entry + TQString::tqfromLatin1(".png")))
- return entry + TQString::tqfromLatin1(".png");
+ if (KStandardDirs::exists(entry + TQString::fromLatin1(".png")))
+ return entry + TQString::fromLatin1(".png");
// rather theoretical
- if (KStandardDirs::exists(entry + TQString::tqfromLatin1(".xpm")))
- return entry + TQString::tqfromLatin1(".xpm");
+ if (KStandardDirs::exists(entry + TQString::fromLatin1(".xpm")))
+ return entry + TQString::fromLatin1(".xpm");
return TQString();
}
@@ -634,8 +634,8 @@ void KCardDialog::slotRandomCardDirToggled(bool on)
if (on) {
d->cardLabel->setText("random");
setCardDir(getRandomCardDir());
- if (cardDir().length()>0 && cardDir().right(1)!=TQString::tqfromLatin1("/")) {
- setCardDir(cardDir() + TQString::tqfromLatin1("/"));
+ if (cardDir().length()>0 && cardDir().right(1)!=TQString::fromLatin1("/")) {
+ setCardDir(cardDir() + TQString::fromLatin1("/"));
}
} else {
d->cardLabel->setText("empty");
@@ -742,7 +742,7 @@ void KCardDialog::saveConfig(KConfig* conf)
void KCardDialog::slotSetGlobalDeck()
{
- KSimpleConfig* conf = new KSimpleConfig(TQString::tqfromLatin1("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(TQString::tqfromLatin1("kdeglobals"), false);
+ KSimpleConfig* conf = new KSimpleConfig(TQString::fromLatin1("kdeglobals"), false);
conf->setGroup(CONF_GLOBAL_GROUP);
conf->writePathEntry(CONF_GLOBAL_CARDDIR, cardDir());
@@ -764,7 +764,7 @@ void KCardDialog::slotSetGlobalCardDir()
void KCardDialog::getGlobalDeck(TQString& deck, bool& random)
{
- KSimpleConfig* conf = new KSimpleConfig(TQString::tqfromLatin1("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)) {
@@ -780,7 +780,7 @@ void KCardDialog::getGlobalDeck(TQString& deck, bool& random)
void KCardDialog::getGlobalCardDir(TQString& dir, bool& random)
{
- KSimpleConfig* conf = new KSimpleConfig(TQString::tqfromLatin1("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") + TQString::tqfromLatin1("carddecks/"));
+ KGlobal::dirs()->addResourceType("cards", KStandardDirs::kde_default("data") + TQString::fromLatin1("carddecks/"));
KGlobal::locale()->insertCatalogue("libtdegames");
_inited = true;