NDEVR
API Documentation
ProjectEditor.h
1/*--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: NDEVR
28File: ProjectEditor
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include <NDEVR/Editor.h>
34#include <NDEVR/FileChooserDialog.h>
35#include <QApplication>
36namespace Ui
37{
38 class ProjectUI;
39}
40namespace NDEVR
41{
47 class NDEVR_API ProjectEditor : public Editor
48 {
49 Q_OBJECT
50 public:
56 ProjectEditor(const DynamicPointer<QTDesignObject>& project, QWidget* parent = nullptr);
57 virtual ~ProjectEditor();
59 virtual void updateValues() override;
60 protected:
67 static File getFileName(const StringView& folder_name, const StringView& project_name);
73 static String getProjectName(const StringView& project_name);
82 bool willOverrideExisting(const StringView& folder_name, const StringView& project_name);
83 EditorShowMode showMode() const override;
91 public slots:
95 void fileChosen();
96 protected:
98 Ui::ProjectUI* ui;
99 };
100}
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:356
Editor(QWidget *parent=nullptr)
Constructs an Editor with no design object target.
A dialog designed to allow the user to navigate a filesytem and select or create one or more files or...
Logic for reading or writing to a file as well as navigating filesystems or other common file operati...
Definition File.h:53
ProjectEditor(const DynamicPointer< QTDesignObject > &project, QWidget *parent=nullptr)
Constructs a project editor for the given design object.
EditorShowMode showMode() const override
Returns the preferred display mode for this editor.
void hideFileChooser()
Hides the file chooser dialog if it is visible.
void clearValues()
Clears all input field values in the editor.
virtual void updateValues() override
Updates the UI values from the current project state.
void fileChosen()
Slot called when a file is chosen from the file browser dialog.
String folderName() const
Gets the current folder name from the UI.
void workingDirectory()
Opens a file browser to select the project working directory.
FileChooserDialog * m_file_chooser_dialog
The file chooser dialog for selecting project directories.
Ui::ProjectUI * ui
The auto-generated UI form.
bool willOverrideExisting(const StringView &folder_name, const StringView &project_name)
Checks whether saving to the given path would overwrite an existing project.
static String getProjectName(const StringView &project_name)
Extracts or sanitizes a project name from the given string.
static File getFileName(const StringView &folder_name, const StringView &project_name)
Constructs a file path from the folder name and project name.
The core String View class for the NDEVR API.
Definition StringView.h:58
The core String class for the NDEVR API.
Definition String.h:95
The primary namespace for the NDEVR SDK.
EditorShowMode
Describes how an Editor should be displayed within the application UI.
Definition Editor.h:48
Vector2< g_type > project(const Vector3< g_type > &)
Projects a 3D point to 2D by dividing by the z component.
Definition se3_ops.hpp:50