Turn into a TDE application.

The game is renamed TDEFifteen (original name: q15).
Add icons (Public Domaine, https://commons.wikimedia.org/wiki/File:15-puzzle.svg).

Signed-off-by: gregory guy <gregory-tde@laposte.net>
(cherry picked from commit e33e8edb80)
r14.0.x
gregory guy 4 years ago committed by Slávek Banko
parent cc192fd939
commit d607668c5a
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -91,7 +91,7 @@ option( BUILD_KTRON "Build ktron" ${BUILD_ALL} )
option( BUILD_KTUBERLING "Build ktuberling" ${BUILD_ALL} ) option( BUILD_KTUBERLING "Build ktuberling" ${BUILD_ALL} )
option( BUILD_LSKAT "Build lskat" ${BUILD_ALL} ) option( BUILD_LSKAT "Build lskat" ${BUILD_ALL} )
option( BUILD_TWIN4 "Build twin4" ${BUILD_ALL} ) option( BUILD_TWIN4 "Build twin4" ${BUILD_ALL} )
option( BUILD_Q15 "Build q15" ${BUILD_ALL} ) option( BUILD_TDEFIFTEEN "Build tdefifteen" ${BUILD_ALL} )
##### configure checks ##### configure checks
@ -161,7 +161,7 @@ tde_conditional_add_subdirectory( BUILD_KTRON ktron )
tde_conditional_add_subdirectory( BUILD_KTUBERLING ktuberling ) tde_conditional_add_subdirectory( BUILD_KTUBERLING ktuberling )
tde_conditional_add_subdirectory( BUILD_LSKAT lskat ) tde_conditional_add_subdirectory( BUILD_LSKAT lskat )
tde_conditional_add_subdirectory( BUILD_TWIN4 twin4 ) tde_conditional_add_subdirectory( BUILD_TWIN4 twin4 )
tde_conditional_add_subdirectory( BUILD_Q15 q15 ) tde_conditional_add_subdirectory( BUILD_TDEFIFTEEN tdefifteen )
if( BUILD_KSIRTET OR BUILD_KFOULEGGS OR BUILD_KLICKETY ) if( BUILD_KSIRTET OR BUILD_KFOULEGGS OR BUILD_KLICKETY )
add_subdirectory( libksirtet ) add_subdirectory( libksirtet )

@ -1,2 +0,0 @@
add_subdirectory( src )

@ -1 +0,0 @@
Fifteen puzzle game

@ -1,41 +0,0 @@
/*
* $Id: main.cpp,v 0.1 2005/08/14 11:21:13 denis Exp $
*
* Author: Denis Kozadaev (denis@tambov.ru)
* Description:
*
* See also: style(9)
*
* Hacked by:
*/
#include <stdlib.h>
#include <tqapplication.h>
#include "mainwindow.h"
const int XSize = 640, YSize = 480;
int
main(int argc, char *argv[])
{
TQApplication *app;
MainWindow *mw;
int result;
app = new TQApplication(argc, argv);
mw = new MainWindow(NULL);
mw->resize(XSize, YSize);
mw->show();
mw->setMinimumSize(mw->size());
mw->setMaximumSize(mw->size());
result = app->exec();
delete mw;
delete app;
return (result);
}

@ -1,51 +0,0 @@
/*
* $Id: mainwindow.cpp,v 0.1 2005/08/14 11:25:03 denis Exp $
*
* Author: Denis Kozadaev (denis@tambov.ru)
* Description:
*
* See also: style(9)
*
* Hacked by:
*/
#include <tqapplication.h>
#include "mainwindow.h"
MainWindow::MainWindow(TQWidget *parent, const char *name)
:TQMainWindow(parent, name)
{
file = new TQPopupMenu(this);
file->insertItem(tr("New"), this, SLOT(newGame()), TQt::CTRL + TQt::Key_N);
file->insertItem(tr("Load an image"), this, SLOT(loadImage()),
TQt::CTRL + TQt::Key_L);
file->insertItem(tr("Quit"), tqApp, SLOT(quit()), TQt::CTRL + TQt::Key_Q);
menuBar()->insertItem(tr("File"), file);
gb = new GameBoard(this);
setCentralWidget(gb);
}
MainWindow::~MainWindow()
{
delete gb;
delete file;
}
void
MainWindow::newGame()
{
gb->newGame();
}
void
MainWindow::loadImage()
{
gb->loadImage();
}
#include "mainwindow.moc"

@ -1,40 +0,0 @@
/*
* $Id: mainwindow.h,v 0.1 2005/08/14 11:25:03 denis Exp $
*
* Author: Denis Kozadaev (denis@tambov.ru)
* Description:
*
* See also: style(9)
*
* Hacked by:
*/
#ifndef __MAIN_WINDOW_H__
#define __MAIN_WINDOW_H__
#include <stdlib.h>
#include <tqmainwindow.h>
#include <tqmenubar.h>
#include <tqpopupmenu.h>
#include "gameboard.h"
class MainWindow:public TQMainWindow
{
Q_OBJECT
public:
MainWindow(TQWidget *parent = NULL, const char *name = NULL);
~MainWindow();
private:
TQPopupMenu *file;
GameBoard *gb;
private slots:
void newGame();
void loadImage();
};
#endif /* __MAIN_WINDOW_H__ */

@ -0,0 +1 @@
Denis Kozadaev (denis@tambov.ru)

@ -0,0 +1,2 @@
tde_auto_add_subdirectories()

@ -0,0 +1,15 @@
Copyright (c) 2017-2020 Denis Kozadaev
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

@ -0,0 +1,7 @@
TDEFifteen is a sliding puzzle that consists of a frame of numbered
square tiles in random order with one tile missing.
This kind of puzzle have many names such as: Gem Puzzle, Boss Puzzle,
Game of Fifteen...
For more information: https://en.wikipedia.org/wiki/15_puzzle

@ -0,0 +1,3 @@
##### icons
tde_install_icons( tdefifteen )

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 990 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

@ -24,16 +24,22 @@ link_directories(
) )
##### (executable) q15 ##### (executable) tdefifteen
tde_add_executable( q15 AUTOMOC tde_add_executable( tdefifteen AUTOMOC
SOURCES SOURCES
gameboard.cpp gameboard.cpp
main.cpp main.cpp
mainwindow.cpp mainwindow.cpp
LINK LINK
tqt-mt tdeui-shared
tdecore-shared
DESTINATION ${BIN_INSTALL_DIR} DESTINATION ${BIN_INSTALL_DIR}
) )
###### other data
tde_create_translated_desktop( tdefifteen.desktop )

