2 * Copyright 2014-2015 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#include "launcheritem.h"
18#include "quicklistmodel.h"
22LauncherItem::LauncherItem(const QString &appId, const QString &name, const QString &icon, QObject *parent) :
23 LauncherItemInterface(parent),
32 m_countVisible(false),
34 m_quickList(new QuickListModel(this))
36 QuickListEntry nameAction;
37 nameAction.setActionId("launch_item");
38 nameAction.setText(m_name);
39 m_quickList->appendAction(nameAction);
42QString LauncherItem::appId() const
47QString LauncherItem::name() const
52void LauncherItem::setName(const QString &name)
57 entry.setActionId("launch_item");
58 entry.setText(m_name);
59 m_quickList->updateAction(entry);
60 Q_EMIT nameChanged(name);
64QString LauncherItem::icon() const
69void LauncherItem::setIcon(const QString &icon)
73 Q_EMIT iconChanged(icon);
77bool LauncherItem::pinned() const
82void LauncherItem::setPinned(bool pinned)
84 if (m_pinned != pinned) {
86 Q_EMIT pinnedChanged(pinned);
90bool LauncherItem::running() const
95void LauncherItem::setRunning(bool running)
97 if (m_running != running) {
99 Q_EMIT runningChanged(running);
103bool LauncherItem::recent() const
108void LauncherItem::setRecent(bool recent)
110 if (m_recent != recent) {
112 Q_EMIT recentChanged(recent);
116int LauncherItem::progress() const
121void LauncherItem::setProgress(int progress)
123 if (m_progress != progress) {
124 m_progress = progress;
125 Q_EMIT progressChanged(progress);
129int LauncherItem::count() const
134void LauncherItem::setCount(int count)
136 if (m_count != count) {
138 Q_EMIT countChanged(count);
142bool LauncherItem::countVisible() const
144 return m_countVisible;
147void LauncherItem::setCountVisible(bool countVisible)
149 if (m_countVisible != countVisible) {
150 m_countVisible = countVisible;
151 Q_EMIT countVisibleChanged(countVisible);
155bool LauncherItem::focused() const
160void LauncherItem::setFocused(bool focused)
162 if (m_focused != focused) {
164 Q_EMIT focusedChanged(focused);
168unity::shell::launcher::QuickListModelInterface *LauncherItem::quickList() const
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