2 * Copyright (C) 2016 Canonical, Ltd.
4 * This program is free software: you can redistribute it and/or modify it under
5 * the terms of the GNU Lesser General Public License version 3, as published by
6 * the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
10 * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17#ifndef UNITY_SCREENS_H
18#define UNITY_SCREENS_H
20#include <QAbstractListModel>
21#include <QSharedPointer>
33class Screens : public QAbstractListModel
36 Q_PROPERTY(int count READ count NOTIFY countChanged)
37 Q_PROPERTY(QVariant activeScreen READ activeScreen WRITE activateScreen NOTIFY activeScreenChanged)
41 ScreenRole = Qt::UserRole + 1
44 explicit Screens(const QSharedPointer<qtmir::Screens>& model);
47 Q_INVOKABLE ScreensProxy *createProxy();
48 Q_INVOKABLE void sync(Screens *proxy);
50 /* QAbstractItemModel */
51 QHash<int, QByteArray> roleNames() const override;
52 QVariant data(const QModelIndex &index, int role = ScreenRole) const override;
53 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
56 QVariant activeScreen() const;
58 const QVector<ScreenInterface*>& list() const { return m_screens; }
60 static Screens *self();
63 void activateScreen(const QVariant& index);
67 void activeScreenChanged();
69 void screenAdded(ScreenInterface* screen);
70 void screenRemoved(ScreenInterface* screen);
73 void onScreenAdded(qtmir::Screen *screen);
74 void onScreenRemoved(qtmir::Screen *screen);
77 Screens(const Screens& other);
79 QVector<ScreenInterface*> m_screens;
80 QSharedPointer<qtmir::Screens> m_wrapped;
81 static Screens* m_self;
84class ScreensProxy : public Screens
87 ScreensProxy(Screens*const screens);
90 const QPointer<Screens> m_original;
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