Commit b4f8942a authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Preferences: Adding a Password flag.

The proxy password is now a password, and is displayed as such.
parent 051ee9a8
......@@ -287,7 +287,7 @@ MainWindow::initVlmcPreferences()
QT_TRANSLATE_NOOP( "PreferenceWidget", "Proxy Username" ),
QT_TRANSLATE_NOOP( "PreferenceWidget", "The HTTP Proxy Username" ) );
VLMC_CREATE_PREFERENCE_STRING( "network/ProxyPassword", "",
VLMC_CREATE_PREFERENCE_PASSWORD( "network/ProxyPassword", "",
QT_TRANSLATE_NOOP( "PreferenceWidget", "Proxy Password" ),
QT_TRANSLATE_NOOP( "PreferenceWidget", "The HTTP Proxy Password" ) );
......
......@@ -29,6 +29,8 @@ StringWidget::StringWidget( SettingValue *s, QWidget *parent /*= NULL*/ ) :
m_setting( s )
{
m_lineEdit = new QLineEdit( parent );
if ( ( s->flags() & SettingValue::Password ) != 0 )
m_lineEdit->setEchoMode( QLineEdit::Password );
connect( s, SIGNAL( changed( const QVariant& ) ),
this, SLOT( changed( const QVariant& ) ) );
changed( s->get() );
......
......@@ -51,7 +51,8 @@ class SettingValue : public QObject
{
Nothing = 0,
/// If this flag is used, then the variable should not be shown in the config widgets.
Private = 1,
Private = 1 << 0,
Password = 1 << 1,
};
/**
......
......@@ -92,6 +92,9 @@ SettingsManager::getInstance()->createVar( type, key, defaultValue, name, \
VLMC_CREATE_PREFERENCE( SettingValue::String, key, defaultValue, "", "", SettingValue::Private )
#define VLMC_CREATE_PRIVATE_PROJECT_STRING( key, defaultValue ) \
VLMC_CREATE_PROJECT_VAR( SettingValue::String, key, defaultValue, "", "", SettingValue::Private )
#define VLMC_CREATE_PREFERENCE_PASSWORD( key, defaultValue, name, desc ) \
VLMC_CREATE_PREFERENCE( SettingValue::String, key, defaultValue, name, desc, SettingValue::Password )
class SettingsManager : public QObject, public Singleton<SettingsManager>
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment