Skip to content

Commit

Permalink
Initial codes
Browse files Browse the repository at this point in the history
  • Loading branch information
Harinlen committed May 31, 2015
1 parent d94ef42 commit fa9585e
Show file tree
Hide file tree
Showing 31 changed files with 3,661 additions and 0 deletions.
39 changes: 39 additions & 0 deletions Robot.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#Enabled the qt modules.
QT += core gui widgets

#Enabled c++ 11 syntax.
CONFIG += c++11

SOURCES += \
main.cpp \
mainwindow.cpp \
ground.cpp \
robot.cpp \
panel.cpp \
menubar.cpp \
robotmanagement.cpp \
paneldock.cpp \
robotaddwidget.cpp \
groundpreviewwidget.cpp \
generateground.cpp \
groundeditor.cpp \
generategroundbase.cpp \
barrackseditor.cpp \
barrackseditorbase.cpp

HEADERS += \
mainwindow.h \
ground.h \
robot.h \
panel.h \
groundbase.h \
menubar.h \
robotmanagement.h \
paneldock.h \
robotaddwidget.h \
groundpreviewwidget.h \
generateground.h \
groundeditor.h \
generategroundbase.h \
barrackseditor.h \
barrackseditorbase.h
24 changes: 24 additions & 0 deletions barrackseditor.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright (C) Kreogist Dev Team
*
* 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.
*/

#include "barrackseditor.h"

BarracksEditor::BarracksEditor(QWidget *parent) :
BarracksEditorBase(parent)
{
}
36 changes: 36 additions & 0 deletions barrackseditor.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright (C) Kreogist Dev Team
*
* 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.
*/

#ifndef BARRACKSEDITOR_H
#define BARRACKSEDITOR_H

#include "barrackseditorbase.h"

class BarracksEditor : public BarracksEditorBase
{
Q_OBJECT
public:
explicit BarracksEditor(QWidget *parent = 0);

signals:

public slots:

};

#endif // BARRACKSEDITOR_H
24 changes: 24 additions & 0 deletions barrackseditorbase.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright (C) Kreogist Dev Team
*
* 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.
*/

#include "barrackseditorbase.h"

BarracksEditorBase::BarracksEditorBase(QWidget *parent) :
QWidget(parent)
{
}
36 changes: 36 additions & 0 deletions barrackseditorbase.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright (C) Kreogist Dev Team
*
* 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.
*/

#ifndef BARRACKSEDITORBASE_H
#define BARRACKSEDITORBASE_H

#include <QWidget>

class BarracksEditorBase : public QWidget
{
Q_OBJECT
public:
explicit BarracksEditorBase(QWidget *parent = 0);

signals:

public slots:

};

#endif // BARRACKSEDITORBASE_H
76 changes: 76 additions & 0 deletions generateground.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/*
* Copyright (C) Kreogist Dev Team
*
* 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.
*/
#include <QBoxLayout>
#include <QPushButton>
#include <QTabWidget>

#include "groundeditor.h"
#include "barrackseditor.h"

#include "generateground.h"

GenerateGround::GenerateGround(QWidget *parent) :
GenerateGroundBase(parent),
m_tabManager(new QTabWidget(this)),
m_groundEditor(new GroundEditor(this)),
m_barracksEditor(new BarracksEditor(this)),
m_okay(new QPushButton(this)),
m_cancel(new QPushButton(this))
{
//Set properties.
#ifdef Q_OS_MACX
setWindowFlags(Qt::Sheet);
#endif

//Configure buttons.
m_cancel->setShortcut(QKeySequence(Qt::Key_Escape));
connect(m_cancel,
static_cast<void (QPushButton::*)(bool)>(&QPushButton::clicked),
[=]
{
close();
});

//Initial the layout.
QBoxLayout *mainLayout=new QBoxLayout(QBoxLayout::LeftToRight,
this);
setLayout(mainLayout);

mainLayout->addWidget(m_tabManager, 1);

m_tabManager->addTab(m_groundEditor, "");
m_tabManager->addTab(m_barracksEditor, "");

QBoxLayout *buttonLayout=new QBoxLayout(QBoxLayout::TopToBottom,
mainLayout->widget());
mainLayout->addLayout(buttonLayout);
buttonLayout->addWidget(m_okay);
buttonLayout->addWidget(m_cancel);
buttonLayout->addStretch();

retranslate();
}

void GenerateGround::retranslate()
{
m_okay->setText(tr("Ok"));
m_cancel->setText(tr("Cancel"));

m_tabManager->setTabText(0, tr("Ground"));
m_tabManager->setTabText(1, tr("Barracks"));
}
56 changes: 56 additions & 0 deletions generateground.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* Copyright (C) Kreogist Dev Team
*
* 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.
*/

#ifndef GENERATEGROUND_H
#define GENERATEGROUND_H

#include "generategroundbase.h"

class QPushButton;
class QTabWidget;
class GroundEditor;
class BarracksEditor;
/*!
* \brief The GenerateGround class is a default realization of
* GenerateGroundBase.
*/
class GenerateGround : public GenerateGroundBase
{
Q_OBJECT
public:
/*!
* \brief Construct ground generator widget.
* \param parent The parent widget.
*/
explicit GenerateGround(QWidget *parent = 0);

signals:

public slots:

private slots:
void retranslate();

private:
QTabWidget *m_tabManager;
GroundEditor *m_groundEditor;
BarracksEditor *m_barracksEditor;
QPushButton *m_okay, *m_cancel;
};

#endif // GENERATEGROUND_H
24 changes: 24 additions & 0 deletions generategroundbase.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright (C) Kreogist Dev Team
*
* 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.
*/

#include "generategroundbase.h"

GenerateGroundBase::GenerateGroundBase(QWidget *parent) :
QDialog(parent)
{
}
44 changes: 44 additions & 0 deletions generategroundbase.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Copyright (C) Kreogist Dev Team
*
* 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.
*/

#ifndef GENERATEGROUNDBASE_H
#define GENERATEGROUNDBASE_H

#include <QDialog>

/*!
* \brief The GenerateGround class is a widget which can help user to generate
* the border and barracks.
*/
class GenerateGroundBase : public QDialog
{
Q_OBJECT
public:
/*!
* \brief Construct a GenerateGroundBase dialog.
* \param parent Set the parent widget.
*/
explicit GenerateGroundBase(QWidget *parent = 0);

signals:

public slots:

};

#endif // GENERATEGROUNDBASE_H
Loading

0 comments on commit fa9585e

Please sign in to comment.