File indexing completed on 2024-05-05 04:48:48

0001 /****************************************************************************************
0002  * Copyright (c) 2008-2010 Soren Harward <stharward@gmail.com>                          *
0003  *                                                                                      *
0004  * This program is free software; you can redistribute it and/or modify it under        *
0005  * the terms of the GNU General Public License as published by the Free Software        *
0006  * Foundation; either version 2 of the License, or (at your option) any later           *
0007  * version.                                                                             *
0008  *                                                                                      *
0009  * This program is distributed in the hope that it will be useful, but WITHOUT ANY      *
0010  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A      *
0011  * PARTICULAR PURPOSE. See the GNU General Public License for more details.             *
0012  *                                                                                      *
0013  * You should have received a copy of the GNU General Public License along with         *
0014  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
0015  ****************************************************************************************/
0016 
0017 #ifndef APG_PRESET_EDIT_DIALOG
0018 #define APG_PRESET_EDIT_DIALOG
0019 
0020 #include "ui_PresetEditDialog.h"
0021 
0022 #include "Preset.h"
0023 
0024 #include <QDialog>
0025 #include <QHash>
0026 
0027 class ConstraintNode;
0028 
0029 namespace APG {
0030     class TreeController;
0031 
0032     class PresetEditDialog : public QDialog {
0033         Q_OBJECT
0034 
0035         public:
0036             explicit PresetEditDialog( const PresetPtr &);
0037 
0038         private Q_SLOTS:
0039             void addNode( const QString& );
0040             void removeNode();
0041             void currentNodeChanged( const QModelIndex& );
0042 
0043             void accept() override;
0044             void reject() override;
0045 
0046             void on_lineEdit_Title_textChanged( const QString& );
0047 
0048         private:
0049             Ui::PresetEditDialog ui;
0050 
0051             TreeController* m_controller;
0052             PresetPtr m_preset;
0053 
0054             QHash<ConstraintNode*, int> m_widgetStackPages;
0055     };
0056 }
0057 
0058 #endif