@ -1,17 +1,9 @@
/* // Author: Denis Kozadaev - (c) 2017-2020
* $Id: gameboard.cpp,v 0.1 2005/08/14 12:10:05 denis Exp $
*
* Author: Denis Kozadaev (denis@tambov.ru) #include <cstdlib>
* Description:
* #include <tdeapplication.h>
* See also: style(9)
*
* Hacked by:
*/
#include <stdlib.h>
#include <tqapplication.h>
#include <tqpainter.h> #include <tqpainter.h>
#include <tqcursor.h> #include <tqcursor.h>
#include <tqmessagebox.h> #include <tqmessagebox.h>
@ -251,7 +243,7 @@ GameBoard::startMoving(int i, int t)
dx = step(xt, map[n]->x()); dx = step(xt, map[n]->x());
dy = step(yt, map[n]->y()); dy = step(yt, map[n]->y());
tmr->start(DELAY); tmr->start(DELAY);
TQApplication::setOverrideCursor(TQCursor(TQt::WaitCursor)); TDEApplication::setOverrideCursor(TQCursor(TQt::WaitCursor));
} }
@ -305,7 +297,7 @@ GameBoard::moveItem()
xt = yt = -1; xt = yt = -1;
dx = dy = 0; dx = dy = 0;
tmr->stop(); tmr->stop();
TQApplication::restoreOverrideCursor(); TDEApplication::restoreOverrideCursor();
checkEndGame(); checkEndGame();
} }
} }

