structurelibraryview.hpp 859 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
 * <32021 by Stellaris. Copying Art is an act of love. Love is not subject to law.
 */
#ifndef STRUCTURELIBRARYVIEW_HPP
#define STRUCTURELIBRARYVIEW_HPP

#include <QFrame>

#include <QDir>
#include <QTreeWidgetItem>

#include "structure.hpp"

namespace Ui {
class StructureLibraryView;
}

class StructureLibraryView : public QFrame
{
    Q_OBJECT

public:
    explicit StructureLibraryView(QWidget *parent = nullptr);
    ~StructureLibraryView();

signals:
    void structure_copied(const Structure& s);

private:
    void load_structures();
    QTreeWidgetItem *add_directory_contents(const QDir& dir);
    bool load_structure(const QString& filename, Structure& s);

private slots:
    void update_info(QTreeWidgetItem* item, int column);
    void copy_button_clicked();

private:
    Ui::StructureLibraryView *ui;
};

#endif // STRUCTURELIBRARYVIEW_HPP