-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprojectloader.h
67 lines (58 loc) · 2.24 KB
/
projectloader.h
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/**
* Atlas - Volumetric terrain editor
* Copyright (C) 2012-2015 Ondřej Záruba
*
* This program 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 3 of the License, or
* (at your option) any later version.
* This program 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 this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef LOADING_H
#define LOADING_H
#include <QQuickItem>
#include <QFileInfo>
#include <QOpenGLContext>
#include <QQuickWindow>
#include <QSettings>
#include "project.h"
#include "projectio.h"
#include "globalsettings.h"
class ProjectLoader : public QQuickItem
{
Q_OBJECT
Q_PROPERTY(float loadingProgress READ loadingProgress WRITE setLoadingProgress NOTIFY loadingProgressChanged)
Q_PROPERTY(QString loadingMessage READ loadingMessage WRITE setLoadingMessage NOTIFY loadingMessageChanged)
public:
explicit ProjectLoader(QQuickItem *parent = 0);
void openProject(const QString &file_path, QOpenGLContext *context);
void createProject();
float loadingProgress() const;
QString loadingMessage() const;
void saveProject();
void saveProjectAs(const QUrl & save_folder);
void createProject(const QString &path, const QString &name, const QString &author, int width, int height, int depth);
public slots:
void setLoadingProgress(float arg);
void setLoadingMessage(QString & arg);
signals:
void projectLoaded(Project * project);
void loadingProgressChanged(float arg);
void loadingMessageChanged(QString arg);
private slots:
void updateProgress(QString caption, int value);
void loadingDone(bool status);
private:
void addRecentProject(const QString &project_file);
ProjectIO handler;
Project * project;
float m_loadingProgress;
QString m_loadingMessage;
};
#endif // LOADING_H