@ -1,13 +1,5 @@
/* // Author: Denis Kozadaev - (c) 2017-2020
* $Id: gameboard.h,v 0.1 2005/08/14 12:10:05 denis Exp $
*
* Author: Denis Kozadaev (denis@tambov.ru)
* Description:
*
* See also: style(9)
*
* Hacked by:
*/
#ifndef __GAME_BOARD_H__ #ifndef __GAME_BOARD_H__
#define __GAME_BOARD_H__ #define __GAME_BOARD_H__

@ -0,0 +1,45 @@
// Author: Denis Kozadaev - (c) 2017-2020
#include "mainwindow.h"
#include <tdeaboutdata.h>
#include <tdeapplication.h>
#include <tdecmdlineargs.h>
#include <tdelocale.h>
const int XSize = 640, YSize = 480;
static const char description[] = I18N_NOOP("TDEFifteen is a sliding puzzle\n"
"that consists of a frame of numbered square tiles\n"
"in random order with one tile missing.");
int main(int argc, char *argv[])
{
TDEAboutData about( "tdefifteen", // program name used internally
I18N_NOOP("TDEFifteen"), // displayable program name
"14.0.10", // program version string
description, // short description
TDEAboutData::License_GPL, // licence type
I18N_NOOP("(c) 2017-2020 Denis Kozadaev"), // copyright statement
0, // text - any information
"http://trinitydesktop.org", // home page address
0); // bug email address
about.addAuthor( "Denis Kozadaev", "Author", "denis@tambov.ru" );
TDECmdLineArgs::init(argc, argv, &about);
TDEApplication app;
MainWindow* mainWin = new MainWindow();
mainWin->resize(XSize, YSize);
mainWin->setMinimumSize( mainWin->size() );
mainWin->setMaximumSize( mainWin->size() );
app.setMainWidget( mainWin );
app.miniIcon();
mainWin->show();
return app.exec();
}

@ -0,0 +1,45 @@
// Author: Denis Kozadaev - (c) 2017-2020
#include "mainwindow.h"
#include <tdeactionclasses.h>
#include <tdemenubar.h>
#include <kiconloader.h>
MainWindow::MainWindow(TQWidget* parent, const char* name) : TDEMainWindow(parent, name)
{
TDEAction* actionQuit = KStdAction::quit(this, SLOT(close()), 0);
TDEAction* actionNew = new TDEAction( "&New Game", "reload", TQt::CTRL + TQt::Key_N, this, SLOT(newGame()), this, "New Game");
mMenu = new TDEPopupMenu(this);
mMenu->insertItem(SmallIcon("images_display"), "Load an image", this, SLOT(loadImage()), TQt::CTRL + TQt::Key_L);
mMenu->insertSeparator();
actionNew->plug(mMenu);
actionQuit->plug(mMenu);
menuBar()->insertItem(tr("Menu"), mMenu);
mBoard = new GameBoard(this);
setCentralWidget(mBoard);
}
MainWindow::~MainWindow()
{
delete mBoard;
delete mMenu;
}
void MainWindow::newGame()
{
mBoard->newGame();
}
void MainWindow::loadImage()
{
mBoard->loadImage();
}
#include "mainwindow.moc"

@ -0,0 +1,30 @@
// Author: Denis Kozadaev - (c) 2017-2020
#ifndef __MAIN_WINDOW_H__
#define __MAIN_WINDOW_H__
#include <tdemainwindow.h>
#include <tdepopupmenu.h>
#include "gameboard.h"
class MainWindow : public TDEMainWindow
{
Q_OBJECT
public:
MainWindow(TQWidget* parent = 0, const char* name = 0);
~MainWindow();
private:
TDEPopupMenu* mMenu;
GameBoard* mBoard;
private slots:
void newGame();
void loadImage();
};
#endif /* __MAIN_WINDOW_H__ */

@ -0,0 +1,9 @@
[Desktop Entry]
Name=TDEFifteen
GenericName=Puzzle-solving game
Exec=tdefifteen
Comment=Sliding puzzle with one missing tile
Icon=tdefifteen
Terminal=false
Type=Application
Categories=Qt;TDE;Game;BoardGame;
Loading…
Cancel
Save