QML-UI: allow toggling verbose mode from the UI

Hidden in the Developer menu.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2015-12-19 18:41:10 -08:00
parent 41c59c1c8d
commit c3ebeadb34
3 changed files with 28 additions and 0 deletions

View file

@ -106,6 +106,15 @@ MobileComponents.ApplicationWindow {
stackView.push(themetest)
}
}
Action {
checkable: true
checked: manager.verboseEnabled
text: checked ? "Disable verbose (for adb logcat)" : "Enable verbose (for adb logcat)"
onToggled: {
manager.verboseEnabled = checked;
checked = !checked;
}
}
}
] // end actions

View file

@ -387,6 +387,19 @@ void QMLManager::setLocationServiceEnabled(bool locationServiceEnabled)
locationProvider->serviceEnable(m_locationServiceEnabled);
}
bool QMLManager::verboseEnabled() const
{
return m_verboseEnabled;
}
void QMLManager::setVerboseEnabled(bool verboseMode)
{
m_verboseEnabled = verboseMode;
verbose = verboseMode;
qDebug() << "verbose is" << verbose;
emit verboseEnabledChanged();
}
QString QMLManager::cloudPassword() const
{
return m_cloudPassword;

View file

@ -19,6 +19,7 @@ class QMLManager : public QObject
Q_PROPERTY(int timeThreshold READ timeThreshold WRITE setTimeThreshold NOTIFY timeThresholdChanged)
Q_PROPERTY(bool loadFromCloud READ loadFromCloud WRITE setLoadFromCloud NOTIFY loadFromCloudChanged)
Q_PROPERTY(QString startPageText READ startPageText WRITE setStartPageText NOTIFY startPageTextChanged)
Q_PROPERTY(bool verboseEnabled READ verboseEnabled WRITE setVerboseEnabled NOTIFY verboseEnabledChanged)
public:
QMLManager();
~QMLManager();
@ -37,6 +38,9 @@ public:
bool locationServiceEnabled() const;
void setLocationServiceEnabled(bool locationServiceEnable);
bool verboseEnabled() const;
void setVerboseEnabled(bool verboseMode);
int distanceThreshold() const;
void setDistanceThreshold(int distance);
@ -83,6 +87,7 @@ private:
bool m_saveCloudPassword;
QString m_logText;
bool m_locationServiceEnabled;
bool m_verboseEnabled;
int m_distanceThreshold;
int m_timeThreshold;
GpsLocation *locationProvider;
@ -97,6 +102,7 @@ signals:
void cloudPasswordChanged();
void saveCloudPasswordChanged();
void locationServiceEnabledChanged();
void verboseEnabledChanged();
void logTextChanged();
void timeThresholdChanged();
void distanceThresholdChanged();