20#ifndef ORES_QT_DETAIL_DIALOG_BASE_HPP
21#define ORES_QT_DETAIL_DIALOG_BASE_HPP
28#include "ores.qt/ChangeReasonDialog.hpp"
29#include "ores.qt/export.hpp"
35class ChangeReasonCache;
36class ProvenanceWidget;
79 using QWidget::QWidget;
130 void onCloseClicked();
142 emit statusMessage(message);
172 return v != T{} ? std::optional<T>(v) : std::nullopt;
181 void setProvenanceEnabled(
bool enabled);
190 void populateProvenance(
int version,
191 const std::string& modified_by,
192 const std::string& performed_by,
193 std::chrono::system_clock::time_point recorded_at,
194 const std::string& change_reason_code,
195 const std::string& change_commentary);
198 void clearProvenance();
208 std::string reason_code;
209 std::string commentary;
237 std::optional<change_reason_selection>
240 std::string_view category =
"system");
243 bool closeConfirmed_ =
false;
Qt-based graphical user interface for ORE Studio.
Definition AccountController.hpp:32
Shared cache for change reasons used across all entity dialogs.
Definition ChangeReasonCache.hpp:48
OperationType
Type of operation requiring a change reason.
Definition ChangeReasonDialog.hpp:58
Base class for all detail dialogs.
Definition DetailDialogBase.hpp:75
virtual bool hasUnsavedChanges() const
Definition DetailDialogBase.hpp:83
virtual ProvenanceWidget * provenanceWidget() const =0
Returns the promoted ProvenanceWidget (named "provenanceWidget" in .ui).
virtual QWidget * provenanceTab() const =0
Returns the Provenance tab widget (named "provenanceTab" in .ui).
void statusMessage(const QString &message)
Emitted to show a status message in the status bar.
virtual QTabWidget * tabWidget() const =0
Returns the dialog's QTabWidget (named "tabWidget" in .ui).
bool isCloseConfirmed() const
Returns true if the user has already confirmed closing this dialog.
Definition DetailDialogBase.hpp:92
void notifySaveSuccess(const QString &message)
Notify that a save operation completed successfully.
Definition DetailDialogBase.hpp:141
static std::optional< T > nulloptIfZero(T v)
Return std::optional(v) when v is non-zero, std::nullopt otherwise.
Definition DetailDialogBase.hpp:171
void closeRequested()
Emitted when the dialog wants to close its container window.
void requestClose()
Request closure of the container window.
Definition DetailDialogBase.hpp:136
void setChangeReasonCache(ChangeReasonCache *cache)
Inject the shared change reason cache.
Definition DetailDialogBase.hpp:101
void errorMessage(const QString &message)
Emitted when an error occurs that should be shown to the user.
Result of a successful change reason prompt.
Definition DetailDialogBase.hpp:207
Widget displaying the 6 standard record provenance fields.
Definition ProvenanceWidget.hpp:40