libyui-qt-pkg  2.42.5
 All Classes Functions Variables Enumerations
YQPkgWarningRangeNotifier Class Reference

#include <YQPkgDiskUsageList.h>

Public Member Functions

 YQPkgWarningRangeNotifier ()
 
void enterRange ()
 
void enterProximity ()
 
void warningPostedNotify ()
 
bool inRange () const
 
bool needWarning () const
 
bool leavingProximity () const
 
void clear ()
 
void clearHistory ()
 

Protected Attributes

bool _inRange
 
bool _isClose
 
bool _hasBeenClose
 
bool _warningPosted
 

Detailed Description

Helper class to manage warnings that are to be issued when a value enters a predefined range, but repeated only when that value leaves a (wider) "proximity" range and then re-enters the (narrower) "inner" range.

Example: Disk space usage:

 70%
 75%
 80%        [proximity range start]
 85%
 90%        [inner range start]
 95%
 100%

A warning is to be posted when there is only 90% disk space left. After the warning is displayed, there shall be no more warning until disk usage decreases below 80% (the proximity range) and then later increases again to 90%.

The net effect of all that is to avoid posting the warning over and over again while the value changes back and forth around the boundary of the ( inner ) warning range.

Definition at line 77 of file YQPkgDiskUsageList.h.

Constructor & Destructor Documentation

YQPkgWarningRangeNotifier::YQPkgWarningRangeNotifier ( )

Constructor.

Definition at line 353 of file YQPkgDiskUsageList.cc.

Here is the call graph for this function:

Member Function Documentation

void YQPkgWarningRangeNotifier::clear ( )

Clear the current values, i.e. prepare for a new round of checks

Definition at line 360 of file YQPkgDiskUsageList.cc.

void YQPkgWarningRangeNotifier::clearHistory ( )

Clear everything, including all history values such as if a warning has been posted.

Definition at line 369 of file YQPkgDiskUsageList.cc.

Here is the call graph for this function:

void YQPkgWarningRangeNotifier::enterProximity ( )

Notification that the proximity range is entered, i.e. that the value is getting near the inner range. 'enterRange()' automatically includes this, too.

Definition at line 386 of file YQPkgDiskUsageList.cc.

void YQPkgWarningRangeNotifier::enterRange ( )

Notification that the inner range is entered. The caller has to decide the criteria for that.

Definition at line 378 of file YQPkgDiskUsageList.cc.

Here is the call graph for this function:

bool YQPkgWarningRangeNotifier::inRange ( ) const

Check if the value is in range, i.e. if anybody from the outside has called 'enterRange()' since the last call to 'clear()'.

Definition at line 401 of file YQPkgDiskUsageList.cc.

bool YQPkgWarningRangeNotifier::leavingProximity ( ) const

Check if the value is leaving the proximity range.

Definition at line 408 of file YQPkgDiskUsageList.cc.

bool YQPkgWarningRangeNotifier::needWarning ( ) const

Check if a warning should be posted, i.e. if the value is currently in range ( see 'inRange() ) and there has been no notification yet that a warning has already been posted.

Definition at line 415 of file YQPkgDiskUsageList.cc.

void YQPkgWarningRangeNotifier::warningPostedNotify ( )

Notification that a warning has been posted.

Definition at line 394 of file YQPkgDiskUsageList.cc.


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