diff --git a/clients/nitrogen/nitrogenexception.cpp b/clients/nitrogen/nitrogenexception.cpp index 065338b410..a992497f80 100644 --- a/clients/nitrogen/nitrogenexception.cpp +++ b/clients/nitrogen/nitrogenexception.cpp @@ -24,6 +24,7 @@ ////////////////////////////////////////////////////////////////////////////// #include +#include #include "nitrogenexception.h" namespace Nitrogen @@ -40,7 +41,7 @@ namespace Nitrogen // exception type setType( type( group.readEntry( NitrogenConfig::TYPE, - default_configuration.typeName() ) ) ); + default_configuration.typeName( false ) ), false ) ); // exception pattern regExp().setPattern( group.readEntry( NitrogenConfig::PATTERN, QString() ) ); @@ -62,7 +63,7 @@ namespace Nitrogen { NitrogenConfiguration::write( group ); - group.writeEntry( NitrogenConfig::TYPE, typeName() ); + group.writeEntry( NitrogenConfig::TYPE, typeName( false ) ); group.writeEntry( NitrogenConfig::PATTERN, regExp().pattern() ); group.writeEntry( NitrogenConfig::ENABLED, enabled() ); group.writeEntry( NitrogenConfig::MASK, mask() ); @@ -70,12 +71,12 @@ namespace Nitrogen } //_______________________________________________________ - QString NitrogenException::typeName( Type type ) + QString NitrogenException::typeName( Type type, bool translated ) { switch( type ) { - case WindowTitle: return "Window Title"; - case WindowClassName: return "Window Class Name"; + case WindowTitle: return translated ? i18n( "Window Title" ):"Window Title"; + case WindowClassName: return translated ? i18n( "Window Class Name" ):"Window Class Name"; default: assert( false ); } @@ -83,10 +84,10 @@ namespace Nitrogen } //_______________________________________________________ - NitrogenException::Type NitrogenException::type( const QString& value ) + NitrogenException::Type NitrogenException::type( const QString& value, bool translated ) { - if( value == "Window Title" ) return WindowTitle; - else if( value == "Window Class Name" ) return WindowClassName; + if( value == typeName( WindowTitle, translated ) ) return WindowTitle; + else if( value == typeName( WindowClassName, translated ) ) return WindowClassName; else return WindowClassName; } diff --git a/clients/nitrogen/nitrogenexception.h b/clients/nitrogen/nitrogenexception.h index df4735b945..996e40bb5d 100644 --- a/clients/nitrogen/nitrogenexception.h +++ b/clients/nitrogen/nitrogenexception.h @@ -122,11 +122,11 @@ namespace Nitrogen //!@name exception type //@{ - static QString typeName( Type ); - static Type type( const QString& name ); + static QString typeName( Type, bool ); + static Type type( const QString& name, bool ); - virtual QString typeName( void ) const - { return typeName( type() ); } + virtual QString typeName( bool translated ) const + { return typeName( type(), translated ); } virtual Type type( void ) const { return type_; }