2 * Copyright (C) 2013 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/>.
16 * Author: Nick Dedekind <nick.dedekind@canonical.com>
22#include <unity/shell/scopes/ScopesInterface.h>
25#include "fake_scope.h"
34class Scopes : public unity::shell::scopes::ScopesInterface
39 explicit Scopes(QObject *parent = 0);
42 Q_INVOKABLE int rowCount(const QModelIndex& parent = QModelIndex()) const override;
44 Q_INVOKABLE unity::shell::scopes::ScopeInterface* getScope(int row) const override;
45 Q_INVOKABLE unity::shell::scopes::ScopeInterface* getScope(const QString& scope_id) const override;
47 Q_INVOKABLE void addScope(Scope* scope);
49 Q_INVOKABLE void clear();
50 Q_INVOKABLE void clearFavorites();
51 Q_INVOKABLE void load();
53 QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
54 QModelIndex parent ( const QModelIndex & index ) const override;
56 bool loaded() const override;
57 int count() const override;
58 unity::shell::scopes::ScopeInterface* overviewScope() const override;
60 Q_INVOKABLE void setFavorite(const QString& scopeId, bool favorite) override;
61 Q_INVOKABLE void moveFavoriteTo(const QString& scopeId, int index) override;
63 void addTempScope(unity::shell::scopes::ScopeInterface* scope);
64 Q_INVOKABLE void closeScope(unity::shell::scopes::ScopeInterface* scope) override;
66 // This is used as part of implementation of the other C++ code, not API
67 QList<Scope*> favScopes() const;
68 QList<Scope*> nonFavScopes() const;
69 Q_INVOKABLE Scope* getScopeFromAll(const QString& scope_id) const;
75 QList<Scope*> m_scopes; // the favorite ones
76 QList<Scope*> m_allScopes;
77 QSet<unity::shell::scopes::ScopeInterface*> m_tempScopes;
78 ScopesOverview *m_scopesOverview;
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