File indexing completed on 2024-04-28 07:54:19

0001 /* This file is part of KsirK.
0002    Copyright (C) 2008 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 
0021 #include "ksirkSkinEditorConfigDialog.h"
0022 #include "ksirkskineditorsettings.h"
0023 #include "ui_preferences.h"
0024 
0025 #include <KConfig>
0026 #include <KEditToolBar>
0027 #include "ksirkskineditor_debug.h"
0028 #include <QPushButton>
0029 #include <KStandardAction>
0030 
0031 #include <KLocalizedString>
0032 
0033 #include <QSlider>
0034 #include <QCheckBox>
0035 #include <iostream>
0036 
0037 using namespace KsirkSkinEditor;
0038 
0039 KsirkSkinEditorConfigurationDialog::KsirkSkinEditorConfigurationDialog (
0040               QWidget *parent, const char *name, KConfigSkeleton *config, 
0041               FaceType dialogType, QDialogButtonBox::StandardButtons dialogButtons, 
0042               QDialogButtonBox::StandardButton defaultButton, bool modal) : 
0043       KConfigDialog (parent, name, config) , m_changed(false), 
0044       m_widget(new Ui::KsirkSkinEditorPreferencesWidget())
0045 
0046 {
0047   setFaceType(dialogType);
0048   setStandardButtons(dialogButtons);
0049   button(defaultButton)->setDefault(true);
0050   setModal(modal);
0051   QWidget* w = new QWidget();
0052   m_widget->setupUi(w);
0053 
0054  
0055   addPage( w, i18n("Preferences"), QStringLiteral("games-config-options")/*, i18n("Preferences"), false*/);
0056   // below, connection to activate the apply button
0057 //   connect(m_widget->reloadOnChangeMode, SIGNAL(clicked(int)), this, SLOT(settingChanged(int)));
0058 }
0059 
0060 KsirkSkinEditorConfigurationDialog::~KsirkSkinEditorConfigurationDialog ()
0061 {
0062   delete m_widget;
0063 }
0064 
0065 void KsirkSkinEditorConfigurationDialog::settingChanged(int)
0066 {
0067   qCDebug(KSIRKSKINEDITOR_LOG);
0068   m_changed = true;
0069   //settingsChangedSlot();
0070   //updateButtons ();
0071 }
0072 
0073 bool KsirkSkinEditorConfigurationDialog::hasChanged()
0074 {
0075   qCDebug(KSIRKSKINEDITOR_LOG);
0076   return m_changed;
0077 }
0078 
0079 void KsirkSkinEditorConfigurationDialog::updateSettings()
0080 {
0081   qCDebug(KSIRKSKINEDITOR_LOG);
0082   m_changed = false;
0083   KsirkSkinEditorSettings::self()->save();
0084 }
0085 
0086 void KsirkSkinEditorConfigurationDialog::updateWidgets()
0087 {
0088   qCDebug(KSIRKSKINEDITOR_LOG);
0089 
0090   m_changed = false;
0091 }
0092 
0093 #include "moc_ksirkSkinEditorConfigDialog.cpp"