2#include "./ui_MainWindow.h"
4#include "RabbitCommonDir.h"
5#include "RabbitCommonTools.h"
11MainWindow::MainWindow(QWidget *parent)
16 RabbitCommon::CTools::AddStyleMenu(ui->menuTools);
17 ui->menuTools->addMenu(RabbitCommon::CTools::GetLogMenu(
this));
20 this->setCentralWidget(m_pChess);
21 ui->actionPrompt_sound_S->setChecked(m_pChess->getEnablePromptSound());
22 ui->actionPrompt_message_M->setChecked(m_pChess->getEnablePromptMessage());
25 ui->actionUpdate_U->setIcon(updater.windowIcon());
28MainWindow::~MainWindow()
33void MainWindow::on_actionOpen_O_triggered()
36 QString szFile = QFileDialog::getOpenFileName(
this, tr(
"Open chess game"));
41void MainWindow::on_actionSave_S_triggered()
44 QString szFile = QFileDialog::getSaveFileName(
this,
45 tr(
"Open chess game"),
47 tr(
"Chinese chess control file(*.ccc);;Portable game notation file(*.pgn);;All files(*.*)"));
51void MainWindow::on_actionPreviou_P_triggered()
57void MainWindow::on_actionNext_N_triggered()
63void MainWindow::on_actionExit_E_triggered()
68void MainWindow::on_actionAbout_A_triggered()
70 QCursor cursor = this->cursor();
71 setCursor(Qt::WaitCursor);
72 CDlgAbout about(
this);
73 about.m_AppIcon = QImage(
":/image/Chess");
74 about.m_szAppName = tr(
"Chinese chess");
75 about.m_szHomePage =
"https://github.com/KangLin/ChineseChessControl";
76 about.m_szCopyrightStartTime =
"1994";
77 about.m_szVersion = ChineseChessApp_VERSION;
78 about.m_szVersionRevision = ChineseChessApp_REVISION;
80#if defined (Q_OS_ANDROID)
81 about.showMaximized();
87void MainWindow::on_actionPrompt_sound_S_triggered(
bool checked)
90 m_pChess->EnablePromptSound(checked);
93void MainWindow::on_actionPrompt_message_M_triggered(
bool checked)
96 m_pChess->EnablePromptMessage(checked);
99void MainWindow::on_actionUpdate_U_triggered()
101 CFrmUpdater* m_pfrmUpdater =
new CFrmUpdater();
102 m_pfrmUpdater->SetTitle(QImage(
":/image/Chess"));
103 #if defined (Q_OS_ANDROID)
104 m_pfrmUpdater->showMaximized();
106 m_pfrmUpdater->show();
int PreviouStep()
函数名:PreviouStep 功 能:上步棋 参 数:无 返回值:走棋步数 作 者:康 林 版 本:1.0.0.1 日 期:2004-10-5 时 间:10:19:51
virtual int LoadChessGame(const char *pszFile)
加载棋局。 根据文件扩展名来解析文件的格式。 当前支持自定义格式、PGN格式
int NextStep()
函数名:NextStep 功 能:下步棋 参 数:无 返回值:走棋步数 作 者:康 林 版 本:1.0.0.1 日 期:2004-10-5 时 间:10:19:33
virtual int SaveChessGame(const char *pszFile)
保存棋局。 根据文件扩展名来保存为相应的格式。 当前支持自定义格式、PGN格式