2 * Copyright (C) 2012-2016 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/>.
18/* This class is a really tiny filter around QLightDM::Greeter. There are some
19 operations that we want to edit a bit for the benefit of Qml. Specifically,
20 we want to chop colons off of any password prompts. But there may be more
21 such edits in the future, and by inserting ourselves here, we have more
26#include <QLightDM/Greeter>
27#include <QtCore/QObject>
32class Greeter : public QObject
36 Q_PROPERTY(bool active READ isActive WRITE setIsActive NOTIFY isActiveChanged)
37 Q_PROPERTY(bool authenticated READ isAuthenticated NOTIFY isAuthenticatedChanged)
38 Q_PROPERTY(QString authenticationUser READ authenticationUser NOTIFY authenticationUserChanged)
39 Q_PROPERTY(QString defaultSession READ defaultSessionHint CONSTANT)
40 Q_PROPERTY(QString selectUser READ selectUser CONSTANT)
43 static Greeter *instance();
46 bool isActive() const;
47 bool isAuthenticated() const;
48 QString authenticationUser() const;
49 QString defaultSessionHint() const;
50 QString selectUser() const;
51 bool hasGuestAccount() const;
52 bool showManualLoginHint() const;
53 bool hideUsersHint() const;
55 PromptsModel *promptsModel();
58 void authenticate(const QString &username=QString());
59 void respond(const QString &response);
60 bool startSessionSync(const QString &session=QString());
61 void setIsActive(bool isActive);
64 void authenticationUserChanged();
65 void isActiveChanged();
66 void isAuthenticatedChanged();
69 void loginError(bool automatic);
70 void loginSuccess(bool automatic);
71 void authenticationStarted(); // useful for testing
73 // This signal is emitted by external agents like indicators, and the UI
74 // should switch to this user if possible.
75 void requestAuthenticationUser(const QString &user);
78 explicit Greeter(QObject* parent=0);
80 GreeterPrivate * const d_ptr;
82 Q_DECLARE_PRIVATE(Greeter)
85 void showMessageFilter(const QString &text, QLightDM::Greeter::MessageType type);
86 void showPromptFilter(const QString &text, QLightDM::Greeter::PromptType type);
87 void authenticationCompleteFilter();
88 void checkAuthenticationUser();
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