summaryrefslogtreecommitdiffstats
path: root/kmines
diff options
context:
space:
mode:
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 7fb5dec9..ec0d8048 100644
--- a/kmines/dialogs.cpp
+++ b/kmines/dialogs.cpp
@@ -21,7 +21,7 @@
#include <tqpixmap.h>
#include <tqvgroupbox.h>
-#include <tqlayout.h>
+#include <layout.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%):")
- .tqarg( (100*l.nbMines()) / (l.width() * l.height()) ));
+ .arg( (100*l.nbMines()) / (l.width() * l.height()) ));
_gameType->setCurrentItem(l.type());
_block = false;
}
diff --git a/kmines/field.cpp b/kmines/field.cpp
index 035b3708..d1831df5 100644
--- a/kmines/field.cpp
+++ b/kmines/field.cpp
@@ -21,7 +21,7 @@
#include <math.h>
-#include <tqlayout.h>
+#include <layout.h>
#include <tqtimer.h>
#include <tqpainter.h>
@@ -57,7 +57,7 @@ void Field::readSettings()
if ( Settings::magicReveal() ) emit setCheating();
}
-TQSize Field::tqsizeHint() const
+TQSize Field::sizeHint() 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 updatetqStatus( hasMine(p) );
+ if ( isActive() ) emit updateStatus( hasMine(p) );
}
TQPoint Field::toPoint(const Coord &p) const
diff --git a/kmines/field.h b/kmines/field.h
index 2c21348b..3d443843 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 tqsizeHint() const;
+ virtual TQSize sizeHint() 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 updatetqStatus(bool);
+ void updateStatus(bool);
void gameStateChanged(GameState);
void setMood(Mood);
void setCheating();
diff --git a/kmines/frame.cpp b/kmines/frame.cpp
index 5eee07ba..2b348694 100644
--- a/kmines/frame.cpp
+++ b/kmines/frame.cpp
@@ -36,7 +36,7 @@ FieldFrame::FieldFrame(TQWidget *parent)
void FieldFrame::adjustSize()
{
- setFixedSize(tqsizeHint());
+ setFixedSize(sizeHint());
_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(),
- tqcolorGroup(), pressed, 2,
- &tqcolorGroup().brush(TQColorGroup::Background));
+ colorGroup(), pressed, 2,
+ &colorGroup().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,
- tqcolorGroup(), TQStyle::Style_Enabled);
+ colorGroup(), 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, tqcolorGroup(), true, pixmap,
+ tqstyle().drawItem(&painter, r, AlignCenter, colorGroup(), true, pixmap,
text, -1, &color);
if ( advised!=-1 )
- tqstyle().drawItem(&painter, r, AlignCenter, tqcolorGroup(), true,
+ tqstyle().drawItem(&painter, r, AlignCenter, colorGroup(), true,
&_advised[advised], TQString());
}
diff --git a/kmines/kzoommainwindow.cpp b/kmines/kzoommainwindow.cpp
index 1d0f5319..8d0521bc 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->tqtopLevelWidget();
+ TQWidget *tlw = widget->topLevelWidget();
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(tqminimumSize()); // because K/TQMainWindow
+ setFixedSize(minimumSize()); // 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 e4353c2d..00092183 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 tqtopLevelWidget() is the KZoomMainWindow.
+ * This function assumes that the topLevelWidget() is the KZoomMainWindow.
*/
static void addWidget(TQWidget *widget);
diff --git a/kmines/main.cpp b/kmines/main.cpp
index d1453b3f..9cdcec4d 100644
--- a/kmines/main.cpp
+++ b/kmines/main.cpp
@@ -62,7 +62,7 @@ MainWidget::MainWidget()
{
KNotifyClient::startDaemon();
- _status = new tqStatus(this);
+ _status = new Status(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 7fb10eda..31221e76 100644
--- a/kmines/main.h
+++ b/kmines/main.h
@@ -26,7 +26,7 @@
class KAction;
class KToggleAction;
class KSelectAction;
-class tqStatus;
+class Status;
class MainWidget : public KZoomMainWindow, public KMines
{
@@ -50,7 +50,7 @@ class MainWidget : public KZoomMainWindow, public KMines
virtual bool queryExit();
private:
- tqStatus *_status;
+ Status *_status;
KToggleAction *_pause;
KSelectAction *_levels;
KAction *_advise, *_solve;
diff --git a/kmines/solver/solver.cpp b/kmines/solver/solver.cpp
index 0c90b747..656df8a2 100644
--- a/kmines/solver/solver.cpp
+++ b/kmines/solver/solver.cpp
@@ -24,7 +24,7 @@
#include <assert.h>
#include <tqtimer.h>
-#include <tqlayout.h>
+#include <layout.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").tqarg(field.width()),
+ TQLabel *label = new TQLabel(i18n("Width: %1").arg(field.width()),
plainPage());
top->addWidget(label);
- label = new TQLabel(i18n("Height: %1").tqarg(field.height()), plainPage());
+ label = new TQLabel(i18n("Height: %1").arg(field.height()), plainPage());
top->addWidget(label);
- label = new TQLabel(i18n("Mines: %1 (%2%)").tqarg(field.nbMines())
- .tqarg( field.nbMines() * 100.0 / field.size()),
+ label = new TQLabel(i18n("Mines: %1 (%2%)").arg(field.nbMines())
+ .arg( 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%")
- .tqarg(_success * 100.0 / _i, 0, 'f', 3));
+ .arg(_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 31fd7b36..b0c0554f 100644
--- a/kmines/status.cpp
+++ b/kmines/status.cpp
@@ -22,9 +22,9 @@
#include <tqpainter.h>
#include <tqpixmap.h>
#include <tqwhatsthis.h>
-#include <tqlayout.h>
+#include <layout.h>
#include <tqwidgetstack.h>
-#include <tqtextedit.h>
+#include <textedit.h>
#include <tqtimer.h>
#include <kapplication.h>
@@ -45,7 +45,7 @@
#include "version.h"
-tqStatus::tqStatus(TQWidget *parent)
+Status::Status(TQWidget *parent)
: TQWidget(parent, "status"), _oldLevel(Level::Easy)
{
_timer = new TQTimer(this);
@@ -54,7 +54,7 @@ tqStatus::tqStatus(TQWidget *parent)
_solver = new Solver(TQT_TQOBJECT(this));
connect(_solver, TQT_SIGNAL(solvingDone(bool)), TQT_SLOT(solvingDone(bool)));
-// top tqlayout
+// top layout
TQGridLayout *top = new TQGridLayout(this, 2, 5, 10, 10);
top->setColStretch(1, 1);
top->setColStretch(3, 1);
@@ -93,7 +93,7 @@ tqStatus::tqStatus(TQWidget *parent)
_field = new Field(_fieldContainer);
_field->readSettings();
g->addWidget(_field, 0, 0, AlignCenter);
- connect( _field, TQT_SIGNAL(updatetqStatus(bool)), TQT_SLOT(updatetqStatus(bool)) );
+ connect( _field, TQT_SIGNAL(updateStatus(bool)), TQT_SLOT(updateStatus(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 @@ tqStatus::tqStatus(TQWidget *parent)
top->addMultiCellWidget(_stack, 1, 1, 0, 4);
}
-void tqStatus::smileyClicked()
+void Status::smileyClicked()
{
if ( _field->gameState()==Paused ) emit pause();
else restartGame();
}
-void tqStatus::newGame(int t)
+void Status::newGame(int t)
{
if ( _field->gameState()==Paused ) emit pause();
Level::Type type = (Level::Type)t;
@@ -135,7 +135,7 @@ void tqStatus::newGame(int t)
else newGame( Settings::customLevel() );
}
-void tqStatus::newGame(const Level &level)
+void Status::newGame(const Level &level)
{
_timer->stop();
if ( level.type()!=Level::Custom )
@@ -143,14 +143,14 @@ void tqStatus::newGame(const Level &level)
_field->setLevel(level);
}
-bool tqStatus::checkBlackMark()
+bool Status::checkBlackMark()
{
bool bm = ( _field->gameState()==Playing );
if (bm) KExtHighscore::submitScore(KExtHighscore::Lost, this);
return bm;
}
-void tqStatus::restartGame()
+void Status::restartGame()
{
if ( _field->gameState()==Paused ) emit pause();
else if ( _field->gameState()==Replaying ) {
@@ -162,7 +162,7 @@ void tqStatus::restartGame()
}
}
-void tqStatus::settingsChanged()
+void Status::settingsChanged()
{
_field->readSettings();
@@ -173,7 +173,7 @@ void tqStatus::settingsChanged()
newGame(l);
}
-void tqStatus::updatetqStatus(bool mine)
+void Status::updateStatus(bool mine)
{
int r = _field->nbMines() - _field->nbMarked();
TQColor color = (r<0 && !_field->isSolved() ? red : white);
@@ -184,7 +184,7 @@ void tqStatus::updatetqStatus(bool mine)
gameStateChanged(GameOver, true); // ends only for wins
}
-void tqStatus::setGameOver(bool won)
+void Status::setGameOver(bool won)
{
if ( !won )
KNotifyClient::event(winId(), "explosion", i18n("Explosion!"));
@@ -218,16 +218,16 @@ void tqStatus::setGameOver(bool won)
f.appendChild(data);
}
-void tqStatus::setStopped()
+void Status::setStopped()
{
smiley->setMood(Normal);
- updatetqStatus(false);
+ updateStatus(false);
bool custom = ( _field->level().type()==Level::Custom );
dg->reset(custom);
_field->setSolvingState(Regular);
}
-void tqStatus::setPlaying()
+void Status::setPlaying()
{
smiley->setMood(Normal);
dg->start();
@@ -238,7 +238,7 @@ void tqStatus::setPlaying()
_log = TQDomDocument("kmineslog");
_logRoot = _log.createElement("kmineslog");
_logRoot.setAttribute("version", SHORT_VERSION);
- TQDateTime date = TQDateTime::tqcurrentDateTime();
+ TQDateTime date = TQDateTime::currentDateTime();
_logRoot.setAttribute("date", date.toString(Qt::ISODate));
_logRoot.setAttribute("width", level.width());
_logRoot.setAttribute("height", level.height());
@@ -248,7 +248,7 @@ void tqStatus::setPlaying()
_logRoot.appendChild(_logList);
}
-void tqStatus::gameStateChanged(GameState state, bool won)
+void Status::gameStateChanged(GameState state, bool won)
{
TQWidget *w = _fieldContainer;
@@ -280,7 +280,7 @@ void tqStatus::gameStateChanged(GameState state, bool won)
emit gameStateChangedSignal(state);
}
-void tqStatus::addAction(const KGrid2D::Coord &c, Field::ActionType type)
+void Status::addAction(const KGrid2D::Coord &c, Field::ActionType type)
{
TQDomElement action = _log.createElement("Action");
action.setAttribute("time", dg->pretty());
@@ -291,7 +291,7 @@ void tqStatus::addAction(const KGrid2D::Coord &c, Field::ActionType type)
dg->addAction();
}
-void tqStatus::advise()
+void Status::advise()
{
int res = KMessageBox::warningContinueCancel(this,
i18n("When the solver gives "
@@ -304,25 +304,25 @@ void tqStatus::advise()
_field->setAdvised(c, probability);
}
-void tqStatus::solve()
+void Status::solve()
{
dg->setCheating();
_solver->solve(*_field, false);
_field->setSolvingState(Solved);
}
-void tqStatus::solvingDone(bool success)
+void Status::solvingDone(bool success)
{
if ( !success ) gameStateChanged(GameOver, false);
}
-void tqStatus::solveRate()
+void Status::solveRate()
{
SolvingRateDialog sd(*_field, this);
sd.exec();
}
-void tqStatus::viewLog()
+void Status::viewLog()
{
KDialogBase d(this, "view_log", true, i18n("View Game Log"),
KDialogBase::Close, KDialogBase::Close);
@@ -335,7 +335,7 @@ void tqStatus::viewLog()
d.exec();
}
-void tqStatus::saveLog()
+void Status::saveLog()
{
KURL url = KFileDialog::getSaveURL(TQString(), TQString(), this);
if ( url.isEmpty() ) return;
@@ -354,7 +354,7 @@ void tqStatus::saveLog()
tmp.unlink();
}
-void tqStatus::loadLog()
+void Status::loadLog()
{
KURL url = KFileDialog::getOpenURL(TQString(), TQString(), this);
if ( url.isEmpty() ) return;
@@ -368,7 +368,7 @@ void tqStatus::loadLog()
bool ok = doc.setContent(&file, 0, &errorLine);
if ( !ok ) {
KMessageBox::sorry(this, i18n("Cannot read XML file on line %1")
- .tqarg(errorLine));
+ .arg(errorLine));
return;
}
success = true;
@@ -390,7 +390,7 @@ void tqStatus::loadLog()
}
}
-bool tqStatus::checkLog(const TQDomDocument &doc)
+bool Status::checkLog(const TQDomDocument &doc)
{
// check root element
if ( doc.doctype().name()!="kmineslog" ) return false;
@@ -435,7 +435,7 @@ bool tqStatus::checkLog(const TQDomDocument &doc)
}
-void tqStatus::replayLog()
+void Status::replayLog()
{
uint w = _logRoot.attribute("width").toUInt();
uint h = _logRoot.attribute("height").toUInt();
@@ -454,7 +454,7 @@ void tqStatus::replayLog()
_timer->start(500);
}
-void tqStatus::replayStep()
+void Status::replayStep()
{
if ( _index>=_actions.count() ) {
_timer->stop();
diff --git a/kmines/status.h b/kmines/status.h
index a91fcda9..eec7b608 100644
--- a/kmines/status.h
+++ b/kmines/status.h
@@ -30,12 +30,12 @@ class Solver;
class TQWidgetStack;
class TQTimer;
-class tqStatus : public TQWidget, public KMines
+class Status : public TQWidget, public KMines
{
Q_OBJECT
TQ_OBJECT
public :
- tqStatus(TQWidget *parent);
+ Status(TQWidget *parent);
const Level &currentLevel() const { return _field->level(); }
bool isPlaying() const { return _field->gameState()==Playing; }
@@ -51,7 +51,7 @@ class tqStatus : public TQWidget, public KMines
public slots:
void newGame(int type);
void restartGame();
- void updatetqStatus(bool);
+ void updateStatus(bool);
void pauseGame() { _field->pause(); }
void moveUp() { _field->moveCursor(KGrid2D::SquareBase::Up); }