2 * Copyright (C) 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/>.
17#include "MockController.h"
19static QLightDM::MockController *m_instance = nullptr;
24MockController::MockController(QObject *parent)
29 {"ubuntu-2d", "Ubuntu 2D"},
31 {"gnome-classic", "GNOME Classic"},
32 {"gnome-flashback-compiz", "GNOME Flashback (Compiz)"},
33 {"gnome-flashback-metacity", "GNOME Flashback (Metacity)"},
34 {"gnome-wayland", "GNOME on Wayland"},
37 {"xterm", "Recovery Console"},
41 m_userMode = qgetenv("LIBLIGHTDM_MOCK_MODE");
42 if (m_userMode.isEmpty()) {
45 m_sessionMode = "full";
46 m_numSessions = numFullSessions();
49MockController::~MockController()
54MockController *MockController::instance()
57 m_instance = new MockController;
62QString MockController::selectUserHint() const
64 return m_selectUserHint;
67void MockController::setSelectUserHint(const QString &selectUserHint)
69 if (m_selectUserHint != selectUserHint) {
70 m_selectUserHint = selectUserHint;
71 Q_EMIT selectUserHintChanged();
75QString MockController::userMode() const
80void MockController::setUserMode(const QString &userMode)
82 if (m_userMode != userMode) {
83 m_userMode = userMode;
84 Q_EMIT userModeChanged();
88QString MockController::sessionMode() const
93void MockController::setSessionMode(const QString &sessionMode)
95 if (m_sessionMode != sessionMode) {
96 m_sessionMode = sessionMode;
97 Q_EMIT sessionModeChanged();
101const QList<MockController::SessionItem> &MockController::fullSessionItems() const
103 return m_fullSessions;
106int MockController::numFullSessions() const
108 return m_fullSessions.size();
111int MockController::numSessions() const
113 return m_numSessions;
116void MockController::setNumSessions(int numSessions)
118 if (m_numSessions != numSessions) {
119 m_numSessions = numSessions;
120 Q_EMIT numSessionsChanged();
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