File indexing completed on 2024-04-28 07:53:29

0001 /* This file is part of KsirK.
0002  *   Copyright (C) 2007 Gael de Chalendar <kleag@free.fr>
0003  * 
0004  *   KsirK is free software; you can redistribute it and/or
0005  *   modify it under the terms of the GNU General Public
0006  *   License as published by the Free Software Foundation, either version 2
0007    of the License, or (at your option) any later version.
0008  * 
0009  *   This program is distributed in the hope that it will be useful,
0010  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
0011  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0012  *   General Public License for more details.
0013  * 
0014  *   You should have received a copy of the GNU General Public License
0015  *   along with this program; if not, write to the Free Software
0016  *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
0017  *   02110-1301, USA
0018  */
0019 
0020 #include "restartOrExitDialogImpl.h"
0021 
0022 #include <KLocalizedString>
0023 #include "ksirk_debug.h"
0024 #include <QStandardPaths>
0025 
0026 #include <QSpinBox>
0027 #include <QCheckBox>
0028 #include <QComboBox>
0029 #include <QDir>
0030 #include <QStringList>
0031 #include <QRadioButton>
0032 #include <QLabel>
0033 
0034 namespace Ksirk
0035 {
0036 
0037 RestartOrExitDialogImpl::RestartOrExitDialogImpl(
0038       const QString& label,
0039       QWidget *parent) :
0040   QDialog(parent),
0041   Ui::RestartOrExitDialog()
0042 {
0043   setupUi(this);
0044   messageLabel->setText(label);
0045   messageLabel->adjustSize();
0046   connect(doNothingButton, &QAbstractButton::clicked, this, &RestartOrExitDialogImpl::slotDoNothing);
0047   connect(exitButton, &QAbstractButton::clicked, this, &RestartOrExitDialogImpl::slotExit);
0048   connect(newGameButton, &QAbstractButton::clicked, this, &RestartOrExitDialogImpl::slotNewGame);
0049   adjustSize();
0050 }
0051 
0052 RestartOrExitDialogImpl::~RestartOrExitDialogImpl()
0053 {
0054 }
0055 
0056 void RestartOrExitDialogImpl::slotNewGame()
0057 {
0058   qCDebug(KSIRK_LOG);
0059   close();
0060 }
0061 
0062 void RestartOrExitDialogImpl::slotExit()
0063 {
0064   qCDebug(KSIRK_LOG);
0065   close();
0066 }
0067 
0068 /** @todo implements a help */
0069 void RestartOrExitDialogImpl::slotDoNothing()
0070 {
0071   qCDebug(KSIRK_LOG);
0072   close();
0073 }
0074 
0075 }
0076 
0077 #include "moc_restartOrExitDialogImpl.cpp"