[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdenonbeta/kttt/src
From: Albert Astals Cid <tsdgeos () terra ! es>
Date: 2003-09-02 19:02:16
[Download RAW message or body]
CVS commit by aacid:
uhhh, i'm dumb, make it compile
M +5 -1 board.cpp 1.3
M +4 -1 kttt.cpp 1.3
M +3 -0 kttt.h 1.2
--- kdenonbeta/kttt/src/board.cpp #1.2:1.3
@@ -9,4 +9,6 @@
***************************************************************************/
+#include <kapplication.h>
+#include <kconfig.h>
#include <kglobal.h> // for Q_ASSERT
@@ -72,4 +74,6 @@ bool board::ttt() const
bool board::canMoveFrom(int selected_x, int selected_y, int x, int y) const
{
+ Q_ASSERT(selected_x >= 0 && selected_x < 3 && selected_y >= 0 && selected_y < 3
+ && x >= 0 && x < 3 && y >= 0 && y < 3);
int i = selected_x - x;
int j = selected_y - y;
--- kdenonbeta/kttt/src/kttt.cpp #1.2:1.3
@@ -1,2 +1,3 @@
+#include <kaction.h>
#include <kautoconfigdialog.h>
#include <klocale.h>
@@ -17,5 +18,5 @@ kttt::kttt() : KMainWindow(0, "kttt")
KStdGameAction::gameNew(this, SLOT(newGame()), actionCollection());
- KStdGameAction::end(this, SLOT(endGame()), actionCollection());
+ endGameAction = KStdGameAction::end(this, SLOT(endGame()), actionCollection());
KStdGameAction::quit(this, SLOT(quitGame()), actionCollection());
@@ -34,4 +35,5 @@ void kttt::newGame()
{
p_board -> newGame();
+ endGameAction -> setEnabled(true);
}
@@ -39,4 +41,5 @@ void kttt::endGame()
{
p_board -> endGame();
+ endGameAction -> setEnabled(false);
statusBar() -> message(i18n("Press Game -> New to start a new game."));
}
--- kdenonbeta/kttt/src/kttt.h #1.1:1.2
@@ -16,4 +16,6 @@
#include "boardwidget.h"
+class KAction;
+
class kttt : public KMainWindow
{
@@ -33,4 +35,5 @@ Q_OBJECT
protected:
boardWidget *p_board;
+ KAction *endGameAction;
};
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic