2 * Copyright (C) 2014 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#include <DBusGreeter.h>
19#include <DBusGreeterList.h>
20#include "MockGreeter.h"
21#include "MockUsersModel.h"
22#include <libusermetricsoutput/ColorTheme.h>
23#include <libusermetricsoutput/UserMetrics.h>
24#include <QLightDM/UsersModel>
26#include <QAbstractItemModel>
27#include <QDBusConnection>
28#include <QtQml/qqml.h>
30static QObject *greeter_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
33 Q_UNUSED(scriptEngine)
35 MockGreeter *greeter = new MockGreeter;
36 new DBusGreeter(greeter, "/");
37 new DBusGreeterList(greeter, "/list");
42static QObject *users_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
45 Q_UNUSED(scriptEngine)
46 return new MockUsersModel;
49static QObject *infographic_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
52 Q_UNUSED(scriptEngine)
53 return UserMetricsOutput::UserMetrics::getInstance();
56void LightDMPlugin::registerTypes(const char *uri)
58 qmlRegisterType<QAbstractItemModel>();
59 qmlRegisterType<UserMetricsOutput::ColorTheme>();
61 Q_ASSERT(uri == QLatin1String("LightDM"));
62 qRegisterMetaType<QLightDM::Greeter::MessageType>("QLightDM::Greeter::MessageType");
63 qRegisterMetaType<QLightDM::Greeter::PromptType>("QLightDM::Greeter::PromptType");
64 qmlRegisterSingletonType<MockGreeter>(uri, 0, 1, "Greeter", greeter_provider);
65 qmlRegisterSingletonType<MockUsersModel>(uri, 0, 1, "Users", users_provider);
66 qmlRegisterUncreatableType<QLightDM::UsersModel>(uri, 0, 1, "UserRoles", "Type is not instantiable");
67 qmlRegisterSingletonType<UserMetricsOutput::UserMetrics>(uri, 0, 1, "Infographic", infographic_provider);
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