FOSSredder 0.5.0
Loading...
Searching...
No Matches
ui::ExportViewModel Class Reference

Owns Export view state and delegates export execution to ExportWorkflow. More...

#include <ExportViewModel.h>

Inheritance diagram for ui::ExportViewModel:
Collaboration diagram for ui::ExportViewModel:

Signals

void changed ()
 Emitted when export view model state changed.

Public Member Functions

 ExportViewModel (QObject *parent=nullptr)
 Creates the export view model.
void setWorkspaceRoles (WorkspaceStore *store, WorkspaceCommands *commands, WorkspaceSelectors *selectors)
 Binds workspace roles used for catalog rows and export logs.
void setExportWorkflow (ExportWorkflow *value)
 Binds the workflow used to execute exports.
void setActions (Actions *value)
 Binds shell actions such as the export directory picker.
void setFileSystemBrowser (FileSystemBrowser *value)
 Binds filesystem defaults used by the export form.
void setSettings (Settings *value)
 Binds export settings used by defaults and package options.
QString targetDirectory () const
 Returns the selected export target directory.
void setTargetDirectory (const QString &value)
 Updates the selected export target directory.
int packageFormatIndex () const noexcept
 Returns the selected package format index.
void setPackageFormatIndex (int value)
 Updates the selected package format index.
QString addMode () const
 Returns whether the add combobox currently shows annuals or analyses.
void setAddMode (const QString &value)
 Switches the add combobox between annual and analysis mode.
QVariantList annualRows () const
 Returns annual rows available for export selection.
QVariantList analysisRows () const
 Returns analysis rows available for export selection.
QVariantList addRows () const
 Returns the rows shown by the current add combobox mode.
QString addTextRole () const
 Returns the display role used by the current add combobox mode.
int selectedAddIndex () const
 Returns the selected index in the current add combobox mode.
bool canAddEntry () const
 Returns whether the selected row can be added to the export package.
QVariantList exportEntries () const
 Returns the currently configured export package entries.
bool canStart () const
 Returns whether the export can be started.
bool showClear () const
 Returns whether the clear button should be visible.
bool showCancel () const
 Returns whether the cancel button should be visible.
bool showPause () const
 Returns whether the pause/resume button should be visible.
bool isPaused () const
 Returns whether the active export is paused.
QString pauseText () const
 Returns the current pause/resume button text.
double progress () const
 Returns the active export progress.
QString statusText () const
 Returns the current export status text.
bool hasError () const
 Returns whether the workflow currently reports an error.
QVariantList exportLogs () const
 Returns export log rows for the sidebar.
Q_INVOKABLE void refreshFromWorkspace ()
 Refreshes export form rows from the current workspace state.
Q_INVOKABLE void browseDirectory ()
 Opens the export directory picker through shell actions.
Q_INVOKABLE void clearForm ()
 Clears the export form back to defaults.
Q_INVOKABLE void startExport ()
 Starts the export workflow with the current package configuration.
Q_INVOKABLE void cancelExport ()
 Cancels the active export workflow.
Q_INVOKABLE void pauseExport ()
 Pauses the active export workflow.
Q_INVOKABLE void resumeExport ()
 Resumes the active export workflow.
Q_INVOKABLE void openExportLogLocation (const QString &logId)
 Opens the target folder for an export log.
Q_INVOKABLE void deleteExportLog (const QString &logId)
 Deletes an export log from the workspace.
Q_INVOKABLE void selectAddRow (int index)
 Selects a row in the current add combobox.
Q_INVOKABLE void addSelectedEntry ()
 Adds the selected annual or analysis to the export package.
Q_INVOKABLE void removeEntry (int index)
 Removes an export package entry.
Q_INVOKABLE void updateAnnualEntryAtIndex (int entryIndex, int annualIndex)
 Replaces an annual package entry with another annual row.
Q_INVOKABLE void updateAnnualCollapsed (int entryIndex, bool collapsed)
 Updates collapsed state for an annual package entry.
Q_INVOKABLE void updateStandaloneAnalysisAtIndex (int entryIndex, int analysisIndex)
 Replaces a standalone analysis package entry.
Q_INVOKABLE void updateStandaloneAnalysisExportType (int entryIndex, const QString &exportType)
 Updates export type for a standalone analysis entry.
Q_INVOKABLE void updateAnnualAnalysisExportType (int entryIndex, int analysisIndex, const QString &exportType)
 Updates export type for an analysis inside an annual entry.

Properties

