ORE Studio 0.0.4
Loading...
Searching...
No Matches
Public Slots | Public Member Functions | Protected Member Functions | List of all members
EntityListMdiWindow Class Referenceabstract

Base class for entity list MDI windows providing stale indicator support. More...

#include <EntityListMdiWindow.hpp>

Inheritance diagram for EntityListMdiWindow:
Inheritance graph
Collaboration diagram for EntityListMdiWindow:
Collaboration graph

Public Slots

void markAsStale ()
 Mark the list as stale (data changed on server).
 
void clearStaleIndicator ()
 Clear the stale indicator.
 
virtual void reload ()=0
 Reload data from the server.
 

Public Member Functions

 EntityListMdiWindow (QWidget *parent=nullptr)
 

Protected Member Functions

void initializeStaleIndicator (QAction *refreshAction, const QString &iconPath)
 Initialize the stale indicator support.
 
virtual QString normalRefreshTooltip () const
 Get the normal (non-stale) tooltip text for the refresh action.
 
virtual QString staleRefreshTooltip () const
 Get the stale tooltip text for the refresh action.
 

Detailed Description

Base class for entity list MDI windows providing stale indicator support.

This class provides common functionality for entity list windows including:

Subclasses must:

  1. Call initializeStaleIndicator() after creating their refresh action
  2. Implement reload() to refresh data from the server
  3. Call clearStaleIndicator() at the start of their reload() implementation

Example usage in subclass:

void MyEntityMdiWindow::setupToolbar() {
refreshAction_ = toolbar_->addAction(...);
initializeStaleIndicator(refreshAction_, ":/icons/ic_fluent_arrow_sync_20_regular.svg");
}
void MyEntityMdiWindow::reload() {
model_->refresh();
}
void clearStaleIndicator()
Clear the stale indicator.
Definition EntityListMdiWindow.cpp:59
void initializeStaleIndicator(QAction *refreshAction, const QString &iconPath)
Initialize the stale indicator support.
Definition EntityListMdiWindow.cpp:36

Member Function Documentation

◆ markAsStale

void markAsStale ( )
slot

Mark the list as stale (data changed on server).

Starts a pulse animation on the refresh action to indicate that server-side data has changed and the list should be reloaded.

◆ clearStaleIndicator

void clearStaleIndicator ( )
slot

Clear the stale indicator.

Stops the pulse animation and restores the normal refresh icon. Call this at the start of reload() implementations.

◆ reload

virtual void reload ( )
pure virtualslot

Reload data from the server.

Subclasses must implement this to refresh their data. Implementations should call clearStaleIndicator() first.

◆ initializeStaleIndicator()

void initializeStaleIndicator ( QAction *  refreshAction,
const QString &  iconPath 
)
protected

Initialize the stale indicator support.

Call this after creating the refresh action in setupToolbar().

Parameters
refreshActionThe refresh/reload action to animate
iconPathPath to the refresh icon SVG resource

◆ normalRefreshTooltip()

virtual QString normalRefreshTooltip ( ) const
protectedvirtual

Get the normal (non-stale) tooltip text for the refresh action.

Override this to customize the tooltip text.

Reimplemented in AccountMdiWindow, CatalogMdiWindow, ChangeReasonCategoryMdiWindow, ChangeReasonMdiWindow, CountryMdiWindow, CurrencyMdiWindow, DatasetBundleMdiWindow, FeatureFlagMdiWindow, OriginDimensionMdiWindow, and RoleMdiWindow.

◆ staleRefreshTooltip()

virtual QString staleRefreshTooltip ( ) const
protectedvirtual

Get the stale tooltip text for the refresh action.

Override this to customize the tooltip text.