NDEVR
API Documentation
ProjectEditor

A popup Editor dialog for showing options or information related to Project model objects. More...

Inheritance diagram for ProjectEditor:
[legend]
Collaboration diagram for ProjectEditor:
[legend]

Public Member Functions

 ProjectEditor (const DynamicPointer< QTDesignObject > &project, QWidget *parent=nullptr)
 Constructs a project editor for the given design object.
void fileChosen ()
 Slot called when a file is chosen from the file browser dialog.
virtual void updateValues () override
 Updates the UI values from the current project state.
void workingDirectory ()
 Opens a file browser to select the project working directory.
Public Member Functions inherited from Editor
 Editor (const DynamicPointer< QTDesignObject > &object, QWidget *parent=nullptr)
 Constructs an Editor targeting the given design object.
 Editor (QWidget *parent=nullptr)
 Constructs an Editor with no design object target.
virtual Buffer< QWidget * > bottomOptions ()
 Returns widgets to be placed at the bottom of the editor layout.
virtual StringView customDialogIcon () const
 Returns a custom icon name for the editor dialog, or an empty string if none.
virtual TranslatedString customDialogTitle () const
 Returns a custom title for the editor dialog, or an empty string if none.
virtual bool disableExport () const
 Returns whether exporting should be disabled for this editor.
Model getModel () const
 Returns the target design object as a Model.
DesignObject getObject () const
 Returns the target design object.
virtual bool isBusy () const
 Returns whether the editor is currently busy performing an operation.
void isBusyStatusChanged ()
 Emitted when the busy status of the editor changes.
virtual bool isHorizontal () const
 Returns whether the editor layout is horizontal.
virtual void moveTargetWithMouse ()
 Initiates interactive mouse-based movement of the target object in the viewport.
void objectUpdatedSignal ()
 Emitted when the target object has been updated.
virtual InterfaceOrientationControllerorientationController () const
 Returns the orientation controller associated with this editor.
virtual Buffer< QWidget * > printableWidgetOptions ()
 Returns option widgets to configure printing for this editor.
virtual Buffer< QWidget * > printableWidgets ()
 Returns the widgets that can be printed from this editor.
virtual void requestScrollEnabled (bool enabled)
 Requests enabling or disabling scrolling within the editor.
virtual void setHorizontal (bool horizontal)
 Sets whether the editor layout is horizontal.
virtual void setReadOnly (bool read_only)
 Sets whether the editor is in read-only mode.
virtual void setTarget (const DynamicPointer< QTDesignObject > &object)
 Sets the design object target for this editor.
virtual void setup (DesignObjectDialog *, const ShowPropertiesSettings &)
 Sets up the editor with a parent dialog and property display settings.
const DynamicPointer< QTDesignObject > & target () const
 Returns the current design object target.

Protected Member Functions

void clearValues ()
 Clears all input field values in the editor.
String folderName () const
 Gets the current folder name from the UI.
void hideFileChooser ()
 Hides the file chooser dialog if it is visible.
EditorShowMode showMode () const override
 Returns the preferred display mode for this editor.
bool willOverrideExisting (const StringView &folder_name, const StringView &project_name)
 Checks whether saving to the given path would overwrite an existing project.
Protected Member Functions inherited from Editor
void onDesignObjectDeletedSlot ()
 Slot called when the target design object is deleted.
void onDesignObjectUpdateSlot ()
 Slot called when the target design object is updated.

Static Protected Member Functions

static File getFileName (const StringView &folder_name, const StringView &project_name)
 Constructs a file path from the folder name and project name.
static String getProjectName (const StringView &project_name)
 Extracts or sanitizes a project name from the given string.

Protected Attributes

FileChooserDialogm_file_chooser_dialog
 The file chooser dialog for selecting project directories.
Ui::ProjectUI * ui
 The auto-generated UI form.
Protected Attributes inherited from Editor
DynamicPointer< QTDesignObjectm_design_object
 The design object being edited.
bool m_is_read_only = false
 Whether the editor is in read-only mode.
InterfaceOrientationControllerm_orientation_controller
 The orientation controller for this editor.

Detailed Description

A popup Editor dialog for showing options or information related to Project model objects.


This dialog is shown when the user first creates a project and can be accessed from the top of the SceneTree widget.

Definition at line 47 of file ProjectEditor.h.

Constructor & Destructor Documentation

◆ ProjectEditor()

ProjectEditor::ProjectEditor ( const DynamicPointer< QTDesignObject > & project,
QWidget * parent = nullptr )

Constructs a project editor for the given design object.

Parameters
[in]projectThe design object representing the project.
[in]parentThe parent widget.

References ProjectEditor(), and project().

Referenced by ProjectEditor().

Member Function Documentation

◆ folderName()

String ProjectEditor::folderName ( ) const
protected

Gets the current folder name from the UI.

Returns
The folder name string.

◆ getFileName()

File ProjectEditor::getFileName ( const StringView & folder_name,
const StringView & project_name )
staticprotected

Constructs a file path from the folder name and project name.

Parameters
[in]folder_nameThe folder path for the project.
[in]project_nameThe name of the project.
Returns
The full file path for the project file.

◆ getProjectName()

String ProjectEditor::getProjectName ( const StringView & project_name)
staticprotected

Extracts or sanitizes a project name from the given string.

Parameters
[in]project_nameThe raw project name input.
Returns
The sanitized project name.

◆ showMode()

EditorShowMode ProjectEditor::showMode ( ) const
overrideprotectedvirtual

Returns the preferred display mode for this editor.

Returns
The EditorShowMode.

Reimplemented from Editor.

◆ willOverrideExisting()

bool ProjectEditor::willOverrideExisting ( const StringView & folder_name,
const StringView & project_name )
protected

Checks whether saving to the given path would overwrite an existing project.

Parameters
[in]folder_nameThe folder path for the project.
[in]project_nameThe name of the project.
Returns
True if a project already exists at the specified path.

The documentation for this class was generated from the following file: