2 * Copyright (C) 2012,2013, 2015 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/>.
19#include "DBusGreeter.h"
20#include "DBusGreeterList.h"
22#include "UsersModel.h"
23#include <libusermetricsoutput/ColorTheme.h>
24#include <libusermetricsoutput/UserMetrics.h>
25#include <QLightDM/UsersModel>
27#include <QAbstractItemModel>
28#include <QDBusConnection>
29#include <QtQml/qqml.h>
31static QObject *greeter_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
34 Q_UNUSED(scriptEngine)
36 Greeter *greeter = new Greeter();
37 new DBusGreeter(greeter, QStringLiteral("/"));
38 new DBusGreeterList(greeter, QStringLiteral("/list"));
43static QObject *users_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
46 Q_UNUSED(scriptEngine)
47 return new UsersModel();
50static QObject *infographic_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
53 Q_UNUSED(scriptEngine)
54 return UserMetricsOutput::UserMetrics::getInstance();
57void IntegratedLightDMPlugin::registerTypes(const char *uri)
59 qmlRegisterType<QAbstractItemModel>();
60 qmlRegisterType<UserMetricsOutput::ColorTheme>();
62 Q_ASSERT(uri == QLatin1String("IntegratedLightDM"));
63 qRegisterMetaType<QLightDM::Greeter::MessageType>("QLightDM::Greeter::MessageType");
64 qRegisterMetaType<QLightDM::Greeter::PromptType>("QLightDM::Greeter::PromptType");
65 qmlRegisterSingletonType<Greeter>(uri, 0, 1, "Greeter", greeter_provider);
66 qmlRegisterSingletonType<UsersModel>(uri, 0, 1, "Users", users_provider);
67 qmlRegisterUncreatableType<QLightDM::UsersModel>(uri, 0, 1, "UserRoles", QStringLiteral("Type is not instantiable"));
68 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