toruschess/src/optiondlg.h

69 lines
2.4 KiB
C++

/***************************************************************************
* Copyright (C) 2009 by Stefan Bühler *
* stbuehler@web.de *
* *
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef TORUSCHESSOPTIONDLG_H
#define TORUSCHESSOPTIONDLG_H
#include <QDialog>
#include <QButtonGroup>
#include "ui_optiondlg.h"
#include "toruschess.h"
/**
@author Stefan Bühler <stbuehler@web.de>
*/
namespace toruschess {
typedef enum { VIEW_2D, VIEW_3D, VIEW_TORUS } ViewMode;
/** Option Dialog
* Game options are set directly (so one dialog contols only one game instance)
* The view mode option is handled via signal/slot (default is VIEW_2D)
*/
class OptionDlg : public QDialog, private Ui::OptionDlg {
Q_OBJECT
public:
OptionDlg(Game *game, QWidget *parent = 0);
signals:
void setViewMode(ViewMode viewMode);
public slots:
void changedViewMode(ViewMode viewMode);
private slots:
void gameChangedMode(GameMode mode);
void gameChangedAIStrength(int aiStrength);
void dlgReset();
void dlgAccept();
private:
Game *m_game;
GameMode m_curMode;
int m_curAIStrength;
ViewMode m_curViewMode;
QButtonGroup *m_bgMode;
QButtonGroup *m_vMode;
};
}
#endif