QString targetDirectory
int packageFormatIndex
QString addMode
QVariantList annualRows
QVariantList analysisRows
QVariantList addRows
QString addTextRole
int selectedAddIndex
bool canAddEntry
QVariantList exportEntries
bool canStart
bool showClear
bool showCancel
bool showPause
bool isPaused
QString pauseText
double progress
QString statusText
bool hasError
QVariantList exportLogs

Detailed Description

Owns Export view state and delegates export execution to ExportWorkflow.

Definition at line 28 of file ExportViewModel.h.

Constructor & Destructor Documentation

◆ ExportViewModel()

ui::ExportViewModel::ExportViewModel ( QObject * parent = nullptr)
explicit

Creates the export view model.

Parameters
parentOptional QObject parent.

Definition at line 67 of file ExportViewModel.cpp.

Member Function Documentation

◆ addMode()

QString ui::ExportViewModel::addMode ( ) const
inline

Returns whether the add combobox currently shows annuals or analyses.

Returns
Add mode key.

Definition at line 117 of file ExportViewModel.h.

◆ addRows()

QVariantList ui::ExportViewModel::addRows ( ) const

Returns the rows shown by the current add combobox mode.

Returns
Current add rows.

Definition at line 274 of file ExportViewModel.cpp.

◆ addSelectedEntry()

void ui::ExportViewModel::addSelectedEntry ( )

Adds the selected annual or analysis to the export package.

Definition at line 461 of file ExportViewModel.cpp.

◆ addTextRole()

QString ui::ExportViewModel::addTextRole ( ) const

Returns the display role used by the current add combobox mode.

Returns
Display role name.

Definition at line 278 of file ExportViewModel.cpp.

◆ analysisRows()

QVariantList ui::ExportViewModel::analysisRows ( ) const

Returns analysis rows available for export selection.

Returns
Analysis rows.

Definition at line 207 of file ExportViewModel.cpp.

◆ annualRows()

QVariantList ui::ExportViewModel::annualRows ( ) const

Returns annual rows available for export selection.

Returns
Annual rows.

Definition at line 203 of file ExportViewModel.cpp.

◆ browseDirectory()

void ui::ExportViewModel::browseDirectory ( )

Opens the export directory picker through shell actions.

Definition at line 669 of file ExportViewModel.cpp.

◆ canAddEntry()

bool ui::ExportViewModel::canAddEntry ( ) const

Returns whether the selected row can be added to the export package.

Returns
True when add is available.

Definition at line 286 of file ExportViewModel.cpp.

◆ cancelExport()

void ui::ExportViewModel::cancelExport ( )

Cancels the active export workflow.

Definition at line 692 of file ExportViewModel.cpp.

Here is the call graph for this function:

◆ canStart()

bool ui::ExportViewModel::canStart ( ) const

Returns whether the export can be started.

Returns
True when export can start.

Definition at line 617 of file ExportViewModel.cpp.

◆ changed

void ui::ExportViewModel::changed ( )
signal

Emitted when export view model state changed.

◆ clearForm()

void ui::ExportViewModel::clearForm ( )

Clears the export form back to defaults.

Definition at line 303 of file ExportViewModel.cpp.

◆ deleteExportLog()

void ui::ExportViewModel::deleteExportLog ( const QString & logId)

Deletes an export log from the workspace.

Parameters
logIdStable export log id.

Definition at line 721 of file ExportViewModel.cpp.

Here is the call graph for this function:

◆ exportEntries()

QVariantList ui::ExportViewModel::exportEntries ( ) const
inline

Returns the currently configured export package entries.

Returns
Export package entries.

Definition at line 160 of file ExportViewModel.h.

◆ exportLogs()

QVariantList ui::ExportViewModel::exportLogs ( ) const

Returns export log rows for the sidebar.

Returns
Export log rows.

Definition at line 665 of file ExportViewModel.cpp.

◆ hasError()

bool ui::ExportViewModel::hasError ( ) const

Returns whether the workflow currently reports an error.

Returns
True when an error is reported.

Definition at line 661 of file ExportViewModel.cpp.

◆ isPaused()

bool ui::ExportViewModel::isPaused ( ) const

Returns whether the active export is paused.

Returns
True when the export workflow is paused.

Definition at line 634 of file ExportViewModel.cpp.

◆ openExportLogLocation()

void ui::ExportViewModel::openExportLogLocation ( const QString & logId)

Opens the target folder for an export log.

Parameters
logIdStable export log id.

Definition at line 712 of file ExportViewModel.cpp.

◆ packageFormatIndex()

int ui::ExportViewModel::packageFormatIndex ( ) const
inlinenoexcept

Returns the selected package format index.

Returns
Package format index.

Definition at line 104 of file ExportViewModel.h.

