Mantid
|
TrackedAction : This is a version of QAction that tracks usage through the Mantid usage service. More...
#include <TrackedAction.h>
Public Slots | |
void | trackActivation (const bool checked) |
Registers the feature usage if usage is enabled. More... | |
Public Member Functions | |
bool | getIsTracking () const |
Gets whether this action is tracking usage. More... | |
std::vector< std::string > | getTrackingName () const |
Gets the tracking name for this action If the tacking name is not set a default name will be generated using generateTrackingName. More... | |
void | setIsTracking (const bool enableTracking) |
Sets whether this action is tracking usage. More... | |
void | setTrackingName (const std::vector< std::string > &name) |
Sets the tracking name for this action. More... | |
TrackedAction (const QIcon &icon, const QString &text, QObject *parent) | |
Constructor. More... | |
TrackedAction (const QString &text, QObject *parent) | |
Constructor. More... | |
TrackedAction (QObject *parent) | |
Constructor. More... | |
virtual | ~TrackedAction ()=default |
Protected Member Functions | |
virtual std::vector< std::string > | generateTrackingName () const |
Creates a tracking name from the action text. More... | |
virtual void | registerUsage (const std::vector< std::string > &name) |
Registers the feature usage with the usage service. More... | |
Private Member Functions | |
void | setupTracking () |
Sets up tracking for the class. More... | |
Private Attributes | |
bool | m_isTracking |
std::vector< std::string > | m_trackingName |
TrackedAction : This is a version of QAction that tracks usage through the Mantid usage service.
Definition at line 18 of file TrackedAction.h.
MantidQt::MantidWidgets::TrackedAction::TrackedAction | ( | QObject * | parent | ) |
Constructor.
parent | The parent of this action |
Definition at line 17 of file TrackedAction.cpp.
References setupTracking().
MantidQt::MantidWidgets::TrackedAction::TrackedAction | ( | const QString & | text, |
QObject * | parent | ||
) |
Constructor.
text | The text for the action |
parent | The parent of this action |
Definition at line 25 of file TrackedAction.cpp.
References setupTracking().
MantidQt::MantidWidgets::TrackedAction::TrackedAction | ( | const QIcon & | icon, |
const QString & | text, | ||
QObject * | parent | ||
) |
Constructor.
icon | The icon for the action |
text | The text for the action |
parent | The parent of this action |
Definition at line 35 of file TrackedAction.cpp.
References setupTracking().
|
virtualdefault |
|
protectedvirtual |
Creates a tracking name from the action text.
Definition at line 74 of file TrackedAction.cpp.
Referenced by getTrackingName().
bool MantidQt::MantidWidgets::TrackedAction::getIsTracking | ( | ) | const |
Gets whether this action is tracking usage.
Definition at line 65 of file TrackedAction.cpp.
References m_isTracking.
std::vector< std::string > MantidQt::MantidWidgets::TrackedAction::getTrackingName | ( | ) | const |
Gets the tracking name for this action If the tacking name is not set a default name will be generated using generateTrackingName.
Definition at line 50 of file TrackedAction.cpp.
References generateTrackingName(), and m_trackingName.
Referenced by trackActivation().
|
protectedvirtual |
Registers the feature usage with the usage service.
name | The name to use when registering usage |
Definition at line 92 of file TrackedAction.cpp.
References Mantid::Kernel::Feature, and Mantid::Kernel::SingletonHolder< T >::Instance().
Referenced by trackActivation().
void MantidQt::MantidWidgets::TrackedAction::setIsTracking | ( | const bool | enableTracking | ) |
Sets whether this action is tracking usage.
enableTracking | True if the action should tracking usage |
Definition at line 60 of file TrackedAction.cpp.
References m_isTracking.
void MantidQt::MantidWidgets::TrackedAction::setTrackingName | ( | const std::vector< std::string > & | name | ) |
Sets the tracking name for this action.
name | the tracking name for this action |
Definition at line 43 of file TrackedAction.cpp.
References m_trackingName.
|
private |
Sets up tracking for the class.
Definition at line 69 of file TrackedAction.cpp.
References trackActivation().
Referenced by TrackedAction().
|
slot |
Registers the feature usage if usage is enabled.
checked | Whether the QAction is checked |
Definition at line 81 of file TrackedAction.cpp.
References getTrackingName(), m_isTracking, registerUsage(), and UNUSED_ARG.
Referenced by setupTracking().
|
private |
Definition at line 38 of file TrackedAction.h.
Referenced by getIsTracking(), setIsTracking(), and trackActivation().
|
mutableprivate |
Definition at line 39 of file TrackedAction.h.
Referenced by getTrackingName(), and setTrackingName().