summaryrefslogtreecommitdiffstats
path: root/kmines
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2011-12-16 09:58:53 -0600
committerTimothy Pearson <[email protected]>2011-12-16 09:58:53 -0600
commit84ace1135cac57993b72fee7105b92def1638d32 (patch)
treeb8871eb76e3db4a062731b0ce7c99c24fac119e8 /kmines
parent97d1732e257f8700488d7ca1660ae7eba8fc6065 (diff)
downloadtdegames-84ace1135cac57993b72fee7105b92def1638d32.tar.gz
tdegames-84ace1135cac57993b72fee7105b92def1638d32.zip
Revert "Rename a number of old tq methods that are no longer tq specific"
This reverts commit 97d1732e257f8700488d7ca1660ae7eba8fc6065.
Diffstat (limited to 'kmines')
-rw-r--r--kmines/dialogs.cpp4
-rw-r--r--kmines/field.cpp6
-rw-r--r--kmines/field.h4
-rw-r--r--kmines/frame.cpp12
-rw-r--r--kmines/kzoommainwindow.cpp4
-rw-r--r--kmines/kzoommainwindow.h2
-rw-r--r--kmines/main.cpp2
-rw-r--r--kmines/main.h4
-rw-r--r--kmines/solver/solver.cpp12
-rw-r--r--kmines/status.cpp60
-rw-r--r--kmines/status.h6
11 files changed, 58 insertions, 58 deletions
diff --git a/kmines/dialogs.cpp b/kmines/dialogs.cpp
index ec0d8048..7fb5dec9 100644
--- a/kmines/dialogs.cpp
+++ b/kmines/dialogs.cpp
@@ -21,7 +21,7 @@
#include <tqpixmap.h>
#include <tqvgroupbox.h>
-#include <layout.h>
+#include <tqlayout.h>
#include <tqhbox.h>
#include <tqvbox.h>
#include <tqgrid.h>
@@ -165,7 +165,7 @@ void CustomConfig::updateNbMines()
Level l(_width->value(), _height->value(), _mines->value());
_mines->setRange(1, Level::maxNbMines(l.width(), l.height()));
_mines->setLabel(i18n("Mines (%1%):")
- .arg( (100*l.nbMines()) / (l.width() * l.height()) ));
+ .tqarg( (100*l.nbMines()) / (l.width() * l.height()) ));
_gameType->setCurrentItem(l.type());
_block = false;
}
diff --git a/kmines/field.cpp b/kmines/field.cpp
index d1831df5..035b3708 100644
--- a/kmines/field.cpp
+++ b/kmines/field.cpp
@@ -21,7 +21,7 @@
#include <math.h>
-#include <layout.h>
+#include <tqlayout.h>
#include <tqtimer.h>
#include <tqpainter.h>
@@ -57,7 +57,7 @@ void Field::readSettings()
if ( Settings::magicReveal() ) emit setCheating();
}
-TQSize Field::sizeHint() const
+TQSize Field::tqsizeHint() const
{
return TQSize(2*frameWidth() + _level.width()*Settings::caseSize(),
2*frameWidth() + _level.height()*Settings::caseSize());
@@ -117,7 +117,7 @@ void Field::changeCase(const Coord &p, CaseState newState)
BaseField::changeCase(p, newState);
TQPainter painter(this);
drawCase(painter, p);
- if ( isActive() ) emit updateStatus( hasMine(p) );
+ if ( isActive() ) emit updatetqStatus( hasMine(p) );
}
TQPoint Field::toPoint(const Coord &p) const
diff --git a/kmines/field.h b/kmines/field.h
index 3d443843..2c21348b 100644
--- a/kmines/field.h
+++ b/kmines/field.h
@@ -39,7 +39,7 @@ class Field : public FieldFrame, public BaseField
public:
Field(TQWidget *parent);
- virtual TQSize sizeHint() const;
+ virtual TQSize tqsizeHint() const;
void setLevel(const Level &level);
void setReplayField(const TQString &field);
@@ -68,7 +68,7 @@ class Field : public FieldFrame, public BaseField
SolvingState solvingState() const { return _solvingState; }
signals:
- void updateStatus(bool);
+ void updatetqStatus(bool);
void gameStateChanged(GameState);
void setMood(Mood);
void setCheating();
diff --git a/kmines/frame.cpp b/kmines/frame.cpp
index 2b348694..5eee07ba 100644
--- a/kmines/frame.cpp
+++ b/kmines/frame.cpp
@@ -36,7 +36,7 @@ FieldFrame::FieldFrame(TQWidget *parent)
void FieldFrame::adjustSize()
{
- setFixedSize(sizeHint());
+ setFixedSize(tqsizeHint());
_button.resize(Settings::caseSize(), Settings::caseSize());
TQBitmap mask;
@@ -124,22 +124,22 @@ void FieldFrame::drawBox(TQPainter &painter, const TQPoint &p,
bool hasFocus) const
{
qDrawShadePanel(&painter, p.x(), p.y(), _button.width(), _button.height(),
- colorGroup(), pressed, 2,
- &colorGroup().brush(TQColorGroup::Background));
+ tqcolorGroup(), pressed, 2,
+ &tqcolorGroup().brush(TQColorGroup::Background));
if (hasFocus) {
painter.translate(p.x(), p.y());
TQRect fbr = tqstyle().subRect(TQStyle::SR_PushButtonFocusRect, &_button);
tqstyle().tqdrawPrimitive(TQStyle::PE_FocusRect, &painter, fbr,
- colorGroup(), TQStyle::Style_Enabled);
+ tqcolorGroup(), TQStyle::Style_Enabled);
painter.resetXForm();
}
TQRect r(p, _button.size());
const TQPixmap *pixmap = (type==NoPixmap ? 0 : &_pixmaps[type]);
TQColor color = (nbMines==0 ? black : Settings::mineColor(nbMines-1));
- tqstyle().drawItem(&painter, r, AlignCenter, colorGroup(), true, pixmap,
+ tqstyle().drawItem(&painter, r, AlignCenter, tqcolorGroup(), true, pixmap,
text, -1, &color);
if ( advised!=-1 )
- tqstyle().drawItem(&painter, r, AlignCenter, colorGroup(), true,
+ tqstyle().drawItem(&painter, r, AlignCenter, tqcolorGroup(), true,
&_advised[advised], TQString());
}
diff --git a/kmines/kzoommainwindow.cpp b/kmines/kzoommainwindow.cpp
index 8d0521bc..1d0f5319 100644
--- a/kmines/kzoommainwindow.cpp
+++ b/kmines/kzoommainwindow.cpp
@@ -58,7 +58,7 @@ void KZoomMainWindow::init(const char *popupName)
void KZoomMainWindow::addWidget(TQWidget *widget)
{
widget->adjustSize();
- TQWidget *tlw = widget->topLevelWidget();
+ TQWidget *tlw = widget->tqtopLevelWidget();
KZoomMainWindow *zm =
static_cast<KZoomMainWindow *>(tlw->qt_cast("KZoomMainWindow"));
Q_ASSERT(zm);
@@ -74,7 +74,7 @@ void KZoomMainWindow::widgetDestroyed()
bool KZoomMainWindow::eventFilter(TQObject *o, TQEvent *e)
{
if ( e->type()==TQEvent::LayoutHint )
- setFixedSize(minimumSize()); // because K/TQMainWindow
+ setFixedSize(tqminimumSize()); // because K/TQMainWindow
// does not manage fixed central widget
// with hidden menubar...
return KMainWindow::eventFilter(o, e);
diff --git a/kmines/kzoommainwindow.h b/kmines/kzoommainwindow.h
index 00092183..e4353c2d 100644
--- a/kmines/kzoommainwindow.h
+++ b/kmines/kzoommainwindow.h
@@ -50,7 +50,7 @@ public:
/** Add a widget to be managed i.e. the adjustSize() method of the
* widget is called whenever the zoom is changed.
- * This function assumes that the topLevelWidget() is the KZoomMainWindow.
+ * This function assumes that the tqtopLevelWidget() is the KZoomMainWindow.
*/
static void addWidget(TQWidget *widget);
diff --git a/kmines/main.cpp b/kmines/main.cpp
index 9cdcec4d..d1453b3f 100644
--- a/kmines/main.cpp
+++ b/kmines/main.cpp
@@ -62,7 +62,7 @@ MainWidget::MainWidget()
{
KNotifyClient::startDaemon();
- _status = new Status(this);
+ _status = new tqStatus(this);
connect(_status, TQT_SIGNAL(gameStateChangedSignal(KMines::GameState)),
TQT_SLOT(gameStateChanged(KMines::GameState)));
connect(_status, TQT_SIGNAL(pause()), TQT_SLOT(pause()));
diff --git a/kmines/main.h b/kmines/main.h
index 31221e76..7fb10eda 100644
--- a/kmines/main.h
+++ b/kmines/main.h
@@ -26,7 +26,7 @@
class KAction;
class KToggleAction;
class KSelectAction;
-class Status;
+class tqStatus;
class MainWidget : public KZoomMainWindow, public KMines
{
@@ -50,7 +50,7 @@ class MainWidget : public KZoomMainWindow, public KMines
virtual bool queryExit();
private:
- Status *_status;
+ tqStatus *_status;
KToggleAction *_pause;
KSelectAction *_levels;
KAction *_advise, *_solve;
diff --git a/kmines/solver/solver.cpp b/kmines/solver/solver.cpp
index 656df8a2..0c90b747 100644
--- a/kmines/solver/solver.cpp
+++ b/kmines/solver/solver.cpp
@@ -24,7 +24,7 @@
#include <assert.h>
#include <tqtimer.h>
-#include <layout.h>
+#include <tqlayout.h>
#include <tqlabel.h>
#include <kprogress.h>
@@ -198,13 +198,13 @@ SolvingRateDialog::SolvingRateDialog(const BaseField &field, TQWidget *parent)
setButtonOK(item);
TQVBoxLayout *top = new TQVBoxLayout(plainPage(), 0, spacingHint());
- TQLabel *label = new TQLabel(i18n("Width: %1").arg(field.width()),
+ TQLabel *label = new TQLabel(i18n("Width: %1").tqarg(field.width()),
plainPage());
top->addWidget(label);
- label = new TQLabel(i18n("Height: %1").arg(field.height()), plainPage());
+ label = new TQLabel(i18n("Height: %1").tqarg(field.height()), plainPage());
top->addWidget(label);
- label = new TQLabel(i18n("Mines: %1 (%2%)").arg(field.nbMines())
- .arg( field.nbMines() * 100.0 / field.size()),
+ label = new TQLabel(i18n("Mines: %1 (%2%)").tqarg(field.nbMines())
+ .tqarg( field.nbMines() * 100.0 / field.size()),
plainPage());
top->addWidget(label);
@@ -243,7 +243,7 @@ void SolvingRateDialog::solvingDone(bool success)
{
if (success) _success++;
_label->setText(i18n("Success rate: %1%")
- .arg(_success * 100.0 / _i, 0, 'f', 3));
+ .tqarg(_success * 100.0 / _i, 0, 'f', 3));
_progress->advance(1);
TQTimer::singleShot(0, this, TQT_SLOT(step()));
}
diff --git a/kmines/status.cpp b/kmines/status.cpp
index b0c0554f..31fd7b36 100644
--- a/kmines/status.cpp
+++ b/kmines/status.cpp
@@ -22,9 +22,9 @@
#include <tqpainter.h>
#include <tqpixmap.h>
#include <tqwhatsthis.h>
-#include <layout.h>
+#include <tqlayout.h>
#include <tqwidgetstack.h>
-#include <textedit.h>
+#include <tqtextedit.h>
#include <tqtimer.h>
#include <kapplication.h>
@@ -45,7 +45,7 @@
#include "version.h"
-Status::Status(TQWidget *parent)
+tqStatus::tqStatus(TQWidget *parent)
: TQWidget(parent, "status"), _oldLevel(Level::Easy)
{
_timer = new TQTimer(this);
@@ -54,7 +54,7 @@ Status::Status(TQWidget *parent)
_solver = new Solver(TQT_TQOBJECT(this));
connect(_solver, TQT_SIGNAL(solvingDone(bool)), TQT_SLOT(solvingDone(bool)));
-// top layout
+// top tqlayout
TQGridLayout *top = new TQGridLayout(this, 2, 5, 10, 10);
top->setColStretch(1, 1);
top->setColStretch(3, 1);
@@ -93,7 +93,7 @@ Status::Status(TQWidget *parent)
_field = new Field(_fieldContainer);
_field->readSettings();
g->addWidget(_field, 0, 0, AlignCenter);
- connect( _field, TQT_SIGNAL(updateStatus(bool)), TQT_SLOT(updateStatus(bool)) );
+ connect( _field, TQT_SIGNAL(updatetqStatus(bool)), TQT_SLOT(updatetqStatus(bool)) );
connect(_field, TQT_SIGNAL(gameStateChanged(GameState)),
TQT_SLOT(gameStateChangedSlot(GameState)) );
connect(_field, TQT_SIGNAL(setMood(Mood)), smiley, TQT_SLOT(setMood(Mood)));
@@ -120,13 +120,13 @@ Status::Status(TQWidget *parent)
top->addMultiCellWidget(_stack, 1, 1, 0, 4);
}
-void Status::smileyClicked()
+void tqStatus::smileyClicked()
{
if ( _field->gameState()==Paused ) emit pause();
else restartGame();
}
-void Status::newGame(int t)
+void tqStatus::newGame(int t)
{
if ( _field->gameState()==Paused ) emit pause();
Level::Type type = (Level::Type)t;
@@ -135,7 +135,7 @@ void Status::newGame(int t)
else newGame( Settings::customLevel() );
}
-void Status::newGame(const Level &level)
+void tqStatus::newGame(const Level &level)
{
_timer->stop();
if ( level.type()!=Level::Custom )
@@ -143,14 +143,14 @@ void Status::newGame(const Level &level)
_field->setLevel(level);
}
-bool Status::checkBlackMark()
+bool tqStatus::checkBlackMark()
{
bool bm = ( _field->gameState()==Playing );
if (bm) KExtHighscore::submitScore(KExtHighscore::Lost, this);
return bm;
}
-void Status::restartGame()
+void tqStatus::restartGame()
{
if ( _field->gameState()==Paused ) emit pause();
else if ( _field->gameState()==Replaying ) {
@@ -162,7 +162,7 @@ void Status::restartGame()
}
}
-void Status::settingsChanged()
+void tqStatus::settingsChanged()
{
_field->readSettings();
@@ -173,7 +173,7 @@ void Status::settingsChanged()
newGame(l);
}
-void Status::updateStatus(bool mine)
+void tqStatus::updatetqStatus(bool mine)
{
int r = _field->nbMines() - _field->nbMarked();
TQColor color = (r<0 && !_field->isSolved() ? red : white);
@@ -184,7 +184,7 @@ void Status::updateStatus(bool mine)
gameStateChanged(GameOver, true); // ends only for wins
}
-void Status::setGameOver(bool won)
+void tqStatus::setGameOver(bool won)
{
if ( !won )
KNotifyClient::event(winId(), "explosion", i18n("Explosion!"));
@@ -218,16 +218,16 @@ void Status::setGameOver(bool won)
f.appendChild(data);
}
-void Status::setStopped()
+void tqStatus::setStopped()
{
smiley->setMood(Normal);
- updateStatus(false);
+ updatetqStatus(false);
bool custom = ( _field->level().type()==Level::Custom );
dg->reset(custom);
_field->setSolvingState(Regular);
}
-void Status::setPlaying()
+void tqStatus::setPlaying()
{
smiley->setMood(Normal);
dg->start();
@@ -238,7 +238,7 @@ void Status::setPlaying()
_log = TQDomDocument("kmineslog");
_logRoot = _log.createElement("kmineslog");
_logRoot.setAttribute("version", SHORT_VERSION);
- TQDateTime date = TQDateTime::currentDateTime();
+ TQDateTime date = TQDateTime::tqcurrentDateTime();
_logRoot.setAttribute("date", date.toString(Qt::ISODate));
_logRoot.setAttribute("width", level.width());
_logRoot.setAttribute("height", level.height());
@@ -248,7 +248,7 @@ void Status::setPlaying()
_logRoot.appendChild(_logList);
}
-void Status::gameStateChanged(GameState state, bool won)
+void tqStatus::gameStateChanged(GameState state, bool won)
{
TQWidget *w = _fieldContainer;
@@ -280,7 +280,7 @@ void Status::gameStateChanged(GameState state, bool won)
emit gameStateChangedSignal(state);
}
-void Status::addAction(const KGrid2D::Coord &c, Field::ActionType type)
+void tqStatus::addAction(const KGrid2D::Coord &c, Field::ActionType type)
{
TQDomElement action = _log.createElement("Action");
action.setAttribute("time", dg->pretty());
@@ -291,7 +291,7 @@ void Status::addAction(const KGrid2D::Coord &c, Field::ActionType type)
dg->addAction();
}
-void Status::advise()
+void tqStatus::advise()
{
int res = KMessageBox::warningContinueCancel(this,
i18n("When the solver gives "
@@ -304,25 +304,25 @@ void Status::advise()
_field->setAdvised(c, probability);
}
-void Status::solve()
+void tqStatus::solve()
{
dg->setCheating();
_solver->solve(*_field, false);
_field->setSolvingState(Solved);
}
-void Status::solvingDone(bool success)
+void tqStatus::solvingDone(bool success)
{
if ( !success ) gameStateChanged(GameOver, false);
}
-void Status::solveRate()
+void tqStatus::solveRate()
{
SolvingRateDialog sd(*_field, this);
sd.exec();
}
-void Status::viewLog()
+void tqStatus::viewLog()
{
KDialogBase d(this, "view_log", true, i18n("View Game Log"),
KDialogBase::Close, KDialogBase::Close);
@@ -335,7 +335,7 @@ void Status::viewLog()
d.exec();
}
-void Status::saveLog()
+void tqStatus::saveLog()
{
KURL url = KFileDialog::getSaveURL(TQString(), TQString(), this);
if ( url.isEmpty() ) return;
@@ -354,7 +354,7 @@ void Status::saveLog()
tmp.unlink();
}
-void Status::loadLog()
+void tqStatus::loadLog()
{
KURL url = KFileDialog::getOpenURL(TQString(), TQString(), this);
if ( url.isEmpty() ) return;
@@ -368,7 +368,7 @@ void Status::loadLog()
bool ok = doc.setContent(&file, 0, &errorLine);
if ( !ok ) {
KMessageBox::sorry(this, i18n("Cannot read XML file on line %1")
- .arg(errorLine));
+ .tqarg(errorLine));
return;
}
success = true;
@@ -390,7 +390,7 @@ void Status::loadLog()
}
}
-bool Status::checkLog(const TQDomDocument &doc)
+bool tqStatus::checkLog(const TQDomDocument &doc)
{
// check root element
if ( doc.doctype().name()!="kmineslog" ) return false;
@@ -435,7 +435,7 @@ bool Status::checkLog(const TQDomDocument &doc)
}
-void Status::replayLog()
+void tqStatus::replayLog()
{
uint w = _logRoot.attribute("width").toUInt();
uint h = _logRoot.attribute("height").toUInt();
@@ -454,7 +454,7 @@ void Status::replayLog()
_timer->start(500);
}
-void Status::replayStep()
+void tqStatus::replayStep()
{
if ( _index>=_actions.count() ) {
_timer->stop();
diff --git a/kmines/status.h b/kmines/status.h
index eec7b608..a91fcda9 100644
--- a/kmines/status.h
+++ b/kmines/status.h
@@ -30,12 +30,12 @@ class Solver;
class TQWidgetStack;
class TQTimer;
-class Status : public TQWidget, public KMines
+class tqStatus : public TQWidget, public KMines
{
Q_OBJECT
TQ_OBJECT
public :
- Status(TQWidget *parent);
+ tqStatus(TQWidget *parent);
const Level &currentLevel() const { return _field->level(); }
bool isPlaying() const { return _field->gameState()==Playing; }
@@ -51,7 +51,7 @@ class Status : public TQWidget, public KMines
public slots:
void newGame(int type);
void restartGame();
- void updateStatus(bool);
+ void updatetqStatus(bool);
void pauseGame() { _field->pause(); }
void moveUp() { _field->moveCursor(KGrid2D::SquareBase::Up); }