| 1 |
/****************************************************************************** |
| 2 |
This source file is part of the Avogadro project. |
| 3 |
This source code is released under the 3-Clause BSD License, (see "LICENSE"). |
| 4 |
******************************************************************************/ |
| 5 |
|
| 6 |
#ifndef AVOGADRO_QTGUI_CUSTOMELEMENTDIALOG_H |
| 7 |
#define AVOGADRO_QTGUI_CUSTOMELEMENTDIALOG_H |
| 8 |
|
| 9 |
#include "avogadroqtguiexport.h" |
| 10 |
#include <QtWidgets/QDialog> |
| 11 |
|
| 12 |
#include <avogadro/core/avogadrocore.h> |
| 13 |
|
| 14 |
namespace Avogadro { |
| 15 |
namespace QtGui { |
| 16 |
class Molecule; |
| 17 |
|
| 18 |
namespace Ui { |
| 19 |
class CustomElementDialog; |
| 20 |
} |
| 21 |
|
| 22 |
/** |
| 23 |
* @class CustomElementDialog customelementdialog.h |
| 24 |
* <avogadro/qtgui/customelementdialog.h> |
| 25 |
* @brief Dialog window for mapping custom elements into elemental types. |
| 26 |
*/ |
| 27 |
class AVOGADROQTGUI_EXPORT CustomElementDialog : public QDialog |
| 28 |
{ |
| 29 |
Q_OBJECT |
| 30 |
public: |
| 31 |
explicit CustomElementDialog(Molecule& mol, QWidget* parent = nullptr); |
| 32 |
~CustomElementDialog() override; |
| 33 |
|
| 34 |
/** |
| 35 |
* Static entry point for using this dialog. @a parent is the parent of the |
| 36 |
* dialog, @a mol is the molecule to operate on. |
| 37 |
*/ |
| 38 |
static void resolve(QWidget* parent, Molecule& mol); |
| 39 |
|
| 40 |
public slots: |
| 41 |
/** Apply the changes to the molecule. */ |
| 42 |
void apply(); |
| 43 |
|
| 44 |
private: |
| 45 |
Ui::CustomElementDialog* m_ui; |
| 46 |
Molecule& m_molecule; |
| 47 |
QStringList m_elements; |
| 48 |
|
| 49 |
void prepareElements(); |
| 50 |
void prepareForm(); |
| 51 |
void addRow(unsigned char customElementId, const QString& name); |
| 52 |
}; |
| 53 |
|
| 54 |
} // namespace QtGui |
| 55 |
} // namespace Avogadro |
| 56 |
#endif // AVOGADRO_QTGUI_CUSTOMELEMENTDIALOG_H |