mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
QML UI: remove the checkbox for remembering the password
In the context of the mobile app this simply makes no sense. If the user doesn't select this option, the app doesn't really work. So why have the option in the first place? Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
246422d03f
commit
d99c931219
3 changed files with 4 additions and 36 deletions
|
@ -17,7 +17,6 @@ Item {
|
||||||
function saveCredentials() {
|
function saveCredentials() {
|
||||||
manager.cloudUserName = login.text
|
manager.cloudUserName = login.text
|
||||||
manager.cloudPassword = password.text
|
manager.cloudPassword = password.text
|
||||||
manager.saveCloudPassword = savePassword.checked
|
|
||||||
manager.saveCloudCredentials()
|
manager.saveCloudCredentials()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,14 +67,6 @@ Item {
|
||||||
MobileComponents.Label {
|
MobileComponents.Label {
|
||||||
text: "Show password"
|
text: "Show password"
|
||||||
}
|
}
|
||||||
|
|
||||||
CheckBox {
|
|
||||||
checked: manager.saveCloudPassword
|
|
||||||
id: savePassword
|
|
||||||
}
|
|
||||||
MobileComponents.Label {
|
|
||||||
text: "Remember"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Item { width: MobileComponents.Units.gridUnit; height: width }
|
Item { width: MobileComponents.Units.gridUnit; height: width }
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,7 +103,6 @@ void QMLManager::finishSetup()
|
||||||
// Initialize cloud credentials.
|
// Initialize cloud credentials.
|
||||||
setCloudUserName(prefs.cloud_storage_email);
|
setCloudUserName(prefs.cloud_storage_email);
|
||||||
setCloudPassword(prefs.cloud_storage_password);
|
setCloudPassword(prefs.cloud_storage_password);
|
||||||
setSaveCloudPassword(prefs.save_password_local);
|
|
||||||
// if the cloud credentials are valid, we should get the GPS Webservice ID as well
|
// if the cloud credentials are valid, we should get the GPS Webservice ID as well
|
||||||
QString url;
|
QString url;
|
||||||
if (!cloudUserName().isEmpty() &&
|
if (!cloudUserName().isEmpty() &&
|
||||||
|
@ -149,8 +148,6 @@ void QMLManager::saveCloudCredentials()
|
||||||
bool cloudCredentialsChanged = false;
|
bool cloudCredentialsChanged = false;
|
||||||
s.beginGroup("CloudStorage");
|
s.beginGroup("CloudStorage");
|
||||||
s.setValue("email", cloudUserName());
|
s.setValue("email", cloudUserName());
|
||||||
s.setValue("save_password_local", saveCloudPassword());
|
|
||||||
if (saveCloudPassword())
|
|
||||||
s.setValue("password", cloudPassword());
|
s.setValue("password", cloudPassword());
|
||||||
s.sync();
|
s.sync();
|
||||||
if (!same_string(prefs.cloud_storage_email, qPrintable(cloudUserName()))) {
|
if (!same_string(prefs.cloud_storage_email, qPrintable(cloudUserName()))) {
|
||||||
|
@ -158,17 +155,13 @@ void QMLManager::saveCloudCredentials()
|
||||||
prefs.cloud_storage_email = strdup(qPrintable(cloudUserName()));
|
prefs.cloud_storage_email = strdup(qPrintable(cloudUserName()));
|
||||||
cloudCredentialsChanged = true;
|
cloudCredentialsChanged = true;
|
||||||
}
|
}
|
||||||
if (saveCloudPassword() != prefs.save_password_local)
|
|
||||||
prefs.save_password_local = saveCloudPassword();
|
|
||||||
|
|
||||||
cloudCredentialsChanged |= !same_string(prefs.cloud_storage_password, qPrintable(cloudPassword()));
|
cloudCredentialsChanged |= !same_string(prefs.cloud_storage_password, qPrintable(cloudPassword()));
|
||||||
|
|
||||||
if (saveCloudPassword()) {
|
|
||||||
if (!same_string(prefs.cloud_storage_password, qPrintable(cloudPassword()))) {
|
if (!same_string(prefs.cloud_storage_password, qPrintable(cloudPassword()))) {
|
||||||
free(prefs.cloud_storage_password);
|
free(prefs.cloud_storage_password);
|
||||||
prefs.cloud_storage_password = strdup(qPrintable(cloudPassword()));
|
prefs.cloud_storage_password = strdup(qPrintable(cloudPassword()));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (cloudUserName().isEmpty() || cloudPassword().isEmpty()) {
|
if (cloudUserName().isEmpty() || cloudPassword().isEmpty()) {
|
||||||
setStartPageText(RED_FONT + tr("Please enter valid cloud credentials.") + END_FONT);
|
setStartPageText(RED_FONT + tr("Please enter valid cloud credentials.") + END_FONT);
|
||||||
} else if (cloudCredentialsChanged) {
|
} else if (cloudCredentialsChanged) {
|
||||||
|
@ -852,16 +845,6 @@ void QMLManager::appendTextToLog(const QString &newText)
|
||||||
emit logTextChanged();
|
emit logTextChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QMLManager::saveCloudPassword() const
|
|
||||||
{
|
|
||||||
return m_saveCloudPassword;
|
|
||||||
}
|
|
||||||
|
|
||||||
void QMLManager::setSaveCloudPassword(bool saveCloudPassword)
|
|
||||||
{
|
|
||||||
m_saveCloudPassword = saveCloudPassword;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool QMLManager::locationServiceEnabled() const
|
bool QMLManager::locationServiceEnabled() const
|
||||||
{
|
{
|
||||||
return m_locationServiceEnabled;
|
return m_locationServiceEnabled;
|
||||||
|
|
|
@ -13,7 +13,6 @@ class QMLManager : public QObject {
|
||||||
Q_ENUMS(credentialStatus_t)
|
Q_ENUMS(credentialStatus_t)
|
||||||
Q_PROPERTY(QString cloudUserName READ cloudUserName WRITE setCloudUserName NOTIFY cloudUserNameChanged)
|
Q_PROPERTY(QString cloudUserName READ cloudUserName WRITE setCloudUserName NOTIFY cloudUserNameChanged)
|
||||||
Q_PROPERTY(QString cloudPassword READ cloudPassword WRITE setCloudPassword NOTIFY cloudPasswordChanged)
|
Q_PROPERTY(QString cloudPassword READ cloudPassword WRITE setCloudPassword NOTIFY cloudPasswordChanged)
|
||||||
Q_PROPERTY(bool saveCloudPassword READ saveCloudPassword WRITE setSaveCloudPassword NOTIFY saveCloudPasswordChanged)
|
|
||||||
Q_PROPERTY(QString logText READ logText WRITE setLogText NOTIFY logTextChanged)
|
Q_PROPERTY(QString logText READ logText WRITE setLogText NOTIFY logTextChanged)
|
||||||
Q_PROPERTY(bool locationServiceEnabled READ locationServiceEnabled WRITE setLocationServiceEnabled NOTIFY locationServiceEnabledChanged)
|
Q_PROPERTY(bool locationServiceEnabled READ locationServiceEnabled WRITE setLocationServiceEnabled NOTIFY locationServiceEnabledChanged)
|
||||||
Q_PROPERTY(int distanceThreshold READ distanceThreshold WRITE setDistanceThreshold NOTIFY distanceThresholdChanged)
|
Q_PROPERTY(int distanceThreshold READ distanceThreshold WRITE setDistanceThreshold NOTIFY distanceThresholdChanged)
|
||||||
|
@ -44,9 +43,6 @@ public:
|
||||||
QString cloudPassword() const;
|
QString cloudPassword() const;
|
||||||
void setCloudPassword(const QString &cloudPassword);
|
void setCloudPassword(const QString &cloudPassword);
|
||||||
|
|
||||||
bool saveCloudPassword() const;
|
|
||||||
void setSaveCloudPassword(bool saveCloudPassword);
|
|
||||||
|
|
||||||
bool locationServiceEnabled() const;
|
bool locationServiceEnabled() const;
|
||||||
void setLocationServiceEnabled(bool locationServiceEnable);
|
void setLocationServiceEnabled(bool locationServiceEnable);
|
||||||
|
|
||||||
|
@ -125,7 +121,6 @@ private:
|
||||||
QString m_cloudPassword;
|
QString m_cloudPassword;
|
||||||
QString m_ssrfGpsWebUserid;
|
QString m_ssrfGpsWebUserid;
|
||||||
QString m_startPageText;
|
QString m_startPageText;
|
||||||
bool m_saveCloudPassword;
|
|
||||||
QString m_logText;
|
QString m_logText;
|
||||||
bool m_locationServiceEnabled;
|
bool m_locationServiceEnabled;
|
||||||
bool m_verboseEnabled;
|
bool m_verboseEnabled;
|
||||||
|
@ -145,7 +140,6 @@ private:
|
||||||
signals:
|
signals:
|
||||||
void cloudUserNameChanged();
|
void cloudUserNameChanged();
|
||||||
void cloudPasswordChanged();
|
void cloudPasswordChanged();
|
||||||
void saveCloudPasswordChanged();
|
|
||||||
void locationServiceEnabledChanged();
|
void locationServiceEnabledChanged();
|
||||||
void verboseEnabledChanged();
|
void verboseEnabledChanged();
|
||||||
void logTextChanged();
|
void logTextChanged();
|
||||||
|
|
Loading…
Reference in a new issue