◆ pauseExport()

void ui::ExportViewModel::pauseExport ( )

Pauses the active export workflow.

Definition at line 700 of file ExportViewModel.cpp.

◆ pauseText()

QString ui::ExportViewModel::pauseText ( ) const

Returns the current pause/resume button text.

Returns
Pause/resume text.

Definition at line 638 of file ExportViewModel.cpp.

◆ progress()

double ui::ExportViewModel::progress ( ) const

Returns the active export progress.

Returns
Progress value.

Definition at line 642 of file ExportViewModel.cpp.

◆ refreshFromWorkspace()

void ui::ExportViewModel::refreshFromWorkspace ( )

Refreshes export form rows from the current workspace state.

Definition at line 290 of file ExportViewModel.cpp.

Here is the caller graph for this function:

◆ removeEntry()

void ui::ExportViewModel::removeEntry ( int index)

Removes an export package entry.

Parameters
indexEntry index.

Definition at line 482 of file ExportViewModel.cpp.

◆ resumeExport()

void ui::ExportViewModel::resumeExport ( )

Resumes the active export workflow.

Definition at line 706 of file ExportViewModel.cpp.

◆ selectAddRow()

void ui::ExportViewModel::selectAddRow ( int index)

Selects a row in the current add combobox.

Parameters
indexIndex into addRows().

Definition at line 447 of file ExportViewModel.cpp.

◆ selectedAddIndex()

int ui::ExportViewModel::selectedAddIndex ( ) const

Returns the selected index in the current add combobox mode.

Returns
Selected row index.

Definition at line 282 of file ExportViewModel.cpp.

◆ setActions()

void ui::ExportViewModel::setActions ( Actions * value)

Binds shell actions such as the export directory picker.

Parameters
valueActions object or nullptr.

Definition at line 89 of file ExportViewModel.cpp.

◆ setAddMode()

void ui::ExportViewModel::setAddMode ( const QString & value)

Switches the add combobox between annual and analysis mode.

Parameters
valueAdd mode key.

Definition at line 262 of file ExportViewModel.cpp.

◆ setExportWorkflow()

void ui::ExportViewModel::setExportWorkflow ( ExportWorkflow * value)

Binds the workflow used to execute exports.

Parameters
valueExport workflow or nullptr.

Definition at line 80 of file ExportViewModel.cpp.

◆ setFileSystemBrowser()

void ui::ExportViewModel::setFileSystemBrowser ( FileSystemBrowser * value)

Binds filesystem defaults used by the export form.

Parameters
valueFile system browser or nullptr.

Definition at line 97 of file ExportViewModel.cpp.

◆ setPackageFormatIndex()

void ui::ExportViewModel::setPackageFormatIndex ( int value)

Updates the selected package format index.

Parameters
valuePackage format index.

Definition at line 253 of file ExportViewModel.cpp.

◆ setSettings()

void ui::ExportViewModel::setSettings ( Settings * value)

Binds export settings used by defaults and package options.

Parameters
valueSettings object or nullptr.

Definition at line 109 of file ExportViewModel.cpp.

◆ setTargetDirectory()

void ui::ExportViewModel::setTargetDirectory ( const QString & value)

Updates the selected export target directory.

Parameters
valueTarget directory path.

Definition at line 245 of file ExportViewModel.cpp.

◆ setWorkspaceRoles()

void ui::ExportViewModel::setWorkspaceRoles ( WorkspaceStore * store,
WorkspaceCommands * commands,
WorkspaceSelectors * selectors )

Binds workspace roles used for catalog rows and export logs.

Definition at line 69 of file ExportViewModel.cpp.

Here is the call graph for this function:

◆ showCancel()

bool ui::ExportViewModel::showCancel ( ) const

Returns whether the cancel button should be visible.

Returns
True when cancel should be shown.

Definition at line 626 of file ExportViewModel.cpp.

◆ showClear()

bool ui::ExportViewModel::showClear ( ) const

Returns whether the clear button should be visible.

Returns
True when clear should be shown.

Definition at line 622 of file ExportViewModel.cpp.

◆ showPause()

bool ui::ExportViewModel::showPause ( ) const

Returns whether the pause/resume button should be visible.

Returns
True when pause/resume should be shown.

Definition at line 630 of file ExportViewModel.cpp.

◆ startExport()

void ui::ExportViewModel::startExport ( )

Starts the export workflow with the current package configuration.

Definition at line 675 of file ExportViewModel.cpp.

Here is the call graph for this function:

◆ statusText()

QString ui::ExportViewModel::statusText ( ) const

Returns the current export status text.

Returns
Status text.

