2 * Copyright (C) 2013 Canonical, Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 * Author: Michael Terry <michael.terry@canonical.com>
19#include "AccountsService.h"
23AccountsService::AccountsService(QObject* parent)
25 m_enableLauncherWhileLocked(true),
26 m_enableIndicatorsWhileLocked(true),
27 m_backgroundFile(qmlDirectory() + "graphics/phone_background.jpg"),
28 m_statsWelcomeScreen(true),
36QString AccountsService::user() const
41void AccountsService::setUser(const QString &user)
45 Q_EMIT passwordDisplayHintChanged();
48bool AccountsService::demoEdges() const
53void AccountsService::setDemoEdges(bool demoEdges)
55 m_demoEdges = demoEdges;
56 Q_EMIT demoEdgesChanged();
59bool AccountsService::enableLauncherWhileLocked() const
61 return m_enableLauncherWhileLocked;
64void AccountsService::setEnableLauncherWhileLocked(bool enableLauncherWhileLocked)
66 m_enableLauncherWhileLocked = enableLauncherWhileLocked;
67 Q_EMIT enableLauncherWhileLockedChanged();
70bool AccountsService::enableIndicatorsWhileLocked() const
72 return m_enableIndicatorsWhileLocked;
75void AccountsService::setEnableIndicatorsWhileLocked(bool enableIndicatorsWhileLocked)
77 m_enableIndicatorsWhileLocked = enableIndicatorsWhileLocked;
78 Q_EMIT enableIndicatorsWhileLockedChanged();
81QString AccountsService::backgroundFile() const
83 return m_backgroundFile;
86void AccountsService::setBackgroundFile(const QString &backgroundFile)
88 m_backgroundFile = backgroundFile;
89 backgroundFileChanged();
92bool AccountsService::statsWelcomeScreen() const
94 return m_statsWelcomeScreen;
97void AccountsService::setStatsWelcomeScreen(bool statsWelcomeScreen)
99 m_statsWelcomeScreen = statsWelcomeScreen;
100 statsWelcomeScreenChanged();
103AccountsService::PasswordDisplayHint AccountsService::passwordDisplayHint() const
105 if (m_user == "has-pin")
106 return PasswordDisplayHint::Numeric;
108 return PasswordDisplayHint::Keyboard;
111uint AccountsService::failedLogins() const
113 return m_failedLogins;
116void AccountsService::setFailedLogins(uint failedLogins)
118 m_failedLogins = failedLogins;
119 failedLoginsChanged();
122bool AccountsService::hereEnabled() const
124 return m_hereEnabled;
127void AccountsService::setHereEnabled(bool enabled)
129 m_hereEnabled = enabled;
130 hereEnabledChanged();
133QString AccountsService::hereLicensePath() const
135 return m_hereLicensePath;
138void AccountsService::setHereLicensePath(const QString &path)
140 // Path should always be valid (this code is all synchronous)
142 m_hereLicensePath = QString::null;
143 } else if (path.isNull()) { // because qml collapses null and empty
144 m_hereLicensePath = "";
146 m_hereLicensePath = path;
148 hereLicensePathChanged();
151bool AccountsService::hereLicensePathValid() const
153 return !m_hereLicensePath.isNull();
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list