2007-04-05 01:13:14 +00:00
|
|
|
#ifndef ELEMENTS_CATEGORY_EDITOR_H
|
|
|
|
#define ELEMENTS_CATEGORY_EDITOR_H
|
|
|
|
#include <QtGui>
|
2007-04-05 18:02:40 +00:00
|
|
|
/**
|
|
|
|
Cette classe permet d'editer une categorie existante ou de creer une
|
|
|
|
categorie.
|
|
|
|
*/
|
2007-04-05 01:13:14 +00:00
|
|
|
class ElementsCategory;
|
|
|
|
class ElementsCategoryEditor : public QDialog {
|
|
|
|
Q_OBJECT
|
|
|
|
//Constructeurs, destructeur
|
|
|
|
public:
|
|
|
|
ElementsCategoryEditor(QWidget * = 0);
|
|
|
|
ElementsCategoryEditor(const QString &, bool = true, QWidget * = 0);
|
|
|
|
~ElementsCategoryEditor();
|
|
|
|
|
|
|
|
// attributs
|
|
|
|
private:
|
|
|
|
QTreeWidget *category_names;
|
|
|
|
ElementsCategory *category;
|
|
|
|
QDialogButtonBox *buttons;
|
2007-04-05 18:02:40 +00:00
|
|
|
QPushButton *button_add_line;
|
|
|
|
QHash<QString, QString> hash_names;
|
|
|
|
|
2007-04-05 01:13:14 +00:00
|
|
|
bool mode_edit;
|
|
|
|
// methodes
|
|
|
|
private:
|
|
|
|
void buildDialog();
|
2007-04-05 18:02:40 +00:00
|
|
|
void clean();
|
|
|
|
bool checkOneName();
|
|
|
|
void updateHash();
|
2007-04-05 01:13:14 +00:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
void acceptCreation();
|
|
|
|
void acceptUpdate();
|
2007-04-05 18:02:40 +00:00
|
|
|
void addLine();
|
2007-04-05 01:13:14 +00:00
|
|
|
};
|
|
|
|
#endif
|