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 "../Greeter.h"
20#include "../GreeterPrivate.h"
22#include <QtCore/QSettings>
27GreeterPrivate::GreeterPrivate(Greeter* parent)
28 : authenticated(false),
34void GreeterPrivate::handleAuthenticate()
38 QSettings settings(QDir::homePath() + "/.unity8-greeter-demo", QSettings::NativeFormat);
39 QVariant password = settings.value("password", "none");
41 if (password == "pin") {
42 Q_EMIT q->showPrompt("PIN", Greeter::PromptTypeSecret);
43 } else if (password == "keyboard") {
44 Q_EMIT q->showPrompt("Password", Greeter::PromptTypeSecret);
47 Q_EMIT q->authenticationComplete();
51void GreeterPrivate::handleRespond(const QString &response)
55 QSettings settings(QDir::homePath() + "/.unity8-greeter-demo", QSettings::NativeFormat);
56 QVariant password = settings.value("password", "none");
58 QString passwordValue;
59 if (password == "pin") {
60 passwordValue = settings.value("passwordValue", "1234").toString();
62 passwordValue = settings.value("passwordValue", "password").toString();
64 authenticated = (response == passwordValue);
65 Q_EMIT q->authenticationComplete();
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