2 * Copyright 2013 Canonical Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser 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 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 * Nick Dedekind <nick.dedekind@canonical.com>
20#ifndef UNITYMENUMODELSTACK_H
21#define UNITYMENUMODELSTACK_H
23#include "unityindicatorsglobal.h"
28class UnityMenuModelEntry;
31// A LIFO queue for storing the current submenu of a UnityMenuModel.
32// The root menu model is set as the head, and each subsiquent submenu that is
33// opened can be pushed onto the queue.
34// The tail is set to the last item on the queue
35// Popping the queue will remove the last entry, and the tail be updated to the last item.
36class UNITYINDICATORS_EXPORT UnityMenuModelStack : public QObject
39 Q_PROPERTY(UnityMenuModel* head READ head WRITE setHead NOTIFY headChanged)
40 Q_PROPERTY(UnityMenuModel* tail READ tail NOTIFY tailChanged)
41 Q_PROPERTY(int count READ count NOTIFY countChanged)
43 UnityMenuModelStack(QObject*parent=nullptr);
44 ~UnityMenuModelStack();
46 UnityMenuModel* head() const;
47 void setHead(UnityMenuModel* model);
49 UnityMenuModel* tail() const;
53 Q_INVOKABLE void push(UnityMenuModel* model, int menuIndex);
54 Q_INVOKABLE UnityMenuModel* pop();
57 void headChanged(UnityMenuModel* head);
58 void tailChanged(UnityMenuModel* tail);
59 void countChanged(int count);
65 QList<UnityMenuModelEntry*> m_menuModels;
68#endif // UNITYMENUMODELSTACK_H
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