Turn into a TDE application.

Signed-off-by: gregory guy <gregory-tde@laposte.net>
gregory guy 3 years ago
parent a81ef5296b
commit 7730258155
No known key found for this signature in database
GPG Key ID: 2CC84A1CC6823AF8

@ -33,7 +33,8 @@ tde_add_executable( q15 AUTOMOC
main.cpp
mainwindow.cpp
LINK
tqt-mt
tdeui-shared
tdecore-shared
DESTINATION ${BIN_INSTALL_DIR}
)

@ -9,9 +9,9 @@
* Hacked by:
*/
#include <stdlib.h>
#include <cstdlib>
#include <tqapplication.h>
#include <tdeapplication.h>
#include <tqpainter.h>
#include <tqcursor.h>
#include <tqmessagebox.h>
@ -251,7 +251,7 @@ GameBoard::startMoving(int i, int t)
dx = step(xt, map[n]->x());
dy = step(yt, map[n]->y());
tmr->start(DELAY);
TQApplication::setOverrideCursor(TQCursor(TQt::WaitCursor));
TDEApplication::setOverrideCursor(TQCursor(TQt::WaitCursor));
}

@ -1,41 +1,38 @@
/*
* $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"
#include <tdeaboutdata.h>
#include <tdeapplication.h>
#include <tdecmdlineargs.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();
static const char description[] = I18N_NOOP("TDE Gem/Puzzle Game");
const int XSize = 640, YSize = 480;
delete mw;
delete app;
return (result);
int main(int argc, char *argv[])
{
TDEAboutData about( "TDEFifteenPieces", // program name used internally
"TDEFifteenPieces", // displayable program name
"14.0.10", // program version string
description, // short description
0, // licence type
"(c) 2017-2020 by 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 );
mainWin->show();
return app.exec();
}

@ -9,43 +9,45 @@
* Hacked by:
*/
#include <tqapplication.h>
#include "mainwindow.h"
MainWindow::MainWindow(TQWidget *parent, const char *name)
:TQMainWindow(parent, name)
#include <tdeactionclasses.h>
#include <tdemenubar.h>
#include <kiconloader.h>
MainWindow::MainWindow(TQWidget* parent, const char* name) : TDEMainWindow(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);
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");
menuBar()->insertItem(tr("File"), file);
mMenu = new TDEPopupMenu(this);
mMenu->insertItem(SmallIcon("images_display"), "Load an image", this, SLOT(loadImage()), TQt::CTRL + TQt::Key_L);
mMenu->insertSeparator();
gb = new GameBoard(this);
setCentralWidget(gb);
actionNew->plug(mMenu);
actionQuit->plug(mMenu);
menuBar()->insertItem(tr("Menu"), mMenu);
mBoard = new GameBoard(this);
setCentralWidget(mBoard);
}
MainWindow::~MainWindow()
{
delete gb;
delete file;
delete mBoard;
delete mMenu;
}
void
MainWindow::newGame()
void MainWindow::newGame()
{
gb->newGame();
mBoard->newGame();
}
void
MainWindow::loadImage()
void MainWindow::loadImage()
{
gb->loadImage();
mBoard->loadImage();
}
#include "mainwindow.moc"

@ -12,29 +12,27 @@
#ifndef __MAIN_WINDOW_H__
#define __MAIN_WINDOW_H__
#include <stdlib.h>
#include <tqmainwindow.h>
#include <tqmenubar.h>
#include <tqpopupmenu.h>
#include <tdemainwindow.h>
#include <tdepopupmenu.h>
#include "gameboard.h"
class MainWindow:public TQMainWindow
class MainWindow : public TDEMainWindow
{
Q_OBJECT
public:
MainWindow(TQWidget *parent = NULL, const char *name = NULL);
MainWindow(TQWidget* parent = 0, const char* name = 0);
~MainWindow();
private:
TQPopupMenu *file;
GameBoard *gb;
TDEPopupMenu* mMenu;
GameBoard* mBoard;
private slots:
void newGame();
void loadImage();
void newGame();
void loadImage();
};
#endif /* __MAIN_WINDOW_H__ */

Loading…
Cancel
Save