ORE Studio 0.0.4
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
ChangeReasonDialog Class Referencefinal

Dialog for selecting a change reason when saving/deleting entities. More...

#include <ChangeReasonDialog.hpp>

Inherits QDialog.

Collaboration diagram for ChangeReasonDialog:
Collaboration graph

Public Types

enum class  OperationType { Amend , Delete }
 Type of operation requiring a change reason. More...
 

Public Member Functions

 ChangeReasonDialog (const std::vector< dq::domain::change_reason > &reasons, OperationType operation, bool hasFieldChanges, QWidget *parent=nullptr)
 Construct the dialog.
 
std::string selectedReasonCode () const
 Get the selected reason code.
 
std::string commentary () const
 Get the commentary entered by the user.
 

Detailed Description

Dialog for selecting a change reason when saving/deleting entities.

This dialog is displayed when a user saves changes to an entity that requires change tracking. It presents a list of applicable reasons and optionally requires commentary based on the selected reason.

Usage:

if (dialog.exec() == QDialog::Accepted) {
std::string reason_code = dialog.selectedReasonCode();
std::string commentary = dialog.commentary();
}
Dialog for selecting a change reason when saving/deleting entities.
Definition ChangeReasonDialog.hpp:50
@ Amend
Updating an existing entity.
std::string commentary() const
Get the commentary entered by the user.
Definition ChangeReasonDialog.cpp:245

Member Enumeration Documentation

◆ OperationType

enum class OperationType
strong

Type of operation requiring a change reason.

Enumerator
Amend 

Updating an existing entity.

Delete 

Deleting an entity.

Constructor & Destructor Documentation

◆ ChangeReasonDialog()

ChangeReasonDialog ( const std::vector< dq::domain::change_reason > &  reasons,
OperationType  operation,
bool  hasFieldChanges,
QWidget *  parent = nullptr 
)
explicit

Construct the dialog.

Parameters
reasonsList of applicable change reasons
operationType of operation (Amend or Delete)
hasFieldChangesTrue if any entity fields have been modified. When false, this is a "touch" operation and only "common.non_material_update" is valid. When true, "common.non_material_update" is disabled.
parentParent widget

Member Function Documentation

◆ selectedReasonCode()

std::string selectedReasonCode ( ) const

Get the selected reason code.

Returns
The code of the selected reason (e.g., "common.rectification")

◆ commentary()

std::string commentary ( ) const

Get the commentary entered by the user.

Returns
Commentary text (may be empty if not required)