2007-12-01 10:47:15 +00:00
|
|
|
/*
|
2016-05-13 17:40:36 +00:00
|
|
|
Copyright 2006-2016 The QElectroTech Team
|
2007-12-01 10:47:15 +00:00
|
|
|
This file is part of QElectroTech.
|
|
|
|
|
|
|
|
QElectroTech 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.
|
|
|
|
|
|
|
|
QElectroTech 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 QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2007-04-05 01:13:14 +00:00
|
|
|
#ifndef NEW_ELEMENT_WIZARD_H
|
|
|
|
#define NEW_ELEMENT_WIZARD_H
|
2016-05-14 17:10:03 +00:00
|
|
|
|
|
|
|
#include <QWizard>
|
|
|
|
#include "elementslocation.h"
|
|
|
|
|
2007-10-21 16:10:21 +00:00
|
|
|
class NamesListWidget;
|
2009-04-03 19:30:25 +00:00
|
|
|
class QFileNameEdit;
|
2016-05-14 17:10:03 +00:00
|
|
|
class QTreeView;
|
|
|
|
|
2007-04-04 02:13:14 +00:00
|
|
|
/**
|
2012-11-09 21:09:24 +00:00
|
|
|
This class provides a wizard dialog enabling users to to specify the basic
|
|
|
|
parameters of the electrical elements they intend to draw.
|
|
|
|
|
|
|
|
These parameters include:
|
|
|
|
- the category the element should be saved to
|
|
|
|
- the filename the element should be saved to
|
|
|
|
- localized names
|
2007-04-04 02:13:14 +00:00
|
|
|
*/
|
2007-09-07 08:42:36 +00:00
|
|
|
class NewElementWizard : public QWizard {
|
2007-04-04 02:13:14 +00:00
|
|
|
Q_OBJECT
|
2007-04-12 03:13:13 +00:00
|
|
|
|
2012-11-09 21:09:24 +00:00
|
|
|
// constructors, destructor
|
2007-04-04 02:13:14 +00:00
|
|
|
public:
|
|
|
|
NewElementWizard(QWidget * = 0, Qt::WindowFlags = 0);
|
2007-04-12 03:13:13 +00:00
|
|
|
virtual ~NewElementWizard();
|
|
|
|
|
|
|
|
private:
|
|
|
|
NewElementWizard(const NewElementWizard &);
|
2007-04-04 02:13:14 +00:00
|
|
|
|
2012-11-09 21:09:24 +00:00
|
|
|
// attributes
|
2007-04-04 02:13:14 +00:00
|
|
|
private:
|
2013-11-14 10:11:22 +00:00
|
|
|
enum WizardState { Category, Filename, Names };
|
2016-05-14 17:10:03 +00:00
|
|
|
QFileNameEdit *m_qle_filename;
|
|
|
|
NamesListWidget *m_names_list;
|
|
|
|
QString m_chosen_file;
|
|
|
|
QTreeView *m_tree_view = nullptr;
|
|
|
|
ElementsLocation m_chosen_location;
|
2007-04-04 02:13:14 +00:00
|
|
|
|
2012-11-09 21:09:24 +00:00
|
|
|
// methods
|
2007-04-06 02:47:25 +00:00
|
|
|
private:
|
2007-09-07 08:42:36 +00:00
|
|
|
QWizardPage *buildStep1();
|
|
|
|
QWizardPage *buildStep2();
|
|
|
|
QWizardPage *buildStep3();
|
2007-04-06 02:47:25 +00:00
|
|
|
bool validStep1();
|
|
|
|
bool validStep2();
|
2007-09-07 08:42:36 +00:00
|
|
|
bool validateCurrentPage();
|
2007-04-07 19:25:38 +00:00
|
|
|
void createNewElement();
|
2007-04-04 02:13:14 +00:00
|
|
|
};
|
2007-04-05 01:13:14 +00:00
|
|
|
#endif
|