2 * Copyright (C) 2014 Canonical, Ltd.
5 * Michał Sawicz <michal.sawicz@canonical.com>
6 * Michal Hruby <michal.hruby@canonical.com>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; version 3.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22#include "fake_previewmodel.h"
25#include "fake_scope.h"
26#include "fake_scopes.h"
27#include "fake_previewwidgetmodel.h"
32PreviewModel::PreviewModel(QObject* parent, Scope* scope)
33 : unity::shell::scopes::PreviewModelInterface(parent)
37 // we have one column by default
38 PreviewWidgetModel* columnModel = new PreviewWidgetModel(this);
39 m_previewWidgetModels.append(columnModel);
40 connect(this, &PreviewModel::triggered, this, &PreviewModel::triggeredSlot);
43void PreviewModel::setWidgetColumnCount(int count)
46 qWarning("PreviewModel::setWidgetColumnCount != 1 not implemented");
50int PreviewModel::widgetColumnCount() const
55bool PreviewModel::loaded() const
60bool PreviewModel::processingAction() const
65int PreviewModel::rowCount(const QModelIndex&) const
67 return m_previewWidgetModels.size();
70QVariant PreviewModel::data(const QModelIndex& index, int role) const
74 return QVariant::fromValue(m_previewWidgetModels.at(index.row()));
80void PreviewModel::setLoaded(bool loaded)
82 if (m_loaded != loaded) {
84 Q_EMIT loadedChanged();
88void PreviewModel::triggeredSlot(QString const&, QString const&, QVariantMap const&) {
90 Scopes *scopes = static_cast<Scopes*>(m_scope->parent());
91 Scope* scope = scopes->getScopeFromAll("MockScope9");
92 scopes->addTempScope(scope);
93 Q_EMIT m_scope->openScope(scope);
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