Definition at line 648 of file ExportViewModel.cpp.

◆ targetDirectory()

QString ui::ExportViewModel::targetDirectory ( ) const
inline

Returns the selected export target directory.

Returns
Target directory path.

Definition at line 92 of file ExportViewModel.h.

◆ updateAnnualAnalysisExportType()

void ui::ExportViewModel::updateAnnualAnalysisExportType ( int entryIndex,
int analysisIndex,
const QString & exportType )

Updates export type for an analysis inside an annual entry.

Parameters
entryIndexExport entry index.
analysisIndexAnalysis index inside the annual entry.
exportTypeExport type key.

Definition at line 555 of file ExportViewModel.cpp.

◆ updateAnnualCollapsed()

void ui::ExportViewModel::updateAnnualCollapsed ( int entryIndex,
bool collapsed )

Updates collapsed state for an annual package entry.

Parameters
entryIndexExport entry index.
collapsedTrue when collapsed.

Definition at line 514 of file ExportViewModel.cpp.

◆ updateAnnualEntryAtIndex()

void ui::ExportViewModel::updateAnnualEntryAtIndex ( int entryIndex,
int annualIndex )

Replaces an annual package entry with another annual row.

Parameters
entryIndexExport entry index.
annualIndexIndex into annualRows().

Definition at line 490 of file ExportViewModel.cpp.

◆ updateStandaloneAnalysisAtIndex()

void ui::ExportViewModel::updateStandaloneAnalysisAtIndex ( int entryIndex,
int analysisIndex )

Replaces a standalone analysis package entry.

Parameters
entryIndexExport entry index.
analysisIndexIndex into analysisRows().

Definition at line 524 of file ExportViewModel.cpp.

◆ updateStandaloneAnalysisExportType()

void ui::ExportViewModel::updateStandaloneAnalysisExportType ( int entryIndex,
const QString & exportType )

Updates export type for a standalone analysis entry.

Parameters
entryIndexExport entry index.
exportTypeExport type key.

Definition at line 542 of file ExportViewModel.cpp.

Property Documentation

◆ addMode

QString ui::ExportViewModel::addMode
readwrite

Definition at line 36 of file ExportViewModel.h.

◆ addRows

QVariantList ui::ExportViewModel::addRows
read

Definition at line 39 of file ExportViewModel.h.

◆ addTextRole

QString ui::ExportViewModel::addTextRole
read

Definition at line 40 of file ExportViewModel.h.

◆ analysisRows

QVariantList ui::ExportViewModel::analysisRows
read

Definition at line 38 of file ExportViewModel.h.

◆ annualRows

QVariantList ui::ExportViewModel::annualRows
read

Definition at line 37 of file ExportViewModel.h.

◆ canAddEntry

bool ui::ExportViewModel::canAddEntry
read

Definition at line 42 of file ExportViewModel.h.

◆ canStart

bool ui::ExportViewModel::canStart
read

Definition at line 44 of file ExportViewModel.h.

◆ exportEntries

QVariantList ui::ExportViewModel::exportEntries
read

Definition at line 43 of file ExportViewModel.h.

◆ exportLogs

QVariantList ui::ExportViewModel::exportLogs
read

Definition at line 53 of file ExportViewModel.h.

◆ hasError

bool ui::ExportViewModel::hasError
read

Definition at line 52 of file ExportViewModel.h.

◆ isPaused

bool ui::ExportViewModel::isPaused
read

Definition at line 48 of file ExportViewModel.h.

◆ packageFormatIndex

int ui::ExportViewModel::packageFormatIndex
read

Definition at line 34 of file ExportViewModel.h.

◆ pauseText

QString ui::ExportViewModel::pauseText
read

Definition at line 49 of file ExportViewModel.h.

◆ progress

double ui::ExportViewModel::progress
read

Definition at line 50 of file ExportViewModel.h.

◆ selectedAddIndex

int ui::ExportViewModel::selectedAddIndex
read

Definition at line 41 of file ExportViewModel.h.

◆ showCancel

bool ui::ExportViewModel::showCancel
read

Definition at line 46 of file ExportViewModel.h.

◆ showClear

bool ui::ExportViewModel::showClear
read

Definition at line 45 of file ExportViewModel.h.

◆ showPause

bool ui::ExportViewModel::showPause
read

Definition at line 47 of file ExportViewModel.h.

◆ statusText

QString ui::ExportViewModel::statusText
read

Definition at line 51 of file ExportViewModel.h.

◆ targetDirectory

QString ui::ExportViewModel::targetDirectory
read

Definition at line 32 of file ExportViewModel.h.


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