{
if ( myModule->deactivateModule( activeStudy() ) )
{
- logUserEvent( tr( "MODULE_DEACTIVATED" ).arg( myModule->moduleName() ) );
+ logStructuredUserEvent( myModule->moduleName(),
+ "",
+ "",
+ "deactivated" );
}
moduleDeactivated( myModule );
}
myModule->connectToStudy( dynamic_cast<CAM_Study*>( activeStudy() ) );
if ( myModule->activateModule( activeStudy() ) )
{
- logUserEvent( tr( "MODULE_ACTIVATED" ).arg( myModule->moduleName() ) );
+ logStructuredUserEvent( myModule->moduleName(),
+ "",
+ "",
+ "activated" );
}
else
{
\param actionId is a numerical unique operation identifier
\return \c true in case of success and \c false otherwise
*/
-bool CAM_Application::activateOperation( const QString& modName, int actionId )
+bool CAM_Application::activateOperation( const QString& modName,
+ const int actionId )
{
CAM_Module* mod = loadModule(modName, false);
if (mod) {
\param actionId is a string unique operation identifier
\return \c true in case of success and \c false otherwise
*/
-bool CAM_Application::activateOperation( const QString& modName, const QString& actionId )
+bool CAM_Application::activateOperation( const QString& modName,
+ const QString& actionId )
{
CAM_Module* mod = loadModule(modName, false);
if (mod) {
{
QDateTime current = QDateTime::currentDateTime();
QTextStream stream( &file );
- stream << current.toString("yyyyMMdd-hhmmss") << ": " << eventDescription << endl;
+ stream << current.toString("yyyyMMdd-hhmmss")
+ << "," << eventDescription
+ << endl;
file.close();
}
}
}
+void CAM_Application::logStructuredUserEvent( const QString& module,
+ const QString& section,
+ const QString& action,
+ const QString& event,
+ const QString& message )
+{
+ const QStringList mes = (QStringList() << module
+ << section
+ << action
+ << event
+ << message);
+
+ logUserEvent( mes.join( "," ) );
+}
+
/*!
\brief Log given action.
\param action GUI action being logged.
text = action->text();
if ( text.isEmpty() )
text = action->iconText();
+
if ( !text.isEmpty() )
{
- QStringList message;
- if ( !moduleName.isEmpty() )
- message << moduleName;
if ( action->isCheckable() )
{
- message << tr( "ACTION_TOGGLED" );
- message << ( action->isChecked() ? tr( "ACTION_ON" ) : tr( "ACTION_OFF" ) );
+ logStructuredUserEvent ( moduleName,
+ "",
+ "toggled",
+ action->isChecked() ? "on" : "off",
+ text );
}
else
{
- message << tr( "ACTION_TRIGGERED" );
+ logStructuredUserEvent ( moduleName,
+ "",
+ "triggered",
+ "",
+ text );
}
- message << text;
- logUserEvent( message.join( ": " ) );
}
}