added setting for disabling autologin on start, closes #52
This commit is contained in:
parent
22d6d38293
commit
4e77817468
4 changed files with 24 additions and 1 deletions
|
|
@ -230,7 +230,7 @@ Page {
|
|||
username.text = settings.username
|
||||
password.text = settings.password
|
||||
|
||||
if(settings.autologin)
|
||||
if(settings.autologin && settings.useAutologin)
|
||||
startLogin();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,6 +82,12 @@ Page {
|
|||
onCheckedChanged: settings.useAllFeedsOnStartup = checked
|
||||
}
|
||||
|
||||
SettingsSwitchRow {
|
||||
text: qsTr('Automatically Login')
|
||||
checked: settings.useAutologin
|
||||
onCheckedChanged: settings.useAutologin = checked
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,6 +70,14 @@ void Settings::setAutologin(bool autologin) {
|
|||
}
|
||||
}
|
||||
|
||||
void Settings::setUseAutologin(bool useAutologin) {
|
||||
if (_useAutologin != useAutologin) {
|
||||
_useAutologin = useAutologin;
|
||||
m_settings->setValue("useAutologin", _autologin);
|
||||
emit useAutologinChanged();
|
||||
}
|
||||
}
|
||||
|
||||
void Settings::setWhiteTheme(bool whiteTheme) {
|
||||
if (_whiteTheme != whiteTheme) {
|
||||
_whiteTheme = whiteTheme;
|
||||
|
|
@ -123,6 +131,7 @@ Settings::Settings(QObject *parent) : QObject(parent), m_settings(new QSettings(
|
|||
_username = m_settings->value("username", "").toString();
|
||||
_password = m_settings->value("password", "").toString();
|
||||
_autologin = m_settings->value("autologin", false).toBool();
|
||||
_useAutologin = m_settings->value("useAutologin", true).toBool();
|
||||
|
||||
_httpauthuser = m_settings->value("httpauthusername", "").toString();
|
||||
_httpauthpasswd = m_settings->value("httpauthpassword", "").toString();
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ class Settings : public QObject
|
|||
Q_PROPERTY(QString username READ username WRITE setUsername NOTIFY usernameChanged)
|
||||
Q_PROPERTY(QString password READ password WRITE setPassword NOTIFY passwordChanged)
|
||||
Q_PROPERTY(bool autologin READ hasAutologin WRITE setAutologin NOTIFY autologinChanged)
|
||||
Q_PROPERTY(bool useAutologin READ hasUseAutologin WRITE setUseAutologin NOTIFY useAutologinChanged)
|
||||
|
||||
Q_PROPERTY(QString httpauthusername READ httpauthUsername WRITE setHttpauthUsername NOTIFY httpauthUsernameChanged)
|
||||
Q_PROPERTY(QString httpauthpassword READ httpauthPassword WRITE setHttpauthPassword NOTIFY httpauthPasswordChanged)
|
||||
|
|
@ -48,6 +49,11 @@ public:
|
|||
}
|
||||
void setAutologin(bool autologin);
|
||||
|
||||
bool hasUseAutologin() const {
|
||||
return this->_useAutologin;
|
||||
}
|
||||
void setUseAutologin(bool useAutologin);
|
||||
|
||||
QString httpauthUsername() const {
|
||||
return this->_httpauthuser;
|
||||
}
|
||||
|
|
@ -93,6 +99,7 @@ signals:
|
|||
void usernameChanged();
|
||||
void passwordChanged();
|
||||
void autologinChanged();
|
||||
void useAutologinChanged();
|
||||
|
||||
void httpauthUsernameChanged();
|
||||
void httpauthPasswordChanged();
|
||||
|
|
@ -116,6 +123,7 @@ private:
|
|||
QString _username;
|
||||
QString _password;
|
||||
bool _autologin;
|
||||
bool _useAutologin;
|
||||
|
||||
QString _httpauthuser;
|
||||
QString _httpauthpasswd;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue