2007-12-01 10:47:15 +00:00
|
|
|
/*
|
2025-01-04 13:37:40 +01:00
|
|
|
Copyright 2006-2025 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 ELEMENTS_CATEGORY_EDITOR_H
|
|
|
|
#define ELEMENTS_CATEGORY_EDITOR_H
|
2016-05-12 15:41:55 +00:00
|
|
|
|
2020-12-08 19:57:35 +01:00
|
|
|
#include "ElementsCollection/elementslocation.h"
|
|
|
|
|
2016-05-12 15:41:55 +00:00
|
|
|
#include <QDialog>
|
|
|
|
|
2019-01-02 16:56:46 +00:00
|
|
|
class NameListWidget;
|
2009-04-03 19:30:25 +00:00
|
|
|
class QFileNameEdit;
|
2016-05-12 15:41:55 +00:00
|
|
|
class QDialogButtonBox;
|
|
|
|
class QLabel;
|
|
|
|
|
2007-04-05 18:02:40 +00:00
|
|
|
/**
|
2020-08-16 11:19:36 +02:00
|
|
|
@brief The ElementsCategoryEditor class
|
|
|
|
This class provides a dialog to edit an existing category or create a new one.
|
|
|
|
*/
|
2016-05-12 15:41:55 +00:00
|
|
|
class ElementsCategoryEditor : public QDialog
|
|
|
|
{
|
2007-04-05 01:13:14 +00:00
|
|
|
Q_OBJECT
|
2016-05-12 15:41:55 +00:00
|
|
|
|
2007-04-05 01:13:14 +00:00
|
|
|
public:
|
2016-05-12 15:41:55 +00:00
|
|
|
ElementsCategoryEditor(const ElementsLocation &location, bool edit = true, QWidget *parent = nullptr);
|
2017-08-05 02:10:01 +00:00
|
|
|
~ElementsCategoryEditor() override;
|
2016-06-17 09:09:46 +00:00
|
|
|
|
|
|
|
ElementsLocation createdLocation() const;
|
2007-04-12 03:13:13 +00:00
|
|
|
|
|
|
|
private:
|
2016-05-12 15:41:55 +00:00
|
|
|
ElementsCategoryEditor(const ElementsCategoryEditor &);
|
2007-04-05 01:13:14 +00:00
|
|
|
|
|
|
|
private:
|
2016-05-12 15:41:55 +00:00
|
|
|
QDialogButtonBox *m_buttons;
|
2019-01-02 16:56:46 +00:00
|
|
|
NameListWidget *m_names_list;
|
2016-05-12 15:41:55 +00:00
|
|
|
QLabel *m_file_name;
|
|
|
|
QFileNameEdit *m_file_line_edit;
|
|
|
|
bool m_edit_mode;
|
|
|
|
ElementsLocation m_location;
|
2016-06-17 09:09:46 +00:00
|
|
|
ElementsLocation m_created_location;
|
2016-05-12 15:41:55 +00:00
|
|
|
|
2007-04-05 01:13:14 +00:00
|
|
|
private:
|
2016-05-12 15:41:55 +00:00
|
|
|
void setUpWidget();
|
2007-04-05 01:13:14 +00:00
|
|
|
|
|
|
|
public slots:
|
2016-05-12 15:41:55 +00:00
|
|
|
void acceptCreation();
|
|
|
|
void acceptUpdate();
|
2007-04-05 01:13:14 +00:00
|
|
|
};
|
|
|
|
#endif
|